/* ============================================================
   ThoughtDocs — landing page
   Mobile-first. Tokens first.
   ============================================================ */

:root {
  --ink: #0a0b0e;            /* vault night */
  --ink-2: #10141d;          /* deep panel */
  --gold: #c9a14e;           /* bullion */
  --gold-pale: #ead9a8;      /* headline highlight */
  --gold-dim: rgba(201, 161, 78, 0.28);
  --paper: #f1efe7;          /* document white */
  --muted: #9aa1ae;
  --signal: #5fa8ff;         /* interaction blue */
  --line: rgba(201, 161, 78, 0.18);

  --font-display: Arial, sans-serif;
  --font-body: Arial, sans-serif;
  /* Consolidated to two type families. Former "mono" label styling now uses the
     body family — the uppercase + wide letter-spacing keeps the eyebrow look. */
  --font-mono: var(--font-body);

  /* Black blurred halo so light text stays legible over the bright 3D scene. */
  --text-halo: 0 1px 2px rgba(0, 0, 0, 0.55), 0 2px 16px rgba(0, 0, 0, 0.8);

  --step--1: clamp(0.78rem, 0.74rem + 0.2vw, 0.875rem);
  --step-0: clamp(0.95rem, 0.9rem + 0.3vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.05rem + 0.5vw, 1.375rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(2.1rem, 1.6rem + 2.4vw, 3.4rem);
  --step-4: clamp(2.6rem, 1.9rem + 3.6vw, 4.6rem);

  --space: clamp(1.25rem, 4vw, 2.5rem);
  --panel-max: 68rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--ink); }

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--gold-pale);
  outline-offset: 3px;
  border-radius: 2px;
}

img { display: block; max-width: 100%; height: auto; }

/* ---------- 3D canvas + loading veil ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

body.no-webgl #scene { display: none; }
body.no-webgl {
  background:
    radial-gradient(60rem 40rem at 50% -10%, rgba(201, 161, 78, 0.12), transparent 60%),
    var(--ink);
}

/* CDN unavailable fallback — same visual treatment as no-webgl */
body.no-cdn #scene { display: none; }
body.no-cdn #top-scrim { display: none; }
body.no-cdn {
  background:
    radial-gradient(60rem 40rem at 50% -10%, rgba(201, 161, 78, 0.12), transparent 60%),
    var(--ink);
}
/* Without GSAP, .reveal elements start invisible (will-change only) — make them
   visible immediately so content isn't hidden when CDN animations can't run. */
body.no-cdn .reveal {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* Top scrim — 50% black at the very top, fading to clear lower down, so the
   hero title reads over the bright 3D scene. Sits above the canvas but below the
   text + header; JS scrubs its opacity to 0 as the hero scrolls away. */
#top-scrim {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100svh;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.5) 60%,
    rgba(0, 0, 0, 0) 70%
  );
}

#veil {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  background: var(--ink);
  transition: opacity 0.9s ease, visibility 0.9s ease;
}
#veil img { width: 84px; filter: drop-shadow(0 0 24px rgba(201, 161, 78, 0.35)); }
#veil .veil-label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  animation: veilPulse 1.6s ease-in-out infinite;
}
#veil.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes veilPulse { 50% { opacity: 0.35; } }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem var(--space);
  background: linear-gradient(to bottom, rgba(10, 11, 14, 0.82), rgba(10, 11, 14, 0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--paper);
}
.brand:hover { text-decoration: none; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  letter-spacing: 0.06em;
}

/* ---------- Buttons (one primary style) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  color: var(--ink);
  background: linear-gradient(160deg, var(--gold-pale) 0%, var(--gold) 55%, #a37e34 100%);
  padding: 0.85rem 1.9rem;
  box-shadow:
    0 0 0 1px rgba(234, 217, 168, 0.35) inset,
    0 10px 30px -10px rgba(201, 161, 78, 0.55);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(234, 217, 168, 0.5) inset,
    0 16px 40px -12px rgba(201, 161, 78, 0.7);
}
.btn-primary:active { transform: translateY(0); }

.btn-compact { padding: 0.55rem 1.2rem; font-size: var(--step--1); }
.btn-large { padding: 1.05rem 2.6rem; font-size: var(--step-1); }

/* ---------- Panels / sections ---------- */

main { position: relative; z-index: 10; }

.panel {
  position: relative;
  max-width: var(--panel-max);
  margin: 0 auto;
  padding: clamp(5rem, 16vh, 9rem) var(--space);
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 50% black, blurred backing so content sections stay readable where the
   scrolling 3D scene (pillars + flying documents) shows through behind them.
   Sits behind the content; direct children are lifted above it. */
.panel-shaded > * {
  position: relative;
  z-index: 1;
  /* Inset content from the shaded backing's left/right edges so text and cards
     aren't flush against it (vertical breathing comes from the panel padding). */
  padding-inline: clamp(1.5rem, 3vw, 2.75rem);
}
.panel-shaded::before {
  content: "";
  position: absolute;
  inset: clamp(1.5rem, 5vh, 3.5rem) 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.1rem;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 1.2rem;
  color: var(--paper);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); max-width: 18ch; }
