/* Akiva — portfolio. One face (Switzer), one ground, one ink, one accent.
   Direction: the contact sheet — frames in strict rows, the picks lit.
   Motion curves from Bencho: springs overshoot a little, layout never does. */

:root {
  --bg: #0c0c0d;
  --surface: #151517;
  --surface-2: #1d1d20;
  --surface-3: #2a2a2e;
  --ink: #f3f3f1;
  --ink-2: #d2d2ce;
  --muted: #a2a29e;
  --accent: #3a63f5;
  --accent-hover: #4a70ff;
  --accent-text: #8aa6ff;
  --accent-ink: #ffffff;
  --field: #1f45d6;
  --field-step: #2d53e4;
  --field-step-2: #3c61ee;
  --field-ink: #ffffff;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3rem, min(8vw, 14vh), 8.5rem);

  --m: clamp(16px, 2.2vw, 32px);
  --sec: clamp(112px, 13vw, 208px);
  --bar-h: 64px;

  --spring: cubic-bezier(.28, 1.3, .36, 1);
  --spring-soft: cubic-bezier(.3, 1.12, .4, 1);
  --smooth: cubic-bezier(.32, .72, 0, 1);
  --out: cubic-bezier(.22, 1, .36, 1);

  color-scheme: dark;
}

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .22s var(--smooth) both; }
::view-transition-new(root) { animation: vt-in .5s var(--out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Switzer', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--step-body); line-height: 1.5; letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; font-variant-numeric: tabular-nums;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
p, h1, h2, h3, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 1; text-wrap: balance; }
b, strong { font-weight: 600; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
html { scrollbar-color: var(--surface-3) var(--bg); scrollbar-width: thin; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { padding-inline: var(--m); }
.small { font-size: var(--step-small); color: var(--muted); }
.skip { position: fixed; left: 12px; top: -60px; z-index: 300; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; transition: top .2s var(--out); }
.skip:focus { top: 12px; }

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 500; font-size: var(--step-small);
  text-decoration: none; white-space: nowrap; user-select: none;
  transition: transform .24s var(--spring), background-color .15s, color .15s, opacity .18s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.95); transition-duration: .12s; }
.btn-sm { min-height: 40px; padding: 0 18px; }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-3); }
.link { font-size: var(--step-small); color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); transition: text-decoration-color .2s; }
.link:hover { text-decoration-color: var(--ink); }

/* ---------- the bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 50; height: var(--bar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding-inline: var(--m); background: var(--bg);
  transition: transform .45s var(--smooth);
}
.bar.hide { transform: translateY(-100%); }
.wordmark { font-weight: 600; font-size: var(--step-body); letter-spacing: -0.03em; text-decoration: none; justify-self: start; }
.bar nav { display: flex; gap: clamp(16px, 2.4vw, 36px); font-size: var(--step-small); }
.bar nav a { text-decoration: none; color: var(--muted); transition: color .15s; position: relative; padding: 10px 0; }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--ink); }
.bar .btn { justify-self: end; }

/* ---------- reveals ---------- */
.js [data-reveal] > * { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--out), transform .9s var(--out); transition-delay: calc(var(--i, 0) * 80ms); }
.js [data-reveal].in > * { opacity: 1; transform: none; }
.js [data-reveal]:not(.in) > * { animation: show 0s 3.5s forwards; }
@keyframes show { to { opacity: 1; transform: none; } }

/* ---------- drag rows (strip, slides, gallery) ---------- */
[data-strip], [data-slides] { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; cursor: grab; -webkit-overflow-scrolling: touch; }
[data-strip]::-webkit-scrollbar, [data-slides]::-webkit-scrollbar { display: none; }
.dragging { cursor: grabbing; }
.dragging, .coasting { scroll-snap-type: none !important; }
.dragging * { pointer-events: none; }

