:root {
    --accent: #6B8E72;
    --accent-glow: #a7d4b0;
    --warn: #d99060;
    --warn-deep: #8a4a30;
    --font-sans: "Helvetica Neue", Helvetica, Inter, system-ui, -apple-system, Arial, sans-serif;
    --font-serif: "Instrument Serif", Georgia, serif;
    --font-toxic: "Worn Stencil", "Stardos Stencil", "Stencil Std", "Copperplate", "Impact", serif;
    --font-pure: "Cormorant Garamond", "Instrument Serif", Georgia, serif;
    --cream-bg: #fff7e9;
    --cream-ink: #17202a;
    --pink-orb: #ff5fae;
    --purple-orb: #7d5cff;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; background: #04060c; color: #f4f1ea; font-family: var(--font-sans); transition: background-color 900ms ease, color 900ms ease; }
  body.light-theme { background: var(--cream-bg); color: var(--cream-ink); }
  body { height: 1100vh; }
  canvas#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 1; }
  /* Layer 1 world — independent Three.js scene rendered on top with alpha */
  canvas#scene2 {
    position: fixed; inset: 0; width: 100vw; height: 100vh; display: block;
    z-index: 2; pointer-events: none;
    opacity: 0; transition: opacity 800ms ease;
  }
  /* Layer 1 AND layer 2: show the 3D reveal world */
  body[data-layer="1"] canvas#scene2,
  body[data-layer="2"] canvas#scene2 { opacity: 1; }
  /* Layer 0 shards fade back — scene becomes ghostly under layer 1/2 */
  body[data-layer="1"] canvas#scene,
  body[data-layer="2"] canvas#scene { opacity: 0; transition: opacity 600ms ease; pointer-events: none; }


  /* ── In-scene try panel ── */
  .try-panel {
    position: fixed;
    left: 30px;
    top: 50%;
    bottom: auto;
    width: min(388px, calc(100vw - 72px));
    padding: 18px;
    border-radius: 26px;
    background: rgba(7, 10, 16, 0.70);
    border: 1px solid rgba(164, 210, 176, 0.24);
    box-shadow: 0 24px 90px rgba(0,0,0,0.32), 0 0 60px rgba(164,210,176,0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 11;
    pointer-events: auto;
    opacity: 0;
    transform: translate3d(170px, -50%, 0) scale(0.56);
    transform-origin: 50% 50%;
    transition: opacity 220ms ease, background-color 400ms ease, border-color 400ms ease, box-shadow 400ms ease;
    color: rgba(244,241,234,0.96);
    overflow: hidden;
  }
  .try-panel.visible { opacity: 1; }
  .tag-1 { top: 12px; right: 16px; }
  .tag-2 { top: 64px; right: -6px; }
  .tag-3 { bottom: 78px; right: 14px; }
  .tag-4 { bottom: 22px; right: 26px; }

  .try-step {
    position: absolute;
    inset: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(120px, 0, 0) scale(0.94);
    transition: opacity 180ms ease;
  }
  .try-step .eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(167,212,176,0.86);
  }
  .try-step .title {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 26px;
    line-height: 1.0;
    margin-top: 2px;
  }
  .step-copy {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(244,241,234,0.74);
  }
  .try-panel textarea,
  .community-input {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.05);
    color: inherit;
    padding: 12px 14px;
    font: 500 14px/1.45 var(--font-sans);
    outline: none;
  }
  .try-panel textarea { min-height: 92px; resize: vertical; }
  .try-panel textarea::placeholder,
  .community-input::placeholder { color: rgba(244,241,234,0.45); }
  .try-actions { display: flex; gap: 10px; margin-top: 2px; }
  .try-btn,
  .placement-btn,
  .community-submit {
    appearance: none;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.06);
    color: inherit;
    border-radius: 999px;
    padding: 10px 14px;
    font: 600 12px/1 var(--font-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 120ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
  }
  .try-btn:hover,
  .placement-btn:hover,
  .community-submit:hover { transform: translateY(-1px); }
  .try-btn.active,
  .placement-btn.active,
  .community-submit {
    background: rgba(167,212,176,0.16);
    border-color: rgba(167,212,176,0.44);
    color: rgba(228,245,232,0.98);
  }
  .try-output {
    min-height: 74px;
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
  }
  .try-output .label,
  .community-note {
    display: block;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.42);
    margin-bottom: 8px;
  }
  .try-output .value {
    display: block;
    font-size: 16px;
    line-height: 1.45;
    color: rgba(244,241,234,0.96);
  }
  .community-form { display: flex; flex-direction: column; gap: 10px; }
  .community-textarea { min-height: 70px; resize: vertical; }
  .community-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .community-status {
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    color: rgba(244,241,234,0.72);
  }
  .placement-preview {
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    padding: 12px;
  }
  .placement-browser {
    position: relative;
    height: 124px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(239,236,228,0.08), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
  }
  .browser-content {
    position: absolute;
    inset: 24px 16px 18px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: rgba(244,241,234,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--font-mono);
  }
  .browser-topbar, .browser-left, .browser-right, .browser-bottom {
    position: absolute;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
  }
  .browser-topbar { left: 12px; right: 12px; top: 10px; height: 10px; border-radius: 999px; }
  .browser-left { left: 10px; top: 26px; bottom: 12px; width: 10px; border-radius: 999px; }
  .browser-right { right: 10px; top: 26px; bottom: 12px; width: 10px; border-radius: 999px; }
  .browser-bottom { left: 18px; right: 18px; bottom: 10px; height: 10px; border-radius: 999px; }
  .placement-preview[data-placement="top"] .browser-topbar,
  .placement-preview[data-placement="left"] .browser-left,
  .placement-preview[data-placement="right"] .browser-right,
  .placement-preview[data-placement="bottom"] .browser-bottom {
    background: rgba(255, 132, 214, 0.24);
    border-color: rgba(255,132,214,0.58);
    box-shadow: 0 0 18px rgba(255,132,214,0.22);
  }
  .placement-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.light-theme .try-panel {
    background: rgba(245, 240, 233, 0.86);
    border-color: rgba(123, 93, 255, 0.18);
    box-shadow: 0 24px 90px rgba(67,50,33,0.14), 0 0 60px rgba(255,132,214,0.10);
    color: rgba(23,32,42,0.96);
  }
  body.light-theme .try-step .eyebrow { color: rgba(125,92,255,0.76); }
  body.light-theme .step-copy { color: rgba(23,32,42,0.70); }
  body.light-theme .try-panel textarea,
  body.light-theme .community-input { background: rgba(23,32,42,0.04); border-color: rgba(23,32,42,0.08); }
  body.light-theme .try-panel textarea::placeholder,
  body.light-theme .community-input::placeholder { color: rgba(23,32,42,0.42); }
  body.light-theme .try-btn,
  body.light-theme .placement-btn,
  body.light-theme .community-submit { background: rgba(23,32,42,0.035); border-color: rgba(23,32,42,0.08); color: rgba(23,32,42,0.90); }
  body.light-theme .try-btn.active,
  body.light-theme .placement-btn.active,
  body.light-theme .community-submit {
    background: rgba(255,132,214,0.12);
    border-color: rgba(255,132,214,0.30);
    color: rgba(23,32,42,0.96);
  }
  body.light-theme .try-output,
  body.light-theme .community-status,
  body.light-theme .placement-preview,
  body.light-theme .placement-browser { background: rgba(23,32,42,0.03); border-color: rgba(23,32,42,0.08); }
  body.light-theme .try-output .label,
  body.light-theme .community-note { color: rgba(23,32,42,0.46); }
  body.light-theme .try-output .value,
  body.light-theme .community-status,
  body.light-theme .browser-content { color: rgba(23,32,42,0.92); }


  @media (max-width: 960px) {
    #stage8.act-try {
      align-items: center;
      text-align: center;
      padding-left: 28px;
      padding-right: 28px;
      padding-top: 290px;
    }
    #stage8.act-try .journey-copy-stack { width: 100%; min-height: 320px; }
    #stage8.act-try .headline,
    #stage8.act-try .sub,
    #stage8.act-try .eyebrow,
    #stage8.act-try .stage-index { width: auto; text-align: center; }
    .try-panel {
      left: 50%;
      top: auto;
      bottom: 22px;
      width: min(390px, calc(100vw - 24px));
      transform: translate3d(-50%, 18px, 0) scale(0.94);
    }
    .placement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  /* ── HUD shell ── */
  .hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
  .hud-top {
    position: absolute;
    top: 24px; left: 24px; right: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(244,241,234,0.55);
    transition: color 1s;
  }
  .hud-wordmark {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    text-decoration: none;
    color: inherit;
  }
  .hud-wordmark .name {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 20px;
    letter-spacing: -0.01em;
    color: rgba(244,241,234,0.85);
    text-transform: none;
  }
  .hud-wordmark .sub {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: rgba(244,241,234,0.4);
  }

  /* ── Progress dots (chapter indicator) ── */
  .chapters {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column-reverse;
    gap: 16px;
    z-index: 10;
    pointer-events: auto;
  }
  .chapter-dot {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: rgba(244,241,234,0.4);
    text-decoration: none;
    transition: color 200ms;
  }
  .chapter-dot:hover { color: rgba(244,241,234,0.8); }
  .chapter-dot .ring {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 1px solid currentColor;
    transition: all 240ms;
  }
  .chapter-dot.active .ring {
    background: var(--accent-glow);
    border-color: var(--accent-glow);
    box-shadow: 0 0 12px var(--accent-glow);
    transform: scale(1.3);
  }
  .chapter-dot.active { color: rgba(244,241,234,0.95); }
  .chapter-dot .label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 240ms, transform 240ms;
  }
  .chapter-dot.active .label, .chapter-dot:hover .label {
    opacity: 1; transform: translateX(0);
  }

  /* ── Acts — text overlays that fade in/out by scroll progress ── */
  .act {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    background: transparent; /* never block the reveal canvas beneath */
    transition: opacity 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
    padding: 0 56px;
  }
  .act.visible { opacity: 1; }


  #stage8.act-try {
    align-items: flex-end;
    text-align: left;
    padding-left: max(450px, 37vw);
    padding-right: 90px;
  }
  #stage8.act-try .journey-copy-stack {
    position: relative;
    width: min(620px, 42vw);
    min-height: 380px;
  }
  #stage8.act-try .journey-copy-step {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    opacity: 0;
    transform: translate3d(120px, 0, 0);
    pointer-events: none;
  }
  #stage8.act-try .headline,
  #stage8.act-try .sub,
  #stage8.act-try .eyebrow,
  #stage8.act-try .stage-index {
    width: min(560px, 40vw);
    text-align: left;
  }
  #stage8.act-try .headline { font-size: clamp(42px, 6vw, 88px); }
  #stage8.act-try .sub { max-width: 540px; }


  .act .eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.30em;
    text-transform: uppercase;
    color: rgba(244,241,234,0.55);
    margin-bottom: 22px;
  }
  .act .headline {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(46px, 7.6vw, 108px);
    line-height: 1.18;
    transition: color 900ms ease, text-shadow 900ms ease, font-family 900ms ease;
    letter-spacing: -0.025em;
    margin: 0;
    display: inline-block;
    padding: 0.20em 0.12em 0.28em;
    overflow: visible;
    text-wrap: balance;
  }
  .act .sub {
    margin-top: 28px;
    max-width: 680px;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(244,241,234,0.75);
    text-wrap: pretty;
  }

  /* Act I — toxic */
  .act-1 .eyebrow { color: rgba(217, 144, 96, 0.7); }
  .act-1 .headline { color: rgba(244,241,234,0.92); }
  .act-1 .headline em {
    font-style: italic;
    background: linear-gradient(180deg, #f4eee8 0%, #d99060 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  /* Act II — activation */
  .act-2 .eyebrow { color: var(--accent-glow); }
  .act-2 .headline em {
    background: linear-gradient(180deg, #ffffff 0%, var(--accent-glow) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  /* Act III — calm; pillars are 3 stacked items */
  .pillars {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }
  .pillar {
    position: absolute;
    text-align: center;
    opacity: 0;
    transition: opacity 600ms, transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
    transform: translateY(20px);
  }
  .pillar.visible { opacity: 1; transform: translateY(0); }
  .pillar .roman {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 38px;
    color: var(--accent-glow);
    line-height: 1;
    margin-bottom: 10px;
  }
  .pillar .title {
    font-family: var(--font-serif);
    font-size: clamp(36px, 5vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 12px;
  }
  .pillar .body {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(244,241,234,0.7);
    max-width: 360px;
    margin: 0 auto;
    text-wrap: pretty;
  }

  /* Act IV — install */
  .act-4 .headline {
    background: linear-gradient(180deg, #ffffff 0%, #d8e3da 50%, var(--accent-glow) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 120px rgba(167, 212, 176, 0.35);
  }
  .install-buttons {
    margin-top: 44px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    pointer-events: auto;
  }
  .install-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(8, 14, 22, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(167, 212, 176, 0.4);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 99px;
    transition: all 200ms;
    cursor: pointer;
  }
  .install-btn:hover {
    border-color: var(--accent-glow);
    box-shadow: 0 0 30px rgba(167,212,176,0.3);
    transform: translateY(-2px);
  }
  .install-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(107,142,114,0.4);
  }
  .install-btn.primary:hover {
    background: #7fa384;
    border-color: #a7d4b0;
  }



  /* ── 11-stage story screens ── */
  .stage-index {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    color: rgba(244,241,234,0.46);
    margin-bottom: 14px;
  }
  .act .headline .warn-word {
    background: linear-gradient(180deg, #fff4ec 0%, #d99060 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .act .headline .kind-word {
    font-family: var(--font-pure) !important;
    display: inline-block;
    padding: 0.10em 0.10em 0.18em;
    margin: -0.08em -0.03em -0.14em;
    line-height: 1.24;
    overflow: visible;
    color: var(--accent-calm);
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    font-style: italic;
    text-shadow:
      0 0 18px rgba(167,212,176,0.34),
      0 8px 30px rgba(0,0,0,0.28);
  }
  .act .headline .quiet-word {
    color: rgba(244,241,234,0.72);
  }
  .act .sub strong {
    color: #fff;
    font-weight: 650;
  }
  #stage9 .sub {
    font-size: clamp(18px, 1.95vw, 27px);
  }
  #stage9 .sub strong {
    display: inline-block;
    padding-right: 0.16em;
    color: rgba(23,32,42,0.98);
    text-shadow: 0 0 12px rgba(255,255,255,0.84);
  }
  .act-final .headline {
    background: linear-gradient(180deg, #ffffff 0%, #d8e3da 50%, var(--accent-glow) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 120px rgba(167, 212, 176, 0.35);
  }
  @media (max-width: 720px) {
    .chapters { right: 14px; gap: 11px; }
    .chapter-dot .label { display: none; }
    .hud-top { top: 16px; left: 16px; right: 16px; }
    .act .headline { font-size: clamp(46px, 15vw, 84px); }
    .act .sub { font-size: 16px; max-width: 460px; }
  }

  /* Scroll hint */
  .scroll-hint {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    color: rgba(244,241,234,0.4);
    text-transform: uppercase;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: hintBob 2.4s ease-in-out infinite;
  }
  @keyframes hintBob {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.5; }
    50% { transform: translate(-50%, 4px); opacity: 1; }
  }
  .scroll-hint .arrow {
    display: inline-block;
    width: 1px; height: 24px;
    background: linear-gradient(180deg, currentColor, transparent);
    position: relative;
  }
  .scroll-hint .arrow::before {
    content: "↑";
    position: absolute;
    top: -13px;
    left: -5px;
    font-size: 12px;
    line-height: 1;
    color: currentColor;
  }



  #stage1 .headline {
    max-width: min(1180px, 86vw);
    margin-left: auto;
    margin-right: auto;
  }
  #stage7 .headline .kind-word {
    display: inline-block;
    color: #ff5fae;
    text-shadow: 0 0 28px rgba(255,95,174,0.42);
    opacity: 1;
    filter: none;
  }

  #stage2 .headline,
  #stage3 .headline,
  #stage4 .headline,
  #stage5 .headline {
    line-height: 1.16;
    padding-top: 0.16em;
    padding-bottom: 0.18em;
  }

  body.dark-toxic #stage2 .font-pure,
  body.dark-toxic #stage3 .font-pure,
  body.dark-toxic #stage4 .font-pure,
  body.dark-toxic #stage5 .font-pure {
    font-family: var(--font-pure) !important;
    font-weight: 600 !important;
    font-style: italic !important;
    letter-spacing: -0.045em !important;
    line-height: 1.12 !important;
    text-transform: none !important;
    display: inline-block;
    padding: 0.04em 0.03em 0.10em;
    color: rgba(232, 250, 235, 0.98) !important;
    text-shadow:
      0 0 14px rgba(255,255,255,0.35),
      0 0 32px rgba(167,212,176,0.28),
      0 0 44px rgba(255,95,174,0.12) !important;
    transform: translateY(-0.01em) scale(1.03);
    overflow: visible;
  }
  body.dark-toxic #stage2 .font-toxic,
  body.dark-toxic #stage3 .font-toxic,
  body.dark-toxic #stage4 .font-toxic,
  body.dark-toxic #stage5 .font-toxic {
    font-family: var(--font-toxic) !important;
  }

  /* ── Full theme switch: foreboding → clean/bright ── */
  body.dark-toxic #stage1 .headline,
  body.dark-toxic #stage2 .headline,
  body.dark-toxic #stage3 .headline,
  body.dark-toxic #stage4 .headline,
  body.dark-toxic #stage5 .headline,
  body.dark-toxic .warn-word {
    font-family: var(--font-toxic);
    letter-spacing: 0.01em;
    letter-spacing: calc(0.01em - (var(--morph, 0) * 0.015em));
    transform: scale(calc(1 - (var(--morph, 0) * 0.035)));
    text-shadow:
      0 0 calc(18px - (var(--morph, 0) * 8px)) rgba(217,144,96,0.22),
      0 8px calc(48px - (var(--morph, 0) * 18px)) rgba(0,0,0,0.6);
  }

  body.light-theme .hud-top,
  body.light-theme .chapter-dot,
  body.light-theme .scroll-hint {
    color: rgba(23,32,42,0.58);
  }
  body.light-theme .hud-wordmark .name {
    color: rgba(23,32,42,0.86);
  }
  body.light-theme .hud-wordmark .sub {
    color: rgba(23,32,42,0.42);
  }
  body.light-theme .chapter-dot.active {
    color: rgba(23,32,42,0.95);
  }
  body.light-theme .chapter-dot.active .ring {
    background: var(--pink-orb);
    border-color: var(--pink-orb);
    box-shadow: 0 0 16px rgba(255,95,174,0.45);
  }
  body.light-theme .story-act .eyebrow,
  body.light-theme .stage-index {
    color: rgba(125,92,255,0.66);
  }
  body.light-theme .story-act .headline {
    font-family: var(--font-pure) !important;
    color: rgba(23,32,42,0.94);
    text-shadow:
      0 0 28px rgba(255,255,255,0.9),
      0 12px 52px rgba(125,92,255,0.12);
  }
  body.light-theme .story-act .sub {
    color: rgba(23,32,42,0.68);
  }
  body.light-theme .story-act .sub strong,
  body.light-theme #stage9 .sub strong {
    color: rgba(23,32,42,0.96);
    font-weight: 700;
    text-shadow: 0 0 12px rgba(255,255,255,0.78);
  }
  body.light-theme .kind-word,
  body.light-theme #stage7 .kind-word {
    color: var(--pink-orb);
    text-shadow: 0 0 22px rgba(255,95,174,0.28);
  }
  body.light-theme .quiet-word {
    color: #4e65ff;
  }

  body.dark-toxic .font-pure {
    color: rgba(244,241,234,0.96);
    text-shadow:
      0 0 18px rgba(255,255,255,0.18),
      0 0 26px rgba(167,212,176,0.10);
    transform: translateY(-0.01em);
  }
  body.light-theme .font-pure {
    color: rgba(23,32,42,0.95);
    text-shadow: 0 0 22px rgba(255,255,255,0.60);
  }
  body.dark-toxic .font-toxic {
    color: rgba(244,241,234,0.94);
  }
  body.light-theme .font-toxic {
    color: rgba(23,32,42,0.92);
  }


  /* Anti-clipping guard for colored italic words in first five panes:
     MEAN, YOU, INTACT, TOXICITY. */
  #stage1 .warn-word,
  #stage2 .kind-word,
  #stage4 .kind-word,
  #stage5 .warn-word {
    display: inline-block !important;
    padding: 0.12em 0.12em 0.22em !important;
    margin: -0.10em -0.04em -0.17em !important;
    line-height: 1.30 !important;
    overflow: visible !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    transform: translateZ(0);
  }
  body.dark-toxic #stage1 .warn-word,
  body.dark-toxic #stage5 .warn-word {
    color: #d99060 !important;
  }
  body.dark-toxic #stage2 .kind-word,
  body.dark-toxic #stage4 .kind-word {
    color: rgba(223, 246, 226, 0.98) !important;
  }

  body.light-theme .install-btn {
    background: rgba(255,255,255,0.62);
    border-color: rgba(125,92,255,0.28);
    color: rgba(23,32,42,0.94);
    box-shadow: 0 18px 55px rgba(125,92,255,0.10);
  }
  body.light-theme .install-btn.primary {
    background: linear-gradient(135deg, var(--pink-orb), var(--purple-orb));
    border-color: rgba(255,255,255,0.4);
    color: #fff;
  }

  /* Loader */
  .loader {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 14px;
    z-index: 200;
    background: #04060c;
    transition: opacity 800ms;
  }
  .loader.done { opacity: 0; pointer-events: none; }
  body.light-theme .loader { background: var(--cream-bg); }
  .loader-mark {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(167,212,176,0.3);
    border-top-color: var(--accent-glow);
    animation: spin 1.2s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .loader-text {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.2em;
    color: rgba(244,241,234,0.5);
    text-transform: uppercase;
  }

  /* ── v1.8.18: cleaned side-scene controller ── */
  #stage8.act-try {
    align-items: flex-end !important;
    justify-content: center !important;
    text-align: left !important;
    padding-left: min(52vw, 760px) !important;
    padding-right: 84px !important;
    padding-top: 0 !important;
  }
  #stage8.act-try .journey-copy-stack {
    width: min(620px, 42vw) !important;
    min-height: 430px !important;
    position: relative !important;
  }
  #stage8.act-try .journey-copy-step {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 12px !important;
    opacity: 0 !important;
    transform: translate3d(140px, 0, 0) scale(0.98) !important;
    pointer-events: none !important;
    transition: opacity 220ms ease, transform 260ms cubic-bezier(0.2,0.7,0.2,1) !important;
  }
  #stage8.act-try .journey-copy-step.active {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) scale(1) !important;
  }
  #stage8.act-try .journey-copy-step.exiting {
    opacity: 0 !important;
    transform: translate3d(-140px, 0, 0) scale(0.98) !important;
  }
  #stage8.act-try .headline,
  #stage8.act-try .sub,
  #stage8.act-try .eyebrow,
  #stage8.act-try .stage-index {
    width: min(570px, 42vw) !important;
    text-align: left !important;
  }
  #stage8.act-try .headline {
    font-size: clamp(44px, 5.4vw, 82px) !important;
    line-height: 1.08 !important;
  }
  #stage8.act-try .sub {
    max-width: 520px !important;
    color: rgba(23,32,42,0.72) !important;
  }

  .try-panel {
    left: 28px !important;
    top: 50% !important;
    bottom: auto !important;
    width: min(430px, calc(100vw - 72px)) !important;
    min-height: 470px !important;
    opacity: 0 !important;
    transform: translate3d(-180px, -50%, 0) scale(0.72) !important;
    filter: blur(12px) !important;
    transition: opacity 220ms ease, transform 360ms cubic-bezier(0.16,0.9,0.18,1), filter 260ms ease !important;
    overflow: hidden !important;
  }
  .try-panel.visible {
    opacity: 1 !important;
    transform: translate3d(0, -50%, 0) scale(1) !important;
    filter: blur(0) !important;
  }
  .try-step {
    position: absolute !important;
    inset: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    opacity: 0 !important;
    transform: translate3d(120px, 0, 0) scale(0.98) !important;
    pointer-events: none !important;
    transition: opacity 180ms ease, transform 240ms cubic-bezier(0.2,0.7,0.2,1) !important;
  }
  .try-step.active {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) scale(1) !important;
    pointer-events: auto !important;
  }
  .try-step.exiting {
    opacity: 0 !important;
    transform: translate3d(-120px, 0, 0) scale(0.98) !important;
  }
  .try-panel .title { font-size: 28px !important; }
  .step-copy { font-size: 14.5px !important; color: rgba(244,241,234,0.78) !important; }
  body.light-theme .step-copy { color: rgba(23,32,42,0.72) !important; }
  .try-panel.visible .tag-2 { transition-delay: 60ms !important; }
  .try-panel.visible .tag-3 { transition-delay: 110ms !important; }
  .try-panel.visible .tag-4 { transition-delay: 160ms !important; }

  .community-status.flash {
    border-color: rgba(255,132,214,0.45) !important;
    box-shadow: 0 0 20px rgba(255,132,214,0.14) !important;
  }
  .placement-preview[data-placement="floating"] .browser-content::after {
    content: "K";
    position: absolute;
    right: 14px;
    bottom: 12px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255,132,214,0.24);
    border: 1px solid rgba(255,132,214,0.58);
    box-shadow: 0 0 18px rgba(255,132,214,0.22);
    color: rgba(23,32,42,0.86);
    font-family: var(--font-serif);
    font-style: italic;
  }

  @media (max-width: 960px) {
    #stage8.act-try {
      align-items: center !important;
      padding-left: 26px !important;
      padding-right: 26px !important;
      padding-top: 260px !important;
      text-align: center !important;
    }
    #stage8.act-try .journey-copy-stack { width: 100% !important; min-height: 340px !important; }
    #stage8.act-try .headline,
    #stage8.act-try .sub,
    #stage8.act-try .eyebrow,
    #stage8.act-try .stage-index {
      width: auto !important;
      text-align: center !important;
    }
    .try-panel {
      left: 50% !important;
      top: auto !important;
      bottom: 22px !important;
      width: min(410px, calc(100vw - 24px)) !important;
      transform: translate3d(-50%, 26px, 0) scale(0.92) !important;
    }
    .try-panel.visible { transform: translate3d(-50%, 0, 0) scale(1) !important; }
  }


  /* ── v1.8.18: final Stage 8 layout cleanup ── */
  #stage8.act-try {
    align-items: flex-end !important;
    justify-content: center !important;
    text-align: left !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: clamp(360px, 50vw, 760px) !important;
    padding-right: clamp(28px, 6vw, 92px) !important;
  }
  #stage8.act-try .journey-copy-stack {
    width: min(560px, 42vw) !important;
    min-height: 390px !important;
    margin-top: 40px !important;
  }
  #stage8.act-try .journey-copy-step {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
  }
  #stage8.act-try .headline {
    font-size: clamp(34px, 4.9vw, 74px) !important;
    line-height: 1.08 !important;
    padding-top: 0.12em !important;
    padding-bottom: 0.16em !important;
  }
  #stage8.act-try .sub {
    margin-top: 12px !important;
    font-size: clamp(13px, 1.22vw, 16px) !important;
    line-height: 1.45 !important;
    max-width: 480px !important;
  }
  #stage8.act-try .eyebrow {
    margin-bottom: 8px !important;
  }
  .try-panel {
    left: clamp(18px, 3.2vw, 34px) !important;
    top: 52% !important;
    width: min(360px, 42vw) !important;
    min-height: 430px !important;
    max-height: min(650px, 82vh) !important;
    padding: 15px !important;
    border-radius: 24px !important;
    transform: translate3d(-150px, -50%, 0) scale(0.76) !important;
    overflow: hidden !important;
  }
  .try-panel.visible {
    transform: translate3d(0, -50%, 0) scale(1) !important;
  }
  .try-step {
    inset: 15px !important;
    gap: 8px !important;
  }
  .try-step .title {
    font-size: clamp(22px, 2.45vw, 29px) !important;
    line-height: 1.02 !important;
  }
  .step-copy {
    font-size: clamp(12.5px, 1.1vw, 14px) !important;
    line-height: 1.38 !important;
  }
  .try-panel textarea,
  .community-input {
    font-size: 13px !important;
    padding: 10px 12px !important;
  }
  .try-panel textarea { min-height: 78px !important; }
  .community-textarea { min-height: 60px !important; }
  .try-output {
    min-height: 58px !important;
    padding: 10px 12px !important;
  }
  .try-output .value {
    font-size: 14px !important;
    line-height: 1.35 !important;
  }
  .placement-browser { height: 104px !important; }
  .placement-grid { gap: 8px !important; }
  .placement-btn,
  .try-btn,
  .community-submit {
    padding: 9px 11px !important;
    font-size: 10.5px !important;
  }

  @media (max-width: 960px) and (min-width: 561px) {
    #stage8.act-try {
      align-items: flex-end !important;
      text-align: left !important;
      padding-left: clamp(332px, 48vw, 470px) !important;
      padding-right: 26px !important;
      padding-top: 0 !important;
    }
    #stage8.act-try .journey-copy-stack {
      width: min(360px, 42vw) !important;
      min-height: 330px !important;
      margin-top: 30px !important;
    }
    #stage8.act-try .headline,
    #stage8.act-try .sub,
    #stage8.act-try .eyebrow,
    #stage8.act-try .stage-index {
      width: min(360px, 42vw) !important;
      text-align: left !important;
    }
    #stage8.act-try .headline {
      font-size: clamp(30px, 4.8vw, 48px) !important;
    }
    .try-panel {
      left: 16px !important;
      top: 52% !important;
      bottom: auto !important;
      width: min(312px, 44vw) !important;
      min-height: 390px !important;
      max-height: 78vh !important;
      transform: translate3d(-150px, -50%, 0) scale(0.76) !important;
    }
    .try-panel.visible {
      transform: translate3d(0, -50%, 0) scale(1) !important;
    }
    .try-step .title { font-size: 22px !important; }
    .step-copy { font-size: 12.5px !important; }
  }

  @media (max-width: 560px) {
    #stage8.act-try {
      align-items: center !important;
      justify-content: flex-start !important;
      padding: 250px 22px 0 !important;
      text-align: center !important;
    }
    #stage8.act-try .journey-copy-stack {
      width: 100% !important;
      min-height: 330px !important;
      margin-top: 0 !important;
    }
    #stage8.act-try .headline,
    #stage8.act-try .sub,
    #stage8.act-try .eyebrow,
    #stage8.act-try .stage-index {
      width: auto !important;
      text-align: center !important;
    }
    .try-panel {
      left: 50% !important;
      top: auto !important;
      bottom: 18px !important;
      width: min(390px, calc(100vw - 24px)) !important;
      min-height: 390px !important;
      transform: translate3d(-50%, 30px, 0) scale(0.92) !important;
    }
    .try-panel.visible {
      transform: translate3d(-50%, 0, 0) scale(1) !important;
    }
  }


  /* ── v1.8.18: route pills outside editor surface ── */
  .try-panel {
    padding-top: 64px !important;
    overflow: visible !important;
  }
  .try-step {
    inset: 64px 15px 15px !important;
  }
  @media (max-width: 960px) and (min-width: 561px) {
    .try-panel { padding-top: 58px !important; }
    .try-step { inset: 58px 14px 14px !important; }
  }
  @media (max-width: 560px) {
  }


  /* ── v1.8.18: Stage 8 route pills outside the modal ── */
  .try-panel {
    padding-top: 18px !important;
    overflow: visible !important;
  }





  .try-step {
    inset: 18px 15px 15px !important;
  }



  @media (max-width: 960px) and (min-width: 561px) {
  }

  @media (max-width: 560px) {
  }

  .zoom-note {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    max-width: 280px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(8,12,18,0.72);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.82);
    font: 600 10px/1.45 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
  }
  .zoom-note.visible {
    opacity: 1;
    transform: translateY(0);
  }


  /* ── v1.8.18: route pills are real scene chrome, not modal children ── */
  .try-panel { padding-top: 18px !important; }
  .try-step { inset: 18px 15px 15px !important; }


  @media (max-width: 960px) and (min-width: 561px) {
  }

  @media (max-width: 560px) {
  }


  /* ── v1.8.18: useful loader + fail-open behavior ── */
  .loader-text {
    display: grid !important;
    gap: 8px !important;
    max-width: 520px !important;
    text-align: center !important;
    line-height: 1.35 !important;
  }
  .loader-text strong {
    display: block !important;
    font-family: var(--font-serif) !important;
    font-size: clamp(22px, 3vw, 34px) !important;
    font-style: italic !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
    color: rgba(244,241,234,0.92) !important;
    text-transform: none !important;
  }
  .loader-text span {
    display: block !important;
    font-family: var(--font-mono) !important;
    font-size: 10px !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    color: rgba(244,241,234,0.58) !important;
  }
  .loader.module-failed {
    pointer-events: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* ── v1.8.18: route buttons are scene chrome, never modal children ── */
  .try-panel { padding-top: 18px !important; }
  .try-step { inset: 18px 15px 15px !important; }

  @media (max-width: 960px) and (min-width: 561px) {
  }

  /* ── try-flurry: scene route bar, positioned by JS via getBoundingClientRect ── */
  /* top / left / width are set by updateTrySequence() as inline styles — no !important here
     so JS values win. Only layout, appearance, and z-index are declared in CSS. */
  .try-flurry {
    position: fixed;
    /* top / left / width: set by JS */
    height: auto;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    pointer-events: auto;
    z-index: 150;
    padding: 0;
    opacity: 0;
    transition: opacity 200ms ease;
  }
  .try-flurry.visible { opacity: 1; }

  .try-flurry .flurry-tag {
    position: static;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 999px;
    padding: 9px 13px;
    font-family: var(--font-mono);
    font-size: 8.5px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: rgba(244,241,234,0.84);
    background: rgba(255,255,255,0.11);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
  }
  .try-flurry .flurry-tag.active {
    background: rgba(255,132,214,0.20);
    border-color: rgba(255,132,214,0.44);
    color: rgba(255,255,255,1.0);
  }
  body.light-theme .try-flurry .flurry-tag {
    color: rgba(23,32,42,0.76);
    background: rgba(255,255,255,0.82);
    border-color: rgba(23,32,42,0.11);
  }
  body.light-theme .try-flurry .flurry-tag.active {
    color: rgba(23,32,42,0.96);
    background: rgba(255,132,214,0.16);
    border-color: rgba(255,132,214,0.36);
  }
  @media (max-width: 960px) {
    .try-flurry .flurry-tag {
      font-size: 7.5px;
      padding: 8px 9px;
      letter-spacing: 0.095em;
    }
  }

  /* ════════════════════════════════════════════════════════════
     LAYER SYSTEM — X key cycles through 4 revelation states
     data-layer="0"  default: full UI
     data-layer="1"  quiet:   story copy fades, chrome dims
     data-layer="2"  cinema:  all UI gone, pure 3D
     data-layer="3"  signal:  scene darkens, one phrase appears
     ════════════════════════════════════════════════════════════ */

  /* Shared transition for all layer-affected elements */
  .story-act,
  .hud-top,
  .chapters,
  .scroll-hint,
  .zoom-note,
  .try-panel,
  .try-flurry,
  #layer-x-hint,
  #signal-verse {
    transition:
      opacity 700ms cubic-bezier(0.4, 0, 0.2, 1),
      transform 700ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* ── Layer 1: Quiet ── */
  body[data-layer="1"] .story-act   { opacity: 0; pointer-events: none; }
  body[data-layer="1"] .hud-top     { opacity: 0; pointer-events: none; }
  body[data-layer="1"] .scroll-hint { opacity: 0; pointer-events: none; }
  body[data-layer="1"] .zoom-note   { opacity: 0; }

  /* ── Layer 2: Cinema ── */
  body[data-layer="2"] .story-act   { opacity: 0; pointer-events: none; }
  body[data-layer="2"] .hud-top     { opacity: 0; pointer-events: none; }
  body[data-layer="2"] .chapters    { opacity: 0; pointer-events: none; }
  body[data-layer="2"] .scroll-hint { opacity: 0; pointer-events: none; }
  body[data-layer="2"] .zoom-note   { opacity: 0; }
  body[data-layer="2"] .try-panel   { opacity: 0 !important; pointer-events: none !important; }
  body[data-layer="2"] .try-flurry  { opacity: 0 !important; pointer-events: none !important; }

  /* ── Layer 3: Signal ── */
  body[data-layer="3"] .story-act   { opacity: 0; pointer-events: none; }
  body[data-layer="3"] .hud-top     { opacity: 0; pointer-events: none; }
  body[data-layer="3"] .chapters    { opacity: 0; pointer-events: none; }
  body[data-layer="3"] .scroll-hint { opacity: 0; pointer-events: none; }
  body[data-layer="3"] .zoom-note   { opacity: 0; }
  body[data-layer="3"] .try-panel   { opacity: 0 !important; pointer-events: none !important; }
  body[data-layer="3"] .try-flurry  { opacity: 0 !important; pointer-events: none !important; }

  /* ── X key hint — floats bottom-center, flashes on load then dims ── */
  #layer-x-hint {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(167, 212, 176, 0.72);
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    white-space: nowrap;
  }
  #layer-x-hint.intro-flash {
    animation: xhint-flash 5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  @keyframes xhint-flash {
    /* Start: large, bright, centered vertically */
    0%   { opacity: 0;    font-size: 22px; letter-spacing: 0.28em;
           transform: translateX(-50%) translateY(calc(-40vh)); }
    8%   { opacity: 1;    font-size: 22px; letter-spacing: 0.28em;
           transform: translateX(-50%) translateY(calc(-40vh)); }
    /* Hold center bright */
    38%  { opacity: 0.96; font-size: 22px; letter-spacing: 0.28em;
           transform: translateX(-50%) translateY(calc(-40vh)); }
    /* Slide down and shrink to resting position */
    78%  { opacity: 0.55; font-size: 10px; letter-spacing: 0.18em;
           transform: translateX(-50%) translateY(0); }
    100% { opacity: 0.18; font-size: 10px; letter-spacing: 0.18em;
           transform: translateX(-50%) translateY(0); }
    72%  { opacity: 0.82; }
    100% { opacity: 0.18; transform: translateX(-50%) translateY(0); }
  }
  /* While any layer is active, hint shows the next action */
  body[data-layer="1"] #layer-x-hint,
  body[data-layer="2"] #layer-x-hint,
  body[data-layer="3"] #layer-x-hint {
    opacity: 0.44;
  }
  body[data-layer="0"] #layer-x-hint.intro-done { opacity: 0.18; }

  /* ── Signal verse — the single phrase in layer 3 ── */
  #signal-verse {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
  }
  body[data-layer="3"] #signal-verse {
    opacity: 1;
  }
  #signal-verse p {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(22px, 3.8vw, 46px);
    color: rgba(220, 235, 224, 0.92);
    text-align: center;
    line-height: 1.5;
    max-width: 640px;
    padding: 0 32px;
    animation: signal-pulse 4s ease-in-out infinite;
    text-shadow: 0 0 60px rgba(167,212,176,0.22), 0 0 120px rgba(167,212,176,0.10);
    transition: opacity 500ms ease, transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  /* Only pulse when layer 3 is active */
  body:not([data-layer="3"]) #signal-verse p {
    animation: none;
  }
  @keyframes signal-pulse {
    0%, 100% { opacity: 0.72; }
    50%       { opacity: 1.0;  }
  }

  /* ── Layer indicator pill (top-right, subtle) ── */
  #layer-indicator {
    position: fixed;
    top: 18px;
    right: 20px;
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(167,212,176,0.0);
    pointer-events: none;
    z-index: 20;
    transition: color 400ms ease, opacity 400ms ease;
  }
  body[data-layer="1"] #layer-indicator { color: rgba(167,212,176,0.38); }
  body[data-layer="2"] #layer-indicator { color: rgba(167,212,176,0.52); }
  body[data-layer="3"] #layer-indicator { color: rgba(220,235,224,0.68); }

  /* ══════════════════════════════════════════════════════════════
     LAYER 1 STAGE REVEAL SYSTEM — v1.8.23
     Each stage has a canvas-drawn visual that surfaces when X is 
     pressed. Hero text fades, visual slides forward — not fully 
     legible, felt more than read. The 3D scene stays live behind.
     ══════════════════════════════════════════════════════════════ */

  #stage-reveal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 8; /* above 3D canvas (z:1), always present as atmospheric layer */
    opacity: 0.22; /* always softly visible behind hero text in layer 0 */
    transition: opacity 800ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  body[data-layer="1"] #stage-reveal { opacity: 1; }   /* full reveal */
  body[data-layer="2"] #stage-reveal { opacity: 0; }   /* pure 3D, no overlay */
  body[data-layer="3"] #stage-reveal { opacity: 0; }   /* signal mode, clean */

  #stage-reveal canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    opacity: 0;
    transition: opacity 700ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  #stage-reveal canvas.active { opacity: 1; }

  /* Stage reveal label — appears in layer 1, bottom-left */
  #stage-reveal-label {
    position: fixed;
    bottom: 36px;
    left: 36px;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(167, 212, 176, 0.0);
    pointer-events: none;
    z-index: 20;
    transition: color 600ms ease, opacity 600ms ease;
    max-width: 480px;
    line-height: 1.8;
  }
  body[data-layer="1"] #stage-reveal-label { color: rgba(167, 212, 176, 0.58); }

  /* Stage reveal mode badge — top-left in layer 1 */
  #stage-reveal-mode {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid rgba(167,212,176,0.0);
    color: rgba(167,212,176,0.0);
    pointer-events: none;
    z-index: 20;
    z-index: 20;
    transition: color 600ms ease, border-color 600ms ease, background-color 600ms ease;
    white-space: nowrap;
  }
  body[data-layer="1"] #stage-reveal-mode {
    color: rgba(167,212,176,0.84);
    border-color: rgba(167,212,176,0.28);
    background: rgba(0,0,0,0.32);
    backdrop-filter: blur(8px);
  }
  body[data-layer="1"].light-theme #stage-reveal-mode {
    color: rgba(107,142,114,0.9);
    border-color: rgba(107,142,114,0.3);
    background: rgba(255,255,255,0.45);
  }

  /* In layer 1: story text becomes ghosted/dim rather than gone — 
     viewer can still sense the narrative underneath */
  body[data-layer="1"] .story-act {
    opacity: 0.0;
    pointer-events: none;
  }

  /* Layer 1 hint update */
  body[data-layer="1"] #layer-x-hint { opacity: 0.44; }

  /* ═══════════════════════════════════════════════════
     LAYER 2: DOCTORAL INSIGHTS — float above the live 3D scene
     Layer 1 scene stays visible behind them, fog darkens via JS
     ═══════════════════════════════════════════════════ */
  #auto-mode-badge {
    position: fixed; bottom: 26px; left: 50%;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px;
    padding: 6px 14px; border-radius: 999px;
    background: rgba(10,14,12,0.72);
    border: 1px solid rgba(167,212,176,0.28);
    color: rgba(167,212,176,0.82);
    font-family: 'DM Mono', monospace; font-size: 11px;
    letter-spacing: 0.12em; text-transform: uppercase;
    z-index: 30; opacity: 0; pointer-events: none;
    transition: opacity 400ms ease;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    user-select: none;
  }
  #auto-mode-badge.visible { opacity: 1; pointer-events: auto; }
  #auto-mode-badge .auto-pause-btn {
    cursor: pointer; padding: 2px 6px; border-radius: 4px;
    transition: background 150ms;
  }
  #auto-mode-badge .auto-pause-btn:hover { background: rgba(167,212,176,0.15); }
  #auto-mode-badge .auto-divider {
    width: 1px; height: 12px; background: rgba(167,212,176,0.22);
  }
  #auto-mode-badge .auto-speed-btn {
    cursor: pointer; padding: 2px 7px; border-radius: 4px;
    color: rgba(167,212,176,0.50); transition: color 150ms, background 150ms;
  }
  #auto-mode-badge .auto-speed-btn:hover { color: rgba(167,212,176,0.90); background: rgba(167,212,176,0.10); }
  #auto-mode-badge .auto-speed-btn.active { color: rgba(167,212,176,0.95); background: rgba(167,212,176,0.15); }

  body[data-layer="1"] canvas#scene2,
  body[data-layer="2"] canvas#scene2 { cursor: grab; }
  body[data-layer="1"] canvas#scene2:active,
  body[data-layer="2"] canvas#scene2:active { cursor: grabbing; }

  #doctoral-layer {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 16;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  body[data-layer="2"] #doctoral-layer { opacity: 1; }

  .doctoral-insight {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(48px, 12vw, 200px);
    opacity: 0;
    transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
  }
  .doctoral-insight.active { opacity: 1; }

  .d-index {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.38em;
    text-transform: uppercase;
    color: rgba(167, 212, 176, 0.45);
    margin-bottom: 28px;
    display: block;
  }
  .d-body {
    font-family: var(--font-pure);
    font-style: italic;
    font-size: clamp(20px, 2.6vw, 34px);
    line-height: 1.78;
    color: rgba(244, 241, 234, 0.94);
    text-align: center;
    max-width: 820px;
    margin: 0;
    text-wrap: balance;
    text-shadow:
      0 0 80px rgba(167, 212, 176, 0.10),
      0 4px 32px rgba(0,0,0,0.8);
  }
  .d-body em {
    font-style: italic;
    color: rgba(220, 245, 228, 1.0);
    text-shadow: 0 0 24px rgba(167,212,176,0.38);
  }
  body.light-theme .d-body {
    color: rgba(12, 20, 14, 0.92);
    text-shadow: 0 0 80px rgba(255,255,255,0.5), 0 4px 24px rgba(0,0,0,0.06);
  }
  body.light-theme .d-body em { color: rgba(30, 90, 50, 0.96); }
  body.light-theme .d-index { color: rgba(100, 140, 108, 0.55); }


  /* ── Layer 3: The Still ── */
  #signal-verse {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 18;
    opacity: 0;
    transition: opacity 1400ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  body[data-layer="3"] #signal-verse { opacity: 1; }
  #signal-verse p {
    font-family: var(--font-pure);
    font-style: italic;
    font-size: clamp(26px, 4.5vw, 58px);
    color: rgba(220, 235, 224, 0.92);
    text-align: center;
    line-height: 1.65;
    max-width: 700px;
    padding: 0 32px;
    margin: 0;
    text-shadow:
      0 0 60px rgba(167,212,176,0.18),
      0 0 120px rgba(167,212,176,0.08),
      0 4px 32px rgba(0,0,0,0.9);
  }
  body.light-theme #signal-verse p {
    color: rgba(20,40,24,0.88);
    text-shadow: 0 0 60px rgba(255,255,255,0.5), 0 4px 24px rgba(0,0,0,0.06);
  }
  body[data-layer="3"] #signal-verse p {
    animation: still-breath 7s ease-in-out infinite;
  }
  @keyframes still-breath {
    0%, 100% { opacity: 0.72; transform: translateY(0px); }
    50%       { opacity: 1.00; transform: translateY(-4px); }
  }


/* ── v0.7.0 viewport-integrity hardening ───────────────────────────────
   The journey intentionally uses document scroll as its progress clock.
   Every visual surface remains viewport-fixed while scroll position changes.
   These declarations are intentionally last and important: shell or
   production CSS must never turn the immersive canvases into page content. */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip !important;
}
body {
  min-height: 1100vh;
  min-height: 1100dvh;
}
canvas#scene,
canvas#scene2 {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
}
#stage-reveal,
.hud,
.try-panel,
.try-flurry,
#signal-verse,
#layer-x-hint,
#layer-indicator,
#stage-reveal-label,
#stage-reveal-mode,
#auto-mode-badge,
.loader {
  position: fixed;
}
