/* Playlist site — paper, ink, two dark rails, ruled lines. Colors from Eliecraft Studio (deep green ink, periwinkle) on white paper. */
:root {
  --paper: #ffffff;
  --ink: #213a31;
  --muted: #5d6a63;
  --line: rgba(33, 58, 49, 0.14);
  --accent: #c5d4f6;
  --rail: 20px;
  --rail-gap: 12px;
  --gutter: calc(var(--rail) + var(--rail-gap) * 2 + 4px);
  --row: calc(100vh / 8); /* ruled-line spacing on the home stage */
  --serif: "Instrument Serif", "Times New Roman", serif;
  --label: "Inika", "Times New Roman", serif; /* secondary serif: role line and small labels, sized to take the same space Instrument Serif did */
  --hand: "Caveat", cursive;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mono { font-family: var(--label); font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; } /* small uppercase labels in Inika (Instrument Serif for titles and text, Caveat for notes) */
.hand { font-family: var(--hand); font-size: 26px; line-height: 1; } /* every Caveat note is 26px */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1px dashed currentColor; outline-offset: 3px; }

/* ---------- Rails ---------- */
.rail {
  position: fixed; top: var(--rail-gap); bottom: var(--rail-gap); width: var(--rail);
  background: var(--ink); color: var(--paper); z-index: 60;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  padding: 10px 0;
  font-family: var(--label); font-size: 15px; line-height: 1; letter-spacing: 0.08em; text-transform: uppercase;
}
.rail > * { writing-mode: vertical-rl; white-space: nowrap; }
.rail-l { left: var(--rail-gap); }
.rail-l > * { transform: rotate(180deg); }
.rail-l .logo { display: flex; align-items: center; gap: 8px; }
.rail-l .logo .mark { width: 12px; height: 12px; fill: currentColor; flex: none; transform: rotate(180deg); }
.rail-l .logo:hover .mark { fill: var(--accent); }
.rail-r { right: var(--rail-gap); }
.rail-r .toggles { display: flex; flex-direction: row; gap: 26vh; align-items: center; }
.toggle { display: flex; align-items: center; gap: 6px; }
.toggle span { padding: 6px 1px; border-radius: 99px; transition: background 0.3s, color 0.3s; }
.toggle span.on { background: var(--accent); color: var(--ink); }

/* ---------- Ruled page ---------- */
.ruled {
  background-image: repeating-linear-gradient(to bottom, transparent 0 74px, var(--line) 74px 75px);
  background-position: 0 0;
}
body:not([data-page="home"]) main { padding: 0 var(--gutter); }

