/* Cutsway prototypes: shared page layer (type, chapters, turnaround, faq, footer). */
  :root {
    --night: #0b0a10;
    --paper: #f2f0e6;
    --soft: #d9d4e6;
    --yellow: #f9e853;
    --red: #e32139;
    --spec: linear-gradient(90deg, #2136cd, #2664f7 8%, #32a9f6 20%, #32d7f6 30%, #c5f9ed 38%, #fbf7c9 45%, #fef78e 53%, #f9e853 61%, #f5b843 69%, #fa7d31 77%, #ef462e 87%, #e32139);
    --m: clamp(20px, 3vw, 48px);
    --step-small: 0.875rem;
    --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
    --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
    --step-head: clamp(2.6rem, 1rem + 5.4vw, 6.6rem);
    --step-giant: clamp(3.6rem, 13vw, 14rem);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  }
  * { box-sizing: border-box; }
  html { color-scheme: dark; scrollbar-color: #3f2740 var(--night); }
  body { margin: 0; font-family: "Archivo", system-ui, sans-serif; font-size: var(--step-body); line-height: 1.45; color: var(--paper); background: var(--night); -webkit-font-smoothing: antialiased; }
  ::selection { background: var(--yellow); color: var(--night); }
  :focus-visible { outline: 2px solid var(--yellow); outline-offset: 4px; }
  a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
  svg { display: block; }
  .num { font-variant-numeric: tabular-nums; }

  /* ── the world sits behind everything ── */
  #world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
  .no-webgl #world { display: none; }
  .no-webgl body { background: #1a1020 url(../assets/spectrum.jpg) center / cover fixed; }
  html.lenis, html.lenis body { height: auto; }
  .lenis.lenis-smooth { scroll-behavior: auto !important; }
  .lenis.lenis-stopped { overflow: hidden; }
  .scrim { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgb(11 10 16 / 0.78), rgb(11 10 16 / 0) 48%); }
  .nav::before { content: ""; position: absolute; inset: 0 0 -40px 0; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, rgb(11 10 16 / 0.72), rgb(11 10 16 / 0)); }

  /* ── export intro: the logo bar renders in, under a second ── */
  .export { position: fixed; inset: 0; z-index: 60; background: var(--night); display: grid; place-content: center; gap: 18px; width: 100%; padding: 0 var(--m); transition: opacity 320ms ease, visibility 320ms; }
  .export.done { opacity: 0; visibility: hidden; }
  .export__bar { width: min(560px, 80vw); height: 26px; clip-path: polygon(0 30%, 100% 0, 100% 70%, 0 100%); background: #1b1824; position: relative; overflow: hidden; }
  .export__bar i { position: absolute; inset: 0; background: var(--spec); transform-origin: left; transform: scaleX(var(--p, 0)); }
  .export__row { display: flex; justify-content: space-between; font-size: var(--step-small); font-weight: 700; color: var(--soft); width: min(560px, 80vw); }

  /* ── nav ── */
  .nav { position: fixed; inset: 0 0 auto 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: calc(18px + env(safe-area-inset-top, 0px)) var(--m) 18px; }
  .nav__logo svg { width: clamp(120px, 11vw, 156px); color: var(--paper); }
  .nav__links { display: flex; gap: clamp(18px, 2.4vw, 36px); font-size: var(--step-small); font-weight: 700; }
  .nav__links a { text-decoration: none; color: var(--soft); transition: color 160ms; }
  .nav__links a:hover { color: var(--paper); }
  .nav__cta { justify-self: end; }
  .pill {
    display: inline-flex; align-items: center; gap: 10px; padding: 0.8em 1.3em; border-radius: 999px;
    border: 1.5px solid rgb(242 240 230 / 0.42); color: var(--paper); text-decoration: none; font-weight: 800; font-size: var(--step-small);
    background: rgb(242 240 230 / 0.1); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    transition: background-color 200ms, color 200ms, border-color 200ms, transform 240ms var(--ease-out);
  }
  .pill:hover { background: var(--paper); color: var(--night); border-color: var(--paper); }
  .pill:active { transform: scale(0.97); }
  .pill--solid { background: var(--yellow); color: var(--night); border-color: var(--yellow); }
  .pill--solid:hover { background: var(--paper); border-color: var(--paper); }
  .pill svg { width: 15px; }

  /* ── chapters over the world ── */
  main, footer { position: relative; z-index: 2; }
  .ch { min-height: 100svh; padding: clamp(96px, 12vh, 140px) var(--m) clamp(48px, 8vh, 88px); display: grid; grid-template-columns: repeat(12, 1fr); align-content: end; gap: 24px var(--m); }
  .ch--top { align-content: start; padding-top: clamp(120px, 18vh, 200px); }
  .ch h1 { grid-column: 1 / -1; font-size: var(--step-giant); }
  .ch h2 { font-size: var(--step-head); }
  .display { font-weight: 900; font-stretch: 125%; letter-spacing: -0.04em; line-height: 0.88; text-transform: lowercase; margin: 0; text-wrap: balance; }
  .copy { grid-column: 1 / span 5; }
  .copy p { margin: 20px 0 0; max-width: 38ch; font-size: var(--step-lead); line-height: 1.3; font-weight: 500; }
  .copy .pill { margin-top: 28px; }
  .hero__row { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
  .hero__row p { margin: 0; max-width: 34ch; font-size: var(--step-lead); line-height: 1.3; font-weight: 500; }
  .hint { font-size: var(--step-small); font-weight: 700; color: var(--soft); display: inline-flex; align-items: center; gap: 10px; }
  .hint i { width: 2px; height: 28px; background: var(--paper); transform-origin: top; animation: hint 1.8s var(--ease-out) infinite; }
  @keyframes hint { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

  .glass { background: rgb(18 14 26 / 0.38); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border: 1.5px solid rgb(242 240 230 / 0.28); border-radius: 22px; }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: rgb(18 14 26 / 0.9); } }

  /* turnaround */
  .turn { grid-column: 1 / span 6; padding: clamp(22px, 2.6vw, 36px); }
  .turn h2 { margin-bottom: 24px; }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip { border: 1.5px solid rgb(242 240 230 / 0.4); border-radius: 999px; padding: 0.6em 1em; background: transparent; color: var(--paper); font: 700 var(--step-small)/1 "Archivo", sans-serif; cursor: pointer; transition: background-color 160ms, color 160ms, transform 200ms var(--ease-out); }
  .chip:hover { background: rgb(242 240 230 / 0.14); }
  .chip:active { transform: scale(0.97); }
  .chip[aria-pressed="true"] { background: var(--paper); color: var(--night); border-color: var(--paper); }
  .due { margin: 26px 0 6px; font-size: var(--step-small); font-weight: 700; color: var(--soft); }
  .due strong { display: block; margin-top: 6px; color: var(--yellow); font-weight: 900; font-stretch: 125%; letter-spacing: -0.03em; font-size: clamp(2.2rem, 4.4vw, 4.4rem); line-height: 0.95; text-transform: lowercase; }
  .splits { list-style: none; margin: 22px 0 0; padding: 0; font-size: var(--step-small); font-weight: 600; }
  .splits li { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; padding: 9px 0; }
  .splits li + li { border-top: 1px solid rgb(242 240 230 / 0.18); }
  .splits span:nth-child(3) { color: var(--soft); min-width: 7.5em; text-align: right; }
  .note { margin: 14px 0 0; font-size: var(--step-small); color: var(--soft); }

  /* faq */
  .faq { grid-column: 1 / span 6; padding: clamp(10px, 1.4vw, 18px) clamp(22px, 2.6vw, 36px); }
  .faq-h { grid-column: 1 / -1; }
  .faq details + details { border-top: 1px solid rgb(242 240 230 / 0.2); }
  .faq summary { list-style: none; cursor: pointer; padding: 20px 0; display: flex; justify-content: space-between; gap: 16px; font-weight: 800; font-stretch: 112%; font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem); line-height: 1.2; }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary svg { flex: none; width: 20px; transition: transform 260ms var(--ease-out); }
  .faq details[open] summary svg { transform: rotate(45deg); }
  .faq details p { margin: 0 0 20px; max-width: 56ch; color: var(--soft); }

  /* footer */
  .foot { min-height: 100svh; padding: clamp(96px, 14vh, 160px) var(--m) calc(32px + env(safe-area-inset-bottom, 0px)); display: grid; align-content: end; gap: 28px; }
  .foot h2 { font-size: var(--step-giant); }
  .foot h2 a { text-decoration: none; transition: color 200ms; }
  .foot h2 a:hover { color: var(--yellow); }
  .foot p { margin: 0; max-width: 36ch; font-size: var(--step-lead); line-height: 1.3; font-weight: 500; }
  .foot__row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding-top: 20px; border-top: 1.5px solid rgb(242 240 230 / 0.3); font-size: var(--step-small); font-weight: 700; color: var(--soft); }
  .foot__row nav { display: flex; gap: 22px; }

  /* text arrives with its chapter */
  .js .rise { opacity: 0; transform: translateY(26px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
  .js .rise.in { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) {
    .js .rise { transform: none; transition: opacity 300ms; }
    .hint i { animation: none; }
    .export { display: none; }
  }

  @media (max-width: 820px) {
    .nav { grid-template-columns: 1fr auto; }
    .nav__links { display: none; }
    .ch { grid-template-columns: 1fr; align-content: end; }
    .ch--top { align-content: end; }
    .copy, .turn, .faq { grid-column: 1 / -1; }
    .ch h1 { font-size: 19vw; }
    .foot h2 { font-size: 17vw; }
  }
  /* heads-up display used by some worlds (clock, splits) */
  .hud { position: fixed; z-index: 25; right: var(--m); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); font-variant-numeric: tabular-nums; pointer-events: none; }
  .tag { display: inline-block; margin-top: 18px; font-size: var(--step-small); font-weight: 700; color: var(--soft); }
