/* The Local Studio — landing page ("Orbital" theme).
   One viewport, four scenes. Scenes swap with depth transitions (js/landing.js);
   the page itself never scrolls. Brand accents (coral / sky / lemon) carried over
   from the studio's Pop Poster theme, re-lit as neon on a deep void. */

@property --ang {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --gap {
  syntax: "<length>";
  inherits: true;
  initial-value: 8px;
}

@property --cut {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

:root {
  --void: #05060b;
  --void-2: #0a0c16;
  --text: #eef0f8;
  --mute: #9096ae;
  --dim: #5d6380;
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.18);
  --glass: linear-gradient(155deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.015));
  --coral: #ff6b4a;
  --sky: #4ec5f1;
  --lemon: #ffe566;
  --violet: #9b7bff;
  --grad: linear-gradient(100deg, var(--coral) 0%, #ff9d5c 28%, var(--lemon) 50%, var(--sky) 78%, var(--violet) 100%);

  --f-display: "Unbounded", system-ui, sans-serif;
  --f-body: "Instrument Sans", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease-warp: cubic-bezier(0.76, 0, 0.18, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-scene: 1.15s;

  --hud-h: 4.25rem;
  --foot-h: 5rem;
  --gutter: clamp(1rem, 4vw, 3.25rem);
  --rail-w: 12rem; /* stops + the current section's name beside them */

  --mx: 0;
  --my: 0;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body.lp {
  position: fixed;
  inset: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lp-skip {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  z-index: 60;
  translate: -50% -200%;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--lemon);
  color: var(--void);
  font: 600 0.8rem var(--f-mono);
  text-decoration: none;
  transition: translate 0.3s var(--ease-out);
}

.lp-skip:focus {
  translate: -50% 0;
}

/* ───────── Ambient field ───────── */

.lp-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.lp-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.lp-aurora__blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  transition:
    transform 2.2s var(--ease-warp),
    background-color 2.2s var(--ease-warp),
    opacity 2.2s var(--ease-warp);
}

.lp-aurora__blob--a {
  left: -22vmax;
  top: -26vmax;
  background-color: var(--sky);
}

.lp-aurora__blob--b {
  right: -26vmax;
  top: 8vmax;
  background-color: var(--coral);
  opacity: 0.2;
}

.lp-aurora__blob--c {
  left: 20vmax;
  bottom: -38vmax;
  background-color: var(--violet);
  opacity: 0.22;
}

body[data-scene="1"] .lp-aurora__blob--a {
  transform: translate(50vw, 10vh);
  background-color: var(--violet);
}
body[data-scene="1"] .lp-aurora__blob--b {
  transform: translate(-60vw, 20vh);
  background-color: var(--sky);
}
body[data-scene="2"] .lp-aurora__blob--a {
  transform: translate(10vw, 40vh);
  background-color: var(--coral);
}
body[data-scene="2"] .lp-aurora__blob--c {
  transform: translate(30vw, -30vh);
  background-color: var(--lemon);
  opacity: 0.14;
}
body[data-scene="3"] .lp-aurora__blob--a {
  transform: translate(30vw, 30vh);
}
body[data-scene="3"] .lp-aurora__blob--b {
  transform: translate(-30vw, -10vh);
  background-color: var(--violet);
}
body[data-scene="3"] .lp-aurora__blob--c {
  transform: translate(-10vw, -20vh);
  background-color: var(--coral);
}

.lp-grain {
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-1%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ───────── HUD ───────── */

.lp-hud {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--hud-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
}

.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  min-width: 0;
}

.lp-brand__mark {
  position: relative;
  display: inline-flex;
  gap: 5px;
  align-items: stretch;
  height: 22px;
  padding: 0 2px;
}

.lp-brand__mark i {
  position: relative;
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.55);
}

.lp-brand__mark i::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  translate: -50% -50%;
  animation: fader 4.8s var(--ease-warp) infinite;
}

.lp-brand__mark i:nth-child(1)::after {
  top: 35%;
  background: var(--coral);
  box-shadow: 0 0 10px var(--coral);
}
.lp-brand__mark i:nth-child(2)::after {
  top: 70%;
  background: var(--sky);
  box-shadow: 0 0 10px var(--sky);
  animation-delay: -1.6s;
}
.lp-brand__mark i:nth-child(3)::after {
  top: 20%;
  background: var(--lemon);
  box-shadow: 0 0 10px var(--lemon);
  animation-delay: -3.2s;
}

@keyframes fader {
  0%, 100% { translate: -50% -50%; }
  50% { translate: -50% 120%; }
}

.lp-brand__word {
  font: 700 0.78rem/1 var(--f-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.lp-hud__links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lp-hud__link {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font: 600 0.72rem/1 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--mute);
  transition: color 0.25s, background-color 0.25s;
}

.lp-hud__link:hover {
  color: var(--text);
}

.lp-hud__link--cta {
  color: var(--text);
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
}

.lp-hud__link--cta:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lp-corners {
  position: fixed;
  inset: 0.85rem;
  z-index: 30;
  pointer-events: none;
}

.lp-corners i {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 0 solid rgba(255, 255, 255, 0.28);
}

.lp-corners i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.lp-corners i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.lp-corners i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.lp-corners i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

/* Section rail: numbered stops on a progress line. The current stop always shows
   its name; the others reveal theirs on hover / focus. */
.lp-rail {
  --stop: 2.25rem;
  position: fixed;
  right: var(--gutter);
  top: 50%;
  z-index: 40;
  translate: 0 -50%;
}

.lp-rail ol {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.lp-rail button {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--stop);
  height: var(--stop);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(5, 6, 11, 0.75);
  cursor: pointer;
  color: var(--mute);
  transition: color 0.3s, border-color 0.3s, background-color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease-out);
}

.lp-rail__no {
  font: 600 0.74rem/1 var(--f-mono);
  letter-spacing: 0.02em;
}

