/* =====================================================================
   StudyPandit — brand design system
   Concept: "The Gyaan Yantra" — Indian knowledge tradition × neural AI
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Core palette */
  --ink:        #12122A;   /* manuscript ink — primary bg */
  --ink-2:      #1A1A3A;   /* raised surface on dark */
  --ink-3:      #24244d;   /* hairline / border on dark */
  --paper:      #F7F4EC;   /* warm off-white surface */
  --paper-2:    #efe9db;   /* secondary paper */
  --brass:      #C9A24B;   /* scholarly gilding — brand accent */
  --brass-soft: #e4c987;

  /* Product accents */
  --jee:      #F2913D;   /* saffron  */
  --ai:       #6B5BFF;   /* indigo   */
  --code:     #1FB6A6;   /* teal     */
  --interview:#E8536B;   /* rose     */

  /* Text */
  --text-hi:  #F7F4EC;   /* on dark — headings & primary */
  --text-body:#D8D6EA;   /* on dark — reading copy (brighter than muted) */
  --text-lo:  #A9A7C4;   /* muted on dark — meta/labels only */
  --text-ink: #1a1830;   /* on paper */
  --text-ink-lo: #5b5872;

  /* Per-page accent (overridden by product pages) */
  --accent: var(--brass);
  --accent-soft: var(--brass-soft);

  /* Type */
  --f-display: "Space Grotesk", system-ui, sans-serif;
  --f-body:    "Newsreader", Georgia, serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* Scale */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1:  clamp(1.25rem, 1.15rem + 0.5vw, 1.6rem);
  --step-2:  clamp(1.6rem, 1.4rem + 1vw, 2.4rem);
  --step-3:  clamp(2.1rem, 1.7rem + 2vw, 3.6rem);
  --step-4:  clamp(2.8rem, 2rem + 4vw, 5.6rem);

  --maxw: 1180px;
  --radius: 14px;
  --gap: clamp(1rem, 0.6rem + 2vw, 2rem);
  --shadow: 0 20px 50px -24px rgba(0,0,0,.55);

  /* Motion — smooth, natural easing */
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);   /* easeOutExpo — settles gently */
  --ease-soft:cubic-bezier(0.65, 0, 0.35, 1);   /* smooth in-out for hovers */
  --dur:   .55s;
  --dur-sm:.32s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text-hi);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 5vw, 2.5rem); }
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--accent);
  opacity: .8;
}
h1, h2, h3, .display {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
.lede { font-size: var(--step-1); color: var(--text-body); line-height: 1.5; max-width: 44ch; }
.muted { color: var(--text-lo); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--f-mono);
  font-size: var(--step--1);
  letter-spacing: .04em;
  padding: .8rem 1.4rem;
  border-radius: 100px;
  border: 1px solid transparent;
  transition: transform var(--dur-sm) var(--ease-soft), background var(--dur-sm) var(--ease-soft), border-color var(--dur-sm) var(--ease-soft), color var(--dur-sm) var(--ease-soft);
  will-change: transform;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #14121f; font-weight: 500; }
.btn-primary:hover { background: var(--accent-soft); }
.btn-ghost { border-color: var(--ink-3); color: var(--text-hi); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn .arrow { transition: transform var(--dur-sm) var(--ease-soft); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  border-bottom: 1px solid var(--ink-3);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--f-display); font-weight: 600; font-size: 1.18rem; letter-spacing: -.01em; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand b { color: var(--brass); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .03em; color: var(--text-lo); transition: color .18s ease; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text-hi); }
.nav-cta { display: flex; align-items: center; gap: .8rem; }
.nav-toggle { display: none; background: none; border: 1px solid var(--ink-3); border-radius: 8px; padding: .45rem .55rem; color: var(--text-hi); }
.nav-toggle svg { width: 20px; height: 20px; }

.menu-cta { display: none; }
@media (max-width: 1024px) {
  .nav-toggle { display: inline-flex; }
  .nav-links, .nav-cta .btn { display: none; }
  .site-header.open .nav-links {
    display: flex; position: absolute; inset: 68px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 1.1rem;
    padding: 1.4rem clamp(1.1rem, 5vw, 2.5rem);
    background: var(--ink-2); border-bottom: 1px solid var(--ink-3);
  }
  .site-header.open .nav-links a { font-size: 1rem; }
  .site-header.open .nav-links .menu-cta {
    display: inline-flex; align-items: center; gap: .5rem;
    margin-top: .4rem; padding: .7rem 1.2rem; border-radius: 100px;
    background: var(--accent); color: #14121f; font-family: var(--f-mono);
    font-size: var(--step--1); font-weight: 500;
  }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 55% at 50% 42%, color-mix(in srgb, var(--brass) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}
.hero h1 { margin-top: 1.1rem; }
.hero h1 .grad {
  color: var(--brass); /* fallback if background-clip:text unsupported */
  background: linear-gradient(100deg, var(--brass) 0%, var(--jee) 40%, var(--interview) 70%, var(--ai) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; /* only clears when supported, else color shows */
}
@media (forced-colors: active) {
  .hero h1 .grad { -webkit-text-fill-color: currentColor; color: currentColor; background: none; }
}
.hero p.lede { margin-top: 1.4rem; }
.hero-actions { margin-top: 2rem; display: flex; gap: .9rem; flex-wrap: wrap; }
.hero-stats { margin-top: 2.6rem; display: flex; align-items: flex-start; gap: 2.2rem; flex-wrap: wrap; }
.stat .n { font-family: var(--f-display); font-size: var(--step-2); color: var(--brass); line-height: 1.05; }
.stat .l { font-family: var(--f-mono); font-size: var(--step--1); color: var(--text-lo); letter-spacing: .04em; margin-top: .35rem; }
/* Product-page stats hold short phrases, not numerics — smaller so labels align */
.phero .stat .n { font-size: var(--step-1); white-space: nowrap; }

/* Yantra host */
.yantra-wrap { position: relative; aspect-ratio: 1 / 1; width: 100%; }
#yantra { width: 100%; height: 100%; }
@keyframes yantra-in { from { opacity: 0; transform: scale(.955); } to { opacity: 1; transform: none; } }
html.js #yantra svg { animation: yantra-in .9s var(--ease) both; transform-origin: center; }
.yantra-caption {
  position: absolute; bottom: -.2rem; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 92%;
  font-family: var(--f-mono); font-size: var(--step--1); color: var(--text-lo);
  letter-spacing: .12em; text-transform: uppercase; text-align: center;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .yantra-wrap { max-width: 460px; margin-inline: auto; order: -1; }
}

/* ---------- Section head ---------- */
.sec-head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.sec-head h2 { margin-top: .9rem; }
.sec-head h1 { margin-top: .9rem; font-size: var(--step-3); } /* products.html uses h1 at section-head scale */
.sec-head p { margin-top: 1rem; color: var(--text-body); font-size: var(--step-1); line-height: 1.5; }

/* ---------- Product grid / cards ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
@media (max-width: 600px) { .prod-grid { grid-template-columns: 1fr; } }

.pcard {
  --a: var(--brass);
  position: relative; display: flex; flex-direction: column;
  padding: 1.6rem 1.6rem 1.5rem;
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
  will-change: transform;
}
.pcard::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--a);
  transform: scaleY(.4); transform-origin: top; transition: transform var(--dur) var(--ease); }
.pcard:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--a) 55%, var(--ink-3)); }
.pcard:hover::before { transform: scaleY(1); }
.pcard .tag {
  font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .05em;
  color: var(--a); text-transform: uppercase; display: inline-flex; align-items: center; gap: .5rem;
}
.pcard .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--a); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a) 20%, transparent); }
.pcard h3 { margin: 1rem 0 .5rem; font-size: var(--step-2); }
.pcard h3 span { color: var(--a); }
.pcard p { color: var(--text-body); font-size: var(--step-0); flex: 1; }
.pcard .aud { font-family: var(--f-mono); font-size: var(--step--1); color: var(--text-lo); margin-top: 1.1rem; opacity: .8; }
.pcard .go { margin-top: 1.2rem; font-family: var(--f-mono); font-size: var(--step--1); color: var(--a); display: inline-flex; align-items: center; gap: .5rem; }
.pcard .go .arrow { transition: transform var(--dur-sm) var(--ease-soft); }
.pcard:hover .go .arrow { transform: translateX(5px); }

/* ---------- Feature row ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 900px){ .features { grid-template-columns: repeat(2, 1fr); } } /* tablet: 2-up */
@media (max-width: 600px){ .features { grid-template-columns: 1fr; } }         /* phone: 1-up */
.feat { padding: 1.4rem; border: 1px solid var(--ink-3); border-radius: var(--radius); background: color-mix(in srgb, var(--ink-2) 60%, transparent); }
.feat .ico { width: 34px; height: 34px; color: var(--accent); margin-bottom: 1rem; }
.feat h3 { font-size: var(--step-1); margin-bottom: .5rem; }
.feat p { color: var(--text-body); font-size: var(--step-0); }

/* ---------- Paper section (light band) ---------- */
.band-paper { background: var(--paper); color: var(--text-ink); }
.band-paper .eyebrow { color: color-mix(in srgb, var(--accent) 78%, #7a5a10); }
.band-paper h2 { color: var(--text-ink); }
.band-paper p, .band-paper .muted { color: var(--text-ink-lo); }

/* Steps (gurukul path) */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; counter-reset: step; }
@media (max-width: 900px){ .steps { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 600px){ .steps { grid-template-columns: 1fr;} }
.step-c { padding-top: 1.2rem; border-top: 1px solid rgba(0,0,0,.14); }
.step-c .k { font-family: var(--f-mono); font-size: var(--step--1); color: #8a6a1e; letter-spacing: .1em; }
.step-c h3 { font-size: var(--step-1); margin: .7rem 0 .4rem; color: var(--text-ink); }
.step-c p { font-size: var(--step-0); color: var(--text-ink-lo); }

/* ---------- Compare table ---------- */
.compare-scroll { overflow-x: auto; border: 1px solid var(--ink-3); border-radius: var(--radius); }
table.compare { width: 100%; border-collapse: collapse; min-width: 640px; font-size: var(--step-0); }
table.compare th, table.compare td { text-align: left; padding: 1rem 1.1rem; border-bottom: 1px solid var(--ink-3); }
table.compare thead th { font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .05em; text-transform: uppercase; color: var(--text-lo); }
table.compare tbody th { font-family: var(--f-display); font-weight: 600; }
table.compare tbody td { color: var(--text-lo); }
table.compare .acc { color: var(--accent); }
table.compare tr:last-child th, table.compare tr:last-child td { border-bottom: 0; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band .inner {
  border: 1px solid var(--ink-3); border-radius: 20px;
  padding: clamp(2.2rem, 5vw, 3.6rem);
  background:
    radial-gradient(70% 120% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--ink-2);
}
.cta-band h2 { max-width: 18ch; margin: .8rem auto 0; }
.cta-band p { max-width: 46ch; margin: 1rem auto 0; color: var(--text-body); font-size: var(--step-1); }
.cta-band .hero-actions { justify-content: center; }

/* ---------- Waitlist form ---------- */
.waitlist { display: flex; gap: .6rem; flex-wrap: wrap; max-width: 480px; margin-top: 1.6rem; }
.waitlist input {
  flex: 1 1 220px; font: inherit; font-size: var(--step-0);
  padding: .8rem 1rem; border-radius: 100px;
  background: var(--ink); border: 1px solid var(--ink-3); color: var(--text-hi);
}
.waitlist input::placeholder { color: var(--text-lo); }
.waitlist input:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.form-note { font-family: var(--f-mono); font-size: var(--step--1); color: var(--text-lo); margin-top: .8rem; }
.form-msg { font-family: var(--f-mono); font-size: var(--step--1); margin-top: .9rem; text-align: center; }

/* ---------- Product page hero ---------- */
.phero { border-bottom: 1px solid var(--ink-3); }
.phero .badge {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .05em;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--ink-3));
  padding: .35rem .8rem; border-radius: 100px; text-transform: uppercase;
}
.phero h1 { margin: 1.2rem 0; }
.phero h1 span { color: var(--accent); }
.crumbs { font-family: var(--f-mono); font-size: var(--step--1); color: var(--text-lo); margin-bottom: 1.4rem; }
.crumbs a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--ink-3); padding-block: 3rem 2rem; background: var(--ink-2); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 600px){ .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand-col { grid-column: 1 / -1; } }
.foot-brand-col p { color: var(--text-lo); font-size: var(--step-0); margin-top: 1rem; max-width: 34ch; }
.foot-col h4 { font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .1em; text-transform: uppercase; color: var(--text-lo); margin-bottom: 1rem; }
.foot-col a { display: block; color: var(--text-hi); padding: .3rem 0; font-size: var(--step-0); }
.foot-col a:hover { color: var(--brass); }
.foot-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--ink-3); font-family: var(--f-mono); font-size: var(--step--1); color: var(--text-lo); }

/* ---------- Reveal on scroll (progressive enhancement) ---------- */
/* Only hide when JS is active — no-JS visitors and crawlers see everything. */
html.js .reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  will-change: opacity, transform;
}
html.js .reveal.in { opacity: 1; transform: none; }
/* Gentle stagger so grids cascade instead of snapping in together */
html.js .prod-grid .reveal.in:nth-child(2) { transition-delay: .08s; }
html.js .prod-grid .reveal.in:nth-child(3) { transition-delay: .16s; }
html.js .prod-grid .reveal.in:nth-child(4) { transition-delay: .24s; }
html.js .features .reveal.in:nth-child(2),
html.js .steps .reveal.in:nth-child(2) { transition-delay: .07s; }
html.js .features .reveal.in:nth-child(3),
html.js .steps .reveal.in:nth-child(3) { transition-delay: .14s; }
html.js .features .reveal.in:nth-child(4),
html.js .steps .reveal.in:nth-child(4) { transition-delay: .21s; }
html.js .features .reveal.in:nth-child(5) { transition-delay: .28s; }
html.js .features .reveal.in:nth-child(6) { transition-delay: .35s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  html.js .reveal, .reveal { opacity: 1 !important; transform: none !important; }
  .btn:hover, .pcard:hover { transform: none; }
}

