/* =========================================================
   KhanIT — public theme layer (loads after tokens.css)
   Clear cards, colorful per-category accents, motion.
   ========================================================= */

body {
  background:
    radial-gradient(900px 600px at 12% -5%, rgba(var(--purple-rgb), .22), transparent 60%),
    radial-gradient(800px 600px at 95% 15%, rgba(var(--cyan-rgb), .10), transparent 60%),
    radial-gradient(900px 700px at 50% 105%, rgba(var(--pink-rgb), .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink-2);
}
main, .site-footer { position: relative; z-index: 1; }
h1, h2, h3, h4 { color: var(--ink); }
p { color: var(--ink-2); }

/* Background blobs: purple / cyan / pink */
.bg-blob { opacity: .28; }
.bg-blob--1 { background: radial-gradient(circle, #8B5CF6, transparent 68%); }
.bg-blob--2 { background: radial-gradient(circle, #22D3EE, transparent 68%); }
.bg-blob--3 { background: radial-gradient(circle, #F472B6, transparent 68%); }

/* ---------- Gradient text / eyebrow ---------- */
.text-gradient, .section-title .text-gradient {
  background: linear-gradient(90deg, #A78BFA, #F472B6 50%, #FB923C);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  background-size: 200% 100%; animation: grad-shift 6s ease-in-out infinite alternate;
}
@keyframes grad-shift { to { background-position: 100% 0; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .95rem; border-radius: 999px;
  background: rgba(var(--purple-rgb), .16);
  border: 1px solid rgba(var(--purple-light-rgb), .45);
  color: var(--purple-light);
}

/* ---------- Header ---------- */
.site-header {
  background: rgba(11, 7, 22, .72);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(var(--purple-light-rgb), .18);
  transition: background .3s, box-shadow .3s;
}
.site-header.is-scrolled {
  background: rgba(17, 11, 34, .92);
  box-shadow: 0 8px 40px rgba(var(--purple-rgb), .25);
}
.nav-link { color: var(--ink-2); position: relative; }
.nav-link:hover { color: var(--ink); background: rgba(var(--purple-rgb), .14); }
.nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after, .nav-link:hover::after {
  content: ""; position: absolute; left: 14%; right: 14%; bottom: 2px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #8B5CF6, #22D3EE);
}
.brand-name { color: var(--ink); }
.brand-tagline { color: var(--ink-3); }
.nav-menu.is-open { background: var(--bg-raised); border: 1px solid rgba(var(--purple-light-rgb), .3); }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; transition: transform .2s, box-shadow .25s, background .25s, border-color .25s; }
.btn-primary {
  background: var(--grad-primary); color: var(--ink); border: 1px solid rgba(var(--pink-rgb), .35);
  box-shadow: 0 8px 28px rgba(var(--purple-rgb), .45);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(192, 38, 211, .5); filter: brightness(1.08); }
.btn-outline {
  background: rgba(var(--purple-rgb), .08); color: var(--ink);
  border: 1px solid rgba(var(--purple-light-rgb), .6);
}
.btn-outline:hover { background: rgba(var(--purple-rgb), .24); border-color: var(--purple-light); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(var(--purple-rgb), .35); }
.btn-white {
  background: rgba(var(--purple-rgb), .16); color: var(--ink);
  border: 1px solid var(--purple-light);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.btn-white:hover { background: var(--grad-primary); border-color: transparent; transform: translateY(-3px); box-shadow: 0 14px 40px rgba(192, 38, 211, .45); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-play { background: rgba(var(--cyan-rgb), .16); color: var(--cyan); border: 1px solid rgba(var(--cyan-rgb), .5); }
.text-link, .card-arrow { color: var(--cyan); }
.text-link:hover { color: var(--ink); }

/* ---------- Sections ---------- */
.section--tint {
  background: linear-gradient(180deg, rgba(var(--purple-rgb), .09), rgba(var(--cyan-rgb), .04));
  border-block: 1px solid rgba(var(--purple-light-rgb), .14);
}
.section-title { color: var(--ink); }
.section-subtitle { color: var(--ink-2); }
.page-hero { background: radial-gradient(70% 90% at 50% 0%, rgba(var(--purple-rgb), .28), transparent 70%); border-bottom: 1px solid rgba(var(--purple-light-rgb), .16); }

/* ---------- Accent assignment (one color per card in a cycle) ---------- */
:is(.services-grid, .portfolio-grid, .testimonial-grid, .blog-grid, .team-grid, .mission-grid, .process-grid, .features-strip, .stats-row, .values-grid, .contact-info-stack, .faq-list) > :nth-child(7n+1) { --accent: var(--cyan);   --accent-rgb: var(--cyan-rgb); }
:is(.services-grid, .portfolio-grid, .testimonial-grid, .blog-grid, .team-grid, .mission-grid, .process-grid, .features-strip, .stats-row, .values-grid, .contact-info-stack, .faq-list) > :nth-child(7n+2) { --accent: var(--pink);   --accent-rgb: var(--pink-rgb); }
:is(.services-grid, .portfolio-grid, .testimonial-grid, .blog-grid, .team-grid, .mission-grid, .process-grid, .features-strip, .stats-row, .values-grid, .contact-info-stack, .faq-list) > :nth-child(7n+3) { --accent: var(--orange); --accent-rgb: var(--orange-rgb); }
:is(.services-grid, .portfolio-grid, .testimonial-grid, .blog-grid, .team-grid, .mission-grid, .process-grid, .features-strip, .stats-row, .values-grid, .contact-info-stack, .faq-list) > :nth-child(7n+4) { --accent: var(--green);  --accent-rgb: var(--green-rgb); }
:is(.services-grid, .portfolio-grid, .testimonial-grid, .blog-grid, .team-grid, .mission-grid, .process-grid, .features-strip, .stats-row, .values-grid, .contact-info-stack, .faq-list) > :nth-child(7n+5) { --accent: var(--purple-light); --accent-rgb: var(--purple-light-rgb); }
:is(.services-grid, .portfolio-grid, .testimonial-grid, .blog-grid, .team-grid, .mission-grid, .process-grid, .features-strip, .stats-row, .values-grid, .contact-info-stack, .faq-list) > :nth-child(7n+6) { --accent: var(--blue);   --accent-rgb: var(--blue-rgb); }
:is(.services-grid, .portfolio-grid, .testimonial-grid, .blog-grid, .team-grid, .mission-grid, .process-grid, .features-strip, .stats-row, .values-grid, .contact-info-stack, .faq-list) > :nth-child(7n+7) { --accent: var(--yellow); --accent-rgb: var(--yellow-rgb); }
[data-accent="cyan"]   { --accent: var(--cyan);   --accent-rgb: var(--cyan-rgb); }
[data-accent="pink"]   { --accent: var(--pink);   --accent-rgb: var(--pink-rgb); }
[data-accent="orange"] { --accent: var(--orange); --accent-rgb: var(--orange-rgb); }
[data-accent="green"]  { --accent: var(--green);  --accent-rgb: var(--green-rgb); }
[data-accent="purple"] { --accent: var(--purple-light); --accent-rgb: var(--purple-light-rgb); }
[data-accent="blue"]   { --accent: var(--blue);   --accent-rgb: var(--blue-rgb); }
[data-accent="yellow"] { --accent: var(--yellow); --accent-rgb: var(--yellow-rgb); }

/* ---------- CARDS: surface + colored border + glow + top line ---------- */
.service-card, .project-card, .testimonial-card, .blog-card, .value-card, .team-card,
.process-step, .stat-block, .feature-item, .contact-info-card, .contact-form-card,
.faq-item, .sidebar-card, .hours-card, .results-panel, .hero-design-card, .hero-float-badge,
.media-badge, .cta-banner, .map-panel, .article-sidebar {
  --accent: var(--purple-light); --accent-rgb: var(--purple-light-rgb);
  background:
    linear-gradient(90deg, transparent, var(--accent), transparent) top / 100% 3px no-repeat,
    linear-gradient(160deg, var(--surface) 0%, var(--bg-raised) 100%);
  border: 1px solid rgba(var(--accent-rgb), .4);
  box-shadow: 0 10px 40px rgba(var(--accent-rgb), .16), inset 0 1px 0 rgba(var(--accent-rgb), .22);
  color: var(--ink-2);
  transition: border-color .3s, box-shadow .3s, transform .3s, opacity .7s;
}
.service-card:hover, .project-card:hover, .testimonial-card:hover, .blog-card:hover, .value-card:hover,
.team-card:hover, .process-step:hover, .stat-block:hover, .feature-item:hover, .contact-info-card:hover,
.faq-item:hover {
  border-color: rgba(var(--accent-rgb), .85);
  box-shadow: 0 18px 60px rgba(var(--accent-rgb), .32), inset 0 1px 0 rgba(var(--accent-rgb), .4);
}
.service-card:hover, .project-card:hover, .blog-card:hover, .value-card:hover, .team-card:hover,
.process-step:hover, .testimonial-card:hover { transform: translateY(-6px); }
.service-card h3, .project-card h3, .testimonial-card h3, .blog-card h3, .value-card h3,
.team-card h3, .process-step h3, .feature-item h3 { color: var(--ink); }
.service-card p, .value-card p, .process-step p, .feature-item p, .blog-card p, .project-content p { color: var(--ink-2); }
.service-card::before { background: radial-gradient(60% 60% at 50% 0%, rgba(var(--accent-rgb), .18), transparent 70%) !important; opacity: 1 !important; }

/* Icon badges take the card's accent */
.service-card .icon-tile, .value-card .icon-tile, .feature-item .icon-tile {
  background: rgba(var(--accent-rgb), .16); color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), .5);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), .3);
}
.service-card .card-arrow { color: var(--accent); border-color: rgba(var(--accent-rgb), .5); background: rgba(var(--accent-rgb), .12); }
.service-card:hover .card-arrow { background: var(--accent); color: var(--bg); }
.project-category, .blog-category {
  background: rgba(var(--accent-rgb), .22); color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.project-open { background: var(--accent); color: var(--bg); }
.process-step::before { color: var(--accent); }

/* Stats: gradient numbers, different accent each */
.stat-block strong {
  background: linear-gradient(135deg, var(--accent), var(--ink));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.stat-block span:not([data-counter]) { color: var(--ink-2); }
.check-icon { background: rgba(var(--green-rgb), .2); color: var(--green); border: 1px solid rgba(var(--green-rgb), .5); }

/* Testimonials */
.stars { color: var(--yellow); text-shadow: 0 0 14px rgba(var(--yellow-rgb), .5); }
.testimonial-top img, .author-avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.testimonial-quote { color: var(--ink-2); }
.testimonial-quote::before { color: var(--accent); }

/* Hero */
.hero { position: relative; }
.hero-text, .hero-copy p { color: var(--ink-2); }
.hero-proof__text, .hero-proof__text strong { color: var(--ink-2); }
.hero-proof__text strong { color: var(--ink); }
.hero-design-card, .hero-float-badge { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); background-color: rgba(26, 18, 51, .82); }
.hero-media img, .split-media img, .project-media img, .blog-card__media img { border: 1px solid rgba(var(--purple-light-rgb), .3); }
.hero-media { box-shadow: 0 30px 90px rgba(var(--purple-rgb), .4); }

/* FAQ */
.faq-question { color: var(--ink); }
.faq-item.is-open { --accent: var(--cyan); --accent-rgb: var(--cyan-rgb); background-color: rgba(var(--cyan-rgb), .06); border-color: rgba(var(--cyan-rgb), .8); }
.faq-answer { color: var(--ink-2); }

/* CTA */
.cta-section { background: radial-gradient(70% 120% at 50% 0%, rgba(var(--purple-rgb), .35), transparent 70%); }
.cta-banner { background: linear-gradient(135deg, #3B1A8F 0%, #7C1FA6 60%, #A21CAF 100%); border-color: rgba(var(--pink-rgb), .55); box-shadow: 0 24px 80px rgba(192, 38, 211, .4); }
.cta-banner h2, .cta-banner p { color: var(--ink); }

/* Forms */
.form-control {
  background: var(--surface); color: var(--ink);
  border: 1px solid rgba(var(--purple-light-rgb), .4);
}
.form-control:hover { border-color: rgba(var(--purple-light-rgb), .7); }
.form-control:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(var(--cyan-rgb), .28); outline: none; }
.form-control.is-invalid, .form-group.has-error .form-control { border-color: var(--red); }
.form-error { color: #FCA5A5; }
.form-success, .site-flash--success { background: rgba(var(--green-rgb), .14); border: 1px solid rgba(var(--green-rgb), .55); color: #A7F3D0; }
.toast--error { background: rgba(var(--red-rgb), .16); border: 1px solid rgba(var(--red-rgb), .6); color: #FECACA; }
label { color: var(--ink-2); }
select option { background: var(--surface); color: var(--ink); }

/* Modal */
.modal-backdrop { background: rgba(8, 3, 24, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal-panel { background: var(--grad-card); border: 1px solid rgba(var(--purple-light-rgb), .5); box-shadow: 0 30px 100px rgba(var(--purple-rgb), .45); }
.modal-close { color: var(--ink); background: rgba(var(--purple-rgb), .2); }

/* Footer */
.site-footer {
  background: linear-gradient(180deg, var(--bg-raised), var(--bg));
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, #8B5CF6, #22D3EE, #F472B6, transparent) 1;
}
.site-footer a, .footer-links a { color: var(--ink-2); }
.site-footer a:hover, .footer-links a:hover { color: var(--cyan); }
.social-links a { border: 1px solid rgba(var(--purple-light-rgb), .4); background: rgba(var(--purple-rgb), .12); }
.social-links a:hover { background: var(--grad-primary); color: var(--ink); transform: translateY(-3px); }
.footer-bottom { border-top: 1px solid rgba(var(--purple-light-rgb), .18); color: var(--ink-3); }

/* Pagination / filters */
.filter-btn, .page-link { background: var(--surface); color: var(--ink-2); border: 1px solid rgba(var(--purple-light-rgb), .35); }
.filter-btn:hover, .page-link:hover { border-color: var(--purple-light); color: var(--ink); }
.filter-btn.is-active, .page-link.is-active, .page-link[aria-current] { background: var(--grad-primary); color: var(--ink); border-color: transparent; }

/* ---------- Scroll progress bar ---------- */
.fx-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 10000; pointer-events: none; }
.fx-progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, #8B5CF6, #22D3EE, #F472B6); box-shadow: 0 0 14px rgba(var(--purple-rgb), .9); }

/* ---------- Floating objects + cursor glow ---------- */
.fx-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fx-obj { position: absolute; will-change: transform; }
.fx-shape { width: 100%; height: 100%; animation: fx-float var(--dur, 14s) ease-in-out infinite alternate; animation-delay: var(--delay, 0s); }
@keyframes fx-float {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to   { transform: translate3d(var(--fx, 18px), var(--fy, -34px), 0) rotate(var(--rot, 40deg)); }
}
.fx-orb  .fx-shape { border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--c1), var(--c2) 60%, transparent 72%); filter: blur(1px); box-shadow: 0 0 60px var(--c2); opacity: .75; }
.fx-ring .fx-shape { border-radius: 50%; border: 2px solid var(--c1); box-shadow: 0 0 30px var(--c1), inset 0 0 30px var(--c1); opacity: .5; }
.fx-cube .fx-shape { border: 2px solid var(--c1); border-radius: 12px; background: linear-gradient(135deg, rgba(var(--purple-rgb), .22), transparent); box-shadow: 0 0 30px var(--c1); opacity: .55; }
.fx-cross .fx-shape { background:
    linear-gradient(var(--c1), var(--c1)) center / 100% 3px no-repeat,
    linear-gradient(var(--c1), var(--c1)) center / 3px 100% no-repeat; opacity: .6; filter: drop-shadow(0 0 8px var(--c1)); }
.fx-cursor { position: fixed; top: 0; left: 0; width: 460px; height: 460px; margin: -230px 0 0 -230px; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(var(--purple-rgb), .22), rgba(var(--cyan-rgb), .06) 45%, transparent 70%); opacity: 0; transition: opacity .4s; will-change: transform; }
.fx-cursor.is-on { opacity: 1; }

/* 3D tilt on cards (uses CSS vars set by theme.js; transform is isolated from .reveal) */
[data-tilt].is-visible, [data-tilt]:not(.reveal) {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
}
[data-tilt].tilting { transition-delay: 0s !important; transition: transform .15s ease-out, border-color .3s, box-shadow .3s, opacity .7s; }
[data-tilt]:hover { --ty: -6px; }

/* Scroll-linked motion uses the independent translate/scale properties */
[data-scroll] { will-change: translate, scale; }

/* Mobile + reduced motion: calm everything down */
@media (max-width: 767px) {
  .fx-layer, .fx-cursor { display: none; }
  .service-card:hover, .project-card:hover, .blog-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-layer, .fx-cursor, .fx-progress { display: none; }
  .fx-shape, .text-gradient, .bg-blob { animation: none !important; }
  [data-tilt], [data-scroll] { transform: none !important; translate: none !important; scale: none !important; }
}