h2 { font-size: var(--step-3); max-width: 20ch; }
h1 em, h2 em {
  font-style: normal;
  color: var(--gold-pale);
}

h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-1);
  margin: 0 0 0.45rem;
  color: var(--gold-pale);
}

.lede {
  font-size: var(--step-1);
  color: var(--paper);
  max-width: 36ch;
  margin: 0 0 2rem;
}
.lede em {
  font-style: italic;
  color: var(--gold-pale);
}

.body-copy {
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 2.4rem;
}

/* ---------- Legibility over the 3D scene ---------- */

/* Black blurred halo on light text so it reads against bright flying documents. */
.eyebrow, h1, h2, h3, .lede, .body-copy, .layer-label,
.amount, .tier-detail, .brand-name, .legal {
  text-shadow: var(--text-halo);
}

/* Hero sits over the busiest part of the scene — give it a stronger halo
   (no backing panel here, so the vault animation stays fully visible). */
.hero h1, .hero .lede, .hero .eyebrow {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 2px 10px rgba(0, 0, 0, 0.85),
    0 8px 44px rgba(0, 0, 0, 0.72);
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  text-align: left;
}
/* The hero lede is now a full sentence, not a short tagline — give it room. */
.hero .lede { max-width: 52ch; }

.cta-row { display: flex; gap: 1rem; align-items: center; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  width: 26px; height: 44px;
  border: 1px solid var(--gold-dim);
  border-radius: 14px;
  display: flex;
  justify-content: center;
}
.scroll-cue span {
  width: 3px; height: 9px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--gold);
  animation: cueDrop 1.8s ease-in-out infinite;
}
@keyframes cueDrop {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- Glass cards (layers / features / tiers) ---------- */

.layers, .features, .tiers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.layer-card, .feature, .tier {
  background: linear-gradient(165deg, rgba(16, 20, 29, 0.78), rgba(16, 20, 29, 0.55));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem 1.4rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.layer-card:hover, .feature:hover, .tier:hover {
  border-color: rgba(201, 161, 78, 0.45);
  transform: translateY(-3px);
}

.layer-card p, .feature p, .tier p { margin: 0; color: var(--muted); }

.layer-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 0.7rem;
}

/* ---------- Pricing ---------- */

.tiers { margin-top: 1rem; }

.tier { text-align: center; padding: 2rem 1.4rem; position: relative; }

.tier-popular {
  border-color: rgba(201, 161, 78, 0.6);
  box-shadow: 0 18px 50px -22px rgba(201, 161, 78, 0.45);
}

.tier-badge {
  position: absolute;
  top: -0.8rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(160deg, var(--gold-pale), var(--gold));
  border-radius: 999px;
  padding: 0.32rem 0.95rem;
}

.price { margin: 0.4rem 0 0.2rem; }
.amount {
  font-family: var(--font-display);
  font-size: var(--step-3);
  color: var(--paper);
}
.tier-detail {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  color: var(--gold);
}

.pricing-link { margin-top: 2rem; }
.pricing-link a { font-family: var(--font-mono); letter-spacing: 0.06em; }

.pricing-section-label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.plan-limits {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.plan-limits li {
  font-size: var(--step--1);
  color: var(--muted);
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.tier-coming-soon {
  opacity: 0.6;
}

.tier-badge-soon {
  background: linear-gradient(160deg, #3a3a4a, #5a5a6a);
  color: var(--paper);
}

/* ---------- Closing CTA ---------- */

.closing {
  align-items: center;
  text-align: center;
}
.closing h2, .closing .lede { margin-left: auto; margin-right: auto; }
.closing-mark { filter: drop-shadow(0 0 28px rgba(201, 161, 78, 0.4)); margin-bottom: 1.4rem; }
.closing .cta-row { justify-content: center; }

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--line);
  background: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.footer-inner {
  max-width: var(--panel-max);
  margin: 0 auto;
  padding: 2.2rem var(--space);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.site-footer nav { display: flex; gap: 1.4rem; }
.site-footer nav a {
  color: var(--muted);
  font-size: var(--step--1);
}
.site-footer nav a:hover { color: var(--gold-pale); }
.legal {
  margin: 0;
  color: var(--muted);
  font-size: var(--step--1);
}

/* ---------- Reveal default (JS animates from this) ---------- */

.reveal { will-change: transform, opacity; }

/* No-JS / reduced-motion safety: content always visible by default.
   JS adds the .fx class to <body> before hiding anything. */

/* ---------- Desktop enhancements ---------- */

@media (min-width: 700px) {
  .layers { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .tiers { grid-template-columns: repeat(3, 1fr); gap: 1.2rem; align-items: stretch; }
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

@media (min-width: 1100px) {
  .features { grid-template-columns: repeat(3, 1fr); }
  .panel { padding-left: 0; padding-right: 0; }
  .hero h1 { max-width: 16ch; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue span, #veil .veil-label { animation: none; }
  .btn, .layer-card, .feature, .tier { transition: none; }
}