.lp-rail__name {
  position: absolute;
  right: calc(100% + 0.7rem);
  top: 50%;
  translate: 6px -50%;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(5, 6, 11, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: 600 0.7rem/1 var(--f-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, translate 0.3s var(--ease-out);
}

.lp-rail button:focus-visible {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.45);
}

@media (hover: hover) {
  .lp-rail button:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.45);
    transform: scale(1.06);
  }
}

.lp-rail button:focus-visible .lp-rail__name,
.lp-rail button[aria-current="step"] .lp-rail__name {
  opacity: 1;
  translate: 0 -50%;
}

@media (hover: hover) {
  .lp-rail button:hover .lp-rail__name {
    opacity: 1;
    translate: 0 -50%;
  }
}

.lp-rail button[aria-current="step"] {
  color: var(--void);
  border-color: var(--lemon);
  background: var(--lemon);
  box-shadow: 0 0 0 5px rgba(255, 229, 102, 0.14), 0 0 22px rgba(255, 229, 102, 0.55);
}

.lp-rail button[aria-current="step"] .lp-rail__name {
  border-color: rgba(255, 229, 102, 0.45);
  color: var(--lemon);
}

/* Progress line behind the stops */
.lp-rail__track {
  position: absolute;
  left: 50%;
  top: calc(var(--stop) / 2);
  bottom: calc(var(--stop) / 2);
  width: 1px;
  translate: -50% 0;
  background: var(--line-2);
}

.lp-rail__fill {
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--scene-i, 0) / 3 * 100%);
  background: linear-gradient(var(--sky), var(--lemon));
  box-shadow: 0 0 10px var(--sky);
  transition: height var(--t-scene) var(--ease-warp);
}

/* Next-section button */
.lp-next {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 40;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.4rem 0.4rem 0.4rem 1.2rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(5, 6, 11, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.3s, box-shadow 0.3s, translate 0.4s var(--ease-out);
}

@media (hover: hover) {
  .lp-next:hover {
    border-color: rgba(255, 229, 102, 0.55);
    box-shadow: 0 0 30px -8px rgba(255, 229, 102, 0.45), 0 18px 40px -20px rgba(0, 0, 0, 0.9);
    translate: -50% -2px;
  }
}

.lp-next__text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.lp-next__kicker {
  font: 600 0.6rem/1 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.lp-next__how--touch,
.lp-next__how--end,
.lp-next.is-end .lp-next__how--pointer,
.lp-next.is-end .lp-next__how--touch {
  display: none;
}

.lp-next.is-end .lp-next__how--end {
  display: inline;
}

@media (hover: none) {
  .lp-next__how--pointer { display: none; }
  .lp-next:not(.is-end) .lp-next__how--touch { display: inline; }
}

.lp-next__name {
  font: 700 0.86rem/1.1 var(--f-display);
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lp-next__name::before {
  content: "Next: ";
  color: var(--mute);
  font-weight: 500;
}

.lp-next.is-end .lp-next__name::before {
  content: "";
}

.lp-next__arrow {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--lemon);
  box-shadow: 0 0 20px rgba(255, 229, 102, 0.5);
}

/* Chevron that nudges in the direction of travel */
.lp-next__arrow i {
  width: 0.62rem;
  height: 0.62rem;
  margin-top: -0.25rem;
  border-right: 2px solid var(--void);
  border-bottom: 2px solid var(--void);
  rotate: 45deg;
  animation: nudge 1.6s var(--ease-out) infinite;
}

.lp-next.is-end .lp-next__arrow i {
  margin-top: 0.25rem;
  rotate: -135deg;
}

@keyframes nudge {
  0%, 100% { translate: 0 0; }
  50% { translate: 3px 3px; }
}

/* ───────── Stage & scene transitions ───────── */

.lp-stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  perspective: 1400px;
  perspective-origin: 50% 45%;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--hud-h) + env(safe-area-inset-top)) calc(var(--gutter) + var(--rail-w))
    calc(var(--foot-h) + env(safe-area-inset-bottom)) var(--gutter);
  transform-origin: 50% 50%;
  transition:
    transform var(--t-scene) var(--ease-warp),
    opacity calc(var(--t-scene) * 0.8) var(--ease-warp),
    filter var(--t-scene) var(--ease-warp),
    visibility 0s linear var(--t-scene);
  will-change: transform, opacity;
}

.scene.is-active {
  transform: none;
  opacity: 1;
  filter: none;
  visibility: visible;
  transition-delay: 0s;
  z-index: 2;
}

/* Left behind: flies past the camera */
.scene.is-past {
  transform: translate3d(0, -4vh, 380px) scale(1.08);
  opacity: 0;
  filter: blur(16px);
  visibility: hidden;
  pointer-events: none;
}

/* Ahead: waits deep in the field */
.scene.is-future {
  transform: translate3d(0, 6vh, -900px) rotateX(8deg);
  opacity: 0;
  filter: blur(18px);
  visibility: hidden;
  pointer-events: none;
}

.scene.is-past,
.scene.is-future {
  transition:
    transform var(--t-scene) var(--ease-warp),
    opacity calc(var(--t-scene) * 0.6) var(--ease-warp),
    filter var(--t-scene) var(--ease-warp),
    visibility 0s linear var(--t-scene);
}

.scene__inner {
  position: relative;
  width: 100%;
  max-width: 82rem;
}

/* Staggered reveal for elements inside the active scene */
.r {
  opacity: 0;
  transform: translate3d(0, 46px, 0) scale(0.97);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
}

.is-active .r {
  opacity: 1;
  transform: none;
  transition:
    opacity 1s var(--ease-out) calc(var(--i, 0) * 90ms + 420ms),
    transform 1.3s var(--ease-out) calc(var(--i, 0) * 90ms + 420ms);
}