/* ---------- Annotations ---------- */
.anno { transition: opacity 0.4s; }
body.no-anno .anno { opacity: 0; pointer-events: none; }
.scroll-note { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: 150px; height: 44px; display: grid; place-items: center; z-index: 5; }
.scroll-note svg { position: absolute; inset: 0; overflow: visible; }
.scroll-note path { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw 1.4s 0.4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Home stage ---------- */
.track { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage-lines { position: absolute; inset: 0 var(--gutter); background: linear-gradient(to bottom, transparent calc(100% - 1px), var(--line) calc(100% - 1px)) 0 0 / 100% var(--row) repeat-y; }

.big-title {
  position: absolute; left: 0; top: calc(var(--row) * 2.5 - 0.5em); z-index: 6; margin: 0; font-weight: 400;
  font-size: clamp(19px, 2.4vw, 46px); line-height: 1.1; text-transform: uppercase; letter-spacing: -0.02em;
  background: var(--paper); padding: 0 0.16em; white-space: nowrap; overflow: hidden; will-change: transform;
}
.big-title sup { font-size: 0.44em; line-height: 1; vertical-align: top; position: relative; top: 0.2em; margin-left: 0.15em; letter-spacing: 0; }
.big-title .roll { display: inline-block; transition: transform 0.7s var(--ease), opacity 0.7s; }
.big-title.out .roll { transform: translateY(-105%); opacity: 0; }
.big-title.in .roll { transform: translateY(105%); opacity: 0; transition: none; }

.stage-tag {
  position: absolute; left: 50%; top: var(--row); height: var(--row); width: min(36ch, calc(100% - 2 * var(--gutter) - 24px)); transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; margin: 0; z-index: 6; text-align: center;
  font-size: clamp(21px, 2.1vw, 30px); line-height: 1.2; transition: opacity 0.6s, transform 0.6s var(--ease);
}
.stage-tag.gone { opacity: 0; transform: translate(-50%, -12px); pointer-events: none; }
.playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; will-change: transform; background: var(--ink); z-index: 7; pointer-events: none; }
.playhead::before, .playhead::after { content: ""; position: absolute; left: -4px; border: 4px solid transparent; }
.playhead::before { top: 0; border-top-color: var(--ink); }
.playhead::after { bottom: 0; border-bottom-color: var(--ink); }

.filmstrip { position: absolute; top: calc(var(--row) * 4); left: 0; height: 28px; margin-top: -14px; display: flex; z-index: 3; will-change: transform; }
.filmstrip .frame { height: 28px; flex: none; overflow: hidden; background: #ddd; }
.filmstrip .frame img, .filmstrip .frame .cover { width: 100%; height: 100%; object-fit: cover; }
.filmstrip .frame .cover * { display: none; }

.cluster { position: absolute; top: 0; bottom: 0; left: 0; width: 0; z-index: 4; pointer-events: none; --tile-scale: 1; will-change: transform; }
.tile {
  position: absolute; overflow: hidden; background: #e9e9e9; box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  opacity: 0; transform: translate3d(0, 40px, 0) scale(0.96);
  transition: opacity 0.7s var(--ease), transform 0.9s var(--ease);
  will-change: transform, opacity;
}
.tile.show { opacity: 1; transform: translate3d(var(--px, 0px), var(--py, 0px), 0) scale(1); }
.tile.leave { opacity: 0; transform: translate3d(0, -60px, 0) scale(0.98); transition-duration: 0.45s; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
/* app screens (1440×1024): the white nav bar ends 92.2% down, so scale the screen to fill the
   tile from the header down to the nav, and the strip of background under the nav falls off the bottom */
.tile img.crop-nav { position: absolute; top: 0; left: 50%; height: 108.45%; width: auto; min-width: 100%; transform: translateX(-50%); object-fit: cover; object-position: 50% 0 !important; }
.tile.show { transition: opacity 0.7s var(--ease), transform 0.12s linear; }
/* the hero's composition, reusable: the laptop centred on the soft wash, sized as on the case study */
.device-stage { position: absolute; inset: 0; container-type: size; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 15% 10%, #dfe8f7 0%, rgba(223, 232, 247, 0) 60%), radial-gradient(100% 90% at 90% 100%, #eef1d9 0%, rgba(238, 241, 217, 0) 60%), #f4f6f8; }
.device-stage .device { width: min(80cqw, 131cqh); margin-top: 1cqh; }
/* on the small home tiles the laptop fills more of the frame, with a band of the wash still around it */
.tile .device-stage .device { width: min(90cqw, 145cqh); margin-top: 0; }
.device-stage .device-screen img { object-position: 50% 15% !important; }
/* shadow in container units so a small tile, the full-screen hold and the hero all look like one picture at different sizes */
.device-stage .device-frame, .study-hero .device-frame { object-fit: fill !important; filter: drop-shadow(0 5.5cqh 7.5cqh rgba(15, 25, 45, 0.28)); }
.dv-device .dv-scrim { display: none; }

/* Generated covers for projects without images */
.cover { position: relative; width: 100%; height: 100%; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 20% 15%, var(--g1) 0%, transparent 55%), radial-gradient(100% 80% at 85% 90%, var(--g2) 0%, transparent 60%), var(--base); }
.cover .m-circle { position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%; background: var(--g1); right: 10%; top: 18%; mix-blend-mode: screen; opacity: 0.85; }
.cover .m-ui { position: absolute; inset: 16% 14%; background: rgba(255,255,255,0.92); border-radius: 6px; padding: 9% 8%; display: flex; flex-direction: column; gap: 7%; }
.cover .m-ui i { display: block; height: 7%; border-radius: 3px; background: var(--base); opacity: 0.18; }
.cover .m-ui i:first-child { width: 55%; height: 12%; opacity: 0.85; background: var(--g2); }
.cover .m-ui i:nth-child(3) { width: 80%; }
.cover .m-type { position: absolute; left: 8%; bottom: 4%; font-family: var(--serif); font-size: clamp(40px, 9vw, 120px); line-height: 0.8; color: var(--g1); }
.cover .m-stripes { position: absolute; inset: 0; background: repeating-linear-gradient(115deg, transparent 0 14px, rgba(255,255,255,0.14) 14px 16px); }
.cover .m-label { position: absolute; left: 8%; top: 8%; font-family: var(--label); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; }

.stage-bar { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 20px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; z-index: 8; font-size: 15px; letter-spacing: 0; text-transform: none; }
.ticker { display: inline-block; height: 24px; line-height: 24px; overflow: hidden; vertical-align: bottom; transition: width 0.7s var(--ease); }
.ticker-list { display: flex; flex-direction: column; transition: transform 0.7s var(--ease); }
.ticker-list span { height: 24px; align-self: flex-start; white-space: nowrap; }
.stage-bar .num { padding-left: 6%; }
.stage-bar .now { position: relative; text-align: center; justify-self: center; }
/* Project picker (dropdown): the list sits above the now-playing button; its gray panel wipes up and covers the button */
.now-bt { position: relative; padding: 8px 16px; margin: -8px -16px; white-space: nowrap; transition: background 0.3s; }
.now-bt:hover, .now-bt.on { background: var(--paper-2); }
.picker { position: absolute; bottom: calc(100% + 8px); left: -16px; min-width: calc(100% + 32px); margin: 0; padding: 12px 16px 0; list-style: none; text-align: left; white-space: nowrap; isolation: isolate; visibility: hidden; pointer-events: none; transition: visibility 0.6s; }
.picker.on { visibility: visible; pointer-events: auto; transition: visibility 0s; }
.pk-bg { position: absolute; z-index: -1; inset: 0 0 calc(-1 * var(--ext, 0px)) 0; background: var(--paper-2); clip-path: inset(100% 0 0 0); transition: clip-path 0.65s cubic-bezier(0.5, 0, 0.15, 1); }
.picker.on .pk-bg { clip-path: inset(0); }
.picker li { opacity: 0; transition: opacity 0.25s ease-out; }
.picker.on li { opacity: 1; transition-delay: 0.2s; }
.pk-i { display: block; padding: 7px 0; text-align: left; }
.pk-i.off { display: none; }
.pk-m { visibility: hidden; }
.pk-i > span:last-child { display: inline-block; transition: letter-spacing 1.4s var(--ease); }
.pk-i:hover > span:last-child, .pk-i:focus-visible > span:last-child { letter-spacing: 0.2em; }
.stage-bar .view { justify-self: end; margin-right: 8%; position: relative; }
.stage-bar .view a { border-bottom: 1px solid transparent; transition: border-color 0.3s; }
.stage-bar .view a:hover { border-color: currentColor; }
.more-note { position: absolute; right: 30px; bottom: 22px; display: flex; align-items: flex-start; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.more-note svg { width: 40px; height: 36px; margin-left: -2px; margin-top: 10px; }
.more-note path { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; }

.track-hit { position: absolute; z-index: 5; left: var(--gutter); right: var(--gutter); top: 8%; bottom: 12%; }

/* ---------- Menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 55; background: var(--ink); color: var(--paper);
  padding: 0 var(--gutter); display: flex; flex-direction: column; justify-content: center;
  clip-path: inset(0 0 100% 0); transition: clip-path 0.8s var(--ease), visibility 0s 0.8s; visibility: hidden;
}
body.menu-open .menu { clip-path: inset(0 0 0 0); visibility: visible; transition: none; } /* opens covering the whole screen at once, so the page never shows through; the words still rise in, and closing still wipes up */
body.menu-open .rail { background: var(--ink); color: rgba(255,255,255,0.75); }
/* Page changes from the menu: words fade, the screen stays dark, then the new page's cover wipes up like the menu closing. */
body.leaving .menu nav, body.leaving .menu-foot { opacity: 0; transition: opacity 0.25s; }
html.via-menu body { background: var(--ink); }
html.via-menu main { visibility: hidden; }
.page-cover { position: fixed; inset: 0; z-index: 55; background: var(--ink); pointer-events: none; clip-path: inset(0 0 0 0); transition: clip-path 0.8s var(--ease); }
.page-cover.out { clip-path: inset(0 0 100% 0); }
body.menu-open .toggle span.on { background: var(--accent); color: var(--ink); }
.menu nav { display: flex; flex-direction: column; }
.m-row { border-top: 1px solid rgba(255,255,255,0.13); display: flex; justify-content: center; }
.m-row:last-child { border-bottom: 1px solid rgba(255,255,255,0.13); }
.m-row + .m-row { margin-top: 14px; }
.menu nav a {
  position: relative; display: inline-flex; align-items: flex-start;
  font-size: clamp(48px, 9vw, 112px); line-height: 0.9; text-transform: uppercase; padding: 0.04em 0 0;
  transform: translateY(40px); opacity: 0; transition: transform 0.9s var(--ease), opacity 0.9s;
}
.menu nav a small { position: absolute; right: calc(100% + 8px); top: 0; font-family: var(--serif); font-size: 16px; letter-spacing: 0; padding-top: 0.6em; transition: transform 0.6s var(--ease); }
.menu nav .word { display: inline-block; transition: letter-spacing 0.7s var(--ease); animation: word-trail-out 1s var(--ease); }
.menu nav a:hover .word, .menu nav a:focus-visible .word { letter-spacing: 0.32em; margin-right: -0.32em; animation: word-trail-in 1s var(--ease); }
/* As a word spreads (or settles back), its letters leave a very faint periwinkle trail that fades as it lands */
@keyframes word-trail-in { 0% { text-shadow: 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent; } 25% { text-shadow: -0.040em 0 1px rgba(197, 212, 246, 0.18), -0.080em 0 1px rgba(197, 212, 246, 0.14), -0.120em 0 1px rgba(197, 212, 246, 0.11), -0.160em 0 1px rgba(197, 212, 246, 0.085), -0.200em 0 1px rgba(197, 212, 246, 0.067), -0.240em 0 1px rgba(197, 212, 246, 0.052), -0.280em 0 1px rgba(197, 212, 246, 0.041), -0.320em 0 1px rgba(197, 212, 246, 0.032); } 100% { text-shadow: 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent; } }
@keyframes word-trail-out { 0% { text-shadow: 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent; } 25% { text-shadow: 0.040em 0 1px rgba(197, 212, 246, 0.18), 0.080em 0 1px rgba(197, 212, 246, 0.14), 0.120em 0 1px rgba(197, 212, 246, 0.11), 0.160em 0 1px rgba(197, 212, 246, 0.085), 0.200em 0 1px rgba(197, 212, 246, 0.067), 0.240em 0 1px rgba(197, 212, 246, 0.052), 0.280em 0 1px rgba(197, 212, 246, 0.041), 0.320em 0 1px rgba(197, 212, 246, 0.032); } 100% { text-shadow: 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent; } }
.menu nav a[aria-current="page"] .word { font-style: italic; }
.m-note { position: absolute; text-transform: none; font-size: 26px; white-space: nowrap; opacity: 0; transition: opacity 0.6s 0.6s; }
body.menu-open .m-note { opacity: 1; }
body.no-anno .m-note { opacity: 0; }
.m-note.n-tr { right: -0.4em; top: -1.23em; } /* sits clear above the row line, as in the Figma menu */
.m-note.n-l { left: -1.75em; top: 0.3em; } /* notes tucked in close to their words, as in the Figma menu */
.m-note.n-br { right: -2.25em; bottom: -0.26em; }
.m-note.n-b { left: 52%; bottom: -1.03em; }
body.menu-open .menu nav a { transform: none; opacity: 1; }
body.menu-open .m-row:nth-child(2) a { transition-delay: 0.06s; }
body.menu-open .m-row:nth-child(3) a { transition-delay: 0.12s; }
body.menu-open .m-row:nth-child(4) a { transition-delay: 0.18s; }
.menu-foot { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 14px; display: grid; grid-template-columns: 1fr 1fr 1fr; text-transform: none; letter-spacing: 0.04em; }
.menu-foot a { padding-left: 8%; }
.menu-foot a:nth-child(2) { text-align: center; padding: 0; }
.menu-foot a:nth-child(3) { text-align: right; padding: 0 8% 0 0; }
.menu-foot a:hover { text-decoration: underline; }

/* ---------- Opening a project (home → case study) ----------
   One continuous move: the room darkens and the project's first image grows out of its collage tile to
   fill the screen while its title rises (a drawn rule, a small line naming the project, the title). It
   holds a beat, then smoothly shrinks into exactly where the case study's hero image sits as the room
   turns to the page's white. The case study then appears around it. Motion is driven from home.js. */
.develop { position: fixed; inset: 0; z-index: 90; background: transparent; } /* catches clicks so nothing underneath is pressed mid-move */
.dv-box { position: absolute; overflow: hidden; background: var(--paper-2); }
.dv-img { position: absolute; inset: 0; }
.dv-img img, .dv-img .cover { width: 100%; height: 100%; object-fit: cover; }
.dv-scrim { position: absolute; inset: 0; opacity: 0; background: linear-gradient(to top, rgba(14, 24, 20, 0.7) 0%, rgba(14, 24, 20, 0.25) 32%, transparent 55%); }
.dv-meta { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 6vh; color: var(--paper); transition: opacity 0.35s; }
.dv-kicker { position: relative; display: flex; gap: 2.2em; margin: 0 0 14px; padding-top: 12px; opacity: 0; transform: translateY(8px); transition: opacity 0.5s 0.15s, transform 0.7s 0.15s var(--ease); }
.dv-kicker::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: rgba(255, 255, 255, 0.45); transform: scaleX(0); transform-origin: left; transition: transform 0.9s var(--ease); }
.dv-title { margin: 0; overflow: hidden; font-weight: 400; font-size: clamp(56px, 10vw, 160px); line-height: 0.86; text-transform: uppercase; letter-spacing: -0.01em; }
.dv-title span { display: block; padding-top: 0.06em; transform: translateY(105%); transition: transform 0.9s 0.15s var(--ease); }
.dv-meta.on .dv-kicker { opacity: 1; transform: none; }
.dv-meta.on .dv-kicker::before, .dv-meta.on .dv-title span { transform: none; }
.dv-meta.off { opacity: 0; }
/* The playhead, as on the home stage: a hairline with small triangles top and bottom, swept from home.js */
.dv-head { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--paper); opacity: 0; will-change: transform; }
.dv-head::before, .dv-head::after { content: ""; position: absolute; left: -4px; border: 4px solid transparent; }
.dv-head::before { top: 0; border-top-color: var(--paper); }
.dv-head::after { bottom: 0; border-bottom-color: var(--paper); }
/* The arriving page sits under the image (on the page's white, at the hero's spot) until it's ready */
html.via-develop body { background: var(--paper); }
html.via-develop main { visibility: hidden; }
.develop.arrive { background: var(--paper); transition: opacity 0.5s var(--ease); }
.develop.arrive.out { opacity: 0; }
/* the tile's own picture over the box at the start, and the hero's first frame on the screen at the end */
.dv-from { position: absolute; inset: 0; z-index: 2; overflow: hidden; background: var(--paper-2); }
.dv-from > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dv-from img.crop-nav { position: absolute; }
.device-screen > .dv-land { position: absolute; inset: 0; opacity: 0; }
.develop.arrive .dv-land { opacity: 1; }
/* the flying image uses the hero's own device size, position and backdrop, so it lands on the real hero with no jump */
.dv-box .device-stage .device--display { width: min(62cqw, 100cqh); margin-top: 0; translate: 0 3%; }
.dv-box .device-stage.has-wash { background: radial-gradient(60% 55% at 50% 38%, rgba(250, 250, 251, 0.9), rgba(250, 250, 251, 0) 100%), var(--wash-bg, #e6e7e9) !important; }

/* ---------- Preloader ---------- */
.loader { position: fixed; inset: 0; z-index: 100; background: var(--ink); color: var(--paper); display: flex; flex-direction: column; justify-content: center; gap: 22px; overflow: hidden; transition: clip-path 1s var(--ease); clip-path: inset(0 0 0 0); }
.loader.done { clip-path: inset(0 0 100% 0); }
.loader .block { border-top: 1px solid rgba(255,255,255,0.16); border-bottom: 1px solid rgba(255,255,255,0.16); padding: 8px 0; }
/* Each line types in from the left, dragging fading periwinkle copies of itself behind it, then rests */
.loader .line { font-size: clamp(18px, 2.05vw, 28px); line-height: 1; letter-spacing: -0.02em; text-transform: uppercase; white-space: nowrap; animation: type-in 3.6s var(--ease) infinite both; }
.loader .line:nth-child(2) { animation-delay: 0.25s; }
.loader .line:nth-child(3) { animation-delay: 0.5s; }
.loader .line:nth-child(4) { animation-delay: 0.75s; }
.loader .line:nth-child(5) { animation-delay: 1s; }
.loader .block:nth-child(2) .line { animation-duration: 4.1s; }
.loader .block:nth-child(3) .line { animation-duration: 4.6s; }
@keyframes type-in {
  0% { transform: translateX(-16vw); opacity: 0; text-shadow: none; }
  8% { opacity: 1; text-shadow: -0.45em 0 rgba(197,212,246,0.42), -0.9em 0 rgba(197,212,246,0.3), -1.35em 0 rgba(197,212,246,0.2), -1.8em 0 rgba(197,212,246,0.12), -2.25em 0 rgba(197,212,246,0.06); }
  42% { transform: translateX(0); text-shadow: 0 0 rgba(197,212,246,0), 0 0 rgba(197,212,246,0), 0 0 rgba(197,212,246,0), 0 0 rgba(197,212,246,0), 0 0 rgba(197,212,246,0); }
  100% { transform: translateX(0); opacity: 1; }
}
/* Logo tiles moving into the mark beside the percentage (Eliecraft Studio splash) */
.loader .l-mark { --s: 28px; position: relative; display: block; width: var(--s); height: var(--s); flex: none; color: var(--accent); }
.loader .lt { position: absolute; width: calc(100% / 2.08); aspect-ratio: 1; }
.loader .lt svg { display: block; width: 100%; height: 100%; fill: currentColor; overflow: visible; }
.loader .lt-1, .loader .lt-3 { left: calc(100% * 1.08 / 2.08); }
.loader .lt-2, .loader .lt-3 { top: calc(100% * 1.08 / 2.08); }
.loader .pct { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; transition: opacity 0.5s; }
.loader .pct b { font-weight: 400; min-width: 4ch; }
.loader .blocks { display: flex; flex-direction: column; gap: 22px; transition: opacity 0.6s, transform 0.9s var(--ease); }
.loader.ready .blocks { opacity: 0; transform: translateY(-30px); pointer-events: none; }
.loader.ready .pct { opacity: 0; }
html.locked, html.locked body { overflow: hidden; }

/* Splash: appears once loading reaches 100% */
.splash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 var(--gutter); visibility: hidden; }
.loader.ready .splash { visibility: visible; }
.s-top { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.8s 0.5s; }
.s-name { font-weight: 400; margin: 0; font-size: clamp(64px, 15vw, 230px); line-height: 0.8; text-transform: uppercase; letter-spacing: -0.01em; }
.s-name span { display: block; overflow: hidden; padding-top: 0.06em; }
.s-name i { display: block; font-style: normal; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.s-name span:nth-child(2) i { transition-delay: 0.1s; font-style: italic; color: var(--accent); }
.s-role { margin: 28px 0 0; font-size: clamp(15px, 1.9vw, 26px); line-height: 1.4; text-wrap: balance; font-weight: 400; letter-spacing: 0.16em; opacity: 0; transition: opacity 0.8s 0.5s; }
.s-play { position: relative; width: 126px; height: 126px; margin-top: 28px; border-radius: 50%; display: grid; place-items: center; opacity: 0; transform: scale(0.85); transition: opacity 0.8s 0.6s, transform 0.8s 0.6s var(--ease); }
.s-play svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: spin 14s linear infinite; }
.s-play text { fill: var(--paper); font-family: var(--label); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }
.s-play::before { content: ""; position: absolute; inset: 22px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.4); transition: background 0.4s, border-color 0.4s; }
.s-tri { position: relative; display: grid; transition: color 0.4s; }
.s-play .s-tri svg { position: static; width: 30px; height: 30px; animation: none; fill: none; stroke: currentColor; stroke-width: 1.2; transition: transform 0.8s var(--ease); }
.s-play:hover .s-tri svg { transform: rotate(60deg); }
.s-play:hover::before { background: var(--paper); border-color: var(--paper); } /* hover only; the button is focused on load */
.s-play:hover .s-tri { color: var(--ink); }
.s-play:hover svg { animation-duration: 5s; }
.s-play, .s-play:focus-visible { outline: 1px dashed var(--paper); outline-offset: 3px; } /* the dashed circle, always on */
@keyframes spin { to { transform: rotate(360deg); } }
.s-hint { margin-top: 24px; font-size: 26px; opacity: 0; transition: opacity 0.8s 0.9s; }
.s-quiet { margin-top: 14px; color: rgba(255,255,255,0.85); text-decoration: underline; text-underline-offset: 3px; opacity: 0; transition: opacity 0.8s 0.9s, color 0.3s; }
.s-quiet:hover { color: var(--paper); }
.s-foot { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 12px; display: flex; justify-content: space-between; opacity: 0; transition: opacity 0.8s 0.7s; }
/* The loader and splash labels stay a size smaller than the rest of the site */
.loader .pct, .s-top, .s-quiet, .s-foot { font-size: 14px; }
.loader.ready .s-name i { transform: none; }
.loader.ready .s-top, .loader.ready .s-role, .loader.ready .s-quiet, .loader.ready .s-foot { opacity: 1; }
.loader.ready .s-hint { opacity: 1; }
body.no-anno .loader .s-hint { opacity: 0; }
.loader.ready .s-play { opacity: 1; transform: none; }
/* Splash as a digicam's LCD screen, layered on top (nothing moves): faint scanlines, darker edges,
   fine moving grain, and a slight red-blue lens fringe on the name */
.splash::before, .splash::after { content: ""; position: absolute; pointer-events: none; opacity: 0; transition: opacity 0.8s 0.6s; }
.splash::before { inset: 0; z-index: 1; background: radial-gradient(ellipse at center, transparent 65%, rgba(0, 0, 0, 0.22) 100%), repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 3px); }
.splash::after { inset: -50%; z-index: 1; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: lcd-grain 0.6s steps(3) infinite; }
.loader.ready .splash::before { opacity: 1; }
.loader.ready .splash::after { opacity: 0.04; }
@keyframes lcd-grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } 100% { transform: translate(0, 0); } }
.splash > * { position: relative; z-index: 2; }
.splash > .s-top, .splash > .s-foot { position: absolute; }
.loader.ready .s-name i { text-shadow: -1px 0 rgba(255, 60, 90, 0.22), 1px 0 rgba(60, 200, 255, 0.22); }

