/* ============================================================
   index_page.css  —  Editorial cream redesign
   Scoped entirely to body.index-dark (class name retained for
   backwards compatibility; the theme is now light/editorial).
   ============================================================ */

/* ── Tokens — matches /auth/login palette ──
   Brand-identity values (ink, cream, hot, fonts) come from
   /static/css/editorial.css. Page-specific shades stay local until
   the same value shows up on a third page worth hoisting for. */
.index-dark {
  --bg:           var(--ed-cream);   /* cream paper */
  --bg2:          var(--ed-cream-3); /* deeper cream surface */
  --bg3:          var(--ed-cream-2); /* card highlight */
  --surface:      var(--ed-cream);
  --border:       rgba(14,29,61,0.10);
  --border2:      rgba(14,29,61,0.20);

  --ink:          var(--ed-ink);     /* deep navy ink */
  --ink-2:        var(--ed-ink-2);
  --text:         var(--ed-ink);
  --muted:        #5d6a82;
  --subtle:       #8590a6;

  --accent:       var(--ed-hot);     /* hot blue */
  --accent-deep:  var(--ed-hot-deep);
  --accent-soft:  rgba(37,99,235,0.10);

  --serif: var(--ed-serif);
  --mono:  var(--ed-mono);
  --sans:  var(--ed-sans);
}

/* ── Base ── */
.index-dark {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Nav override — cream-tinted on the index page only ── */
.index-dark nav {
  background: rgba(245, 239, 225, 0.88) !important;
  border-bottom-color: var(--border) !important;
  backdrop-filter: blur(10px);
}
.index-dark nav .text-indigo-600 { color: var(--accent) !important; }
.index-dark nav .text-gray-500,
.index-dark nav .text-gray-700   { color: var(--ink-2) !important; }
.index-dark nav a:hover           { color: var(--accent) !important; }

/* Main content area — remove default padding/max-width */
.index-dark > main {
  max-width: 100% !important;
  padding: 0 !important;
}

/* ── Grid background — navy blueprint lines on cream, masked toward edges ── */
.index-dark .grid-bg {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(14,29,61,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,29,61,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none; z-index: 0;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 0%, transparent 100%);
}

/* Paper grain across the whole page (very subtle) */
.index-dark::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.12; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Orbs — soft blue tints (was saturated purple) ── */
.index-dark .orb {
  position: fixed; border-radius: 50%;
  filter: blur(140px); pointer-events: none; z-index: 0; opacity: 0.22;
}
.index-dark .orb-1 {
  width: 620px; height: 620px;
  background: radial-gradient(circle, #2563eb 0%, transparent 70%);
  top: -260px; left: -220px;
}
.index-dark .orb-2 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #60a5fa 0%, transparent 70%);
  bottom: -160px; right: -160px;
}

/* ── Main wrapper ── */
.index-dark .qr-main { position: relative; z-index: 1; }

/* ── HERO ── */
.index-dark .qr-hero {
  min-height: calc(100vh - 4rem);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 5vw, 3rem);
  position: relative;
}
/* Editorial registration mark + folio caption */
.index-dark .qr-hero::before {
  content: "+";
  position: absolute; top: 26px; right: 30px;
  font-family: var(--mono); font-weight: 500; font-size: 22px;
  color: var(--ink); opacity: 0.32;
}
.index-dark .qr-hero::after {
  content: "FOLIO · 2026/05 · LANDING";
  position: absolute; bottom: 26px; left: 30px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink); opacity: 0.4;
}

.index-dark .hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px;
  border: 1px solid rgba(37,99,235,0.30);
  background: rgba(37,99,235,0.06);
  color: var(--accent);
  font-size: 12px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; margin-bottom: 2rem;
  font-family: var(--mono);
}
.index-dark .hero-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.18);
  animation: index-pulse 1.8s ease-in-out infinite;
}
@keyframes index-pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(37,99,235,0.18); }
  50%      { box-shadow: 0 0 0 9px rgba(37,99,235,0.04); }
}

.index-dark .hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1.0; letter-spacing: -0.025em;
  margin-bottom: 1.5rem; max-width: 14ch;
  color: var(--ink);
}
.index-dark .hero-title .accent-word {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: currentColor !important;
}

.index-dark .hero-sub {
  font-family: var(--sans);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: var(--muted); max-width: 46ch;
  line-height: 1.65; margin-bottom: 2.75rem; font-weight: 400;
}