/* ============ landing ============ */
.logo { display: block; flex: none; border-radius: 22%; }
/* The first screen leaves room for the Projects heading at its foot. */
.hero { min-height: calc(100svh - var(--bar-h) - clamp(6.5rem, 9vw, 8.5rem)); display: grid; grid-template-rows: auto 1fr; padding-bottom: 8px; }
.hero-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px clamp(28px, 5vw, 80px); padding-top: 14px; font-size: var(--step-small); text-align: center; }
.hero-facts dt { font-weight: 500; }
.hero-facts dd { color: var(--muted); }
.hero-facts a { color: var(--muted); text-decoration: none; transition: color .15s; }
.hero-facts a:hover { color: var(--ink); }
.hero-centre { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-block: clamp(40px, 6vh, 72px); }
.hero h1 { font-size: var(--step-display); letter-spacing: -0.05em; line-height: .92; }
.hero-sub { margin-top: 32px; max-width: 36ch; font-size: var(--step-lead); line-height: 1.38; color: var(--ink-2); }
.hero-apps { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(20px, 3vw, 44px); margin-top: clamp(40px, 6vh, 64px); }
.hero-app { display: grid; justify-items: center; gap: 10px; text-decoration: none; font-size: var(--step-small); color: var(--ink-2); transition: color .2s; }
.hero-app .logo { width: 64px; height: 64px; transition: transform .4s var(--spring); }
.hero-app:hover { color: var(--ink); }
.hero-app:hover .logo { transform: translateY(-5px) scale(1.06); }
.hero-app:active .logo { transform: scale(.95); transition-duration: .12s; }
.hero-centre > .btn { margin-top: clamp(36px, 5vh, 56px); }
.js .hero-facts > div, .js .hero h1, .js .hero-sub, .js .hero-app, .js .hero-centre > .btn { animation: rise 1s var(--out) both; }
.js .hero-facts > div:nth-child(2) { animation-delay: .06s; } .js .hero-facts > div:nth-child(3) { animation-delay: .12s; }
.js .hero h1 { animation-delay: .08s; } .js .hero-sub { animation-delay: .2s; }
.js .hero-app:nth-child(1) { animation-delay: .32s; } .js .hero-app:nth-child(2) { animation-delay: .38s; }
.js .hero-app:nth-child(3) { animation-delay: .44s; } .js .hero-app:nth-child(4) { animation-delay: .5s; } .js .hero-app:nth-child(n+5) { animation-delay: .56s; }
.js .hero-centre > .btn { animation-delay: .62s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes title-in { from { opacity: 0; transform: translateY(8px); } }

/* projects: one at a time, screens in order */
.projects { padding-top: 0; }
.sec-h { font-size: var(--step-head); margin-bottom: clamp(48px, 6vw, 88px); }
.proj + .proj { margin-top: clamp(104px, 11vw, 176px); }
.proj-head { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: end; }
.proj-name { grid-column: 1 / 5; display: flex; align-items: center; gap: 18px; }
.proj-name .logo { width: 64px; height: 64px; }
.proj-name h3 { font-size: var(--step-head); letter-spacing: -0.045em; line-height: .95; }
.proj-name p { font-size: var(--step-small); color: var(--muted); margin-top: 8px; }
.proj-line { grid-column: 5 / 10; color: var(--ink-2); max-width: 46ch; }
.proj-acts { grid-column: 10 / 13; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.highs { display: flex; justify-content: safe center; gap: clamp(20px, 2.6vw, 40px); margin-top: clamp(32px, 3.4vw, 48px); padding-inline: var(--m); scroll-snap-type: x proximity; scroll-padding-inline: var(--m); }
.hl { flex: 0 0 auto; width: clamp(230px, 20vw, 300px); scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hl img { width: 100%; height: auto; aspect-ratio: 780 / 1688; object-fit: cover; background: var(--surface); border-radius: clamp(22px, 2vw, 30px); transition: transform .6s var(--smooth); }
.hl:hover img { transform: translateY(-6px); }
.hl figcaption { margin-top: 18px; font-size: var(--step-small); line-height: 1.45; color: var(--muted); max-width: 30ch; }
.hl figcaption b { display: block; color: var(--ink); font-weight: 500; font-size: var(--step-body); letter-spacing: -0.01em; margin-bottom: 4px; }
.hl-hist { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: var(--step-small); font-weight: 500; transition: background-color .2s, color .2s, transform .24s var(--spring); }
.hl-hist span { color: var(--muted); font-weight: 400; }
.hl-hist:hover { background: var(--surface-3); color: var(--ink); }
.hl-hist:active { transform: scale(.95); }

/* the history of one screen */
.hist { width: min(1080px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 28px; background: var(--surface); color: var(--ink); overflow: auto; box-shadow: 0 30px 120px rgba(0, 0, 0, .6); }
.hist::backdrop { background: rgba(5, 5, 6, .78); }
.hist[open] { animation: hist-in .45s var(--out); }
.hist[open]::backdrop { animation: fade .3s ease; }
@keyframes hist-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
.hist-in { position: relative; display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 4vw, 56px); padding: clamp(24px, 3.4vw, 44px); align-items: center; }
.hist-device { position: relative; width: min(330px, 40vh, 70vw); aspect-ratio: 780 / 1688; border-radius: 30px; overflow: hidden; background: var(--bg); }
.hist-device img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.hist-app { font-size: var(--step-small); color: var(--muted); }
.hist-text h2 { font-size: var(--step-head); letter-spacing: -0.04em; margin-top: 8px; }
.hist-scrub { margin-top: 32px; touch-action: none; cursor: pointer; --v: 0; --max: 1; }
.hist-scrub .scrub-fill { width: calc(var(--v) / var(--max) * 100%); }
.hist-scrub .scrub-knob { left: calc(var(--v) / var(--max) * 100%); }
.hist-scrub:focus-visible { outline: none; }
.hist-scrub:focus-visible .scrub-knob { box-shadow: 0 0 0 4px var(--accent); }
.hist-stops { display: flex; justify-content: space-between; gap: 8px; }
.hist-stops button { border: 0; background: none; padding: 6px 0; font-size: var(--step-small); color: var(--muted); transition: color .2s; text-align: center; flex: 1; }
.hist-stops button:first-child { text-align: left; } .hist-stops button:last-child { text-align: right; }
.hist-stops button.on { color: var(--ink); font-weight: 500; }
.hist-notes { position: relative; margin-top: 28px; min-height: 7.5em; }
.hist-notes p { font-size: var(--step-lead); line-height: 1.38; color: var(--ink-2); animation: title-in .45s var(--out); }
.hist-notes p b { color: var(--ink); font-weight: 600; }
.hist-nav { display: flex; gap: 8px; margin-top: 24px; }
.hist-close { position: absolute; top: 16px; right: 16px; background: var(--surface-2); color: var(--ink); }

/* by the numbers */
.stats { margin-top: var(--sec); display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: start; }
.stats h2 { grid-column: 1 / 5; font-size: var(--step-head); }
.stat-list { grid-column: 5 / 13; display: grid; }
.stat-list li { display: flex; align-items: baseline; gap: 20px; padding-block: 16px; font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.015em; color: var(--ink-2); }
.stat-list b { flex: none; min-width: 3.4ch; text-align: right; color: var(--ink); font-weight: 600; }

/* how I work: run-in column */
.how { margin-top: var(--sec); padding-inline: var(--m); }
.how-col { max-width: 600px; margin-left: clamp(0px, calc(30vw - var(--m)), 420px); }
.how h2 { font-size: var(--step-head); margin-bottom: 48px; }
.step + .step { margin-top: 72px; }
.step > p { font-size: var(--step-body); line-height: 1.6; color: var(--ink-2); }
.step > p b { color: var(--ink); }
.step > :not(p) { margin-top: 20px; }
.ev-row { display: flex; gap: 8px; height: 112px; }
.ev-row img { height: 100%; width: auto; }
.ev-crop { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); }
.ev-crop img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.ev-log { background: var(--surface); padding: 6px 20px; }
.log-row { padding: 16px 0; }
.log-meta { font-size: var(--step-small); color: var(--muted); }
.log-title { font-weight: 500; margin-top: 2px; }
.log-text { font-size: var(--step-small); color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* about: side facts, wide paragraph */
.about { margin-top: var(--sec); }
.about-row { display: grid; grid-template-columns: 34% 1fr; }
.side-facts { display: grid; gap: 20px; align-content: start; font-size: var(--step-small); max-width: 220px; }
.side-facts dt { color: var(--muted); }
.about-text { max-width: calc(90vw - 34vw); }
.about-text h2 { font-size: var(--step-head); margin-bottom: 28px; }
.about-text p { font-size: var(--step-lead); line-height: 1.38; }
.record { margin-top: 120px; grid-template-columns: 34% 260px 64px 260px; row-gap: 18px; }
.rec-word { grid-column: 1; font-size: var(--step-small); font-weight: 500; }
.record .rec-list:nth-of-type(1) { grid-column: 2; grid-row: 1; }
.rec-word-2 { display: none; }
.record .rec-list:nth-of-type(2) { grid-column: 4; grid-row: 1; }
.rec-list li { display: flex; justify-content: space-between; gap: 12px; font-size: var(--step-small); padding-block: 5px; }
.rec-list li span:last-child { color: var(--muted); }

/* contact: blue field */
.contact { margin-top: var(--sec); background: var(--field); color: var(--field-ink); min-height: 80svh; padding: 48px 0 clamp(72px, 10vw, 140px); overflow: hidden; }
.marquee { overflow: hidden; }
.marquee-run { display: flex; gap: 8px; width: max-content; animation: marquee 80s linear infinite; }
.marquee img { height: 150px; width: auto; }
.contact:hover .marquee-run { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.contact h2 { font-size: var(--step-head); margin-top: 72px; letter-spacing: -0.04em; }
.cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 40px; }
.cell { height: 96px; background: var(--field-step); display: flex; align-items: center; justify-content: center; border-radius: 0; transition: background-color .2s, transform .24s var(--spring); }
.cell input { width: 100%; height: 100%; background: none; border: 0; outline: 0; text-align: center; font-size: var(--step-body); color: var(--field-ink); }
.cell input::placeholder { color: rgba(255, 255, 255, .78); }
.cell:focus-within { background: #fff; }
.cell:focus-within input { color: var(--field); }
.cell:focus-within input::placeholder { color: rgba(31, 69, 214, .55); }
.cell-go { border: 0; background: #fff; color: var(--field); font-size: var(--step-body); font-weight: 600; }
.cell-go:hover { background: #e8edff; }
.cell-go:active { transform: scale(.98); }
.cells-print { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; font-size: var(--step-small); color: rgba(255, 255, 255, .85); }
.cells-print p:last-child { grid-column: 3; }
.cells-print a { color: #fff; }

/* footer */
.foot { margin-top: var(--sec); padding-block: 56px 48px; background: var(--surface); display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: start; }
.foot-statement { grid-column: 1 / 5; color: var(--ink-2); max-width: 30ch; }
.foot-apps { grid-column: 6 / 9; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.foot-apps a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-2); transition: color .15s; }
.foot-apps a:hover { color: var(--ink); }
.foot-apps .logo { width: 28px; height: 28px; transition: transform .3s var(--spring); }
.foot-apps a:hover .logo { transform: scale(1.1); }
.foot-mail { grid-column: 9 / 13; display: grid; gap: 10px; justify-items: end; text-align: right; }
.foot-mail a { text-decoration: none; color: var(--ink); }
.foot-mail a:hover { text-decoration: underline; }
.page-home .foot { margin-top: 0; }

/* ============ project page ============ */
.p-head { padding-top: clamp(40px, 7vw, 96px); }
.p-title { display: flex; align-items: center; gap: clamp(16px, 2vw, 28px); }
.p-title .logo { width: clamp(56px, 6.5vw, 104px); height: auto; }
.p-head h1 { font-size: var(--step-display); letter-spacing: -0.05em; line-height: .9; }
.p-line { margin-top: 24px; font-size: var(--step-lead); line-height: 1.35; max-width: 40ch; color: var(--ink-2); }
.p-facts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; margin-top: clamp(32px, 4vw, 56px); font-size: var(--step-small); }
.p-facts dt { color: var(--muted); }
.js .p-head > * { animation: rise .9s var(--out) both; }
.js .p-head > :nth-child(2) { animation-delay: .08s; } .js .p-head > :nth-child(3) { animation-delay: .16s; }

.demo { margin-top: clamp(48px, 6vw, 88px); }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.demo-bar h2 { font-size: var(--step-lead); letter-spacing: -0.02em; margin-right: auto; }
.demo-acts { display: flex; gap: 8px; }
.seg { position: relative; display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); isolation: isolate; }
.seg button { position: relative; z-index: 1; height: 36px; padding: 0 16px; border: 0; background: none; border-radius: 999px; font-size: var(--step-small); font-weight: 500; color: var(--muted); transition: color .2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { color: var(--bg); background-color: var(--ink); transition: color .2s, background-color 0s .34s; }
.seg.moving button[aria-checked="true"] { background-color: transparent; transition: color .2s; }
.seg button[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.seg button:active:not([aria-disabled="true"]) { transform: scale(.96); }
.seg-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: var(--tw, 0); transform: translateX(var(--tx, 0)); border-radius: 999px; background: var(--ink); transition: transform .38s var(--spring-soft), width .38s var(--spring-soft); }
.seg.no-anim .seg-thumb { transition: none; }

.stage { position: relative; display: flex; justify-content: center; align-items: flex-start; margin-top: 20px; padding-inline: var(--m); height: var(--stage-h, min(80vh, 860px)); transition: height .55s var(--smooth); }
.device { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 1400px; height: min(80vh, 860px); background: var(--surface-2); border-radius: 14px; padding: 0; overflow: hidden; transform-origin: top center;
  transition: width .55s var(--smooth), max-width .55s var(--smooth), height .55s var(--smooth), border-radius .55s var(--smooth), padding .55s var(--smooth), transform .55s var(--smooth), background-color .4s; }
.device-top { flex: none; height: 40px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-inline: 16px; }
.dots { display: flex; gap: 7px; } .dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--surface-3); }
.url { font-size: var(--step-small); color: var(--muted); background: var(--surface); padding: 5px 16px; border-radius: 999px; min-width: 260px; text-align: center; }
.island { display: none; }
.screen { position: relative; flex: 1; background: #000; overflow: hidden; transition: opacity .18s, border-radius .55s var(--smooth); }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; opacity: 0; transition: opacity .5s var(--out); }
.device.ready .screen iframe { opacity: 1; }
.poster { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .5s var(--out); }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; filter: brightness(.35) blur(2px); transform: scale(1.02); }
.poster .run { position: relative; }
.device.ready .poster { opacity: 0; pointer-events: none; }
.device.loading .poster .run { opacity: .0; }
.device.loading .poster::after { content: ''; position: absolute; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.poster-phone { display: none; }
.device.morphing .screen { opacity: 0; }

/* iPhone 16 Pro: 393 x 852 points inside a 12pt bezel */
.device[data-view="phone"] { width: 417px; max-width: 417px; height: 876px; padding: 12px; border-radius: 68px; background: #1b1b1e; transform: scale(var(--s, 1)); }
.device[data-view="phone"] .device-top { position: absolute; z-index: 3; top: 23px; left: 50%; width: 124px; height: 36px; padding: 0; margin-left: -62px; display: block; border-radius: 999px; background: #000; }
.device[data-view="phone"] .device-top > * { display: none; }
.device[data-view="phone"] .screen { border-radius: 56px; }
.device[data-view="phone"] .poster-phone { display: block; object-position: top center; }
.device[data-view="phone"] .poster-desk { display: none; }
.full-close { display: none; }
.full-open { display: none; }

.demo-notes { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 48px; margin-top: 24px; }
.mode-note { font-size: var(--step-small); color: var(--ink-2); max-width: 62ch; }
.demo[data-mode="demo"] [data-note-fresh], .demo[data-mode="fresh"] [data-note-demo] { display: none; }
.mode-note { animation: title-in .4s var(--out); }
.tries { display: flex; gap: 16px; font-size: var(--step-small); }
.tries > p { color: var(--muted); flex: none; }
.tries ul { display: flex; flex-wrap: wrap; gap: 6px; }
.tries li { background: var(--surface); padding: 4px 12px; border-radius: 999px; color: var(--ink-2); }

.demo.is-full .stage { position: fixed; inset: 0; z-index: 200; height: 100dvh !important; margin: 0; padding: calc(env(safe-area-inset-top) + 56px) 0 0; background: #000; align-items: stretch; }
.demo.is-full .device { max-width: none; width: 100% !important; height: 100% !important; border-radius: 0; padding: 0; transform: none; background: #000; }
.demo.is-full .device-top { display: none; }
.demo.is-full .screen { border-radius: 0; }
.demo.is-full .full-close { display: inline-flex; position: absolute; z-index: 5; top: calc(env(safe-area-inset-top) + 8px); right: 12px; background: var(--surface-2); color: var(--ink); }
.demo.is-full .stage::before { content: attr(data-name); position: absolute; top: calc(env(safe-area-inset-top) + 16px); left: 16px; font-weight: 600; letter-spacing: -0.02em; }

.p-story { margin-top: var(--sec); display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.story-text { grid-column: 1 / 8; }
.story-text h2, .p-latest h2, .p-gallery h2 { font-size: var(--step-head); margin-bottom: 40px; }
.story-text p { max-width: 60ch; color: var(--ink-2); }
.story-text p + p { margin-top: 20px; }
.story-text b { color: var(--ink); }
.story-side { grid-column: 9 / 13; align-self: end; }
.story-side h3 { font-size: var(--step-small); color: var(--muted); font-weight: 500; letter-spacing: 0; margin-bottom: 12px; }
.dec-links { display: grid; gap: 6px; }
.dec-links a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 16px; background: var(--surface); text-decoration: none; transition: background-color .2s, transform .24s var(--spring); }
.dec-links a:hover { background: var(--surface-2); transform: translateX(4px); }
.live-link { margin-top: 20px; }

.p-latest { margin-top: var(--sec); }
.latest-src { margin-top: -28px; margin-bottom: 36px; }
.latest { display: grid; gap: 8px; }
.latest li { display: grid; grid-template-columns: 34% 1fr; gap: 20px; padding: 26px 24px; background: var(--surface); }
.l-date { font-size: var(--step-small); color: var(--muted); padding-top: 3px; }
.latest h3 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.2; }
.latest p:not(.l-date) { margin-top: 8px; color: var(--ink-2); max-width: 64ch; }

.p-gallery { margin-top: var(--sec); }
.gallery { display: flex; gap: 12px; padding-inline: var(--m); scroll-snap-type: x proximity; scroll-padding-inline: var(--m); }
.g-frame { flex: none; height: min(64vh, 640px); scroll-snap-align: start; }
.g-frame img { height: calc(100% - 32px); width: auto; transition: transform .6s var(--smooth); }
.g-frame figcaption { font-size: var(--step-small); color: var(--muted); margin-top: 10px; }

.p-next { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: center; margin-top: var(--sec); padding: clamp(56px, 7vw, 104px) var(--m); background: var(--surface); text-decoration: none; transition: background-color .3s; overflow: hidden; }
.p-next-text { grid-column: 1 / 7; }
.p-next-go { display: inline-flex; gap: 8px; margin-top: 32px; font-size: var(--step-small); font-weight: 500; color: var(--accent-text); }
.p-next-pics { grid-column: 7 / 13; display: flex; gap: 10px; justify-content: flex-end; height: clamp(260px, 30vw, 440px); }
.p-next-pics img { height: 100%; width: auto; filter: brightness(.7); transition: filter .5s, transform .7s var(--smooth); }
.p-next-pics img:nth-child(2) { transform: translateY(24px); }
.p-next:hover .p-next-pics img { filter: none; }
.p-next:hover .p-next-pics img:nth-child(2) { transform: translateY(8px); }
.p-next:hover { background: var(--surface-2); }
.p-next-name { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 24px); font-size: var(--step-display); font-weight: 600; letter-spacing: -0.05em; line-height: .95; transition: transform .5s var(--spring-soft); }
.p-next:hover .p-next-name { transform: translateX(16px); }
.p-next-name .logo { width: clamp(48px, 5.5vw, 88px); height: auto; }
.p-next-line { display: block; margin-top: 20px; max-width: 48ch; color: var(--ink-2); font-size: var(--step-lead); line-height: 1.35; }

/* ============ decisions ============ */
.d-head { padding-top: clamp(40px, 7vw, 96px); }
.d-head h1 { font-size: var(--step-display); letter-spacing: -0.05em; line-height: .92; max-width: 10em; }
.d-lead { margin-top: 28px; font-size: var(--step-lead); line-height: 1.35; max-width: 44ch; color: var(--ink-2); }
.js .d-head > * { animation: rise .9s var(--out) both; } .js .d-head > :nth-child(2) { animation-delay: .1s; }

.due { margin-top: clamp(72px, 9vw, 140px); display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; padding-inline: var(--m); }
.due-phone { grid-column: 1 / 6; position: sticky; top: calc(var(--bar-h) + 24px); align-self: start; display: grid; justify-items: center; gap: 28px; }
.due-device { position: relative; width: min(340px, 78vw); aspect-ratio: 780 / 1688; background: var(--surface); overflow: hidden; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .12s linear; }
.due-scrub { width: min(420px, 90vw); touch-action: none; cursor: pointer; }
.scrub-track { position: relative; height: 44px; }
.scrub-track::before { content: ''; position: absolute; left: 0; right: 0; top: 20px; height: 4px; border-radius: 4px; background: var(--surface-3); }
.scrub-fill { position: absolute; left: 0; top: 20px; height: 4px; border-radius: 4px; background: var(--accent); width: calc(var(--v) * 50%); }
.scrub-knob { position: absolute; top: 8px; left: calc(var(--v) * 50%); width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: var(--ink); transition: transform .24s var(--spring); }
.due-scrub:active .scrub-knob { transform: scale(1.15); }
.due-scrub:focus-visible { outline: none; }
.due-scrub:focus-visible .scrub-knob { box-shadow: 0 0 0 4px var(--accent); }
.scrub-stops { display: flex; justify-content: space-between; }
.stop { border: 0; background: none; padding: 6px 0; font-size: var(--step-small); color: var(--muted); transition: color .2s; }
.stop.on { color: var(--ink); font-weight: 500; }
.due-text { grid-column: 7 / 13; }
.case-app { color: var(--accent-text); text-decoration: none; font-weight: 500; }
.case-app:hover { text-decoration: underline; }
.due-text h2, .case h2 { font-size: var(--step-head); letter-spacing: -0.04em; }
.case-problem { margin-top: 24px; font-size: var(--step-lead); line-height: 1.38; color: var(--ink); }
.due-steps { margin-top: 40px; display: grid; gap: 28px; }
.due-step { transition: opacity .35s var(--smooth), transform .5s var(--spring-soft); opacity: .42; }
.due-step.on { opacity: 1; transform: translateX(10px); }
.due-step h3 { font-size: var(--step-body); letter-spacing: -0.01em; }
.due-step p { margin-top: 6px; font-size: var(--step-small); line-height: 1.55; color: var(--ink-2); }
.due-text > p:last-child { margin-top: 32px; color: var(--ink-2); max-width: 60ch; }
.due-text b, .case-text b { color: var(--ink); }

.case { margin-top: var(--sec); display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; padding-inline: var(--m); align-items: center; }
.case-text { grid-column: 1 / 7; }
.case-text > p:not(.case-meta):not(.case-problem) { margin-top: 20px; color: var(--ink-2); max-width: 58ch; }
.case-visual { grid-column: 8 / 13; display: flex; justify-content: center; }
.case.flip .case-text { grid-column: 7 / 13; grid-row: 1; }
.case.flip .case-visual { grid-column: 1 / 6; grid-row: 1; }
.case-shot { width: min(340px, 100%); background: var(--surface); }
.case-shot.wide { width: 100%; }
.case-shot img { width: 100%; height: auto; }

.compare { position: relative; width: min(360px, 100%); aspect-ratio: 780 / 1688; overflow: hidden; background: var(--surface); touch-action: pan-y; user-select: none; cursor: ew-resize; }
.compare img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.c-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.c-label { position: absolute; bottom: 14px; z-index: 2; font-size: var(--step-small); padding: 5px 11px; border-radius: 999px; background: rgba(12, 12, 13, .86); color: var(--ink); pointer-events: none; }
.c-l { left: 12px; } .c-r { right: 12px; }
.c-handle { position: absolute; z-index: 3; top: 0; bottom: 0; left: var(--x); width: 44px; margin-left: -22px; border: 0; background: none; padding: 0; cursor: ew-resize; touch-action: none; }
.c-handle::before { content: ''; position: absolute; top: 0; bottom: 0; left: 21px; width: 2px; background: var(--ink); }
.c-handle span { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: var(--ink); transition: transform .24s var(--spring); }
.c-handle span::before, .c-handle span::after { content: ''; position: absolute; top: 14px; border: 6px solid transparent; }
.c-handle span::before { left: 3px; border-right-color: var(--bg); }
.c-handle span::after { right: 3px; border-left-color: var(--bg); }
.compare:active .c-handle span { transform: scale(1.12); }

.d-apps { margin-top: var(--sec); padding-bottom: 8px; }
.d-apps h2 { font-size: var(--step-head); margin-bottom: 40px; }
.app-links { display: grid; }
.app-links a { display: grid; grid-template-columns: 48px 30% 1fr auto; align-items: center; gap: 20px; padding-block: 22px; text-decoration: none; color: var(--muted); transition: color .25s; }
.al-name { font-size: var(--step-head); font-weight: 600; letter-spacing: -0.045em; line-height: 1; color: var(--ink); transition: transform .45s var(--spring-soft); }
.al-kind { max-width: 46ch; }
.al-go { font-size: var(--step-lead); color: var(--accent-text); opacity: 0; transform: translateX(-12px); transition: opacity .25s, transform .4s var(--spring); }
.app-links a:hover { color: var(--ink-2); }
.app-links a:hover .al-name { transform: translateX(12px); }
.app-links .logo { width: 48px; height: 48px; }
.app-links a:hover .al-go { opacity: 1; transform: none; }


/* ============ tablet ============ */
@media (max-width: 1100px) {
  .proj-name { grid-column: 1 / 8; } .proj-acts { grid-column: 8 / 13; grid-row: 1; } .proj-line { grid-column: 1 / 13; grid-row: 2; }
  .stats h2, .stat-list { grid-column: 1 / 13; }
  .foot-statement { grid-column: 1 / 7; } .foot-apps { grid-column: 7 / 13; } .foot-mail { grid-column: 1 / 13; justify-items: start; text-align: left; }
  .p-facts { grid-template-columns: repeat(3, 1fr); }
  .case { grid-template-columns: 1fr; gap: 40px; }
  .case-text, .case-visual, .case.flip .case-text, .case.flip .case-visual { grid-column: 1; grid-row: auto; }
  .due { grid-template-columns: 1fr; }
  .due-phone { grid-column: 1; position: relative; top: 0; }
  .due-text { grid-column: 1; margin-top: 24px; }
  .p-next-text { grid-column: 1 / 8; } .p-next-pics { grid-column: 8 / 13; }
  .record { grid-template-columns: 34% 1fr; }
  .record .rec-list:nth-of-type(1) { grid-column: 2; grid-row: 1; }
  .rec-word-2 { display: block; grid-column: 1; grid-row: 2; }
  .record .rec-list:nth-of-type(2) { grid-column: 2; grid-row: 2; }
}

/* ============ phone ============ */
@media (max-width: 767px) {
  :root { --bar-h: 56px; }
  .bar { grid-template-columns: auto 1fr auto; }
  .bar nav { justify-content: flex-end; gap: 18px; }
  .bar .btn { display: none; }
  .hero { min-height: calc(100svh - var(--bar-h)); }
  .hero-facts { grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .hero h1 { font-size: clamp(2.6rem, 11vw, 4rem); }
  .hero-sub { margin-top: 22px; }
  .hero-apps { gap: 18px 22px; }
  .hero-app .logo { width: 54px; height: 54px; }
  .proj-head { grid-template-columns: 1fr; gap: 16px; }
  .proj-name, .proj-line, .proj-acts { grid-column: 1 !important; grid-row: auto !important; }
  .proj-acts { flex-direction: row; align-items: center; gap: 20px; }
  .proj-name .logo { width: 52px; height: 52px; }
  .highs { justify-content: flex-start; }
  .hl { width: 64vw; }
  .hist-in { grid-template-columns: 1fr; justify-items: center; padding-top: 64px; }
  .hist-device { width: min(260px, 62vw); }
  .hist-text { width: 100%; }
  .proj + .proj { margin-top: 88px; }
  .stats { grid-template-columns: 1fr; }
  .stat-list li { gap: 14px; padding-block: 12px; }
  .foot { grid-template-columns: 1fr; gap: 32px; }
  .foot-statement, .foot-apps, .foot-mail { grid-column: 1; }
  .foot-mail { justify-items: start; text-align: left; }
  .how-col { margin-left: 0; }
  .step + .step { margin-top: 56px; }
  .ev-row { height: 88px; overflow-x: auto; scrollbar-width: none; }
  .about-row { grid-template-columns: 1fr; gap: 32px; }
  .about-row .side-facts { order: 2; grid-template-columns: 1fr 1fr; max-width: none; font-size: 14px; }
  .about-text { max-width: none; }
  .record { margin-top: 56px; grid-template-columns: 1fr; row-gap: 10px; }
  .record > * { grid-column: 1 !important; grid-row: auto !important; }
  .rec-word, .rec-word-2 { display: block; color: var(--ink); }
  .rec-word-2 { margin-top: 30px; }
  .contact { min-height: auto; padding-top: 32px; }
  .marquee img { height: 110px; }
  .contact h2 { font-size: 9vw; margin-top: 48px; }
  .cells { grid-template-columns: 1fr; }
  .cell { height: 60px; }
  .cells-print { grid-template-columns: 1fr; }
  .cells-print p:last-child { grid-column: 1; }

  .p-facts { grid-template-columns: 1fr 1fr; gap: 14px; }
  .p-facts > div:last-child { display: none; }
  .demo-bar h2 { width: 100%; }
  .seg[data-seg="view"] { display: none; }
  .demo-acts .btn[data-act="open"] { display: none; }
  .stage { height: auto !important; }
  .device, .device[data-view="phone"] { width: 100%; max-width: none; height: 74svh; padding: 0; border-radius: 22px; transform: none; background: #000; }
  .device[data-view="phone"] .device-top, .device-top { display: none; }
  .device[data-view="phone"] .screen { border-radius: 22px; }
  .poster-desk { display: none; } .poster-phone { display: block; object-position: top center; }
  .full-open { display: inline-flex; justify-self: start; }
  .demo-notes { grid-template-columns: 1fr; }
  .tries { flex-direction: column; gap: 8px; }
  .p-story { grid-template-columns: 1fr; }
  .story-text, .story-side { grid-column: 1; }
  .latest li { grid-template-columns: 1fr; gap: 6px; }
  .g-frame { height: 62vh; }

  .due { grid-template-columns: 1fr; }
  .due-phone { grid-column: 1; position: relative; top: 0; }
  .due-text { grid-column: 1; margin-top: 24px; }
  .case { grid-template-columns: 1fr; gap: 32px; }
  .case-text, .case-visual, .case.flip .case-text, .case.flip .case-visual { grid-column: 1; grid-row: auto; }
  .app-links a { grid-template-columns: 1fr; gap: 6px; }
  .al-go { display: none; }
  .p-next { grid-template-columns: 1fr; }
  .p-next-text, .p-next-pics { grid-column: 1; }
  .p-next-pics { justify-content: flex-start; height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .js [data-reveal] > * { transform: none; }
  .marquee-run { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
