/* =====================================================================
   AhuraAuthority.com — v2 "Staircase Hub" homepage.
   New, self-contained brand system (BIS v2.0 "Fortified Growth Engine").
   Deliberately SEPARATE from sales/assets/css/styles.css (the v1 ink/paper
   system). Glassmorphism is allowed here (unlike the v1 zero-shadow rule).

   FALLBACK-FIRST: default styles render a complete, readable, fully-clickable
   static page (no-JS / reduced-motion). journey-init.js adds `.is-enhanced`
   to <body> ONLY when Lenis+GSAP+ScrollTrigger loaded AND motion is allowed;
   the animated 3D overlay lives entirely under `.is-enhanced`.
   Logical properties throughout (RTL-safe, per this project's convention).
   ===================================================================== */

:root {
  /* Brand palette — spec BIS v2.0 */
  --void: #090A0F;          /* Obsidian Void — core background */
  --slate: #12151E;         /* Titanium Slate — surfaces */
  --slate-2: #1B1F2B;       /* lifted surface */
  --gold: #D4AF37;          /* Vault Gold — CTAs, high-status */
  --emerald: #00E676;       /* Cyber Emerald — live/security dots */
  --cyan: #00FFFF;          /* Cyber Cyan — focus/glow */
  --ice: #F4F6F8;           /* Ice White — body text */
  --ice-dim: #9aa3b2;       /* muted text */

  --edge: color-mix(in srgb, var(--ice) 12%, transparent);
  --glass: color-mix(in srgb, var(--slate) 70%, transparent);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --space: clamp(1rem, 2.5vw, 2rem);
  --measure: 40ch;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-block-size: 100dvh;
  background: var(--void);
  color: var(--ice);
  font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;                 /* body never scrolls sideways */
}

a { color: var(--gold); text-underline-offset: 3px; }

/* Skip link — a11y */
.skip {
  position: absolute; inset-block-start: -100px; inset-inline-start: 1rem;
  background: var(--gold); color: var(--void); padding: .6rem 1rem;
  border-radius: 8px; font-weight: 700; z-index: 999;
}
.skip:focus { inset-block-start: 1rem; }

/* Focus visibility — keyboard users */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

/* Placeholder-copy marker (draft narrative awaiting questions-v2.md answers) */
.is-placeholder { position: relative; }
.is-placeholder::after {
  content: "DRAFT COPY";
  position: absolute; inset-block-start: -1.4em; inset-inline-start: 0;
  font-size: .58rem; letter-spacing: .18em; font-weight: 700;
  color: var(--void); background: var(--gold); padding: .1em .5em; border-radius: 4px;
  opacity: .85;
}

/* ---------------------------------------------------------------------
   Brand wordmark / top bar (persists in both modes)
   --------------------------------------------------------------------- */
.topbar {
  position: relative; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.2rem var(--space);
}
.is-enhanced .topbar { position: fixed; inset-block-start: 0; inset-inline: 0; }
.wordmark {
  font-weight: 800; letter-spacing: .06em; font-size: 1.15rem;
  color: var(--ice); text-decoration: none; text-transform: uppercase;
}
.wordmark b { color: var(--gold); }
.topbar__status {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ice-dim);
}
.dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald); }

/* =====================================================================
   FALLBACK LAYOUT (default — no JS / reduced motion)
   Clean vertical narrative: hero, 3 questions, wings, dial pad.
   ===================================================================== */
.journey { position: relative; }

.section {
  max-inline-size: 62rem; margin-inline: auto; padding: clamp(3rem, 9vh, 7rem) var(--space);
}
.eyebrow {
  font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 1rem;
}
.display {
  font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: 1.02; letter-spacing: -0.02em;
  font-weight: 800; margin: 0 0 1.2rem; text-wrap: balance;
}
.lede { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.35rem); color: var(--ice-dim); max-inline-size: var(--measure); }

.climb-q {
  border-inline-start: 3px solid var(--gold);
  padding-inline-start: 1.25rem; margin-block: 2.5rem;
}
.climb-q__k { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.climb-q__t { font-size: clamp(1.5rem, 3.5vw, 2.4rem); line-height: 1.2; font-weight: 700; margin: .5rem 0 0; text-wrap: balance; }

/* Wing graphic (finale) */
.wing {
  inline-size: min(90vw, 720px); margin: 2rem auto 0; display: block;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--gold) 45%, transparent));
}
.wing svg { inline-size: 100%; block-size: auto; }