/* Zero-gravity drift (transform) + pointer parallax (translate) compose */
.fl {
  display: block;
  animation: drift var(--fdur, 7.5s) ease-in-out infinite;
  animation-delay: var(--fd, 0s);
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  33% { transform: translate3d(3px, -11px, 0) rotate(0.45deg); }
  66% { transform: translate3d(-4px, -5px, 0) rotate(-0.35deg); }
}

.par {
  translate: calc(var(--mx) * var(--d, 0) * 1px) calc(var(--my) * var(--d, 0) * 1px);
  transition: translate 0.9s var(--ease-out);
}

/* ───────── Shared atoms ───────── */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: 600 0.7rem/1.3 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}

.eyebrow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lemon);
  box-shadow: 0 0 0 4px rgba(255, 229, 102, 0.12), 0 0 14px var(--lemon);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 7px rgba(255, 229, 102, 0.05), 0 0 22px var(--lemon); }
}

.scene-title {
  font: 700 clamp(1.9rem, 4.2vw, 3.6rem) / 1.02 var(--f-display);
  letter-spacing: -0.035em;
}

.txt-grad {
  background: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 9s linear infinite;
}

@keyframes sheen {
  to { background-position: -200% 0; }
}

.btn-plasma {
  --ang: 0deg;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.15rem 0.95rem 1.45rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(var(--void-2), var(--void-2)) padding-box,
    conic-gradient(from var(--ang), var(--coral), var(--lemon), var(--sky), var(--violet), var(--coral)) border-box;
  font: 600 0.9rem/1 var(--f-display);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  animation: spin-ang 5s linear infinite;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
  box-shadow: 0 0 0 0 rgba(78, 197, 241, 0), 0 14px 40px -18px rgba(255, 107, 74, 0.7);
}

.btn-plasma:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 34px -6px rgba(78, 197, 241, 0.55), 0 18px 50px -18px rgba(255, 107, 74, 0.9);
}

.btn-plasma__arrow {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--text);
  color: var(--void);
  font-family: var(--f-body);
  transition: transform 0.35s var(--ease-out);
}

.btn-plasma:hover .btn-plasma__arrow {
  transform: translateX(3px) rotate(-12deg);
}

.btn-plasma--xl {
  font-size: 1rem;
  padding: 1.1rem 1.25rem 1.1rem 1.7rem;
}

@keyframes spin-ang {
  to { --ang: 360deg; }
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.95rem 1.2rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font: 600 0.72rem/1 var(--f-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--mute);
  white-space: nowrap;
  transition: color 0.25s, border-color 0.25s, background-color 0.25s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.07);
}

/* ───────── 01 · Origin ───────── */

.origin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
}

.origin__copy {
  container-type: inline-size; /* title size follows this column (cqi below) */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(1rem, 2.4vh, 1.6rem);
}

.origin__title {
  margin-block: clamp(0.4rem, 2.2vh, 1.4rem) clamp(0.6rem, 2.8vh, 1.8rem);
  font: 800 clamp(2.8rem, 7vw, 6.4rem) / 0.9 var(--f-display);
  font-size: clamp(2.4rem, 15.5cqi, 6.4rem); /* "The Local" always fits one line */
  letter-spacing: -0.05em;
}

.origin__title .fl {
  --fdur: 9s;
}

.origin__line {
  display: block;
}

.origin__line:first-child {
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(238, 240, 248, 0.75);
}

.origin__line--glow {
  background: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(255, 140, 90, 0.35));
  animation: sheen 10s linear infinite;
}

.origin__cursor {
  display: inline-block;
  width: 0.09em;
  height: 0.78em;
  margin-left: 0.08em;
  vertical-align: -0.04em;
  background: var(--sky);
  box-shadow: 0 0 18px var(--sky);
  animation: blink 1.1s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.origin__lead {
  max-width: 34rem;
  font-size: clamp(0.98rem, 1.2vw, 1.14rem);
  color: var(--mute);
}

.origin__lead strong {
  color: var(--text);
  font-weight: 600;
}

.origin__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.origin__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.stat {
  --fdur: 6.5s;
  min-width: 6.6rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
}

.stat dt {
  font: 600 0.6rem/1 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.stat dd {
  margin-top: 0.4rem;
  font: 700 1.45rem/1 var(--f-display);
  letter-spacing: -0.03em;
}

/* Rotating feature model */
.orbit {
  --n: 7;
  --cw: clamp(148px, 13.5vw, 205px);
  --r: 300px;
  position: relative;
  height: min(70dvh, 640px);
  min-height: 360px;
  display: grid;
  place-items: center;
}

.orbit__halo {
  position: absolute;
  inset: 12% 8%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(78, 197, 241, 0.22), rgba(155, 123, 255, 0.1) 55%, transparent);
  filter: blur(10px);
}

.orbit__core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--cw) * 0.95);
  aspect-ratio: 1;
  margin: calc(var(--cw) * -0.475) 0 0 calc(var(--cw) * -0.475);
  perspective: 600px;
  transform-style: preserve-3d;
}

.core-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(78, 197, 241, 0.55);
  box-shadow: 0 0 18px rgba(78, 197, 241, 0.25), inset 0 0 18px rgba(78, 197, 241, 0.15);
  animation: gyro-1 11s linear infinite;
}

.core-ring--2 {
  inset: 8%;
  border-color: rgba(255, 107, 74, 0.6);
  box-shadow: 0 0 18px rgba(255, 107, 74, 0.25);
  animation: gyro-2 8s linear infinite;
}

.core-ring--3 {
  inset: -12%;
  border-style: dashed;
  border-color: rgba(255, 229, 102, 0.35);
  box-shadow: none;
  animation: gyro-3 17s linear infinite;
}

