/* ==========================================================================
   Ondaline — studio portfolio for iPhone Duo (folded + unfolded, portrait)
   One family (Archivo), one ink (ultramarine), one signal line.
   ========================================================================== */

/* ---------- 1. Colour tokens (light) ---------- */
:root {
  --paper: #edf0f3;
  --paper-2: #e1e6ee;
  --sheet: #f7f9fb;
  --ink: #1226c4;
  --ink-2: #4352cb;
  --rule: rgba(18, 38, 196, 0.28);
  --rule-2: rgba(18, 38, 196, 0.13);
  --signal: #f03a12;
  --on-ink: #f3f5ff;
  --plate: #1730d1;
  --plate-deep: #0d1c96;
  --plate-ink: #f3f5ff;
  --spot-tide: #5fe6de;
  --spot-lumen: #ff86b3;
  --spot-fern: #8be982;
  --spot-kiln: #ff9a6c;
  --spot-orbit: #e79bff;
  --spot-rail: #ffd84d;
  --focus: #1226c4;
  --halo: #edf0f3;
  --backdrop: #dde2ea;
  --scrim: rgba(9, 14, 80, 0.34);
  --error: #b3200a;
  --shadow: rgba(9, 14, 80, 0.2);

  /* Non-colour system values */
  --m: 1.25rem;
  --bar-h: 3.25rem;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --ease: cubic-bezier(0.2, 0.75, 0.15, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

/* ---------- 1b. Colour tokens (dark) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a0f5c;
    --paper-2: #070b49;
    --sheet: #0f1670;
    --ink: #e9ecff;
    --ink-2: #aab4f6;
    --rule: rgba(233, 236, 255, 0.3);
    --rule-2: rgba(233, 236, 255, 0.14);
    --signal: #ff5a2e;
    --on-ink: #0a0f5c;
    --plate: #1d36e6;
    --plate-deep: #0f20a8;
    --plate-ink: #f3f5ff;
    --spot-tide: #5fe6de;
    --spot-lumen: #ff86b3;
    --spot-fern: #8be982;
    --spot-kiln: #ff9a6c;
    --spot-orbit: #e79bff;
    --spot-rail: #ffd84d;
    --focus: #e9ecff;
    --halo: #0a0f5c;
    --backdrop: #060a3f;
    --scrim: rgba(3, 5, 40, 0.6);
    --error: #ff9c85;
    --shadow: rgba(2, 3, 30, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0a0f5c;
  --paper-2: #070b49;
  --sheet: #0f1670;
  --ink: #e9ecff;
  --ink-2: #aab4f6;
  --rule: rgba(233, 236, 255, 0.3);
  --rule-2: rgba(233, 236, 255, 0.14);
  --signal: #ff5a2e;
  --on-ink: #0a0f5c;
  --plate: #1d36e6;
  --plate-deep: #0f20a8;
  --plate-ink: #f3f5ff;
  --spot-tide: #5fe6de;
  --spot-lumen: #ff86b3;
  --spot-fern: #8be982;
  --spot-kiln: #ff9a6c;
  --spot-orbit: #e79bff;
  --spot-rail: #ffd84d;
  --focus: #e9ecff;
  --halo: #0a0f5c;
  --backdrop: #060a3f;
  --scrim: rgba(3, 5, 40, 0.6);
  --error: #ff9c85;
  --shadow: rgba(2, 3, 30, 0.5);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* The whole interface is drawn on a 466 × 678 sheet (folded) or a 626 × 890
   sheet (unfolded) and scales with the real viewport, so each screen always
   fits: 1rem is 16 design pixels. */
html {
  font-size: min(calc(100vw / 466 * 16), calc(100vh / 678 * 16));
  font-size: min(calc(100vw / 466 * 16), calc(100dvh / 678 * 16));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.4;
  font-weight: 420;
  font-stretch: 100%;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
h1, h2, h3, p, ul, ol, address, pre { margin: 0; padding: 0; font: inherit; }
ul, ol { list-style: none; }
address { font-style: normal; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { appearance: none; -webkit-appearance: none; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 0; touch-action: manipulation; }
svg { display: block; flex: none; }
canvas { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--ink); color: var(--on-ink); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 5px var(--halo); }

.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.label {
  font-size: 0.71875rem;
  line-height: 1.2;
  font-weight: 650;
  font-stretch: 88%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- 3. App frame ---------- */
.app {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(100vw, calc(100vh * 0.76));
  width: min(100vw, calc(100dvh * 0.76));
  height: 100vh;
  height: 100dvh;
  background: var(--paper);
  overflow: hidden;
  isolation: isolate;
}
@media (min-aspect-ratio: 4/5) {
  body { background: var(--backdrop); }
  .app { box-shadow: 0 0 0 1px var(--rule-2), 0 2rem 5rem var(--shadow); }
}

.screens {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.screens::-webkit-scrollbar { display: none; }
.screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  overflow: clip;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding-top: calc(var(--bar-h) + var(--sat));
}

/* ---------- 4. Bar ---------- */
.bar {
  position: absolute;
  z-index: 20;
  top: 0; left: 0; right: 0;
  height: calc(var(--bar-h) + var(--sat));
  padding: var(--sat) max(calc(var(--m) - 0.625rem), var(--sar)) 0 max(var(--m), var(--sal));
  display: flex;
  align-items: center;
  gap: 0.125rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.bar-mark {
  margin-right: auto;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  font-size: 1.125rem;
  font-weight: 850;
  font-stretch: 125%;
  letter-spacing: -0.025em;
}
.bar-nav { display: flex; align-items: center; }
.nav-btn {
  position: relative;
  height: 2.75rem;
  min-width: 2.125rem;
  padding: 0 0.4375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.nav-n { font-stretch: 80%; font-variant-numeric: tabular-nums; }
.nav-t {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  font-stretch: 88%;
  transition: max-width 0.5s var(--ease), opacity 0.3s linear, margin 0.5s var(--ease);
}
.nav-btn::after {
  content: "";
  position: absolute;
  left: 0.4375rem; right: 0.4375rem; bottom: 0.5rem;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.5s var(--ease);
}
.nav-btn[aria-current="true"] { color: var(--ink); }
.nav-btn[aria-current="true"] .nav-t { max-width: 4.5rem; opacity: 1; margin-left: 0.375rem; }
.nav-btn[aria-current="true"]::after { transform: scaleX(1); }
.bar-theme {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border-radius: 50%;
}
.bar-theme svg { width: 1.375rem; height: 1.375rem; transition: transform 0.6s var(--ease); }
:root[data-theme="dark"] .bar-theme svg { transform: rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bar-theme svg { transform: rotate(180deg); } }

/* ---------- 5. Shared controls ---------- */
.btn {
  height: 2.75rem;
  padding: 0 1.0625rem;
  border-radius: 99rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.btn svg { width: 1rem; height: 1rem; transition: transform 0.35s var(--ease); }
.btn--solid { background: var(--ink); color: var(--on-ink); }
.btn--line { border: 1px solid var(--ink); color: var(--ink); }
.btn:active { transform: scale(0.97); }
.icon-btn { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 50%; }

.chip {
  position: relative;
  height: 2rem;
  padding: 0 0.6875rem;
  border: 1px solid var(--rule);
  border-radius: 99rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  font-size: 0.8125rem;
  font-weight: 560;
  color: var(--ink);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.chip::before { content: ""; position: absolute; inset: -0.375rem -0.0625rem; }
.chip-n { font-size: 0.6875rem; font-weight: 650; font-stretch: 78%; opacity: 0.72; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

/* ---------- 6. Screen 1 · Home ---------- */
.home { background: var(--paper); }
.sea { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.home-copy {
  position: relative;
  z-index: 1;
  padding: 1.125rem var(--m) 0;
  pointer-events: none;
}
.home-line {
  font-size: 2.5rem;
  line-height: 0.97;
  font-weight: 800;
  font-stretch: 118%;
  letter-spacing: -0.028em;
  max-width: 26.5rem;
  text-wrap: balance;
}
.moves { display: inline-block; white-space: nowrap; }
.moves i {
  display: inline-block;
  font-style: normal;
  font-variation-settings: "wdth" 100;
  animation: breathe 4.4s var(--ease-io) infinite;
}
.moves i:nth-child(1) { animation-delay: 0s; }
.moves i:nth-child(2) { animation-delay: -3.52s; }
.moves i:nth-child(3) { animation-delay: -2.64s; }
.moves i:nth-child(4) { animation-delay: -1.76s; }
.moves i:nth-child(5) { animation-delay: -0.88s; }
@keyframes breathe {
  0%, 100% { font-variation-settings: "wdth" 66; }
  50% { font-variation-settings: "wdth" 125; }
}
.home-info {
  margin-top: 0.875rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.home-sub { font-size: 0.875rem; line-height: 1.36; max-width: 16.5rem; }
.home-disc { display: none; }
.home-meta {
  flex: none;
  text-align: right;
  font-size: 0.71875rem;
  line-height: 1.5;
  font-weight: 650;
  font-stretch: 88%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.home-foot {
  position: absolute;
  z-index: 2;
  left: max(var(--m), var(--sal)); right: max(var(--m), var(--sar));
  bottom: calc(1rem + var(--sab));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}
.home-cue {
  pointer-events: auto;
  height: 2.75rem;
  padding: 0 0.9375rem 0 0.875rem;
  border-radius: 99rem;
  background: var(--ink);
  color: var(--on-ink);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 650;
  white-space: nowrap;
}
.cue-n { font-size: 0.71875rem; font-stretch: 80%; letter-spacing: 0.08em; opacity: 0.75; }
.home-cue svg { width: 1rem; height: 1rem; animation: nudge 2.4s var(--ease-io) infinite; }
@keyframes nudge { 0%, 55%, 100% { transform: translateY(0); } 75% { transform: translateY(0.1875rem); } }
.home-cue--alt { display: none; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.home-cue--alt svg { animation: none; }
.home-hint {
  margin-left: auto;
  padding: 0.3125rem 0.5rem;
  background: var(--paper);
  font-size: 0.6875rem;
  font-weight: 650;
  font-stretch: 88%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- 7. Screen 2 · Work ---------- */
.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding-bottom: calc(0.375rem + var(--sab));
}
.work-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6875rem max(var(--m), var(--sar)) 0.6875rem max(var(--m), var(--sal));
}
.work-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filters { display: flex; gap: 0.25rem; flex: none; }

.stage { display: none; }

.deck {
  position: relative;
  min-height: 0;
  display: flex;
  gap: 0.75rem;
  padding: 0 0 0 max(var(--m), var(--sal));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: max(var(--m), var(--sal));
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.deck::-webkit-scrollbar { display: none; }
.deck::after { content: ""; flex: 0 0 2.125rem; }

.plate {
  position: relative;
  flex: 0 0 calc(100% - 2.875rem);
  min-width: 0;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.plate-art {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--plate);
  overflow: hidden;
}
.plate-art canvas { position: absolute; top: 0; bottom: 0; left: -5%; width: 110%; height: 100%; will-change: transform; }
.plate-cta {
  position: absolute;
  right: 0.625rem; bottom: 0.625rem;
  height: 2.25rem;
  padding: 0 0.8125rem 0 0.9375rem;
  border-radius: 99rem;
  background: var(--plate-ink);
  color: var(--plate);
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  font-size: 0.8125rem;
  font-weight: 650;
}
.plate-cta svg { width: 0.875rem; height: 0.875rem; }
.plate-body { flex: none; padding-top: 0.625rem; }
.plate-title {
  height: 3.3125rem;
  display: flex;
  align-items: flex-end;
  font-size: 3.25rem;
  line-height: 0.86;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.012em;
  white-space: nowrap;
  overflow-x: clip;
}
.fit { display: inline-block; white-space: nowrap; transform-origin: 0 100%; font-variation-settings: "wdth" 100; }
.plate-line { margin-top: 0.5rem; font-size: 0.9375rem; line-height: 1.34; min-height: 2.5rem; max-width: 23rem; }
.plate-meta {
  margin-top: 0.5rem;
  padding-top: 0.4375rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.71875rem;
  line-height: 1.2;
  font-weight: 650;
  font-stretch: 88%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.plate-idx { margin-right: 0.75em; font-weight: 650; color: var(--ink); }
.plate-open, .plate-pick { position: absolute; inset: 0; width: 100%; height: 100%; }
.plate-pick { display: none; }
.plate-open:focus-visible, .plate-pick:focus-visible { outline-offset: 2px; }

.rail {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto 2.75rem;
  align-items: center;
  column-gap: 0.25rem;
  height: 3rem;
  padding: 0 max(calc(var(--m) - 0.875rem), var(--sar)) 0 max(calc(var(--m) - 0.875rem), var(--sal));
}
.rail-arrow { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 50%; }
.rail-arrow svg { width: 1rem; height: 1rem; }
.rail-arrow:disabled { opacity: 0.32; cursor: default; }
.rail-track { position: relative; height: 2.75rem; margin: 0 0.25rem; }
.rail-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rail-line path { fill: none; stroke: var(--signal); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rail-ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; }
.tick { position: relative; flex: 1 1 0; height: 100%; }
.tick::before {
  content: "";
  position: absolute;
  left: 50%; top: 66%;
  width: 0.3125rem; height: 0.3125rem;
  margin: -0.15625rem 0 0 -0.15625rem;
  border-radius: 50%;
  background: var(--ink-2);
  opacity: 0.55;
  transition: opacity 0.3s, transform 0.4s var(--ease), background-color 0.3s;
}
.tick[aria-current="true"]::before { opacity: 0; transform: scale(0.4); }
.rail-line circle { fill: var(--ink); }
.rail-count {
  min-width: 3.5rem;
  text-align: right;
  font-size: 0.71875rem;
  font-weight: 650;
  font-stretch: 88%;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rail-count b { font-weight: 650; color: var(--ink); margin-right: 0.25em; }

/* ---------- 8. Project detail overlay ---------- */
.detail {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--paper);
  overflow: hidden;
}
.detail-art { position: relative; height: 12.75rem; height: max(12.75rem, 30dvh); background: var(--plate); overflow: hidden; transform-origin: 0 0; }
.detail-art canvas, .stage-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Sideways swipes on the artwork change project; vertical ones still move the screens. */
.detail-art, .stage-art { touch-action: pan-y; }
.detail-close {
  position: absolute;
  z-index: 3;
  top: calc(0.625rem + var(--sat));
  right: max(0.625rem, var(--sar));
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--plate-ink);
  color: var(--plate);
}
.detail-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto;
  padding: 0.75rem max(var(--m), var(--sar)) calc(0.375rem + var(--sab)) max(var(--m), var(--sal));
}
.detail-kicker { font-variant-numeric: tabular-nums; }
.detail-title {
  margin-top: 0.375rem;
  height: 3.3125rem;
  display: flex;
  align-items: flex-end;
  font-size: 3.25rem;
  line-height: 0.86;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.012em;
  white-space: nowrap;
  overflow-x: clip;
}
.detail-line { margin-top: 0.5rem; font-size: 0.9375rem; line-height: 1.34; font-weight: 560; max-width: 24rem; }

.tabs {
  position: relative;
  margin-top: 0.625rem;
  display: flex;
  gap: 1.125rem;
  border-bottom: 1px solid var(--rule);
}
.tab {
  position: relative;
  height: 2.25rem;
  font-size: 0.71875rem;
  font-weight: 650;
  font-stretch: 88%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.3s;
}
.tab::before { content: ""; position: absolute; inset: -0.25rem -0.5rem; }
.tab[aria-current="true"] { color: var(--ink); }
.tabs-ink {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: var(--tab-w, 0px);
  transform: translateX(var(--tab-x, 0px));
  background: var(--signal);
  transition: transform 0.45s var(--ease), width 0.45s var(--ease);
}
.parts {
  min-height: 0;
  margin: 0 calc(max(var(--m), var(--sar)) * -1) 0 calc(max(var(--m), var(--sal)) * -1);
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.parts::-webkit-scrollbar { display: none; }
.part {
  flex: 0 0 100%;
  min-width: 0;
  padding: 0.6875rem max(var(--m), var(--sar)) 0 max(var(--m), var(--sal));
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.part .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.part p { font-size: 0.9375rem; line-height: 1.42; max-width: 25.5rem; }
.figs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1rem;
  padding: 0.5rem 0 0.5rem;
  border-top: 1px solid var(--rule);
}
.fig { display: flex; flex-direction: column; min-width: 0; }
.fig b {
  font-size: 2.75rem;
  line-height: 1;
  font-weight: 800;
  font-stretch: 62%;
  letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fig span { margin-top: 0.1875rem; font-size: 0.75rem; line-height: 1.25; color: var(--ink-2); font-weight: 520; }
.fig--meta { display: none; }
.detail-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--rule);
}
.detail-step {
  height: 2.875rem;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
}
.detail-step--next { text-align: right; }
.detail-step span { display: flex; flex-direction: column; min-width: 0; }
.detail-step small {
  font-size: 0.625rem;
  font-weight: 650;
  font-stretch: 88%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.detail-step b { font-size: 0.875rem; font-weight: 750; font-stretch: 110%; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-step svg { width: 1rem; height: 1rem; }

/* ---------- 9. Screen 3 · Studio and contact ---------- */
.st {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-auto-rows: auto;
  align-content: space-between;
  column-gap: 1rem;
  padding: 0.75rem max(var(--m), var(--sar)) calc(0.75rem + var(--sab)) max(var(--m), var(--sal));
}
.st-lead { grid-column: 1 / -1; }
.st-statement {
  margin-top: 0.375rem;
  font-size: 1.3125rem;
  line-height: 1.1;
  font-weight: 760;
  font-stretch: 110%;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}
.st-nums {
  grid-column: 1 / -1;
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: 0.8fr 1.25fr 1fr;
  column-gap: 0.75rem;
}
.st-nums li { display: flex; flex-direction: column; border-top: 1px solid var(--rule); padding-top: 0.375rem; }
.st-nums b {
  font-size: 3rem;
  line-height: 0.92;
  font-weight: 800;
  font-stretch: 62%;
  font-variant-numeric: tabular-nums;
}
.st-nums span { margin-top: 0.1875rem; font-size: 0.75rem; line-height: 1.25; color: var(--ink-2); font-weight: 520; }
.st-wave { grid-column: 1 / -1; width: 100%; height: 1.5rem; margin: 0.25rem 0 0.125rem; overflow: visible; }
.st-wave path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.st-wave .strand { stroke: var(--ink); stroke-width: 1.25; }
.st-wave .join { stroke: var(--signal); stroke-width: 2; }
.st-list { margin-top: 0.4375rem; display: grid; row-gap: 0.4375rem; }
.st-list li { display: grid; grid-template-columns: 1.375rem minmax(0, 1fr); align-items: baseline; }
.st-k { font-size: 0.6875rem; font-weight: 650; font-stretch: 80%; letter-spacing: 0.08em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.st-list p { display: flex; flex-direction: column; }
.st-list b { font-size: 0.875rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.005em; }
.st-list p span { font-size: 0.75rem; line-height: 1.3; color: var(--ink-2); font-weight: 500; }
.st-clients { grid-column: 1 / -1; margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--rule); }
.st-clients p { margin-top: 0.3125rem; font-size: 0.8125rem; line-height: 1.36; font-weight: 520; }
.st-contact {
  grid-column: 1 / -1;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
  align-self: start;
}
.st-contact > .label { grid-column: 1 / -1; }
.st-mail { grid-column: 1 / -1; margin-top: 0.25rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.st-email {
  font-size: 1.4375rem;
  line-height: 1.1;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.025em;
  user-select: all;
  -webkit-user-select: all;
  cursor: text;
  white-space: nowrap;
}
.st-copy { height: 2.25rem; padding: 0 0.8125rem; font-size: 0.8125rem; flex: none; position: relative; }
.st-copy::before { content: ""; position: absolute; inset: -0.25rem; }
.st-address { grid-column: 1; grid-row: 3; margin-top: 0.5rem; font-size: 0.8125rem; line-height: 1.3; font-weight: 520; }
.st-compose { grid-column: 2; grid-row: 3; margin-top: 0.5rem; height: 2.5rem; }
.st-harbour { grid-column: 1 / -1; grid-row: 4; width: 100%; height: 4.25rem; margin-top: 0.875rem; overflow: visible; }
.st-harbour .quay, .st-harbour .pier, .st-harbour .tide { fill: none; stroke: var(--ink); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.st-harbour .pier { fill: var(--paper); }
.st-harbour .pier.is-here { fill: var(--signal); stroke: var(--signal); }
.st-harbour .tide { stroke-width: 1; opacity: 0.6; }
.st-harbour text { fill: var(--ink-2); font-family: var(--font); font-weight: 650; font-stretch: 80%; letter-spacing: 0.06em; }
.st-harbour text.is-here { fill: var(--ink); letter-spacing: 0.1em; }

.composer {
  position: absolute;
  z-index: 6;
  left: 0; right: 0; bottom: 0;
  padding: 0.5rem max(var(--m), var(--sar)) calc(0.875rem + var(--sab)) max(var(--m), var(--sal));
  background: var(--sheet);
  border-top: 2px solid var(--ink);
  box-shadow: 0 -1.5rem 3rem var(--shadow);
  transform: translateY(108%);
  visibility: hidden;
  transition: transform 0.55s var(--ease), visibility 0s linear 0.55s;
}
.studio.is-composing .composer { transform: none; visibility: visible; transition: transform 0.55s var(--ease), visibility 0s; }
.studio::after {
  content: "";
  position: absolute;
  z-index: 5;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.studio.is-composing::after { opacity: 1; pointer-events: auto; }
.composer-head { display: flex; align-items: center; justify-content: space-between; height: 2.75rem; margin-right: -0.75rem; }
.composer-head .label { color: var(--ink); }
.composer-form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 0.75rem; row-gap: 0.375rem; }
.field { min-width: 0; display: flex; flex-direction: column; }
.field--wide { grid-column: 1 / -1; }
.field label { font-size: 0.71875rem; font-weight: 650; font-stretch: 88%; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.6875rem;
  border: 1px solid var(--ink-2);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: max(16px, 1rem);
  line-height: 1.3;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}
.field input { height: 2.75rem; }
.field textarea { height: 4.75rem; resize: none; display: block; }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 0; box-shadow: none; border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field-err { min-height: 1.0625rem; margin-top: 0.125rem; font-size: 0.75rem; line-height: 1.3; font-weight: 600; color: var(--error); }
.composer-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.composer-note { font-size: 0.75rem; line-height: 1.3; color: var(--ink-2); font-weight: 520; max-width: 15rem; }
.done-title { font-size: 1.75rem; line-height: 1; font-weight: 850; font-stretch: 118%; letter-spacing: -0.025em; }
.done-text { margin-top: 0.4375rem; font-size: 0.875rem; line-height: 1.36; font-weight: 520; }
.done-mail { font-weight: 750; user-select: all; -webkit-user-select: all; white-space: nowrap; }
.done-draft {
  margin: 0.625rem 0 0.75rem;
  padding: 0.625rem 0.75rem;
  height: 7.75rem;
  overflow: auto;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--font);
  font-size: 0.8125rem;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
  -webkit-user-select: text;
}

/* ---------- 10. Unfolded (7.6" inner screen) ---------- */
@media (min-width: 540px) and (min-height: 750px) {
  html {
    font-size: min(calc(100vw / 626 * 16), calc(100vh / 890 * 16));
    font-size: min(calc(100vw / 626 * 16), calc(100dvh / 890 * 16));
  }
  :root { --m: 1.375rem; --bar-h: 3.5rem; }

  .nav-btn { padding: 0 0.5625rem; }
  .nav-btn::after { left: 0.5625rem; right: 0.5625rem; }
  .nav-t { max-width: 4.5rem; opacity: 1; margin-left: 0.375rem; }

  /* Home */
  .home-copy { padding-top: 1.5rem; }
  .home-line { font-size: 3.5rem; max-width: 36rem; }
  .home-info { margin-top: 1.125rem; }
  .home-sub { font-size: 0.9375rem; max-width: 15.5rem; }
  .home-disc {
    display: block;
    flex: none;
    margin-left: auto;
    font-size: 0.71875rem;
    line-height: 1.5;
    font-weight: 650;
    font-stretch: 88%;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
  }
  .home-meta { margin-left: 1.5rem; }
  .home-cue--alt { display: inline-flex; }
  .home-foot { bottom: calc(1.375rem + var(--sab)); }

  /* Work: preview stage + index grid */
  .work { grid-template-rows: auto auto minmax(0, 1fr); padding-bottom: calc(1.375rem + var(--sab)); }
  .work-head { padding-top: 0.875rem; padding-bottom: 0.875rem; }
  .filters { gap: 0.375rem; }
  .chip { height: 2.125rem; padding: 0 0.8125rem; }

  .stage { display: block; padding: 0 max(var(--m), var(--sar)) 0 max(var(--m), var(--sal)); }
  .stage-art { position: relative; height: 17.25rem; background: var(--plate); overflow: hidden; transform-origin: 0 0; }
  .stage-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .stage-title {
    margin-top: 0.75rem;
    height: 4.5rem;
    display: flex;
    align-items: flex-end;
    font-size: 4.4375rem;
    line-height: 0.86;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.012em;
    white-space: nowrap;
    overflow-x: clip;
  }
  .stage-row {
    margin-top: 0.75rem;
    padding-bottom: 0.875rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: end;
    column-gap: 1.125rem;
    border-bottom: 1px solid var(--rule);
  }
  .stage-line { font-size: 0.9375rem; line-height: 1.34; max-width: 19rem; min-height: 2.5rem; }
  .stage-meta {
    margin-top: 0.4375rem;
    font-size: 0.71875rem; line-height: 1.2; font-weight: 650; font-stretch: 88%;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); font-variant-numeric: tabular-nums;
  }
  .stage-fig { display: flex; flex-direction: column; max-width: 8.5rem; }
  .stage-fig b { font-size: 2.75rem; line-height: 0.95; font-weight: 800; font-stretch: 62%; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .stage-fig span { margin-top: 0.1875rem; font-size: 0.75rem; line-height: 1.25; color: var(--ink-2); font-weight: 520; }

  .deck {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 0.625rem 0.625rem;
    margin-top: 0.875rem;
    padding: 0 max(var(--m), var(--sar)) 0 max(var(--m), var(--sal));
    overflow: visible;
    scroll-snap-type: none;
  }
  .deck::after { display: none; }
  .plate { flex: none; scroll-snap-align: none; }
  .plate-art canvas { left: 0; width: 100%; }
  .plate-open, .plate-cta, .plate-line { display: none; }
  .plate-pick { display: block; }
  .plate-body { padding-top: 0.4375rem; }
  .plate-title { height: 1.3125rem; font-size: 1.3125rem; line-height: 0.9; }
  .plate-meta { margin-top: 0.3125rem; padding-top: 0; border-top: 0; font-size: 0.65625rem; letter-spacing: 0.08em; white-space: nowrap; }
  .plate-meta span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .plate-meta span:last-child { display: none; }
  .plate::before {
    content: "";
    position: absolute;
    z-index: 2;
    left: 0; right: 0; top: 0;
    height: 0.25rem;
    background: var(--signal);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.5s var(--ease);
    pointer-events: none;
  }
  .plate.is-current::before { transform: scaleX(1); }
  .plate:not(.is-current) .plate-title { color: var(--ink-2); }
  .rail { display: none; }

  /* Detail: split case */
  .detail-art { height: 18.5rem; height: max(18.5rem, 33.2dvh); }
  .detail-close { top: calc(0.875rem + var(--sat)); right: max(0.875rem, var(--sar)); }
  .detail-body { padding-top: 1rem; padding-bottom: calc(0.75rem + var(--sab)); grid-template-rows: auto auto auto minmax(0, 1fr) auto auto; }
  .detail-title { margin-top: 0.5rem; height: 4.5rem; font-size: 4.4375rem; }
  .detail-line { margin-top: 0.75rem; font-size: 1.0625rem; max-width: 30rem; }
  .tabs { display: none; }
  .parts {
    margin: 1rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rule);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 1.25rem;
    overflow: visible;
    scroll-snap-type: none;
    align-content: start;
  }
  .part { padding: 0; }
  .part .label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; display: block; margin-bottom: 0.4375rem; color: var(--ink); }
  .part p { font-size: 0.875rem; line-height: 1.42; }
  .figs { padding: 0.75rem 0 0.875rem; column-gap: 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fig b { font-size: 4rem; }
  .fig span { font-size: 0.8125rem; max-width: 11rem; }
  .fig--meta { display: flex; justify-content: flex-end; row-gap: 0.4375rem; }
  .fig--meta p { display: flex; flex-direction: column; }
  .fig--meta small { font-size: 0.65625rem; font-weight: 650; font-stretch: 88%; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
  .fig--meta em { font-style: normal; font-size: 0.9375rem; line-height: 1.25; font-weight: 700; }
  .detail-step { height: 3.25rem; }

  /* Studio: two columns, form inline */
  .st {
    column-gap: 1.5rem;
    padding-top: 1.125rem;
    padding-bottom: calc(1.125rem + var(--sab));
  }
  .st-statement { font-size: 1.75rem; line-height: 1.06; margin-top: 0.5rem; max-width: 35rem; }
  .st-nums { margin-top: 1rem; column-gap: 1.5rem; grid-template-columns: 0.7fr 1.2fr 1fr; }
  .st-nums b { font-size: 3.75rem; }
  .st-nums span { font-size: 0.8125rem; }
  .st-wave { height: 1.75rem; margin: 0.5rem 0 0.375rem; }
  .st-list { margin-top: 0.625rem; row-gap: 0.625rem; }
  .st-list li { grid-template-columns: 1.625rem minmax(0, 1fr); }
  .st-list b { font-size: 0.9375rem; }
  .st-list p span { font-size: 0.8125rem; }
  .st-clients { margin-top: 1rem; padding-top: 0.625rem; }
  .st-clients p { font-size: 0.9375rem; max-width: 35rem; }
  .st-contact {
    grid-column: 1;
    margin-top: 1rem;
    padding-top: 0.625rem;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }
  .st-mail { flex-direction: column; align-items: flex-start; gap: 0.75rem; margin-top: 0.5rem; }
  .st-email { font-size: 1.3125rem; }
  .st-address { margin-top: 0.875rem; font-size: 0.875rem; }
  .st-harbour { height: 7.25rem; margin-top: 1rem; grid-row: 4; }
  .st-compose { display: none; }
  .studio::after { display: none; }
  .composer {
    position: static;
    grid-column: 2;
    margin-top: 1rem;
    padding: 0.625rem 0 0;
    background: none;
    border-top: 1px solid var(--rule);
    box-shadow: none;
    transform: none;
    visibility: visible;
    transition: none;
    align-self: start;
  }
  .composer-head { height: auto; margin: 0 0 0.5rem; }
  .composer-head .label { color: var(--ink-2); }
  .composer-close { display: none; }
  .composer-form { column-gap: 0.625rem; row-gap: 0.25rem; }
  .field textarea { height: 4.5rem; }
  .composer-note { max-width: 9.5rem; }
  .done-title { font-size: 1.5rem; }
  .done-draft { height: 8.25rem; margin: 0.5rem 0 0.625rem; }
}

/* Chrome that is swiped across should not pick up a text selection. */
.bar, .filters, .rail, .plate, .tabs, .home-foot, .detail-nav, .detail-close, .stage-art {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ---------- 10b. Press and hover feedback ---------- */
.chip:active { transform: scale(0.96); }
.plate-art, .stage-art { transition: transform 0.35s var(--ease); }
.plate:has(.plate-open:active) .plate-art,
.plate:has(.plate-pick:active) .plate-art { transform: scale(0.985); }
.plate-cta svg { transition: transform 0.35s var(--ease); }
.plate:has(.plate-open:active) .plate-cta svg { transform: translate(0.125rem, -0.125rem); }
.btn:active svg { transform: translate(0.125rem, -0.125rem); }
.rail-arrow, .detail-step, .detail-close, .icon-btn, .bar-theme { transition: transform 0.25s var(--ease), opacity 0.25s; }
.rail-arrow:active:not(:disabled), .detail-close:active, .icon-btn:active, .bar-theme:active { transform: scale(0.9); }
.detail-step:active svg { transform: translateX(-0.1875rem); }
.detail-step--next:active svg { transform: translateX(0.1875rem); }
.detail-step svg { transition: transform 0.3s var(--ease); }
.st-email { transition: color 0.3s; }
@media (hover: hover) and (pointer: fine) {
  .deck { cursor: grab; }
  .deck.is-dragging { cursor: grabbing; }
  .deck .plate-open { cursor: inherit; }
}
@media (hover: hover) {
  .chip:hover { border-color: var(--ink); }
  .nav-btn:hover { color: var(--ink); }
  .btn--line:hover { background: var(--ink); color: var(--on-ink); }
  .btn:hover svg { transform: translate(0.125rem, -0.125rem); }
  .plate:has(.plate-open:hover) .plate-cta svg { transform: translate(0.125rem, -0.125rem); }
  .detail-step:hover svg { transform: translateX(-0.1875rem); }
  .detail-step--next:hover svg { transform: translateX(0.1875rem); }
  .tab:hover { color: var(--ink); }
  .stage-art { cursor: pointer; }
}

/* ---------- 11. Entrances ---------- */
/* Each screen settles in once, the first time it is seen. Kept under half a
   second so nothing is ever caught mid-air. */
.js .screen:not(.is-seen) [data-rise] { opacity: 0; transform: translateY(0.75rem); }
.js .screen.is-seen [data-rise] {
  transition: opacity 0.4s var(--ease), transform 0.45s var(--ease);
  transition-delay: calc(var(--rise, 0) * 22ms);
}

/* ---------- 12. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; }
  .moves i:nth-child(1) { font-variation-settings: "wdth" 66; }
  .moves i:nth-child(2) { font-variation-settings: "wdth" 82; }
  .moves i:nth-child(3) { font-variation-settings: "wdth" 98; }
  .moves i:nth-child(4) { font-variation-settings: "wdth" 112; }
  .moves i:nth-child(5) { font-variation-settings: "wdth" 125; }
  .js .screen:not(.is-seen) [data-rise] { transform: none; }
  .js .screen.is-seen [data-rise] { transition: opacity 0.25s linear; transition-delay: 0s; }
  .home-hint { display: none; }
  .composer, .studio.is-composing .composer { transition: opacity 0.2s linear, visibility 0s; }
  .nav-t, .nav-btn::after, .tabs-ink, .plate::before, .tick::before, .btn, .chip, .bar-theme svg,
  .plate-art, .stage-art, .plate-cta svg, .btn svg, .detail-step svg, .rail-arrow, .detail-close, .icon-btn, .bar-theme { transition-duration: 0.01s; }
  .chip:active, .btn:active, .plate:has(.plate-open:active) .plate-art, .plate:has(.plate-pick:active) .plate-art { transform: none; }
}