/* =====================================================================
   DIAL PAD — 10 real, always-clickable WhatsApp links (both modes)
   ===================================================================== */
.dialpad-wrap { text-align: center; }
.dialpad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(.6rem, 1.6vw, 1rem);
  max-inline-size: 420px; margin: 2rem auto 0; padding: 0; list-style: none;
}
.dialpad li:nth-child(10) { grid-column: 2; }  /* 0 key centered on bottom row */
.key {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .25rem; aspect-ratio: 1 / 1; text-decoration: none;
  background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--ice); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.key__num { font-size: 1.7rem; font-weight: 800; color: var(--gold); line-height: 1; }
.key__label { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ice-dim); }
.key:hover, .key:focus-visible {
  transform: translateY(-3px);
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 0 22px color-mix(in srgb, var(--cyan) 40%, transparent);
}
.key:hover .key__label { color: var(--ice); }

/* Dial-pad footnote — a self-contained pill, set well clear of the keys. */
.dial-hint {
  display: inline-flex; align-items: center; gap: .55rem;
  margin-block-start: 2.4rem; padding: .6rem 1.15rem;
  border-radius: 999px; border: 1px solid var(--edge);
  background: color-mix(in srgb, var(--slate) 55%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ice-dim); font-size: .8rem; line-height: 1.3;
  max-inline-size: 34ch; text-align: start;
}
.dial-hint::before {
  content: ""; flex: none; inline-size: 7px; block-size: 7px; border-radius: 50%;
  background: var(--emerald); box-shadow: 0 0 8px var(--emerald);
}

/* Buttons + directory-stub layout (used by the 10 placeholder directory pages) */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: 1rem 1.7rem; border-radius: 12px; font-weight: 800; text-decoration: none;
  background: var(--gold); color: var(--void); border: 1px solid var(--gold);
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover, .btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 24px color-mix(in srgb, var(--gold) 45%, transparent);
}
.btn--ghost { background: transparent; color: var(--ice); border-color: var(--edge); }
.stub { min-block-size: 72vh; display: grid; place-items: center; text-align: center; }
.stub .lede { margin-inline: auto; }

/* =====================================================================
   ENHANCED MODE — animated 3D staircase overlay
   Only active under `.is-enhanced`. The fallback DOM above still exists;
   we relocate the narrative into a fixed HUD and paint the 3D backdrop.
   ===================================================================== */
.is-enhanced .stage { display: block; }
.stage { display: none; }                 /* decorative-only; hidden in fallback */

.is-enhanced .journey { position: relative; }

/* The pinned viewport during the scroll journey. Hidden entirely in fallback
   (fallback shows .flow-only instead). All enhanced overlays live INSIDE it as
   position:absolute so they unpin with it and never cover the footer. */
.viewport { display: none; }
.is-enhanced .viewport {
  display: block; position: relative; block-size: 100dvh; overflow: hidden;
}