/* ---------- Work: sliding strips on ruled rows ---------- */
body[data-page="work"] main { padding: 0; }
.work { position: relative; overflow-x: clip; --wrow: max(56px, calc(100vh / 11)); padding: calc(var(--wrow) * 1.2) 0 var(--wrow); min-height: 100vh; }
.work .scroll-note { position: fixed; z-index: 20; }
.w-rows { list-style: none; margin: 0 var(--gutter); padding: 0; }
.w-row { position: relative; height: var(--wrow); border-bottom: 1px solid var(--line); }
.w-row:first-child { border-top: 1px solid var(--line); }
.w-strip { position: absolute; left: calc(var(--gutter) * -1); top: 5px; bottom: 5px; display: flex; align-items: stretch; will-change: transform; }
.w-strip .shot { height: 100%; aspect-ratio: var(--ar); overflow: hidden; background: #e9e9e9; flex: none; }
.w-strip .shot img, .w-strip .shot .cover { width: 100%; height: 100%; object-fit: cover; }
.w-strip .shot .cover * { display: none; }
.w-strip .w-no { align-self: flex-end; font-size: 15px; padding: 0 6px; letter-spacing: 0; }
.w-strip:hover .shot { filter: grayscale(1); }
.w-strip:hover .shot:hover { filter: none; }
.w-title { position: absolute; left: calc(var(--gutter) * -1); top: 50%; margin-top: -13px; z-index: 3; font-size: 26px; line-height: 26px; text-transform: uppercase; letter-spacing: -0.02em;
  background: var(--paper); padding: 0 4px 0 3px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.25s; }
.w-title.on { opacity: 1; }
.w-title sup { font-size: 14px; vertical-align: top; position: relative; top: -2px; }
.w-head { position: fixed; left: var(--gutter); }

/* Lab keeps the plain heading layout */
body[data-page="lab"] .work { padding: 75px 0 120px; }
.work-head { display: grid; grid-template-columns: 1fr auto; align-items: end; height: 150px; padding-bottom: 6px; }
.work-head h1 { margin: 0; font-weight: 400; font-size: clamp(56px, 10vw, 140px); line-height: 0.8; text-transform: uppercase; }
.hover-peek { position: fixed; z-index: 40; width: 260px; aspect-ratio: 4 / 3; pointer-events: none; overflow: hidden; opacity: 0; transform: translate(-50%, -50%) scale(0.9); transition: opacity 0.3s, transform 0.3s var(--ease); }
.hover-peek.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.hover-peek img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Text pages (about, project, lab) ---------- */
.center { text-align: center; }
.hero-about { padding-top: 34px; display: flex; flex-direction: column; align-items: center; }
.hero-about .role { margin-top: 6px; height: 34px; font-family: var(--label); font-size: 15px; }
/* ---------- About: my corner ----------
   The portrait in a rounded tile with a "that's me" tag, and camera and playlist
   objects floating around it with soft shadows. Objects bob gently, drift with the cursor (from pages.js),
   and lift with a handwritten label on hover; tapping the portrait fires the shutter and scatters stickers. */
.corner { --tile: clamp(210px, min(22vw, 32vh), 300px); --spread: 1; position: relative; width: min(920px, 100%); height: calc(var(--tile) * 1.5); margin: 10px auto 0; } /* sized by width and height, so the whole corner fits the first screen */
.c-tile { position: absolute; left: 50%; top: 50%; width: var(--tile); aspect-ratio: 220 / 260; transform: translate(-50%, -50%) rotate(-1.5deg);
  border-radius: 28px; overflow: hidden; padding: 0; z-index: 3; background: var(--paper-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 30px 50px -28px rgba(20, 30, 26, 0.55), 0 6px 14px -8px rgba(20, 30, 26, 0.35);
  transition: transform 0.6s var(--ease); }
.c-tile:hover { transform: translate(-50%, -50%) rotate(0deg) scale(1.02); }
.c-tile img { width: 100%; height: 100%; object-fit: cover; object-position: center 65%; } /* framed a little lower, so the photo sits higher in the tile */
.c-tile::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.c-tile.snap::after { animation: c-flash 0.5s ease-out; }
@keyframes c-flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
.c-tag { position: absolute; left: calc(50% + var(--tile) * 0.3); top: calc(50% + var(--tile) * 0.5); z-index: 4; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 8px; border-radius: 99px; background: var(--accent); color: var(--ink); font-size: 13px; letter-spacing: 0.04em; white-space: nowrap;
  box-shadow: 0 8px 18px -10px rgba(20, 30, 26, 0.5); transform: rotate(-4deg); animation: c-tag-in 0.6s 1.4s var(--ease) both; }
.c-tag svg { width: 11px; height: 13px; fill: var(--ink); }
@keyframes c-tag-in { from { opacity: 0; transform: translate(-8px, 8px) rotate(-4deg) scale(0.9); } }
body.no-anno .c-tag { display: none; }
.c-obj { position: absolute; left: calc(50% + var(--x) * var(--spread) * var(--tile)); top: calc(50% + var(--y) * var(--tile)); width: calc(var(--w) * var(--tile) * var(--os, 1)); z-index: 2;
  transform: translate(-50%, -50%) translate(var(--mx, 0px), var(--my, 0px)) rotate(var(--r)); }
.c-float { display: block; animation: c-bob 6s ease-in-out infinite; transition: transform 0.5s var(--ease), filter 0.5s; filter: drop-shadow(0 10px 10px rgba(33, 58, 49, 0.2)) drop-shadow(0 2px 2px rgba(33, 58, 49, 0.18)); }
.c-obj:nth-child(2n) .c-float { animation-duration: 7s; animation-delay: -2s; }
.c-obj:nth-child(3n) .c-float { animation-duration: 8s; animation-delay: -4s; }
@keyframes c-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.c-float > svg, .c-float > img { display: block; width: 100%; height: auto; }
.c-obj:hover { z-index: 8; } /* above the photo, the tag and the other objects, so its note is never covered */
.c-obj:hover .c-float { transform: scale(1.08) rotate(3deg); filter: drop-shadow(0 26px 22px rgba(20, 30, 26, 0.3)) drop-shadow(0 4px 6px rgba(20, 30, 26, 0.2)); }
.c-note { position: absolute; left: 50%; top: 100%; margin-top: 8px; transform: translate(calc(-50% + var(--nx, 0px)), 4px) rotate(calc(var(--r) * -1)); white-space: nowrap; opacity: 0; transition: opacity 0.3s, transform 0.4s var(--ease); pointer-events: none; }
.c-obj:hover .c-note { opacity: 1; transform: translate(calc(-50% + var(--nx, 0px)), 0) rotate(calc(var(--r) * -1)); }
body.no-anno .c-note { display: none; }
/* Built-in objects: a Polaroid of the portrait and a vinyl record */
.obj-polaroid { display: block; background: #fff; padding: 7% 7% 26%; border: 2.5px solid var(--ink); border-radius: 3px; }
.obj-polaroid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 30%; }
.obj-vinyl { display: block; aspect-ratio: 1; border-radius: 50%; position: relative; border: 3px solid var(--ink);
  background: radial-gradient(circle, transparent 0 34%, rgba(197, 212, 246, 0.35) 34.5% 35.5%, transparent 36% 52%, rgba(197, 212, 246, 0.25) 52.5% 53.5%, transparent 54% 70%, rgba(197, 212, 246, 0.2) 70.5% 71.5%, transparent 72%), var(--ink); }
.obj-vinyl::before { content: ""; position: absolute; inset: 7%; border-radius: 50%; border: 2px solid transparent; border-top-color: rgba(255, 255, 255, 0.55); border-right-color: rgba(255, 255, 255, 0.2); transform: rotate(-30deg); }
.obj-vinyl span { position: absolute; left: 33%; top: 33%; width: 34%; height: 34%; border-radius: 50%; background: radial-gradient(circle, var(--ink) 0 8%, var(--accent) 9%); border: 2.5px solid var(--ink); box-sizing: border-box; }
.c-obj:hover .obj-vinyl { animation: c-spin 3s linear infinite; }
@keyframes c-spin { to { rotate: 360deg; } }
.c-sticker { position: absolute; z-index: 6; pointer-events: none; }
.c-sticker svg { display: block; width: 100%; height: auto; }
@media (max-width: 760px) {
  .corner { --tile: min(158px, 42vw); --spread: 0.66; --os: 0.84; height: calc(var(--tile) * 1.5 + 56px); }
  .c-tile { border-radius: 22px; }
  .c-note { display: none; } /* hover notes: no hover on a phone, and they pushed the page wider than the screen */
  .hero-about { overflow-x: clip; }
  .hero-about .scroll-cue { margin-top: 24px; }
  .c-tag { left: calc(50% - 64px); top: calc(50% + 96px); }
}

/* ---------- Case study chapters (projects with p.study) ----------
   Same top as every project; the hero is the prototype walkthrough playing in Figma's MacBook Pro 16" frame over a blue-green wash (also used
   for the live prototype). Below the details, a few short chapters: a Caveat label, a serif title and a
   line or two of copy, then one piece of media. */
.study-hero { container-type: size; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 15% 10%, #dfe8f7 0%, rgba(223, 232, 247, 0) 60%), radial-gradient(100% 90% at 90% 100%, #eef1d9 0%, rgba(238, 241, 217, 0) 60%), #f4f6f8 !important; }
/* Figma's MacBook Pro 16" device frame: a 4220 x 2574 PNG (shown at half size) with a transparent
   3456 x 2234 screen at (382, 56); the content sits under it, so the notch and bezel stay on top */
.device { position: relative; width: 100%; aspect-ratio: 4220 / 2574; }
.device-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 30px 40px rgba(15, 25, 45, 0.28)); }
.device-screen { position: absolute; left: 8.7%; top: 1.6%; width: 82.6%; height: 87.9%; overflow: hidden; background: #0b0b0d; /* reaches just under the bezel on every side, so the bezel's soft rim sits over the screen, never over the page */ }
.device-screen > * { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; border: 0; }
/* Figma's embed pads its player by ~62px; oversize the frame so that padding sits under the bezel and the prototype fills the screen */
.device-screen > iframe { position: absolute; left: -62px; top: -62px; width: calc(100% + 124px); height: calc(100% + 124px); max-width: none; }
.study-hero .device { width: min(80cqw, 131cqh); margin-top: 1cqh; }
/* Facts in one ruled row (case studies) */
.st-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.st-facts div { padding: 9px 0 10px; }
.st-facts div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.st-facts dt { color: var(--muted); font-size: 11px; }
.st-facts dd { margin: 2px 0 0; font-size: 17px; }
.case-details.has-facts { border-top: 0; border-bottom: 0; padding: 0; }
.has-facts + .st-sec { padding-top: 64px; }
/* Left column of a case study's details: what was made and with what */
.d-glance { grid-column: 1; display: flex; gap: 48px; padding-top: 8px; }
.d-glance .mono { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.d-glance ul { list-style: none; margin: 0; padding: 0; font-size: 18px; line-height: 1.5; }
.has-facts .d-label { grid-column: 2; }
.has-facts .d-body { grid-column: 3; }
.st-sec { padding: 90px 0 0; }
.st-head { display: grid; grid-template-columns: 0.32fr 1fr; gap: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.st-label { color: var(--muted); }
.st-copy h3 { font-weight: 400; font-size: clamp(32px, 3.6vw, 50px); line-height: 1; margin: 0 0 16px; }
.st-copy p { margin: 0; max-width: 620px; font-size: 20px; line-height: 1.5; }
.st-sec figure { margin: 0; }
.st-sec figcaption.mono { margin-top: 10px; font-size: 12px; color: var(--muted); }
.st-img { overflow: hidden; background: var(--paper-2); box-shadow: 0 0 0 1px var(--line); }
.st-img img { width: 100%; height: auto; transition: transform 1.2s var(--ease); }
.st-sec figure:hover .st-img img { transform: scale(1.03); }
.st-cards, .st-pair, .st-screens, .st-wide, .st-proto { margin-top: 36px !important; }
.st-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.st-card { padding: 24px 24px 26px; background: var(--card-bg, linear-gradient(160deg, #eef3fb, #f6f7ee)); /* a project can set its own tint (data.js cardBg) */ min-height: 180px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.st-card h4 { margin: 0 0 8px; font-weight: 400; font-size: 28px; line-height: 1; }
.st-card p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.45; }
.st-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.st-wide .st-img { max-width: 760px; margin: 0 auto; background: #2b2b2b; }
/* readable boards: stacked full width, or a wide board shown large (data.js stack / full / cols) */
.st-pair--stack { grid-template-columns: 1fr; gap: 28px; }
.st-wide--full .st-img, .st-wide--full figcaption { max-width: 1100px; }
.st-pair--stack .st-img img, .st-wide--full .st-img img, .st-screens[style] .st-img img { image-rendering: -webkit-optimize-contrast; }
/* wireframes: a short window with the screens gliding past sideways, looping seamlessly; pause on hover */
.st-pan { height: clamp(150px, 26vw, 250px); overflow: hidden; position: relative; }
.st-wide .st-pan { max-width: none; } /* the scrolling wireframe strip runs the full content width, like the boards above; height unchanged */
.st-wide:has(.st-pan) figcaption { max-width: none; }
.st-track { display: flex; height: 100%; width: max-content; animation: st-pan 70s linear infinite; will-change: transform; }
.st-track img { height: 100%; width: auto; max-width: none; flex: none; display: block; }
.st-pan:hover .st-track { animation-play-state: paused; }
.st-sec figure:hover .st-pan .st-track img { transform: none; }
@keyframes st-pan { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .st-track { animation: none; } .st-pan { overflow-x: auto; } }
.st-wide figcaption { max-width: 760px; margin-left: auto; margin-right: auto; }
.st-proto { padding: 4% 0 3.5%; background: radial-gradient(120% 90% at 15% 10%, #dfe8f7 0%, rgba(223, 232, 247, 0) 60%), radial-gradient(100% 90% at 90% 100%, #eef1d9 0%, rgba(238, 241, 217, 0) 60%), #f4f6f8; }
.st-proto .device { width: min(58%, 760px); margin: 0 auto; }
/* the live prototype sits exactly in the frame's screen opening (1728 x 1117 of 2110 x 1287), rounded at the top like the glass */
.st-proto .device-screen { left: 9.05%; top: 2.18%; width: 81.9%; height: 86.79%; border-radius: 1.1% 1.1% 0 0 / 1.7% 1.7% 0 0; }
.st-proto figcaption { text-align: center; }
/* a desktop studio display (2400 x 2000 PNG; transparent screen 2200 x 1504 at 100, 42, the recording's own shape), no notch */
.device.device--display { aspect-ratio: 2400 / 2000; }
/* the display carries its own soft floor shadow, so the frame's drop shadow stays light and close */
.device--display .device-frame, .device-stage .device--display .device-frame, .study-hero .device--display .device-frame { filter: drop-shadow(0 1.2cqh 2.4cqh rgba(15, 25, 45, 0.12)); }
.st-proto .device--display .device-frame { filter: drop-shadow(0 8px 16px rgba(15, 25, 45, 0.12)); }
.device.device--display .device-screen { left: 4.12%; top: 2.05%; width: 91.76%; height: 75.3%; border-radius: 0.3%; }
/* the countertop kiosk (2600 x 2100 PNG, transparent screen 2140 x 1495 at 230, 105): same sizing as the display, its own shape */
.device.device--display.device--kiosk { aspect-ratio: 2600 / 2100; }
.device.device--display.device--kiosk .device-screen { left: 8.85%; top: 5%; width: 82.31%; height: 71.19%; border-radius: 0.5%; }
.st-proto .device--kiosk video { background: #0b0b0d; }
.device-stage .device--display { width: min(88cqw, 112cqh); margin-top: 2cqh; }
/* in the hero, a comfortable reading size: the whole display and stand with air around it */
.study-hero .device--display { width: min(62cqw, 100cqh); margin-top: 0; } /* a little larger than Unto's MacBook, the whole display and its base in view */
.tile .device-stage .device--display { width: min(90cqw, 116cqh); }
/* sized so the whole display, stand included, sits inside one screen with room for the caption */
.st-proto .device--display { width: min(46%, 600px); }
/* a soft studio grey in place of the blue/green one, lit a little brighter behind the device */
.study-hero.has-wash, .st-proto.has-wash, .device-stage.has-wash { background:
  radial-gradient(60% 55% at 50% 38%, rgba(250, 250, 251, 0.9), rgba(250, 250, 251, 0) 100%),
  linear-gradient(180deg, var(--wash-bg, #e6e7e9) 0%, color-mix(in srgb, var(--wash-bg, #e6e7e9) 92%, #000) 60%, color-mix(in srgb, var(--wash-bg, #e6e7e9) 86%, #000) 100%) !important; }
.study-hero .device--display { translate: 0 3%; } /* the hero has no platform (as in Figma): the display stands on its own foot, set a touch low */
.study-hero.has-wash, .st-proto.has-wash { background: radial-gradient(60% 55% at 50% 38%, rgba(250, 250, 251, 0.9), rgba(250, 250, 251, 0) 100%), var(--wash-bg, #e6e7e9) !important; }
/* before/after slider: old page underneath, redesign on top cut at --x; the range input covers the stage */
.st-sec .st-compare { margin: 36px 0 0 !important; padding: 56px 24px 44px; border-radius: 0; background: radial-gradient(120% 90% at 15% 10%, #dfe8f7 0%, rgba(223, 232, 247, 0) 60%), radial-gradient(100% 90% at 90% 100%, #eef1d9 0%, rgba(238, 241, 217, 0) 60%), #f4f6f8; }
.st-compare > * { max-width: 600px; margin-left: auto; margin-right: auto; }
.cmp-stage { position: relative; aspect-ratio: 3 / 2; /* the screenshots' own shape, so the whole page shows */ overflow: hidden; border-radius: 10px; background: #e9ecef; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 24px 48px -28px rgba(0, 0, 0, 0.4); user-select: none; touch-action: pan-y; }
.cmp-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; pointer-events: none; transform: none !important; }
.cmp-after { clip-path: inset(0 0 0 var(--x)); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, 0.25); pointer-events: none; }
.cmp-knob { position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--ink); box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.45); transition: scale 0.3s var(--ease); }
.cmp-stage:hover .cmp-knob, .cmp-range:focus-visible ~ .cmp-line .cmp-knob { scale: 1.12; }
.cmp-range:focus-visible ~ .cmp-line .cmp-knob { outline: 2px solid var(--ink); outline-offset: 2px; }
.cmp-tag { position: absolute; top: 12px; padding: 4px 10px; border-radius: 99px; background: rgba(20, 30, 26, 0.72); color: #fff; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; pointer-events: none; backdrop-filter: blur(6px); transition: opacity 0.3s; }
.cmp-tag-b { left: 12px; } .cmp-tag-a { right: 12px; }
.st-compare[data-side="b"] .cmp-tag-a, .st-compare[data-side="a"] .cmp-tag-b { opacity: 0; }
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.cmp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 48px; height: 100vh; }
.cmp-range::-moz-range-thumb { width: 48px; height: 100vh; border: 0; }
.cmp-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 16px; }
.cmp-tab { padding: 6px 13px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; transition: background 0.3s, border-color 0.3s; }
.cmp-tab:hover { background: #f1f3f6; }
.cmp-tab.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.st-compare figcaption { text-align: center; margin-top: 12px; }
.proto-full[hidden] { display: block; visibility: hidden; }
.proto-full { display: block; margin: 18px auto 0; padding: 9px 20px; border-radius: 99px; border: 0; background: rgba(255, 255, 255, 0.92); color: var(--ink); font: inherit; font-size: 16px; cursor: pointer; box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.45); transition: transform 0.4s var(--ease); }
.proto-full:hover { transform: scale(1.05); }
.st-proto iframe:fullscreen { position: static; width: 100vw; height: 100vh; background: #000; }
.proto-cover { position: relative; padding: 0; overflow: hidden; }
.proto-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter 0.6s; }
.proto-cover:hover img { transform: scale(1.02); filter: brightness(0.8); }
.proto-cover { z-index: 1; }
.proto-shade { position: absolute; inset: 0; background: radial-gradient(90% 70% at 30% 20%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 55%), #050505; }
.proto-shade::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; transition: opacity 0.25s ease-out; } /* the white the screen lights up to */
.proto-shut img { transform: scale(1.04); transition: transform 1.4s var(--ease), filter 0.6s; }
.proto-shut:hover img { transform: scale(1.04); filter: none; }
.proto-shut .proto-play { bottom: auto; top: 50%; translate: -50% -50%; transition: transform 0.5s var(--ease), opacity 0.35s; }
.proto-shut.open { cursor: default; }
.proto-shut.reveal .proto-shade { opacity: 0; transition: opacity 0.45s ease; } /* the white clears onto the live page */
.proto-shut.open .proto-shade::after { opacity: 1; }
.proto-shut.open img { transform: none; }
.proto-shut.open .proto-play { opacity: 0; pointer-events: none; }
.device-screen > iframe.proto-live { opacity: 0; pointer-events: none; }
/* a page that fits the screen width and scrolls has no player padding, so it fills the screen exactly */
.device-screen > iframe.proto-live.fit-width { left: 0; top: 0; width: 100%; height: 100%; }
.device-screen > iframe.proto-live.under { opacity: 1; }
.device-screen > iframe.proto-live.on { opacity: 1; pointer-events: auto; z-index: 2; }
.proto-shut.live img { visibility: hidden; }
.proto-cover.open { position: absolute; inset: 0; }
@media (prefers-reduced-motion: reduce) { .proto-shade, .proto-shade::after { transition: none !important; } }
.proto-play { position: absolute; left: 50%; bottom: 9%; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 22px 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5); white-space: nowrap; transition: transform 0.5s var(--ease); }
.proto-play b { font-weight: 400; font-size: 18px; }
.proto-cover:hover .proto-play { transform: scale(1.05); }
.st-screens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 16px; }
#lessons { padding-bottom: 20px; }
@media (max-width: 900px) {
  .st-head { grid-template-columns: 1fr; gap: 6px; }
  .st-cards, .st-pair { grid-template-columns: 1fr; }
  .st-screens { grid-template-columns: 1fr 1fr; }
  .st-card { min-height: 0; }
  .st-sec { padding-top: 70px; }
  .st-proto .device { width: 96%; }
  .st-facts { grid-template-columns: 1fr 1fr; }
  .st-facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .st-facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .has-facts .d-label, .has-facts .d-body, .d-glance { grid-column: auto; }
  .d-glance { order: 3; padding-top: 18px; }
  .proto-play { padding: 8px 14px 10px; } .proto-play .hand { font-size: 20px; } .proto-play b { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) { .c-float { animation: none; } }
.portrait-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 4px; }
.portrait-row img { width: clamp(160px, 18vw, 240px); aspect-ratio: 3 / 4; height: auto; object-fit: cover; object-position: center 30%; }
.portrait-row .mono { font-size: 15px; }
.mega { font-weight: 400; margin: 32px 0 0; font-size: clamp(44px, 8.6vw, 132px); line-height: 0.86; text-transform: uppercase; letter-spacing: -0.01em; }
.mega span { display: block; overflow: hidden; }
.mega span i { display: block; font-style: normal; transform: translateY(100%); transition: transform 1s var(--ease); }
.mega.on span i { transform: none; }
.mega span:nth-child(2) i { transition-delay: 0.08s; }
.mega span:nth-child(3) i { transition-delay: 0.16s; }
.hero-about .mega { margin-top: 18px; font-size: clamp(34px, 5.4vw, 84px); } /* smaller under the corner, so the portrait leads */
.lede { max-width: 500px; margin: 30px auto 0; font-size: 21px; }
.scroll-cue { margin: 48px auto 70px; display: flex; flex-direction: column; align-items: center; gap: 6px; }

.chapter { padding: 75px 0; border-top: 1px solid var(--line); }
.chapter h2 { font-weight: 400; margin: 0; font-size: clamp(30px, 4.6vw, 70px); line-height: 0.95; text-transform: uppercase; }
.chapter h2 .mono { vertical-align: top; margin-right: 10px; }
.chapter p.body { max-width: 460px; margin: 28px auto 0; font-size: 21px; }
.chapter p.body.hand { font-size: 26px; }
/* About: a film strip wipes into the dark closing as you scroll */
.edge { position: relative; height: clamp(70px, 10vw, 150px); margin: -1px calc(var(--gutter) * -1) 0; background: var(--paper); }
.edge + .closing { border-top: 0; }
.edge + .chapter { border-top: 0; }
.edge b { position: absolute; inset: 0 0 -1px; background: var(--ink); clip-path: inset(0 calc((1 - var(--p, 1)) * 100%) 0 0); }
.edge.fx-film { height: clamp(34px, 4.5vw, 66px); } /* a slimmer strip */
.edge b::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 9px; background: repeating-linear-gradient(90deg, transparent 0 12px, var(--paper) 12px 24px); opacity: 0.9; }
/* About services hover: the hovered line in italic, the rest faded */
.svc { transition: opacity 0.35s ease; }
.svc-list.has-hover .svc { opacity: 0.22; }
.svc-list.has-hover .svc.on { opacity: 1; font-style: italic; }
/* About headings ease in line by line as they scroll into view, each line rising from behind a mask */
[data-reveal].rise { opacity: 1; transform: none; }
.rise > span { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.rise > span > i { display: block; font-style: normal; transform: translateY(105%); transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s); }
.rise > span > i.svc { transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s), opacity 0.35s ease; } /* keep the hover fade quick */
.rise.on > span > i { transform: none; }
.rise > span:nth-child(2) > i { --d: 0.08s; }
.rise > span:nth-child(3) > i { --d: 0.16s; }
.rise > span:nth-child(4) > i { --d: 0.24s; }
.rise > span:nth-child(5) > i { --d: 0.32s; }
@media (prefers-reduced-motion: reduce) { .rise > span > i { transform: none; transition: none; } }
/* Lab / Darkroom: experiments as prints hanging from a drying line by periwinkle clips */
.dry-line { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 64px); padding: 78px 0 120px; }
.dry-line::before { content: ""; position: absolute; left: calc(var(--gutter) * -1); right: calc(var(--gutter) * -1); top: 63px; height: 1.5px; background: var(--ink); opacity: 0.55; }
.print { position: relative; display: block; text-decoration: none; transform-origin: 50% -16px; }
.print-frame, .print .clip { transform: rotate(var(--r)); transform-origin: 50% -16px; transition: transform 0.7s var(--ease); }
.print .clip { position: absolute; left: 50%; top: -22px; z-index: 2; width: 14px; height: 34px; margin-left: -7px; border-radius: 3px; background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(33, 58, 49, 0.25), 0 3px 6px -2px rgba(14, 23, 20, 0.35); }
.print .clip::after { content: ""; position: absolute; left: 3px; right: 3px; top: 14px; height: 1px; background: rgba(33, 58, 49, 0.35); }
.print-frame { display: block; padding: 7px; background: #fff; /* a thin, even print border */ box-shadow: 0 26px 44px -26px rgba(14, 23, 20, 0.5), 0 2px 6px rgba(14, 23, 20, 0.1); }
.print .thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); }
.print img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.print:hover .print-frame, .print:hover .clip { transform: rotate(0deg) translateY(-4px); }
.print:hover img { transform: scale(1.04); }
.print .thumb { position: relative; }
.print .live { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; pointer-events: none; opacity: 0; transition: opacity 0.45s ease; background: #000; }
.print .live.on { opacity: 1; }
.print .clip-video { width: 100%; height: 100%; object-fit: cover; }
.print .auto-loop { display: block; width: 100%; height: 100%; object-fit: cover; } /* a motion piece looping in its print */ /* a recorded walkthrough, already cropped to the print */
/* The player a screen recording opens in: the page dims to the darkroom, the video sits in the middle */
.reel { position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 24px; background: rgba(15, 23, 20, 0.94); opacity: 0; transition: opacity 0.4s ease; }
.reel.on { opacity: 1; }
.reel video { width: min(100%, 1280px, calc(80vh * 16 / 9)); aspect-ratio: 16 / 9; background: #000; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), 0 0 60px -20px rgba(214, 58, 42, 0.25);
  transform: translateY(12px); transition: transform 0.6s var(--ease); }
.reel.on video { transform: none; }
.reel-close { color: var(--paper); padding: 8px 18px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, 0.35); transition: background 0.3s, color 0.3s; }
.reel-close:hover, .reel-close:focus-visible { background: var(--paper); color: #0f1714; }
.print-cap { display: block; padding: 20px 4px 0; }
.print-cap h3 { font-weight: 400; font-size: clamp(22px, 1.8vw, 26px); margin: 0 0 6px; text-transform: uppercase; line-height: 1; }
.print-cap p { margin: 0 0 8px; font-size: 15px; line-height: 1.4; min-height: 2.8em; color: var(--muted); } /* room for two lines in every caption, so all the prints line up */
.print-cap .mono { font-size: 12px; }
.dry-line + .dry-line { margin-top: -50px; }
.dry-line:not(:last-child) { padding-bottom: 100px; } /* rows sit a little closer together; the last keeps its room before the page ends */
/* a line of just two prints: same size as the rest, hung in the middle of the line */
.dry-line.pair { grid-template-columns: repeat(2, calc((100% - 2 * clamp(28px, 4vw, 64px)) / 3)); justify-content: center; } /* a second line of prints hangs just below the first */
/* A placeholder: a blank sheet still in the developer tray, the safelight glowing faintly through it */
.print-soon .thumb { display: grid; place-items: center; background: radial-gradient(65% 60% at 50% 45%, rgba(214, 58, 42, 0.16), transparent 72%), #ece6dc; }
.print-soon .soon { color: rgba(33, 58, 49, 0.45); }
.print-soon .print-cap h3 { opacity: 0.75; }
/* Lab / Darkroom lighting: a near-black room under a dim red safelight, with pale type and line */
body[data-page="lab"] { --muted: rgba(255, 255, 255, 0.6); color: var(--paper);
  background: radial-gradient(70% 55% at 50% -8%, rgba(214, 58, 42, 0.22), rgba(214, 58, 42, 0.06) 45%, transparent 75%) fixed, #0f1714; }
body[data-page="lab"] .dry-line::before, body[data-page="lab"] .print::before { background: var(--paper); opacity: 0.32; }
body[data-page="lab"] .print-frame { box-shadow: 0 30px 50px -24px rgba(0, 0, 0, 0.7), 0 0 40px -10px rgba(214, 58, 42, 0.18); }
.index-mark { display: flex; justify-content: center; gap: 220px; margin-top: 50px; }

.reach { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-top: 30px; font-size: clamp(24px, 3vw, 40px); text-transform: uppercase; }
.reach a, .reach button { position: relative; text-transform: inherit; }
.reach a:hover, .reach button:hover { font-style: italic; }
.copied { display: block; height: 18px; margin-top: 10px; opacity: 0; transition: opacity 0.3s; }
.copied.show { opacity: 1; }

.closing { background: var(--ink); color: var(--paper); padding: 90px var(--gutter) 30px; margin: 0 calc(var(--gutter) * -1); text-align: center; }
.closing h2 { font-weight: 400; margin: 18px 0 40px; font-size: clamp(44px, 8.6vw, 132px); line-height: 0.86; text-transform: uppercase; }
.closing .mail { font-size: clamp(22px, 3vw, 40px); text-transform: uppercase; border-bottom: 1px solid currentColor; }
.closing .foot { display: flex; justify-content: space-between; margin-top: 90px; gap: 20px; flex-wrap: wrap; }
.closing .foot .links { display: flex; gap: 14px; }

/* Case study */
.case-head { text-align: center; }
.case-title { font-weight: 400; margin: 0; height: 75px; padding-top: 40px; border-bottom: 1px solid var(--line); font-size: 22px; line-height: 34px; text-transform: uppercase; }
.case-title sup { font-size: 13px; vertical-align: top; position: relative; top: -0.6em; }
.case-hero { width: 78%; margin: 20px auto 0; aspect-ratio: 16 / 9; overflow: hidden; background: #e9e9e9; }
.case-hero img, .g-frame img, .g-panel img { width: 100%; height: 100%; object-fit: cover; }
.case-head .scroll-cue { margin: 26px auto 60px; }
.case-details { display: grid; grid-template-columns: 1fr 0.25fr 1.2fr; gap: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0 30px; }
.d-facts p { margin: 0; font-size: 18px; line-height: 1.3; }
.d-facts b { font-weight: 400; text-transform: uppercase; }
.d-label { text-align: right; font-size: 26px; }
.d-body { font-family: var(--serif); text-transform: none; letter-spacing: 0; font-size: 18px; line-height: 1.5; } /* case-study body copy stays in Instrument Serif */
.d-body p { margin: 0 0 14px; max-width: 520px; }
.d-links { display: flex; gap: 24px; margin-top: 22px !important; }
.d-links a { text-decoration: underline; text-underline-offset: 3px; }
.d-links a:hover { font-style: italic; }
.case-gallery { padding-top: 75px; }
.case-gallery > div { border-bottom: 1px solid var(--line); padding: 10px 0; }
.g-band { background: #efefef; padding: 6vw 0 !important; }
.g-band .g-frame { width: 52%; margin: 0 auto; aspect-ratio: 16 / 10; overflow: hidden; }
.g-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-panel { aspect-ratio: 4 / 3; overflow: hidden; background: #efefef; }
.g-full .g-frame { aspect-ratio: 21 / 9; overflow: hidden; }
.case-more { padding: 90px 0 110px; text-align: center; }
.case-more ol { list-style: none; margin: 20px 0 0; padding: 0; }
.case-more li { border-top: 1px solid var(--line); }
.case-more li:last-child { border-bottom: 1px solid var(--line); }
.case-more a { display: block; padding: 10px 0 8px; }
.m-t { display: inline-block; font-size: clamp(44px, 8vw, 120px); line-height: 0.9; text-transform: uppercase; transition: letter-spacing 0.7s var(--ease); }
.m-t sup { font-size: 0.16em; vertical-align: top; position: relative; top: 0.6em; letter-spacing: 0; }
.case-more a:hover .m-t { letter-spacing: 0.12em; }
.m-idx { display: flex; justify-content: center; gap: 22vw; margin-top: 4px; font-size: 15px; }

/* Lab */
.lab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 40px 0 120px; }
.lab-card .thumb { aspect-ratio: 4 / 3; overflow: hidden; background: #e9e9e9; }
.lab-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.lab-card:hover img { transform: scale(1.05); }
.lab-card h3 { font-weight: 400; font-size: 34px; margin: 12px 0 4px; text-transform: uppercase; line-height: 1; }
.lab-card p { margin: 0 0 8px; color: var(--muted); }

/* Reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
[data-reveal].on { opacity: 1; transform: none; }

/* ---------- Eliecraft Studio visual style (same fonts and layout, square containers): pill buttons,
   cream panels, soft shadows and periwinkle highlights ---------- */
:root { --paper-2: #f2f2f2; --card: #f2f2f2; --soft-shadow: 0 30px 60px -40px rgba(14, 23, 20, 0.45); }
::selection { background: var(--accent); color: var(--ink); }

/* Media on cream instead of gray */
.tile { background: var(--paper-2); box-shadow: var(--soft-shadow); }
.filmstrip .frame, .w-strip .shot { background: var(--paper-2); }
.hover-peek { box-shadow: var(--soft-shadow); }
.case-hero, .g-panel, .g-band .g-frame, .g-full .g-frame { background: var(--paper-2); }
.g-band { background: var(--card); }
.lab-card .thumb { background: var(--paper-2); }

/* Pill buttons that fill periwinkle on hover */
.stage-bar .view a, .d-links a { display: inline-block; padding: 8px 16px; border: 0; border-radius: 99px; background: var(--card); text-decoration: none; box-shadow: 0 1px 0 rgba(33, 58, 49, 0.04); transition: background 0.3s; }
.stage-bar .view a:hover, .d-links a:hover { background: var(--accent); font-style: normal; }
.s-quiet { padding: 8px 16px; border-radius: 99px; text-decoration: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); }
.s-quiet:hover { background: rgba(255, 255, 255, 0.08); }
.closing .mail { display: inline-block; padding: 0.3em 0.8em; border: 0; border-radius: 99px; background: var(--accent); color: var(--ink); transition: transform 0.3s var(--ease); }
.closing .mail:hover { transform: translateY(-3px); }

/* Pointer: an inverting dot in place of the system cursor (mouse and trackpad only; see common.js) */
html.has-cursor, html.has-cursor * { cursor: none !important; }
.cursor { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; mix-blend-mode: difference; opacity: 0; transition: opacity 0.2s; }
.cursor.on { opacity: 1; }
.cursor i { position: absolute; left: 0; top: 0; width: 12px; height: 12px; translate: -50% -50%; border-radius: 50%; background: #fff; border: 1.5px solid #fff;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background-color 0.3s, scale 0.15s; }
.cursor.link i { width: 8px; height: 8px; } /* over links: just the center dot inside the focus brackets */
.cursor.down i { scale: 0.8; }
/* Autofocus brackets: four small viewfinder corners that close in around the dot over links */
.cursor .af { position: absolute; left: 0; top: 0; width: 34px; height: 34px; translate: -50% -50%; opacity: 0; scale: 1.5; transition: opacity 0.2s, scale 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); } /* autofocus snap */
.cursor.link .af { opacity: 1; scale: 1; }
.cursor.down .af { scale: 0.85; } /* half-press: brackets tighten like a shutter */
.cursor .af s { position: absolute; width: 8px; height: 8px; border: 0 solid #fff; }
.cursor .af s:nth-child(1) { left: 0; top: 0; border-top-width: 1px; border-left-width: 1px; }
.cursor .af s:nth-child(2) { right: 0; top: 0; border-top-width: 1px; border-right-width: 1px; }
.cursor .af s:nth-child(3) { left: 0; bottom: 0; border-bottom-width: 1px; border-left-width: 1px; }
.cursor .af s:nth-child(4) { right: 0; bottom: 0; border-bottom-width: 1px; border-right-width: 1px; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  :root { --rail: 12px; --rail-gap: 5px; }
  .rail { font-size: 12px; } /* the phone rails are only 12px wide */
  .toggle span { padding: 5px 0; }
  .rail-r .toggles { gap: 60px; }
  .cluster { --tile-scale: 1.8; }
  .cover .m-label { font-size: 7px; }
  .stage-bar { grid-template-columns: auto 1fr auto; gap: 10px; }
  .stage-bar .num { padding-left: 0; }
  .stage-bar .view { margin-right: 0; }
  .more-note { right: 10px; }
  .hover-peek { display: none; }
  .case-hero { width: 100%; }
  .case-details { grid-template-columns: 1fr; }
  .d-label { text-align: left; }
  .g-band .g-frame { width: 80%; }
  .g-split { grid-template-columns: 1fr; }
  .lab-grid { grid-template-columns: 1fr; }
  .index-mark { gap: 120px; }
  .dry-line { grid-template-columns: 1fr; gap: 72px; padding-top: 60px; }
  .dry-line.pair { grid-template-columns: 1fr; }
  .dry-line::before { display: none; }
  .print::before { content: ""; position: absolute; left: calc(var(--gutter) * -1); right: calc(var(--gutter) * -1); top: -15px; height: 1.5px; background: var(--ink); opacity: 0.55; } /* each print gets its own stretch of line */
  .m-note.n-l { left: -1.2em; top: -0.9em; }
}

/* Narrow screens: the side rails become a top bar (logo and name, Menu) and a bottom bar
   (Annotations, Sound) with the chosen option underlined, as on mariavasilyeva.com */
@media (max-width: 760px) {
  :root { --bar: 44px; --bar-gap: 8px; --gutter: 16px; }
  .rail { top: auto; bottom: auto; left: var(--bar-gap); right: var(--bar-gap); width: auto; height: var(--bar); flex-direction: row; align-items: center; padding: 0 14px; font-size: 15px; /* same size as the vertical rails */ }
  .rail > *, .rail-l > * { writing-mode: horizontal-tb; transform: none; }
  .rail-l { top: var(--bar-gap); }
  .rail-l > span { display: none; } /* the role line only shows on the wide rails */
  .rail-l .logo .mark { transform: none; }
  .rail-r { bottom: var(--bar-gap); }
  .rail-r .menu-btn { position: fixed; top: var(--bar-gap); right: calc(var(--bar-gap) + 14px); height: var(--bar); display: flex; align-items: center; }
  .rail-r .toggles { flex: 1; flex-direction: row-reverse; justify-content: space-between; gap: 0; }
  .toggle span, body.menu-open .toggle span.on { padding: 0; margin-left: 8px; border-radius: 0; background: none; color: inherit; }
  .toggle span.on { background: none; color: inherit; text-decoration: underline; text-underline-offset: 4px; }
  .stage { top: calc(var(--bar) + var(--bar-gap)); height: calc(100svh - 2 * (var(--bar) + var(--bar-gap))); }
  body:not([data-page="home"]) main { padding-top: calc(var(--bar) + var(--bar-gap) + 8px); padding-bottom: calc(var(--bar) + var(--bar-gap) + 8px); }
  .work .scroll-note { top: calc(var(--bar) + var(--bar-gap) + 8px); }
  .menu-foot { bottom: calc(var(--bar) + var(--bar-gap) + 14px); }
}

/* click-to-enlarge for case-study images */
.st-img.zoomable { cursor: zoom-in; }
.lb { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px 24px 24px; background: rgba(12,12,12,0.92); opacity: 0; transition: opacity 0.25s ease; cursor: zoom-out; }
.lb.on { opacity: 1; }
.lb { transition-duration: 0.35s; }
.lb[hidden] { display: none; }
.lb img { max-width: min(100%, 1600px); max-height: calc(100vh - 120px); width: auto; height: auto; object-fit: contain; will-change: transform; transform-origin: 50% 50%; }
.lb p { transition: opacity 0.3s ease 0.15s; } .lb:not(.on) p { opacity: 0; transition-delay: 0s; } /* the caption arrives after the picture lands */
.lb p { margin: 0; color: #cfcfcf; font-size: 12px; text-align: center; }
.lb-x { position: fixed; top: 14px; right: 16px; background: none; border: 0; color: #fff; font-size: 13px; cursor: pointer; padding: 8px; }

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

/* Betel prototype: the walkthrough on the countertop payment terminal (890 x 544 PNG, transparent screen 640 x 447 at 46, 47) */
.st-proto .device.device--square { width: min(78%, 900px); aspect-ratio: 890 / 544; margin: 0 auto; }
.st-proto .device--square .device-screen { left: 5.17%; top: 8.64%; width: 71.91%; height: 82.17%; border-radius: 1.9%; overflow: hidden; background: #0b0b0d; }
.st-proto .device--square .device-screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-proto .device--square .device-frame { filter: drop-shadow(0 14px 24px rgba(60, 20, 45, 0.2)); }
@media (max-width: 720px) { .st-proto .device.device--square { width: 100%; } }
.st-flat .st-img { box-shadow: none; } /* boards on a tinted project: no grey outline */
.st-pan.st-pan--tall { height: clamp(260px, 34vw, 440px); } /* a taller band for the Betel workflow, so its labels stay readable while it scrolls */
.st-wide--full .st-pan { max-width: none; }
/* Betel style guide, kept small: a row of colour chips and two type samples */
.st-style { margin-top: 28px; display: grid; gap: 14px; }
.st-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.st-sw { padding: 34px 12px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.2; }
.st-sw b { font-weight: 500; } .st-sw span { font-size: 11px; opacity: 0.85; }
.st-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-font { padding: 18px 20px; background: var(--card-bg, #f6f4f5); display: flex; flex-direction: column; gap: 6px; }
.st-font p { margin: 0; font-size: 32px; line-height: 1.1; color: var(--ink); }
.st-font span, .st-font em { font-size: 11px; font-style: normal; color: var(--muted); }
@media (max-width: 720px) { .st-swatches { grid-template-columns: repeat(3, 1fr); } .st-fonts { grid-template-columns: 1fr; } }
.st-proto.has-wash { background: radial-gradient(70% 80% at 50% 50%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 100%), var(--wash-bg, #e6e7e9) !important; }
.st-proto .device--square .device-frame { width: 100%; height: 100%; }
.st-proto .device--square .device-screen { background: #000; }
.st-proto .device-screen > .proto-play { position: absolute; left: 0; top: 0; right: auto; bottom: auto; translate: none; transform: none; margin: 0; padding: 0; border-radius: 0; width: 100%; height: 100%; object-fit: initial; display: grid; place-items: center; background: #000; border: 0; cursor: pointer; z-index: 2; transition: opacity 0.35s var(--ease); }
.st-proto .proto-play.gone { opacity: 0; pointer-events: none; }
.st-proto .proto-play span { width: 64px; height: 64px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.7); display: grid; place-items: center; }
.st-proto .proto-play span::before { content: ""; margin-left: 4px; border-left: 16px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.st-wide .st-pan.st-pan--tall { background: #171719; } /* the wireframes run on dark, so the white screens stand out */
