/* ==========================================================================
   Fold/Lab — design tokens
   ========================================================================== */
:root {
  color-scheme: dark;
  --bg: oklch(0.155 0.008 270);
  --bg-2: oklch(0.19 0.01 270);
  --bg-3: oklch(0.23 0.012 270);
  --ink: oklch(0.965 0.004 85);
  --ink-2: oklch(0.82 0.007 85);
  --ink-3: oklch(0.66 0.012 270);
  --ink-4: oklch(0.5 0.014 270);
  --line: oklch(1 0 0 / 0.07);
  --line-2: oklch(1 0 0 / 0.14);
  --glass: oklch(0.2 0.012 270 / 0.62);
  --accent: oklch(0.79 0.145 66);
  --accent-ink: oklch(0.22 0.04 66);
  --accent-soft: oklch(0.79 0.145 66 / 0.18);

  --f-display: "Instrument Serif", "Times New Roman", serif;
  --f-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);

  --gutter: clamp(16px, 2.6vw, 40px);
  --nav-h: 64px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

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

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

/* ==========================================================================
   Type
   ========================================================================== */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: -0.022em;
  line-height: 0.9;
  margin: 0;
  text-wrap: balance;
}
.display em {
  font-style: italic;
  color: var(--ink-2);
}
.display--xl {
  font-size: clamp(3.4rem, 8.4vw, 9.6rem);
}
.display--lg {
  font-size: clamp(2.7rem, 5.6vw, 6.6rem);
}
.display--md {
  font-size: clamp(2.3rem, 4.1vw, 4.6rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow--accent {
  color: var(--accent);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.lede {
  margin: 0;
  max-width: 34ch;
  color: var(--ink-2);
  font-size: clamp(16px, 1.15vw, 18px);
  line-height: 1.65;
}

/* ==========================================================================
   Layers
   ========================================================================== */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(55% 50% at 64% 44%, oklch(0.25 0.02 270) 0%, transparent 72%),
    radial-gradient(45% 28% at 52% 100%, oklch(0.27 0.05 62 / 0.35) 0%, transparent 70%),
    var(--bg);
}

.gl {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.tags {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

main,
.foot {
  position: relative;
  z-index: 4;
}

/* ==========================================================================
   Loader
   ========================================================================== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  background: var(--bg);
  transition: opacity 0.8s var(--ease-out), visibility 0.8s;
}
.loader.is-done {
  opacity: 0;
  visibility: hidden;
}
.loader__mark {
  display: flex;
  perspective: 200px;
}
.loader__mark span {
  width: 18px;
  height: 40px;
  background: var(--ink);
  border-radius: 3px 0 0 3px;
}
.loader__mark span:last-child {
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transform-origin: left center;
  animation: hinge 1.6s var(--ease-io) infinite;
}
.loader__count {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
@keyframes hinge {
  0%, 15% { transform: rotateY(0deg); }
  50%, 65% { transform: rotateY(-178deg); }
  100% { transform: rotateY(0deg); }
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.nav > * {
  pointer-events: auto;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
}
.brand em {
  font-family: var(--f-display);
  font-size: 28px;
  line-height: 1;
}
.brand span {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink-3);
}
.nav nav {
  display: flex;
  gap: clamp(14px, 2vw, 30px);
}
.nav nav a {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink-2);
  display: inline-flex;
  gap: 7px;
  transition: color 0.25s var(--ease-out);
}
.nav nav a span {
  color: var(--ink-4);
}
@media (hover: hover) {
.nav nav a:hover {
  color: var(--ink);
}
}

/* ==========================================================================
   01 — Lab
   ========================================================================== */
.lab {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
}
.lab__stage {
  position: absolute;
  inset: 0;
  touch-action: pan-y;
  cursor: grab;
}
.lab__stage:active {
  cursor: grabbing;
}
.has-cursor .lab__stage {
  cursor: none;
}

.lab__intro,
.lab__info {
  position: absolute;
  left: var(--gutter);
  top: calc(var(--nav-h) + 3vh);
  pointer-events: none;
  transition: opacity 0.6s var(--ease-out), transform 0.8s var(--ease-out);
}
.lab__intro {
  max-width: min(640px, 48vw);
  display: grid;
  gap: 22px;
}
.lab__intro .line {
  display: inline-block;
}
.lab__intro .lede {
  max-width: 30ch;
}
.lab__info {
  width: min(410px, 33vw);
  display: grid;
  gap: 14px;
  opacity: 0;
  transform: translateY(14px);
}
.lab__tag {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  max-width: 30ch;
}
body[data-mode="single"] .lab__intro {
  opacity: 0;
  transform: translateY(-14px);
}
body[data-mode="single"] .lab__info {
  opacity: 1;
  transform: none;
}

.readout {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: 0.75fr 1.7fr 0.9fr;
  border-top: 1px solid var(--line-2);
}
.readout > div {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.readout > div:not(.readout__big) + div {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.readout__big {
  grid-column: 1 / -1;
}
.readout dt {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.readout dd {
  margin: 2px 0 0;
  white-space: nowrap;
  font-family: var(--f-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.readout .readout__big dd {
  font-family: var(--f-display);
  font-size: clamp(4rem, 6.4vw, 6.6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.readout__big sup {
  font-size: 0.42em;
  color: var(--accent);
  vertical-align: 0.95em;
  margin-left: 2px;
}

/* dock */
.dock {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  padding: 14px 16px 14px 14px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 80px -30px oklch(0 0 0 / 0.6);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out) 0.5s, transform 1.1s var(--ease-out) 0.5s;
}
.is-ready .dock {
  opacity: 1;
  transform: none;
}
.dock__main {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-content: space-between;
}
.dock__main > .seg {
  align-self: start;
}
.fold-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: oklch(1 0 0 / 0.045);
  border: 1px solid var(--line);
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar {
  display: none;
}
.seg button {
  flex: none;
  font-family: var(--f-mono);
  font-size: 12.5px;
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--ink-3);
  transition: color 0.25s var(--ease-out), background-color 0.35s var(--ease-out);
}
@media (hover: hover) {
.seg button:not([aria-selected="true"]):not([aria-checked="true"]):hover:not(:disabled) {
  color: var(--ink);
}
}
.seg button[aria-selected="true"],
.seg button[aria-checked="true"] {
  background: var(--ink);
  color: var(--bg);
}
.seg--sm button {
  padding: 6px 12px;
  font-size: 12px;
  min-width: 34px;
}

.fold-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  font-size: 14px;
  transition: transform 0.25s var(--ease-back), box-shadow 0.4s var(--ease-out);
  box-shadow: 0 10px 30px -12px var(--accent);
}
@media (hover: hover) {
.fold-btn:hover {
  transform: translateY(-1px);
}
}
.fold-btn:active {
  transform: scale(0.97);
}
.fold-btn__icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 60px;
}
.fold-btn__icon i {
  width: 7px;
  height: 13px;
  background: var(--accent);
  border-radius: 1.5px 0 0 1.5px;
}
.fold-btn__icon i + i {
  border-radius: 0 1.5px 1.5px 0;
  transform-origin: left center;
  transition: transform 0.6s var(--ease-io);
}
.fold-btn:not(.is-closed) .fold-btn__icon i + i {
  transform: rotateY(-150deg);
}

/* range slider */
.slider {
  flex: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.slider input,
.hinge input {
  --p: 1;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 30px;
  margin: 0;
  background: transparent;
  cursor: ew-resize;
}
.slider input::-webkit-slider-runnable-track,
.hinge input::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) calc(var(--p) * 100%), var(--line-2) 0);
}
.slider input::-webkit-slider-thumb,
.hinge input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 6px;
  height: 26px;
  margin-top: -12px;
  border-radius: 3px;
  background: var(--ink);
  box-shadow: 0 0 0 5px var(--accent-soft);
  transition: transform 0.2s var(--ease-back);
}
.slider input:active::-webkit-slider-thumb {
  transform: scaleY(1.15);
}
.slider input::-moz-range-track,
.hinge input::-moz-range-track {
  height: 2px;
  background: var(--line-2);
}
.slider input::-moz-range-progress,
.hinge input::-moz-range-progress {
  height: 2px;
  background: var(--accent);
}
.slider input::-moz-range-thumb,
.hinge input::-moz-range-thumb {
  width: 6px;
  height: 26px;
  border: 0;
  border-radius: 3px;
  background: var(--ink);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.slider__ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--ink-4);
}

/* experiment panel */
.dock__exp {
  width: 330px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.dock__exp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 22px;
}
.exp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.exp-label {
  font-size: 13px;
  color: var(--ink-2);
  margin-right: 2px;
}
.exp-hint {
  margin: 0;
  font-size: 13px;
  color: var(--ink-4);
}
.hinges {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 14px;
}
.hinges:empty {
  display: none;
}
.hinge {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 6px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--ink-3);
}
.hinge input {
  grid-column: 1 / -1;
  height: 20px;
}
.hinge input::-webkit-slider-runnable-track {
  background: var(--line-2);
}
.hinge input::-webkit-slider-thumb {
  height: 16px;
  margin-top: -7px;
  width: 5px;
}
.hinge output {
  grid-row: 1;
  grid-column: 2;
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ghost {
  justify-self: start;
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 4px 0;
  border-bottom: 1px solid var(--line-2);
  transition: color 0.25s var(--ease-out);
}
@media (hover: hover) {
.ghost:hover {
  color: var(--ink);
}
}

.swatches {
  display: flex;
  gap: 8px;
}
.swatches button {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, oklch(1 0 0 / 0.35), transparent 55%), var(--c);
  box-shadow: inset 0 0 0 1.5px var(--f), 0 0 0 1px var(--line-2);
  transition: transform 0.25s var(--ease-back);
}
@media (hover: hover) {
.swatches button:hover {
  transform: scale(1.12);
}
}
.swatches button[aria-checked="true"] {
  box-shadow: inset 0 0 0 1.5px var(--f), 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink);
}

/* toast + cue */
.toast {
  position: absolute;
  left: 50%;
  top: calc(var(--nav-h) + 10px);
  z-index: 6;
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  background: oklch(0.21 0.02 66 / 0.92);
  border: 1px solid oklch(0.79 0.145 66 / 0.45);
  color: var(--ink);
  transform: translate(-50%, -10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out);
  white-space: nowrap;
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.cue {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-decoration: none;
  display: flex;
  gap: 14px;
  align-items: center;
}
.cue span {
  color: var(--accent);
  text-transform: uppercase;
}

/* ==========================================================================
   Floating tags under devices
   ========================================================================== */
.tag {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  will-change: transform;
}
.tag.is-on {
  opacity: 1;
}
.tag__t {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tag__v {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tag--big .tag__v {
  font-family: var(--f-display);
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.tag__v small {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 4px;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Scroll chapters
   ========================================================================== */
.chapter {
  position: relative;
}
.chapter--exp {
  height: 460vh;
}
.chapter--shapes {
  height: 380vh;
}
.chapter--mm {
  height: 300vh;
}
.sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.chapter__copy {
  position: absolute;
  left: var(--gutter);
  top: calc(var(--nav-h) + 6vh);
  width: min(460px, 37vw);
  display: grid;
  gap: 26px;
}
.chapter__head {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: calc(var(--nav-h) + 4vh);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: end;
  gap: 22px 48px;
}
.chapter__head .eyebrow {
  grid-column: 1 / -1;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.steps li {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease-out), transform 0.8s var(--ease-out);
  pointer-events: none;
}
.steps li.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.steps h3 {
  margin: 0 0 10px;
  font-size: clamp(19px, 1.6vw, 24px);
  font-weight: 650;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.steps h3 span {
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
.steps p {
  margin: 0;
  color: var(--ink-2);
  max-width: 34ch;
}
.cta {
  margin-top: 22px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s;
}
@media (hover: hover) {
.cta:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
}
.cta span {
  transition: transform 0.35s var(--ease-out);
}
@media (hover: hover) {
.cta:hover span {
  transform: translateX(4px);
}
}

.hud {
  position: absolute;
  left: var(--gutter);
  bottom: 9vh;
  margin: 0;
  width: 280px;
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-left: 1px solid var(--accent);
  background: linear-gradient(to right, var(--accent-soft), transparent);
}
.hud dt {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hud dd {
  margin: 2px 0 0;
  font-family: var(--f-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.hud div:first-child dd {
  font-family: var(--f-display);
  font-size: 54px;
  line-height: 1;
}
.hud__bar {
  height: 3px;
  background: var(--line-2);
  overflow: hidden;
}
.hud__bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0.2);
  transition: transform 0.2s linear;
}
.note {
  position: absolute;
  left: var(--gutter);
  bottom: 4vh;
  margin: 0;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-4);
}

.caps {
  display: grid;
  padding-bottom: 6px;
}
.caps p {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out), transform 0.8s var(--ease-out);
  max-width: 40ch;
}
.caps p.is-active {
  opacity: 1;
  transform: none;
}

.weights {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.weights ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.weights li {
  display: grid;
  grid-template-columns: 82px 1fr 64px;
  align-items: center;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-2);
}
.w__bar {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.w__bar i {
  display: block;
  height: 100%;
  width: calc(var(--w) * 100%);
  background: linear-gradient(to right, var(--ink-4), var(--ink-2));
  border-radius: 3px;
}
.w__val {
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.w__val small {
  color: var(--ink-4);
  margin-left: 2px;
}

/* ==========================================================================
   05 — Specs
   ========================================================================== */
.specs {
  position: relative;
  background: var(--bg);
  padding: clamp(80px, 14vh, 160px) var(--gutter) clamp(60px, 10vh, 120px);
  border-top: 1px solid var(--line);
}
.specs__head {
  display: grid;
  gap: 22px;
  margin-bottom: clamp(40px, 7vh, 80px);
}
.table-wrap {
  overflow-x: auto;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter);
}
.spec-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.spec-table th,
.spec-table td {
  text-align: left;
  vertical-align: top;
  padding: 18px 16px 18px 0;
  border-bottom: 1px solid var(--line);
}
.spec-table thead th {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 22px;
}
.th__maker {
  display: block;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 8px;
}
.spec-table tbody th {
  width: 16%;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
}
.spec-table tbody th small,
.spec-table td small {
  display: block;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 2px;
}
.spec-table td {
  font-family: var(--f-mono);
  font-size: 14px;
  color: var(--ink);
}
.spec-table td.is-best {
  position: relative;
  color: var(--accent);
}
.spec-table td.is-best::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 27px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.specs__legend {
  margin: 22px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-4);
}
.spec-table tbody tr {
  transition: background-color 0.3s var(--ease-out);
}
@media (hover: hover) {
.spec-table tbody tr:hover {
  background: oklch(1 0 0 / 0.025);
}
}

/* ==========================================================================
   Footer
   ========================================================================== */
.foot {
  background: var(--bg);
  padding: clamp(60px, 12vh, 140px) var(--gutter) 40px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 60px;
}
.foot__again {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  text-decoration: none;
}
.foot__arrow {
  font-family: var(--f-mono);
  font-size: clamp(28px, 4vw, 56px);
  color: var(--accent);
  transition: transform 0.5s var(--ease-out);
}
@media (hover: hover) {
.foot__again:hover .foot__arrow {
  transform: translateY(-10px);
}
}
.foot__meta {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-4);
  max-width: 90ch;
}
.foot__meta p {
  margin: 0;
}
.foot__meta a {
  color: var(--ink-2);
  text-underline-offset: 3px;
  text-decoration-color: var(--line-2);
}

/* ==========================================================================
   Custom cursor (fine pointers, over the 3D stage only)
   ========================================================================== */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--ease-out);
}
.cursor.is-stage {
  opacity: 1;
}
.cursor.is-hidden {
  opacity: 0;
}
.cursor i {
  position: absolute;
  left: -17px;
  top: -17px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid oklch(1 0 0 / 0.55);
  transition: transform 0.35s var(--ease-back), border-color 0.3s;
}
.cursor.is-down i {
  transform: scale(0.72);
  border-color: var(--accent);
}
.cursor span {
  position: absolute;
  left: 24px;
  top: -11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s var(--ease-out), transform 0.35s var(--ease-out);
}
.cursor.has-label span {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Entrance
   ========================================================================== */
.lab__intro > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
}
.is-ready .lab__intro > * {
  opacity: 1;
  transform: none;
}
.is-ready .lab__intro > :nth-child(2) {
  transition-delay: 0.08s;
}
.is-ready .lab__intro > :nth-child(3) {
  transition-delay: 0.18s;
}

/* ==========================================================================
   Phone / portrait
   ========================================================================== */
@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  :root {
    --nav-h: 56px;
  }
  body {
    font-size: 16px;
  }
  .nav nav a {
    font-size: 0;
    gap: 0;
  }
  .nav nav a span {
    font-size: 11.5px;
    padding: 6px 4px;
  }
  .cue {
    display: none;
  }

  .lab {
    min-height: 560px;
  }
  .lab__intro {
    top: calc(var(--nav-h) + 4px);
    right: var(--gutter);
    max-width: none;
    gap: 10px;
  }
  .lab__intro .display--xl {
    font-size: clamp(3rem, 15vw, 4.6rem);
  }
  .lab__intro .lede {
    font-size: 14.5px;
    max-width: 32ch;
  }
  .lab__info {
    top: calc(var(--nav-h) + 4px);
    right: var(--gutter);
    width: auto;
    gap: 6px;
  }
  .lab__info .display--md {
    font-size: 2.1rem;
  }
  .lab__tag {
    display: none;
  }
  .readout {
    grid-template-columns: auto auto 1fr;
    margin-top: 2px;
  }
  .readout > div:last-child {
    display: none;
  }
  .readout__big {
    grid-column: 1;
    padding-right: 14px;
    border-right: 1px solid var(--line);
  }
  .readout .readout__big dd {
    font-size: 3rem;
  }
  .readout > div:not(.readout__big),
  .readout > div:not(.readout__big) + div {
    padding-left: 12px;
    border-left: 0;
  }
  .readout dd {
    font-size: 12.5px;
  }

  .dock {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
  }
  .seg button {
    padding: 7px 12px;
    font-size: 12px;
  }
  .fold-row {
    gap: 12px;
  }
  .fold-btn {
    padding-right: 14px;
    font-size: 13px;
  }
  .dock__exp {
    width: auto;
    padding: 10px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px 12px;
  }
  .dock__exp-head {
    grid-column: 1 / -1;
  }
  .exp-row {
    gap: 8px;
  }
  .hinges {
    grid-column: 1 / -1;
  }
  .exp-hint {
    font-size: 12px;
  }
  body[data-mode="all"] .dock__exp .exp-row {
    display: none;
  }
  .toast {
    white-space: normal;
    width: calc(100% - 2 * var(--gutter));
    text-align: center;
    border-radius: 16px;
  }

  .chapter__copy {
    left: var(--gutter);
    right: var(--gutter);
    top: auto;
    bottom: 4vh;
    width: auto;
    gap: 14px;
  }
  .chapter--exp .chapter__copy .display--lg {
    font-size: 2.4rem;
  }
  .chapter--exp .chapter__copy .eyebrow {
    display: none;
  }
  .steps p {
    font-size: 14.5px;
  }
  .cta {
    margin-top: 12px;
    padding: 10px 16px;
    font-size: 14px;
  }
  .hud {
    top: calc(var(--nav-h) + 2px);
    bottom: auto;
    left: var(--gutter);
    right: var(--gutter);
    width: auto;
    padding: 8px 12px;
    grid-template-columns: auto 1fr;
    align-items: end;
    gap: 6px 18px;
  }
  .hud__bar {
    grid-column: 1 / -1;
  }
  .hud div:first-child dd {
    font-size: 26px;
  }
  .hud dd {
    font-size: 12.5px;
  }
  .hud dt {
    font-size: 9.5px;
  }
  .note {
    display: none;
  }

  .chapter__head {
    grid-template-columns: 1fr;
    gap: 14px;
    top: calc(var(--nav-h) + 6px);
  }
  .chapter--mm .chapter__copy {
    top: calc(var(--nav-h) + 6px);
    bottom: auto;
  }
  .chapter--mm .lede {
    font-size: 14.5px;
  }
  .weights {
    display: none;
  }
  .tag--big .tag__v {
    font-size: 24px;
  }
}

@media (max-width: 380px) {
  .seg button {
    padding: 6px 9px;
  }
}


/* ==========================================================================
   Video toggle + custom phone panel
   ========================================================================== */
.dock__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-width: 0;
}
.dock__top > .seg {
  min-width: 0;
}
.vid {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vid__toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s;
}
.vid__icon {
  width: 0;
  height: 0;
  border-left: 8px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.vid__toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.vid__toggle[aria-pressed="true"] .vid__icon {
  border: 0;
  width: 8px;
  height: 10px;
  background: linear-gradient(to right, currentColor 0 3px, transparent 3px 5px, currentColor 5px 8px);
}
body:not(.is-video) [data-vid-ratio] {
  opacity: 0.5;
}
.tab--custom {
  color: var(--accent) !important;
}
.tab--custom[aria-selected="true"] {
  color: var(--accent-ink) !important;
  background: var(--accent) !important;
}

.custom {
  position: absolute;
  right: var(--gutter);
  top: calc(var(--nav-h) + 8px);
  z-index: 5;
  width: 312px;
  max-height: calc(100% - var(--nav-h) - 236px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: none;
  align-content: start;
  gap: 10px;
  padding: 14px 16px 12px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  scrollbar-width: thin;
}
body[data-device="custom"] .custom {
  display: grid;
}
body[data-device="custom"] .cue {
  display: none;
}
.custom__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.custom__close {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.field {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
}
.field--text,
.field--seg {
  grid-template-columns: 70px minmax(0, 1fr);
}
.field output {
  font-family: var(--f-mono);
  font-size: 11.5px;
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.field input[type="text"] {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
  font: 600 15px var(--f-sans);
  padding: 4px 0;
  outline: none;
}
.field input[type="text"]:focus {
  border-bottom-color: var(--accent);
}
.field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: ew-resize;
}
.field input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line-2);
}
.field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 5px;
  height: 18px;
  margin-top: -8px;
  border-radius: 3px;
  background: var(--ink);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--line-2);
}
.field input[type="range"]::-moz-range-thumb {
  width: 5px;
  height: 18px;
  border: 0;
  border-radius: 3px;
  background: var(--ink);
}
.colors {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.color {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
  cursor: pointer;
}
.color i {
  font-style: normal;
}
.color input {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.color input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color input::-webkit-color-swatch {
  border: 1px solid var(--line-2);
  border-radius: 50%;
}
.color input::-moz-color-swatch {
  border: 1px solid var(--line-2);
  border-radius: 50%;
}
.presets {
  display: flex;
  gap: 6px;
}
.presets button {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c) 50%, var(--f) 50%);
  box-shadow: 0 0 0 1px var(--line-2);
}
.walls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.walls button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
}
.walls button::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--c), var(--b));
}
.walls button[aria-checked="true"] {
  border-color: var(--ink);
  color: var(--ink);
}
.custom__stats {
  margin: 0 0 2px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
.custom__stats > div {
  padding: 8px 0;
}
.custom__stats > div:nth-child(2n) {
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.custom__stats > div:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}
.rot__icon {
  font-size: 15px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.5s var(--ease-io);
}
.vid__rotate[aria-pressed="true"] .rot__icon {
  transform: rotate(90deg);
}
.custom__stats dt {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.custom__stats dd {
  margin: 3px 0 0;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.custom__actions {
  display: flex;
  justify-content: space-between;
}
.custom-open {
  display: none;
}

@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  .custom {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    max-height: 50vh;
    z-index: 8;
    background: oklch(0.19 0.012 270 / 0.97);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 -20px 60px -20px oklch(0 0 0 / 0.7);
  }
  body[data-device="custom"] .custom {
    display: none;
  }
  body[data-device="custom"].is-custom-open .custom {
    display: grid;
  }
  .custom__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  body[data-device="custom"] .custom-open {
    display: inline-flex;
    position: absolute;
    right: var(--gutter);
    top: calc(var(--nav-h) + 6px);
    z-index: 6;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 13px;
    font-weight: 650;
  }
  body.is-custom-open .custom-open {
    display: none;
  }
  .vid__toggle {
    padding: 6px 12px 6px 10px;
    font-size: 12px;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