.index-dark .hero-cta {
  display: flex; flex-wrap: wrap; gap: 18px;
  justify-content: center; margin-bottom: 4rem;
}

/* ── BUTTONS — slab + offset block (same language as /auth/login hero CTA) ── */
.index-dark .btn-hero {
  position: relative;
  padding: 16px 26px;
  font-family: var(--sans);
  font-size: 13.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
  border: 0; border-radius: 0;
  transition: transform 0.18s cubic-bezier(.2,.7,.2,1),
              box-shadow 0.18s cubic-bezier(.2,.7,.2,1),
              background 0.2s, color 0.2s;
}
.index-dark .btn-hero-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: 6px 6px 0 var(--accent);
}
.index-dark .btn-hero-primary:hover {
  transform: translate(-3px,-3px);
  box-shadow: 9px 9px 0 var(--accent);
}
.index-dark .btn-hero-primary:active {
  transform: translate(0,0);
  box-shadow: 3px 3px 0 var(--accent);
}
.index-dark .btn-hero-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 14.5px 24.5px; /* compensate for the border so heights match */
}
.index-dark .btn-hero-secondary:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ── STATS ── */
.index-dark .hero-stats {
  display: flex; gap: clamp(1.5rem, 5vw, 4.5rem);
  flex-wrap: wrap; justify-content: center;
  border-top: 1px solid var(--border2);
  padding-top: 2.25rem; width: 100%; max-width: 620px;
}
.index-dark .stat { text-align: center; }
.index-dark .stat-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--ink); line-height: 1;
}
.index-dark .stat-label {
  font-family: var(--mono);
  font-size: 12px; color: var(--muted);
  margin-top: 8px; text-transform: uppercase; letter-spacing: 0.18em;
  font-weight: 500;
}

/* ── SECTION SCAFFOLDING ── */
.index-dark .section-wrap {
  max-width: 1100px; margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) clamp(1.25rem, 5vw, 3rem);
  position: relative;
}
.index-dark .section-label {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 1.1rem; font-weight: 500;
  display: flex; align-items: center; gap: 12px;
}
.index-dark .section-label::before {
  content: ''; display: block;
  width: 28px; height: 1px; background: var(--accent);
}
.index-dark .section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.025em; line-height: 1.05;
  margin-bottom: 1rem; max-width: 18ch;
  color: var(--ink);
}
.index-dark .section-title em {
  font-style: italic; color: var(--accent); font-weight: 500;
}
.index-dark .section-body {
  color: var(--muted); font-size: 1rem;
  max-width: 50ch; line-height: 1.7;
  margin-bottom: 3rem; font-weight: 400;
}

/* ── FEATURE CARDS — kept as "boxes", restyled as numbered editorial blocks ── */
.index-dark .features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 18px;
}
.index-dark .feature-card {
  background: var(--bg);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: clamp(1.75rem, 4vw, 2.25rem);
  position: relative; overflow: hidden;
  transition: transform 0.22s cubic-bezier(.2,.7,.2,1),
              box-shadow 0.22s cubic-bezier(.2,.7,.2,1);
}
.index-dark .feature-card::before {
  position: absolute; top: 14px; right: 18px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.22em;
  color: var(--ink); opacity: 0.4; text-transform: uppercase; font-weight: 500;
}
.index-dark .feature-card:nth-child(1)::before { content: "01"; }
.index-dark .feature-card:nth-child(2)::before { content: "02"; }
.index-dark .feature-card:nth-child(3)::before { content: "03"; }
.index-dark .feature-card:nth-child(4)::before { content: "04"; }
.index-dark .feature-card:hover {
  transform: translate(-4px,-4px);
  box-shadow: 8px 8px 0 var(--accent);
}

.index-dark .feature-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 1.4rem;
  border: 1.5px solid var(--ink);
  background: var(--bg2);
  border-radius: 0;
}
/* Neutralise the old per-icon background tints — uniform editorial style */
.index-dark .icon-purple,
.index-dark .icon-blue,
.index-dark .icon-green,
.index-dark .icon-amber { background: var(--bg2); }

.index-dark .feature-title {
  font-family: var(--sans);
  font-size: 1.05rem; font-weight: 500;
  margin-bottom: 0.55rem;
  color: var(--ink);
}
.index-dark .feature-desc {
  font-size: 0.92rem; color: var(--muted);
  line-height: 1.65; font-weight: 400;
}