@keyframes gyro-1 {
  from { transform: rotateX(68deg) rotateZ(0deg); }
  to { transform: rotateX(68deg) rotateZ(360deg); }
}
@keyframes gyro-2 {
  from { transform: rotateY(62deg) rotateZ(0deg); }
  to { transform: rotateY(62deg) rotateZ(-360deg); }
}
@keyframes gyro-3 {
  from { transform: rotateX(78deg) rotateY(14deg) rotateZ(0deg); }
  to { transform: rotateX(78deg) rotateY(14deg) rotateZ(360deg); }
}

.core-lens {
  position: absolute;
  inset: 26%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.55), transparent 32%),
    radial-gradient(circle, rgba(78, 197, 241, 0.55), rgba(155, 123, 255, 0.35) 55%, rgba(255, 107, 74, 0.2) 80%, transparent 72%);
  box-shadow: 0 0 60px rgba(78, 197, 241, 0.45), 0 0 120px rgba(155, 123, 255, 0.3);
  animation: breathe 5s ease-in-out infinite;
}

.core-lens i {
  width: 6%;
  height: 46%;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 10px #fff;
}

.core-lens i:nth-child(2) {
  height: 30%;
}

@keyframes breathe {
  50% { transform: scale(1.08); box-shadow: 0 0 80px rgba(78, 197, 241, 0.55), 0 0 150px rgba(155, 123, 255, 0.35); }
}

.orbit__floor {
  position: absolute;
  left: 50%;
  bottom: 9%;
  width: calc(var(--r) * 2.3);
  max-width: 120%;
  aspect-ratio: 1;
  translate: -50% 50%;
  transform: perspective(900px) rotateX(78deg);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, rgba(78, 197, 241, 0.22) 0 1px, transparent 1px 28px),
    radial-gradient(closest-side, rgba(78, 197, 241, 0.18), transparent);
  mask-image: radial-gradient(closest-side, #000 40%, transparent);
  -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent);
  animation: floor-spin 40s linear infinite;
  pointer-events: none;
}

@keyframes floor-spin {
  to { transform: perspective(900px) rotateX(78deg) rotateZ(360deg); }
}

.orbit__scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 1300px;
  perspective-origin: 50% 32%;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.orbit__scene.is-dragging {
  cursor: grabbing;
}

.orbit__ring {
  position: relative;
  width: var(--cw);
  aspect-ratio: 0.74;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--r) * -0.55)) rotateX(-9deg) rotateY(var(--spin, 0deg));
}

.fcard {
  --face: 1;
  /* Size reference for the card's contents (cqi units below), including the
     body's own padding, which can't measure against itself */
  container-type: inline-size;
  position: absolute;
  inset: 0;
  transform: rotateY(calc(var(--k) * 360deg / var(--n))) translateZ(var(--r));
  opacity: calc(0.14 + 0.86 * var(--face));
  transform-style: preserve-3d;
}

/* Card contents scale with the card's own width (container query units), so they
   fit the fixed card shape whether the ring is 94 px cards on a small phone or
   ~200 px on desktop. Values before each cqi line are fallbacks. */
.fcard__body {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  gap: clamp(0.15rem, 3.5cqi, 0.45rem);
  padding: 10px 10px 12px;
  padding: 8cqi 8cqi 9cqi;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02) 55%),
    rgba(10, 12, 22, 0.86);
  box-shadow:
    0 30px 60px -30px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  animation: drift 6.5s ease-in-out infinite;
  animation-delay: calc(var(--k) * -0.93s);
}

/* Glowing icon tile in the card's accent colour */
.fcard__icon {
  --accent: var(--sky);
  flex: none;
  display: grid;
  place-items: center;
  width: 3rem;
  width: 34cqi;
  aspect-ratio: 1;
  margin-bottom: 0.2rem;
  margin-bottom: 3cqi;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 28%;
  background:
    radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 70%),
    rgba(255, 255, 255, 0.03);
  box-shadow:
    0 0 24px -6px color-mix(in srgb, var(--accent) 70%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--accent);
}

.fcard__icon svg {
  width: 56%;
  height: 56%;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 80%, transparent));
}