/* =====================================================================
   Responsive tiers — scale at the extremes; clamp() covers the middle
   ===================================================================== */

/* --- XXL: 24"/27" desktops — wider column, larger type, more air --- */
@media (min-width: 1600px) {
  :root {
    --maxw: 1320px;
    --step-2: clamp(1.6rem, 1.1rem + 1.4vw, 2.7rem);
    --step-3: clamp(2.1rem, 1.3rem + 2.4vw, 4.1rem);
    --step-4: clamp(2.8rem, 1.4rem + 4.6vw, 6.4rem);
  }
  .section { padding-block: clamp(6rem, 7vw, 9rem); }
}

/* --- Ultrawide (≥2200px): hard-cap the column so it never stretches --- */
@media (min-width: 2200px) {
  :root {
    --maxw: 1440px;
    --step-4: clamp(4rem, 3rem + 2vw, 6.8rem);
  }
  .section { padding-block: clamp(7rem, 6vw, 10rem); }
}

/* --- XS: small phones (≤380px) — compact hero, stacked full-width CTAs --- */
@media (max-width: 380px) {
  .hero h1 { font-size: clamp(2.15rem, 8.5vw, 2.8rem); }
  .hero-actions { gap: .7rem; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
  .hero-stats { gap: 1.3rem; }
  .stat .n { font-size: var(--step-1); }
}

/* --- Landscape short phones — keep the hero within the viewport --- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero-grid { padding-block: 1.4rem; }
  .hero-stats { margin-top: 1.4rem; }
}