/* ── PULL QUOTE — new editorial element between sections ── */
.index-dark .pull-quote-wrap {
  position: relative; z-index: 1;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 5vw, 3rem);
}
.index-dark .pull-quote {
  max-width: 920px; margin: 0 auto;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.4rem, 3.4vw, 2.3rem);
  line-height: 1.25; letter-spacing: -0.012em;
  color: var(--ink);
  position: relative;
}
.index-dark .pull-quote::before {
  content: "✦";
  display: block;
  font-family: var(--mono); font-size: 16px;
  color: var(--accent); font-style: normal;
  margin-bottom: 1.5rem;
}
.index-dark .pull-quote cite {
  display: block;
  margin-top: 1.75rem;
  font-family: var(--mono);
  font-style: normal;
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.index-dark .pull-quote cite::before {
  content: "— ";
  color: var(--accent);
}

/* ── HOW IT WORKS — deeper cream surface with paper grain ── */
.index-dark .how-section {
  background: var(--bg2);
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  position: relative;
  z-index: 1;
}
.index-dark .how-section::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: 0.06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.index-dark .steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 20px; margin-top: 3rem;
  position: relative; z-index: 1;
}
.index-dark .step {
  padding: 1.85rem; background: var(--bg);
  border: 1.5px solid var(--ink); border-radius: 0;
  position: relative;
  transition: transform 0.22s cubic-bezier(.2,.7,.2,1),
              box-shadow 0.22s cubic-bezier(.2,.7,.2,1);
}
.index-dark .step:hover {
  transform: translate(-3px,-3px);
  box-shadow: 6px 6px 0 var(--accent);
}
.index-dark .step-num {
  font-family: var(--mono);
  font-size: 12px; color: var(--accent);
  letter-spacing: 0.22em; margin-bottom: 1rem;
  font-weight: 500; text-transform: uppercase;
}
.index-dark .step-title {
  font-family: var(--sans);
  font-size: 1.05rem; font-weight: 500; margin-bottom: 0.55rem;
  color: var(--ink);
}
.index-dark .step-desc {
  font-size: 0.92rem; color: var(--muted); line-height: 1.65; font-weight: 400;
}

/* ── CTA SECTION ── */
.index-dark .cta-section {
  padding: clamp(5rem, 12vw, 10rem) clamp(1.25rem, 5vw, 3rem);
  text-align: center; max-width: 800px; margin: 0 auto;
  position: relative;
}
.index-dark .cta-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 4rem);
  letter-spacing: -0.025em; line-height: 1.05;
  margin-bottom: 1.25rem;
  color: var(--ink);
}
.index-dark .cta-title em {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}
.index-dark .cta-sub {
  color: var(--muted); font-size: 1rem;
  margin-bottom: 2.75rem; font-weight: 400; line-height: 1.65;
}

/* ── FOOTER ── */
.index-dark .qr-footer {
  border-top: 1.5px solid var(--ink);
  padding: 2rem clamp(1.25rem, 5vw, 3rem);
  display: flex; align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  position: relative; z-index: 1;
  background: var(--bg2);
}
.index-dark .footer-text {
  font-size: 12px; color: var(--ink);
  font-family: var(--mono);
  letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 500;
  display: inline-flex; align-items: baseline; gap: 8px;
}
.index-dark .footer-text em {
  color: var(--accent);
  font-family: var(--serif);
  font-style: italic; font-weight: 500;
  text-transform: none; letter-spacing: -0.01em;
  font-size: 16px;
}
.index-dark .footer-links { display: flex; gap: 26px; }
.index-dark .footer-links a {
  font-size: 12px; color: var(--muted); text-decoration: none;
  font-family: var(--mono);
  letter-spacing: 0.18em; text-transform: uppercase;
  transition: color 0.2s;
  font-weight: 500;
}
.index-dark .footer-links a:hover { color: var(--accent); }

/* ── ANIMATIONS ── */
@keyframes index-fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.index-dark .fade-up { opacity: 0; animation: index-fadeUp 0.7s cubic-bezier(.2,.7,.2,1) both; }
.index-dark .delay-1 { animation-delay: 0.08s; }
.index-dark .delay-2 { animation-delay: 0.16s; }
.index-dark .delay-3 { animation-delay: 0.24s; }
.index-dark .delay-4 { animation-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  .index-dark .fade-up { opacity: 1 !important; animation: none !important; }
  .index-dark *, .index-dark *::before, .index-dark *::after {
    animation: none !important; transition: none !important;
  }
}