/* 3D world */
.stage {
  position: absolute; inset: 0; z-index: 1;
  perspective: 1100px; perspective-origin: 50% 42%;
  background:
    radial-gradient(120% 90% at 50% 8%, color-mix(in srgb, var(--slate) 60%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, var(--void) 0%, #0c1524 55%, #0a1a22 100%);
  pointer-events: none;
}
.stage__sky {
  position: absolute; inset-block-start: 0; inset-inline: 0; block-size: 55%;
  background: radial-gradient(80% 120% at 50% 0%, color-mix(in srgb, var(--cyan) 14%, transparent), transparent 70%);
  opacity: .5;
}
/* Warm environment shift — JS drives opacity 0 → ~0.85 across the journey so the
   scene warms from cold obsidian at the base to gold light near the sky gate. */
.stage__warm {
  position: absolute; inset: 0; opacity: 0; mix-blend-mode: screen; pointer-events: none;
  background: radial-gradient(100% 85% at 50% 72%, color-mix(in srgb, var(--gold) 24%, transparent), transparent 68%);
}
/* Danger flash layer for the fall beats (JS pulses opacity briefly). */
.stage__danger {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(120% 120% at 50% 120%, color-mix(in srgb, var(--red, #ec3013) 30%, transparent), transparent 60%);
}
.world { position: absolute; inset: 0; transform-style: preserve-3d; }

/* Each staircase — a stack of treads receding in Z. */
.staircase {
  position: absolute; inset-inline: 0; inset-block-end: 0;
  margin-inline: auto; inline-size: min(70vw, 640px);
  transform-style: preserve-3d;
  contain: layout paint style;
  visibility: hidden;                     /* only the active staircase is shown */
}
.staircase.is-active { visibility: visible; }
.tread {
  position: absolute; inset-inline-start: 50%; inline-size: 100%;
  block-size: 46px; margin-inline-start: -50%;
  background: linear-gradient(180deg, var(--slate-2), var(--slate));
  border-block-start: 2px solid color-mix(in srgb, var(--gold) 70%, transparent);
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0,0,0,.5);
  transform-origin: 50% 100%;
}

/* Glass pieces — hundreds of clip-path diamonds. Position + opacity are driven
   per-frame from JS (shards.js via gsap.ticker): they idle (drift/rise + twinkle)
   then assemble onto the wing outline on scroll. --sz set per piece in JS. */
.shard {
  position: fixed; inset-block-start: 0; inset-inline-start: 0; z-index: 4;
  inline-size: var(--sz, 12px); block-size: var(--sz, 12px);
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  pointer-events: none; opacity: 0; will-change: transform, opacity;
}
.shard--glow { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--cyan) 65%, transparent)); }

/* HUD — narrative overlay in enhanced mode (absolute within the pinned viewport) */
.is-enhanced .hud {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center; text-align: center;
  padding: var(--space); pointer-events: none;
}
.is-enhanced .hud > * { pointer-events: auto; }

/* In enhanced mode the fallback narrative sections are driven by JS instead */
.is-enhanced .flow-only { display: none; }
.flow-only { display: block; }

/* Enhanced question card */
.is-enhanced .q-card {
  position: absolute; inset-inline: 0; inset-block-start: 50%; translate: 0 -50%;
  max-inline-size: 30ch; margin-inline: auto; z-index: 21;
  padding: 1.6rem 1.8rem; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--edge);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0;                              /* GSAP fades it in — enhanced path only */
}
.q-card__k { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.q-card__t { font-size: clamp(1.3rem, 3vw, 2rem); line-height: 1.2; font-weight: 700; margin: .5rem 0 0; }

/* Enhanced finale (wings + dial pad) — starts hidden, timeline reveals it */
.is-enhanced .finale {
  position: absolute; inset: 0; z-index: 22; display: grid; place-items: center;
  padding: var(--space); opacity: 0; pointer-events: none;
}
.is-enhanced .finale.is-live { pointer-events: auto; }

/* The enhanced finale must fit inside ONE viewport: the stage is pinned with
   overflow:hidden, so anything taller than 100dvh gets clipped at the bottom
   (which read as the footer "covering" the lower dial-pad rows). Compact the
   wing + dial pad here so all 10 keys + hint always fit above the fold. */
.is-enhanced .finale { align-content: center; overflow: hidden; }
.is-enhanced .finale .wing { inline-size: min(44vw, 290px); margin-block: 0 .4rem; }
.is-enhanced .finale .eyebrow { margin-block: 0 .9rem; }
.is-enhanced .finale .dialpad { max-inline-size: 330px; gap: .5rem; margin-block-start: 0; }
.is-enhanced .finale .key { aspect-ratio: auto; padding-block: .5rem; }
.is-enhanced .finale .key__num { font-size: 1.25rem; }
.is-enhanced .finale .dial-hint { margin-block-start: 1.6rem; }
@media (max-height: 720px) {
  .is-enhanced .finale .wing { inline-size: min(36vw, 220px); }
  .is-enhanced .finale .key { padding-block: .35rem; }
  .is-enhanced .finale .key__num { font-size: 1.1rem; }
}

.is-enhanced .scroll-cue { position: absolute; }
.scroll-cue {
  position: fixed; inset-block-end: 1.4rem; inset-inline: 0; text-align: center;
  color: var(--ice-dim); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; z-index: 25;
}
.scroll-cue span { display: inline-block; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(6px);} }

/* ---------------------------------------------------------------------
   Mobile (coarse) — cut visual cost (counts handled in JS; blur/size here)
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .staircase { inline-size: min(86vw, 420px); }
  .key__num { font-size: 1.4rem; }
}

/* ---------------------------------------------------------------------
   Reduced motion — belt-and-braces (JS also hard-bails).
   Force the static flow layout; kill decorative animation.
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .stage, .shard { display: none !important; }
  .scroll-cue span { animation: none; }
  .flow-only { display: block !important; }
}