.fcard__tag {
  font: 600 0.55rem/1.2 var(--f-mono);
  font-size: clamp(0.42rem, 6.2cqi, 0.62rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fcard__title {
  font: 700 0.9rem/1.12 var(--f-display);
  font-size: clamp(0.62rem, 11cqi, 1.1rem);
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.fcard__text {
  font-size: 0.72rem;
  font-size: clamp(0.5rem, 8cqi, 0.8rem);
  line-height: 1.36;
  color: var(--mute);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.orbit__caption {
  position: absolute;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  font: 600 0.6rem/1 var(--f-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
}

/* ───────── 02 · Protocol ───────── */

.protocol {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  grid-template-areas:
    "head  scan"
    "steps scan"
    "steps term";
  column-gap: clamp(1.5rem, 4vw, 4rem);
  row-gap: clamp(1rem, 2.6vh, 1.8rem);
  align-items: start;
}

.protocol__head {
  grid-area: head;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.steps {
  grid-area: steps;
  display: flex;
  flex-direction: column;
  gap: clamp(0.6rem, 1.6vh, 1rem);
  counter-reset: step;
}

.step:nth-child(2) { padding-left: clamp(0rem, 4vw, 3.5rem); }
.step:nth-child(3) { padding-left: clamp(0rem, 8vw, 7rem); }

.step__card {
  --fdur: 8s;
  position: relative;
  max-width: 31rem;
  padding: clamp(0.9rem, 2vh, 1.25rem) 1.3rem clamp(0.9rem, 2vh, 1.25rem) 4.6rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
}

.step__card::before {
  content: "";
  position: absolute;
  left: 3.55rem;
  top: 1.1rem;
  bottom: 1.1rem;
  width: 1px;
  background: linear-gradient(transparent, var(--line-2), transparent);
}

.step__no {
  position: absolute;
  left: 1.05rem;
  top: 50%;
  translate: 0 -50%;
  font: 800 1.5rem/1 var(--f-display);
  letter-spacing: -0.04em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.step h3 {
  font: 700 1.02rem/1.2 var(--f-display);
  letter-spacing: -0.02em;
}

.step p {
  margin-top: 0.3rem;
  font-size: 0.88rem;
  color: var(--mute);
}

.scanner {
  grid-area: scan;
  justify-self: center;
  width: min(100%, 25rem, 46dvh);
  perspective: 900px;
}

.scanner__frame {
  --fdur: 9s;
  position: relative;
  aspect-ratio: 1;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  box-shadow:
    0 40px 90px -40px rgba(78, 197, 241, 0.45),
    0 0 0 6px rgba(255, 255, 255, 0.025);
  transform-origin: 50% 50%;
}

.scanner__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner__img--after {
  clip-path: inset(0 0 0 var(--cut));
}

.scanner__frame,
.scanner__beam {
  animation: drift 9s ease-in-out infinite, scan 6.5s var(--ease-warp) infinite;
  animation-delay: var(--fd, 0s), 0s;
}

.scanner__beam {
  position: absolute;
  top: -5%;
  bottom: -5%;
  left: var(--cut);
  width: 2px;
  translate: -1px 0;
  background: var(--lemon);
  box-shadow: 0 0 12px var(--lemon), 0 0 40px 6px rgba(255, 229, 102, 0.4);
  animation: scan 6.5s var(--ease-warp) infinite;
}

@keyframes scan {
  0%, 8% { --cut: 100%; }
  46%, 58% { --cut: 0%; }
  96%, 100% { --cut: 100%; }
}

.scanner__chip {
  position: absolute;
  bottom: 0.8rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: rgba(5, 6, 11, 0.72);
  border: 1px solid var(--line);
  font: 600 0.56rem/1 var(--f-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.scanner__chip--l { left: 0.8rem; }
.scanner__chip--r { right: 0.8rem; color: var(--lemon); }

.term {
  grid-area: term;
  justify-self: start;
  width: min(100%, 21rem);
  margin-top: -2.4rem;
  margin-left: -2.5rem;
  position: relative;
  z-index: 2;
}

.term__win {
  --fdur: 7s;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(8, 9, 16, 0.88);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.term__bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.term__bar i:nth-child(1) { background: var(--coral); }
.term__bar i:nth-child(2) { background: var(--lemon); }
.term__bar i:nth-child(3) { background: var(--sky); }

.term__bar span {
  margin-left: auto;
  font: 400 0.6rem/1 var(--f-mono);
  color: var(--dim);
}

.term__body {
  margin: 0;
  padding: 0.8rem 0.95rem 0.9rem;
  font: 400 0.74rem/1.75 var(--f-mono);
  color: var(--text);
  white-space: pre-wrap; /* the clone URL is long: wrap instead of scrolling sideways */
  overflow-wrap: anywhere;
}

.term__p { color: var(--dim); }
.term__ok { color: #6ee7a8; }
.term__url { color: var(--sky); }

/* ───────── 03 · Fusion ───────── */

.fusion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "copy    stack"
    "pillars pillars";
  column-gap: clamp(1.5rem, 4vw, 4rem);
  row-gap: clamp(0.8rem, 2.4vh, 1.8rem);
  align-items: center;
}

.fusion__copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(0.8rem, 2vh, 1.2rem);
}

.fusion__lead {
  max-width: 33rem;
  font-size: clamp(0.92rem, 1.1vw, 1.05rem);
  color: var(--mute);
}

.legend {
  display: grid;
  gap: 0.25rem;
  width: min(100%, 26rem);
}

.legend li {
  display: grid;
  grid-template-columns: 2rem 5.6rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 9px;
  border: 1px solid transparent;
  font: 400 0.7rem/1.2 var(--f-mono);
  color: var(--dim);
  transition: color 0.4s, background-color 0.4s, border-color 0.4s;
}

.legend__k { color: var(--dim); }
.legend__v {
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.legend__f {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend li.is-lit {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
}

.legend li.is-lit .legend__k { color: var(--lemon); }

.stack {
  grid-area: stack;
  justify-self: center;
  width: min(100%, 25rem, 44dvh);
  aspect-ratio: 1;
  perspective: 1600px;
}

.stack__float {
  --fdur: 10s;
  width: 100%;
  height: 100%;
}

.stack__rig {
  --gap: 8px;
  --gap-max: clamp(44px, 9dvh, 78px);
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  scale: 0.8;
  transform: rotateX(56deg) rotateZ(-38deg) translateZ(-40px);
  animation:
    explode 9s var(--ease-warp) infinite,
    sway 14s ease-in-out infinite alternate;
}

@keyframes explode {
  0%, 12% { --gap: 6px; }
  38%, 74% { --gap: var(--gap-max); }
  96%, 100% { --gap: 6px; }
}

@keyframes sway {
  from { transform: rotateX(56deg) rotateZ(-38deg) translateZ(-40px); }
  to { transform: rotateX(50deg) rotateZ(-26deg) translateZ(-40px); }
}

.plane {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 12, 22, 0.6);
  transform: translateZ(calc(var(--l) * var(--gap)));
  box-shadow: 0 0 0 0 transparent;
  transition: border-color 0.5s, box-shadow 0.5s;
}

.plane img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plane.is-lit {
  border-color: var(--lemon);
  box-shadow: 0 0 30px rgba(255, 229, 102, 0.35), inset 0 0 20px rgba(255, 229, 102, 0.15);
}

.plane--src img { opacity: 0.85; }

.plane--mask {
  background: #02030a;
}

.plane--mask img {
  filter: grayscale(1) contrast(2.6) brightness(0.62);
  mix-blend-mode: screen;
  opacity: 0.75;
}

.plane__grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(78, 197, 241, 0.25) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(90deg, rgba(78, 197, 241, 0.25) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(180deg, rgba(78, 197, 241, 0.25), rgba(155, 123, 255, 0.25));
  mix-blend-mode: screen;
}

.plane--proc img {
  filter: sepia(0.6) saturate(0.7) contrast(0.92) brightness(1.06);
}

.plane--ink {
  background: rgba(255, 229, 102, 0.02);
  color: var(--lemon);
}

.plane--ink svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px rgba(255, 229, 102, 0.6));
}

.ink-draw path,
.ink-draw circle {
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: ink 9s var(--ease-warp) infinite;
}

@keyframes ink {
  0%, 10% { stroke-dashoffset: 260; }
  45%, 85% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -260; }
}

.plane--out {
  border-color: rgba(255, 255, 255, 0.3);
}

.pillars {
  grid-area: pillars;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.6rem, 1.4vw, 1.1rem);
}

.pillar__card {
  --fdur: 8.5s;
  height: 100%;
  padding: 1rem 1.15rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
}

.pillar h3 {
  margin-top: 0.7rem;
  font: 700 0.92rem/1.2 var(--f-display);
  letter-spacing: -0.02em;
}

.pillar p {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--mute);
}

.pillar__glyph {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.pillar__glyph--ai {
  background: radial-gradient(circle, var(--sky) 0 3px, transparent 4px) 0 0 / 10px 10px;
  box-shadow: 0 0 18px rgba(78, 197, 241, 0.35);
  border: 1px solid rgba(78, 197, 241, 0.5);
}

.pillar__glyph--px {
  background: conic-gradient(var(--coral), var(--lemon), var(--sky), var(--violet), var(--coral));
  box-shadow: 0 0 18px rgba(255, 107, 74, 0.35);
  animation: spin-ang 8s linear infinite;
}

.pillar__glyph--ink {
  border: 1px solid rgba(255, 229, 102, 0.5);
  background:
    radial-gradient(circle at 70% 30%, transparent 7px, rgba(255, 229, 102, 0.9) 7.5px 8.5px, transparent 9px),
    linear-gradient(135deg, transparent 46%, var(--lemon) 47% 53%, transparent 54%);
  box-shadow: 0 0 18px rgba(255, 229, 102, 0.25);
}

/* ───────── 04 · Archive ───────── */

.scene--archive {
  overflow: hidden;
}

.archive {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  max-width: none;
}

.scene__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.archive__wall {
  position: absolute;
  inset: -20% -30%;
  perspective: 1100px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 55% 50% at 50% 50%, transparent 12%, #000 55%, transparent 92%);
  -webkit-mask-image: radial-gradient(ellipse 55% 50% at 50% 50%, transparent 12%, #000 55%, transparent 92%);
}

.archive__plane {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 2vw, 26px);
  transform: rotateX(24deg) rotateZ(-9deg) translateZ(-120px);
}

.archive__row {
  display: flex;
  gap: clamp(14px, 2vw, 26px);
  width: max-content;
  animation: marquee 70s linear infinite;
}

.archive__row--rev {
  animation-direction: reverse;
  animation-duration: 85s;
}

.archive__row[data-row="2"] {
  animation-duration: 95s;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.tile {
  flex: none;
  width: clamp(130px, 15vw, 220px);
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--void-2);
  box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.9);
  animation: drift 8s ease-in-out infinite;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s;
}

.tile img.is-loaded {
  opacity: 0.9;
}

.archive__panel {
  position: relative;
  z-index: 2;
  width: min(100%, 40rem);
}

.archive__glass {
  --fdur: 9s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.8rem, 2vh, 1.2rem);
  padding: clamp(1.4rem, 4vh, 2.6rem) clamp(1.2rem, 4vw, 2.8rem);
  border: 1px solid var(--line-2);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(20, 22, 38, 0.72), rgba(6, 7, 13, 0.8));
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow:
    0 50px 120px -40px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  text-align: center;
}

.archive__lead {
  max-width: 30rem;
  font-size: clamp(0.92rem, 1.1vw, 1.04rem);
  color: var(--mute);
}

.archive__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 0.3rem;
}

.archive__credits {
  font: 400 0.64rem/1.4 var(--f-mono);
  letter-spacing: 0.06em;
  color: var(--dim);
}

.archive__credits a {
  color: var(--mute);
}

.archive__credits a:hover {
  color: var(--text);
}

/* ───────── Responsive ───────── */

/* Content taller than the viewport: the scene scrolls internally and
   js/landing.js only changes scene once that inner scroll hits its edge. */
.scene {
  overflow: hidden;
  scrollbar-width: none;
}

/* Set by js/landing.js only when the scene's real content (not decoration) is too tall */
.scene.is-tall {
  overflow-y: auto;
  /* Fully hidden under the HUD and the bottom dot bar, then a short fade */
  --fade-top: calc(var(--hud-h) + env(safe-area-inset-top));
  --fade-bottom: calc(var(--foot-h) * 0.7 + env(safe-area-inset-bottom));
  -webkit-mask-image: linear-gradient(transparent var(--fade-top), #000 calc(var(--fade-top) + 1rem), #000 calc(100% - var(--fade-bottom) - 1.5rem), transparent calc(100% - var(--fade-bottom)));
  mask-image: linear-gradient(transparent var(--fade-top), #000 calc(var(--fade-top) + 1rem), #000 calc(100% - var(--fade-bottom) - 1.5rem), transparent calc(100% - var(--fade-bottom)));
}

.orbit {
  overflow-y: clip;
}

.scene::-webkit-scrollbar {
  display: none;
}

.scene > .scene__inner {
  margin-block: auto;
}

@media (max-width: 1100px) {
  :root {
    --rail-w: 4.5rem;
  }

  /* No room for a permanent label here: the Next button names the sections */
  .lp-rail button[aria-current="step"]:not(:hover):not(:focus-visible) .lp-rail__name {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  :root {
    --hud-h: 3.6rem;
    --foot-h: 5rem;
    --rail-w: 0rem;
  }

  .scene {
    align-items: flex-start;
    padding-top: calc(var(--hud-h) + env(safe-area-inset-top) + 0.5rem);
  }

  /* Bottom bar: numbered stops on the left, the Next button on the right */
  .lp-rail {
    top: auto;
    right: auto;
    left: var(--gutter);
    bottom: calc(1rem + env(safe-area-inset-bottom));
    translate: none;
  }

  .lp-rail ol {
    flex-direction: row;
    gap: 0.55rem;
  }

  .lp-rail {
    --stop: 2.5rem;
  }

  /* Names live on the Next button here; keep the stops compact */
  .lp-rail__name {
    display: none;
  }

  .lp-rail__track {
    top: 50%;
    bottom: auto;
    left: calc(var(--stop) / 2);
    right: calc(var(--stop) / 2);
    width: auto;
    height: 1px;
    translate: 0 -50%;
  }

  .lp-rail__fill {
    inset: 0 auto 0 0;
    width: calc(var(--scene-i, 0) / 3 * 100%);
    height: auto;
    transition: width var(--t-scene) var(--ease-warp);
  }

  .lp-next {
    left: auto;
    right: var(--gutter);
    translate: none;
    max-width: calc(100vw - 2 * var(--gutter) - 4 * 2.5rem - 3 * 0.55rem - 0.75rem);
    gap: 0.6rem;
    padding: 0.3rem 0.3rem 0.3rem 0.9rem;
  }

  .lp-next:hover {
    translate: none !important;
  }

  .lp-next__name {
    font-size: 0.78rem;
  }

  .lp-next__name::before {
    content: "";
  }

  .lp-next__arrow {
    width: 2.25rem;
    height: 2.25rem;
  }

  .origin {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .origin__copy {
    gap: 0.85rem;
  }

  .origin__title {
    font-size: clamp(2.4rem, 11vw, 4.4rem);
  }

  .orbit {
    --cw: clamp(108px, 26vw, 170px);
    height: clamp(240px, 40dvh, 430px);
    min-height: 0;
  }

  .orbit__caption {
    display: none;
  }

  .protocol {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "head"
      "scan"
      "steps"
      "term";
  }

  .scanner {
    width: min(100%, 19rem, 34dvh);
  }

  .step:nth-child(n) {
    padding-left: 0;
  }

  .step__card {
    max-width: none;
  }

  .term {
    margin: 0;
    justify-self: center;
  }

  .fusion {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "stack"
      "pillars";
  }

  .stack {
    width: min(70%, 16rem, 30dvh);
    margin-block: clamp(4rem, 10dvh, 5.5rem) 1.5rem;
  }

  .stack__rig {
    --gap-max: 30px;
  }

  .pillars {
    grid-template-columns: minmax(0, 1fr);
  }

  .pillar__card {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    column-gap: 0.9rem;
    align-items: start;
  }

  .pillar__glyph {
    grid-row: span 2;
  }

  .pillar h3 {
    margin-top: 0;
  }

  .archive {
    align-items: center;
    min-height: 100%;
  }
}

@media (max-width: 520px) {
  .lp-brand__word {
    font-size: 0.66rem;
    letter-spacing: 0.12em;
  }

  .lp-hud__link:not(.lp-hud__link--cta) {
    display: none;
  }


  .lp-corners {
    inset: 0.5rem;
  }

  .origin__stats .stat {
    flex: 1 1 0;
    min-width: 0;
  }

  .origin__ctas {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .btn-plasma,
  .btn-ghost {
    padding-block: 0.75rem;
  }

  .origin__ctas .btn-plasma {
    gap: 0.6rem;
    padding-left: 1.1rem;
    font-size: 0.84rem;
  }

  .origin__ctas .btn-plasma__arrow {
    width: 1.7rem;
    height: 1.7rem;
  }

  .origin__ctas .btn-ghost {
    padding-inline: 0.9rem;
    font-size: 0.64rem;
  }

  .step__card {
    padding-left: 3.9rem;
  }

  .step__card::before {
    left: 3rem;
  }

  .step__no {
    left: 0.8rem;
    font-size: 1.25rem;
  }

  .legend li {
    grid-template-columns: 1.6rem 4.8rem minmax(0, 1fr);
    padding-inline: 0.4rem;
  }

  .archive__ctas > * {
    width: 100%;
    justify-content: center;
  }

  .archive__ctas .btn-plasma {
    white-space: normal;
  }
}

/* Phones: the numbered stops take the width, so the button just says Next / To start */
@media (max-width: 600px) {
  .lp-next__name {
    display: none;
  }

  .lp-next__text::after {
    content: "Next";
    font: 700 0.86rem/1.1 var(--f-display);
    letter-spacing: -0.01em;
    color: var(--text);
    white-space: nowrap;
  }

  .lp-next.is-end .lp-next__text::after {
    content: "To start";
  }

  .lp-next__kicker {
    letter-spacing: 0.1em;
    white-space: nowrap;
  }
}

@media (max-width: 400px) {
  .lp-rail ol {
    gap: 0.4rem;
  }

  .lp-rail {
    --stop: 2.25rem;
  }

  .lp-next {
    max-width: calc(100vw - 2 * var(--gutter) - 4 * 2.25rem - 3 * 0.4rem - 0.6rem);
  }
}

@media (max-width: 360px) {
  .lp-brand__word {
    display: none;
  }

  .lp-next__kicker {
    display: none;
  }

  .lp-next.is-end .lp-next__text::after {
    content: "Top";
  }

  /* Cards get too narrow for the one-line blurb; tag + title still read */
  .fcard__text {
    display: none;
  }

  .origin__ctas {
    flex-wrap: wrap;
  }
}

/* ───────── Phones & portrait tablets: roomier layout ─────────
   Scenes may be taller than the screen here (they scroll inside, see is-tall),
   so spacing and type are sized for reading, not for squeezing into one view. */
@media (max-width: 900px) {
  :root {
    --gutter: 1.25rem;
  }

  .scene {
    padding-top: calc(var(--hud-h) + env(safe-area-inset-top) + 1.25rem);
  }

  .eyebrow {
    font-size: 0.72rem;
  }

  .scene-title {
    font-size: clamp(2rem, 9vw, 3.2rem);
    line-height: 1.06;
  }

  /* Origin: title → 3D model → pitch → CTAs → stats, so the title and the
     whole model are the first thing on screen */
  .origin {
    gap: 1.4rem;
  }

  .origin__copy {
    display: contents;
  }

  .origin__copy > .eyebrow { order: 1; }
  .origin__title { order: 2; }
  .orbit { order: 3; }
  .origin__lead { order: 4; }
  .origin__ctas { order: 5; }
  .origin__stats { order: 6; }

  .origin__title {
    margin-block: 0.5rem 0.6rem;
    font-size: clamp(2.6rem, 12vw, 4.6rem);
  }

  .origin__lead {
    font-size: 1rem;
    line-height: 1.65;
  }

  .orbit {
    --cw: clamp(100px, 29vw, 160px);
    width: 100%;
    /* Box follows the card size (js/landing.js may shrink --cw to fit the width),
       so there's no dead space between the title and the ring */
    height: calc(var(--cw) * 2.3);
    margin-block: -0.4rem -0.6rem;
  }

  .orbit__floor {
    max-width: 100%;
  }

  /* Protocol */
  .protocol {
    row-gap: 1.6rem;
  }

  .protocol__head {
    gap: 0.9rem;
  }

  .scanner {
    width: min(100%, 22rem, 46dvh);
  }

  .steps {
    gap: 0.9rem;
  }

  .step__card {
    padding-block: 1.1rem;
  }

  .step h3 {
    font-size: 1.05rem;
  }

  .step p {
    margin-top: 0.4rem;
    font-size: 0.94rem;
    line-height: 1.6;
  }

  /* Fusion */
  .fusion {
    row-gap: 1.6rem;
  }

  .fusion__copy {
    gap: 1.1rem;
  }

  .fusion__lead {
    font-size: 1rem;
    line-height: 1.65;
  }

  .legend {
    width: 100%;
    gap: 0.35rem;
  }

  .legend li {
    padding-block: 0.5rem;
    font-size: 0.74rem;
  }

  .pillars {
    gap: 0.85rem;
  }

  .pillar__card {
    padding: 1.1rem 1.15rem 1.2rem;
  }

  .pillar h3 {
    font-size: 1rem;
  }

  .pillar p {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  /* Archive */
  .archive__glass {
    gap: 1.1rem;
    padding: 2rem 1.4rem;
  }

  .archive__lead {
    font-size: 1rem;
    line-height: 1.65;
  }
}

/* Laptop windows with browser chrome (~650–820px tall) */
@media (max-height: 820px) and (min-width: 901px) {
  :root {
    --hud-h: 3.75rem;
    --foot-h: 4.6rem;
  }

  .scene-title {
    font-size: clamp(1.6rem, 6.4dvh, 3.2rem);
  }

  .protocol {
    row-gap: 0.9rem;
  }

  .steps {
    gap: 0.55rem;
  }

  .step__card {
    padding-block: 0.7rem;
  }

  .step p {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .scanner {
    width: min(100%, 25rem, 50dvh);
  }

  .fusion {
    row-gap: 0.8rem;
  }

  .fusion__copy {
    gap: 0.7rem;
  }

  .fusion__lead {
    font-size: 0.9rem;
  }

  .legend li {
    padding-block: 0.22rem;
  }

  .stack {
    width: min(100%, 25rem, 46dvh);
  }

  /* Pillars collapse to a single row of chips */
  .pillar p {
    display: none;
  }

  .pillar__card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
  }

  .pillar h3 {
    margin-top: 0;
  }

  .pillar__glyph {
    flex: none;
    width: 24px;
    height: 24px;
  }
}

/* Short, wide viewports (landscape phones, small laptop windows) */
@media (max-height: 640px) and (min-width: 901px) {
  :root {
    --hud-h: 3.4rem;
    --foot-h: 4.4rem;
  }

  .origin__title {
    font-size: clamp(2.2rem, min(11dvh, 15.5cqi), 4.6rem);
  }

  .origin__copy {
    gap: 0.7rem;
  }

  .origin__stats {
    display: none;
  }

  .orbit {
    --cw: clamp(110px, 24dvh, 170px);
    height: calc(100dvh - var(--hud-h) - var(--foot-h) - 1.5rem);
    min-height: 0;
  }

  .step p,
  .pillar p {
    display: none;
  }

  .term {
    display: none;
  }

  .legend {
    display: none;
  }
}

/* ───────── Reduced motion ───────── */

@media (prefers-reduced-motion: reduce) {
  :root {
    --t-scene: 0.45s;
  }

  .fl,
  .fcard__body,
  .tile,
  .core-ring,
  .core-lens,
  .orbit__floor,
  .lp-grain,
  .txt-grad,
  .origin__line--glow,
  .btn-plasma,
  .pillar__glyph--px,
  .lp-brand__mark i::after,
  .stack__rig,
  .archive__row,
  .lp-next__arrow i,
  .origin__cursor,
  .eyebrow__dot {
    animation: none !important;
  }

  .stack__rig {
    --gap: 46px;
  }

  .ink-draw path,
  .ink-draw circle {
    animation: none;
    stroke-dashoffset: 0;
  }

  .scanner__frame,
  .scanner__beam {
    animation: none;
    --cut: 50%;
  }

  .scene.is-past,
  .scene.is-future {
    transform: none;
    filter: none;
  }

  .r,
  .is-active .r {
    transform: none;
    transition: opacity 0.4s linear;
  }

  .par {
    translate: none;
  }
}