/* ── MOBILE ── */
@media (max-width: 720px) {
  .index-dark .qr-hero::before { font-size: 18px; top: 18px; right: 20px; }
  .index-dark .qr-hero::after  { font-size: 11px; bottom: 18px; left: 20px; }
  .index-dark .hero-cta { gap: 14px; }
}
@media (max-width: 480px) {
  .index-dark .hero-cta {
    flex-direction: column; width: 100%; max-width: 320px; gap: 12px;
  }
  .index-dark .btn-hero { width: 100%; justify-content: center; }
  .index-dark .qr-footer { flex-direction: column; align-items: flex-start; gap: 18px; }
}

/* ============================================================
   DARK MODE — flips the editorial palette
   The global `.dark body` rule has higher specificity than
   `.index-dark` and was forcing the page bg to #111520 while
   text stayed dark navy → invisible. Here we re-anchor the
   surface to deep ink and lift text to cream so the editorial
   layout still reads at night.
   ============================================================ */
.dark.index-dark,
.dark .index-dark {
  --bg:           var(--ed-ink);     /* deep ink replaces cream as the surface */
  --bg2:          #142347;           /* slightly lifted ink for sections */
  --bg3:          #182a52;           /* card surface */
  --surface:      var(--ed-ink);
  --border:       rgba(245,239,225,0.12);
  --border2:      rgba(245,239,225,0.22);

  --ink:          var(--ed-cream);   /* what was deep navy text → now cream */
  --ink-2:        #d8cfba;
  --text:         var(--ed-cream);
  --muted:        #a9b3c9;
  --subtle:       #7c8aa6;

  --accent:       var(--ed-hot-light); /* lighter blue carries better on ink */
  --accent-deep:  #3b82f6;
  --accent-soft:  rgba(96,165,250,0.14);

  background: var(--bg);
  color: var(--text);
}

/* Beat the global `.dark body { background:#111520 }` rule */
.dark body.index-dark { background: var(--bg) !important; }

/* Nav stays cream-tinted on light, ink-tinted on dark */
.dark .index-dark nav {
  background: rgba(20, 35, 71, 0.88) !important;
  border-bottom-color: var(--border) !important;
}
.dark .index-dark nav .text-gray-500,
.dark .index-dark nav .text-gray-700 { color: var(--ink-2) !important; }

/* Grid lines + paper grain — invert to cream-on-ink */
.dark .index-dark .grid-bg {
  background-image:
    linear-gradient(rgba(245,239,225,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,239,225,0.05) 1px, transparent 1px);
}
.dark .index-dark::before { opacity: 0.06; }

/* Orbs — keep blue tones, slightly softer on dark */
.dark .index-dark .orb-1 {
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  opacity: 0.18;
}
.dark .index-dark .orb-2 {
  background: radial-gradient(circle, #60a5fa 0%, transparent 70%);
  opacity: 0.14;
}

/* Buttons — primary stays dark on cream offset, but we flip the surfaces */
.dark .index-dark .btn-hero-primary {
  background: var(--text);      /* cream button on ink page */
  color: var(--bg);
  box-shadow: 6px 6px 0 var(--accent);
}
.dark .index-dark .btn-hero-primary:hover { box-shadow: 9px 9px 0 var(--accent); }
.dark .index-dark .btn-hero-primary:active { box-shadow: 3px 3px 0 var(--accent); }
.dark .index-dark .btn-hero-secondary {
  color: var(--text);
  border-color: var(--text);
}
.dark .index-dark .btn-hero-secondary:hover {
  background: var(--text);
  color: var(--bg);
}

/* Feature cards + steps — dark surface with cream border */
.dark .index-dark .feature-card,
.dark .index-dark .step {
  background: var(--bg2);
  border-color: var(--text);
}
.dark .index-dark .feature-icon { background: var(--bg3); border-color: var(--text); }
.dark .index-dark .icon-purple,
.dark .index-dark .icon-blue,
.dark .index-dark .icon-green,
.dark .index-dark .icon-amber { background: var(--bg3); }

/* "How it works" surface */
.dark .index-dark .how-section {
  background: var(--bg2);
  border-top-color: var(--text);
  border-bottom-color: var(--text);
}

/* Footer */
.dark .index-dark .qr-footer {
  background: var(--bg2);
  border-top-color: var(--text);
}

/* Pull-quote ✦ accent + cite already use --accent (now bright blue), no change needed */
