/* ---------- Base reset (must stay first: the sheet styles below override body) ---------- */
:root {
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0;
  padding: 0;
  font: 14px -apple-system, BlinkMacSystemFont, sans-serif;
  background: #fff;
  color: #000;
}
img { max-width: 100%; }
[hidden]:not([hidden="until-found" i]) { display: none !important; }

/* Layout: an opening curtain, then the work itself. Each project is a full-screen paper sheet
   pinned to the top; the next sheet slides over it while the one below shrinks and dims.
   Footer is the last sheet. One red, ink, paper and cream; giant tight grotesk type. */
:root {
  --red: #F0514A;
  --ink: #1B1B1B;
  --paper: #FFFFFF;
  --cream: #F1ECE4;
  --mute: #6B6663;
  --font-display: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-serif: "Playfair Display", Georgia, serif;
  --gutter: clamp(16px, 2.5vw, 40px);
  --radius: clamp(20px, 3vw, 40px);
  --ease: cubic-bezier(.76, 0, .24, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
html.lenis-stopped, html.is-intro { overflow: hidden; }
body {
  margin: 0; background: var(--ink); color: var(--ink);
  font-family: var(--font-display); font-size: 1.0625rem; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }

.wrap {
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.label { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }
.grain::before {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit;
  background-image: var(--grain); opacity: .3; mix-blend-mode: multiply; pointer-events: none;
}

/* ---------- Opening curtain ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100; background: var(--red); color: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding-top: calc(env(safe-area-inset-top, 0px) + 1.5rem); padding-bottom: 0;
  overflow: hidden; cursor: pointer;
  animation: introOut .95s var(--ease) 2s forwards;
}
.intro.fast { animation: introSkip .7s var(--ease) forwards; }
.intro::before { content: ""; position: absolute; inset: 0; background-image: var(--grain); opacity: .3; mix-blend-mode: multiply; pointer-events: none; }
.intro-top { display: flex; justify-content: space-between; position: relative; z-index: 1; }
/* .nf-word (404.html) rides on the same rules so the number is set exactly like the curtain's word */
.intro-word, .nf-word { position: relative; z-index: 1; margin: 0; display: flex; font-size: clamp(7rem, 31vw, 40rem); font-weight: 800; line-height: .95; letter-spacing: -.065em; margin-left: -.03em; }
.intro-word .l, .nf-word .l { display: block; }
.intro-word .l span, .nf-word .l span { display: block; transform: translateY(110%); animation: letterUp 1s var(--ease-out) calc(.15s + var(--i) * .09s) forwards; }
.intro-word .l:last-child { margin-right: 0; }
@keyframes letterUp { to { transform: translateY(0); } }
@keyframes introOut {
  from { transform: translateY(0); border-radius: 0 0 0 0 / 0 0 0 0; }
  to { transform: translateY(-100%); border-radius: 0 0 50% 50% / 0 0 9vw 9vw; visibility: hidden; }
}
@keyframes introSkip {
  from { transform: translateY(0); border-radius: 0 0 0 0 / 0 0 0 0; }
  to { transform: translateY(-100%); border-radius: 0 0 50% 50% / 0 0 9vw 9vw; visibility: hidden; }
}

/* ---------- Fixed pill nav ---------- */
.nav {
  position: fixed; z-index: 50; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 1rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; pointer-events: none;
  animation: navIn .9s var(--ease-out) 2.7s both;
}
.nav > * { pointer-events: auto; }
@keyframes navIn { from { transform: translateY(-180%); } to { transform: translateY(0); } }
.pill {
  display: inline-flex; align-items: center; height: 3.25rem; padding: 0 1.4rem; border-radius: 999px;
  background: var(--ink); color: var(--cream); border: 2px solid var(--cream);
  text-decoration: none; font-weight: 500; font-size: 1.15rem; transition: background-color .2s, color .2s;
}
.pill:hover { background: var(--cream); color: var(--ink); }
.pill.logo { padding: 0 1.15rem; }
.pill.logo img { display: block; width: 2.125rem; height: 2.125rem; border-radius: 50%; object-fit: cover; transition: transform .25s var(--ease-out); }
.pill.logo:hover { background: var(--ink); color: var(--cream); }
@media (hover: hover) { .pill.logo:hover img { transform: scale(1.06); } }
/* The logo is a fixed-size mark: it never flex-shrinks, and it is exempt from the global
   `img { max-width: 100% }` net. Without both, a tight nav squeezes the pill and that net clamps
   the avatar's width while its height stays put — which squashes the circle. */
.pill.logo { flex: none; }
.pill.logo img { flex: none; max-width: none; }
.menu { display: flex; gap: clamp(.9rem, 2vw, 1.6rem); padding: 0 1.8rem; height: 3.25rem; border-radius: 999px; align-items: center; background: var(--ink); border: 2px solid var(--cream); }
.menu a { color: var(--cream); text-decoration: none; font-size: 1.15rem; font-weight: 500; }
.menu a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* ---------- Paper sheets ---------- */
.stack { position: relative; }
.sheet {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: var(--bg); color: var(--fg);
  border-radius: var(--radius) var(--radius) 0 0;
}
.stack > .sheet:first-child { border-radius: 0; }
.sheet::after { content: ""; position: absolute; inset: 0; z-index: 5; background: #000; opacity: calc(var(--p, 0) * .5); pointer-events: none; border-radius: inherit; }
.sheet.red { --bg: var(--red); --fg: var(--ink); }
.sheet.ink { --bg: var(--ink); --fg: var(--cream); }
.sheet.paper { --bg: var(--paper); --fg: var(--ink); }
.sheet.cream { --bg: var(--cream); --fg: var(--ink); }
.inner {
  position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column;
  padding-top: clamp(5.5rem, 8vw, 6.5rem); padding-bottom: clamp(1rem, 2vw, 1.75rem);
  transform: scale(calc(1 - var(--p, 0) * .06)); transform-origin: 50% 0;
}
.meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.1rem; }
.name { margin: 0; font-size: clamp(2.7rem, 8.4vw, 8.6rem); line-height: .88; letter-spacing: -.06em; font-weight: 800; text-wrap: balance; }
.body { flex: 1; min-height: 0; margin-top: clamp(1rem, 2.4vw, 2rem); display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.75fr); grid-template-rows: minmax(0, 1fr); gap: clamp(1rem, 3vw, 3rem); }
.copy { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; min-width: 0; }
.desc { margin: 0; font-size: clamp(1.1rem, 1.5vw, 1.4rem); line-height: 1.3; letter-spacing: -.01em; max-width: 24rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tags span { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; border: 1.5px solid currentColor; border-radius: 999px; padding: .3rem .75rem; white-space: nowrap; }

/* first sheet rises in after the curtain */
.stack > .sheet:first-child .inner > * { animation: rise 1.1s var(--ease-out) 2.5s both; }
.stack > .sheet:first-child .inner > .name { animation-delay: 2.6s; }
.stack > .sheet:first-child .inner > .body { animation-delay: 2.72s; }
@keyframes rise { from { transform: translateY(5rem); opacity: 0; } to { transform: none; opacity: 1; } }
.skipped .nav { animation-delay: .5s; }
.skipped .stack > .sheet:first-child .inner > * { animation-delay: .3s; }
.skipped .stack > .sheet:first-child .inner > .name { animation-delay: .38s; }
.skipped .stack > .sheet:first-child .inner > .body { animation-delay: .46s; }

/* ---------- Browser-window previews ---------- */
/* The window keeps a 16:10 shape rather than taking whatever the column gives it. Its interior is
   sized in cqmin, so a window that drifts flat leaves the middle empty and the hero reads as
   stretched. max-width is the safety net for tall, narrow viewports: it only binds where the column
   is already narrower than the height, which are the sizes that look right today. */
.win { aspect-ratio: 16 / 10; height: 100%; width: auto; max-width: 100%; justify-self: end; display: flex; flex-direction: column; border: 2px solid currentColor; border-radius: 14px; overflow: hidden; background: var(--bg); transition: transform .5s var(--ease-out); }
/* Windows holding a real screenshot carry a 2.25rem title bar, so a 16:10 frame leaves the image
   area at ~1.70. Widening those windows brings the interior back to ~16:10, which is the shape the
   screenshots are captured at — otherwise cover zoomed them ~7% and clipped the site's nav. */
.win:has(> .win-body > img) { aspect-ratio: 297 / 200; }
@media (hover: hover) { .win:hover { transform: translateY(-.6rem) rotate(-.4deg); } }
.win-bar { flex: none; height: 2.25rem; display: flex; align-items: center; gap: .4rem; padding: 0 .85rem; border-bottom: 2px solid currentColor; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .04em; }
.win-bar i { width: .65rem; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid currentColor; }
.win-bar span { margin-left: auto; }
.win-body { flex: 1; min-height: 0; position: relative; overflow: hidden; container-type: size; color: var(--ink); }
.win-body > div { position: absolute; inset: 0; }

.m1 { background: var(--cream); }
.m1-nav { position: absolute; top: 6cqh; left: 5cqw; right: 5cqw; display: flex; align-items: center; gap: 2cqmin; }
.m1-nav b { font-size: 4.4cqmin; letter-spacing: -.04em; margin-right: auto; }
.m1-nav i { width: 9cqmin; height: 3.2cqmin; border-radius: 99px; border: .5cqmin solid var(--ink); }
.m1-pol { position: absolute; left: 8cqw; top: 24cqh; width: 36cqmin; background: #fff; padding: 2.2cqmin 2.2cqmin 8cqmin; transform: rotate(-6deg); box-shadow: 0 1.2cqmin 0 rgba(27,27,27,.18); }
.m1-pol .ph { aspect-ratio: 1; background: var(--red); position: relative; overflow: hidden; }
.m1-pol .sun { position: absolute; width: 56%; aspect-ratio: 1; border-radius: 50%; background: var(--cream); left: 22%; top: 20%; }
.m1-pol small { position: absolute; left: 0; right: 0; bottom: 2.4cqmin; text-align: center; font-family: var(--font-mono); font-size: 2.3cqmin; letter-spacing: .04em; }
.m1-title { position: absolute; right: 6cqw; bottom: 9cqh; font-size: 18cqmin; font-weight: 800; line-height: .85; letter-spacing: -.06em; text-align: right; }
.m1-btn { position: absolute; left: 8cqw; bottom: 8cqh; background: var(--ink); color: var(--cream); padding: 1.6cqmin 3.6cqmin; border-radius: 99px; font-size: 3.2cqmin; font-weight: 500; }

.m2 { background: var(--red); display: grid; place-items: center; }
.m2 svg { width: 74cqmin; height: 74cqmin; display: block; }

.m3 { background: var(--paper); padding: 6cqmin; display: flex; flex-direction: column; justify-content: space-between; }
.m3 .lab { font-family: var(--font-mono); font-size: 2.7cqmin; letter-spacing: .08em; text-transform: uppercase; }
.m3 .big { font-size: 22cqmin; font-weight: 800; letter-spacing: -.06em; line-height: .9; }
.m3 .track { position: relative; height: 1.1cqmin; background: var(--ink); border-radius: 99px; margin: 2cqmin 0; }
.m3 .thumb { position: absolute; left: 60%; top: 50%; width: 5.6cqmin; aspect-ratio: 1; border-radius: 50%; background: var(--red); border: .7cqmin solid var(--ink); transform: translate(-50%, -50%); }
.m3 .outs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3cqmin; border-top: .5cqmin solid var(--ink); padding-top: 3cqmin; }
.m3 .outs b { display: block; font-size: 6cqmin; letter-spacing: -.04em; }
.m3 .outs span { font-family: var(--font-mono); font-size: 2.3cqmin; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Design gallery: a scroll-scrubbed sequence ----------
   The rail supplies the travel. script.js turns progress through it (--h, 0 → 1) into the phase
   values every rule below reads:
     --hb         strip browse progress
     --stripfade  the strip fading out as a card is lifted
     --fade       the header copy fading and blurring away
     --lift       the chosen card rising into the middle
     --pos        which of the five items is centred (0 → 4) */
.rail { position: relative; height: 600vh; }

/* --- phase 1: the strip --- */
.bands { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: clamp(.5rem, 1.2vw, 1rem); padding-bottom: clamp(1rem, 2vw, 1.75rem); opacity: calc(1 - var(--stripfade, 0)); }
.marquee { flex: 1; min-height: 0; overflow: hidden; }
.marquee .track { display: flex; gap: clamp(.5rem, 1.2vw, 1rem); height: 100%; width: max-content; will-change: transform; }
.marquee[data-dir="-1"] .track { transform: translateX(calc(var(--hb, 0) * -1 * var(--step, 50%))); }
.marquee[data-dir="1"] .track { transform: translateX(calc((1 - var(--hb, 0)) * -1 * var(--step, 50%))); }

/* the header copy dissolves as the card takes the middle */
.head { opacity: calc(1 - var(--fade, 0)); filter: blur(calc(var(--fade, 0) * 9px)); transform: translateY(calc(var(--fade, 0) * -1.25rem)); }
.head .copy { margin-top: clamp(1rem, 2.4vw, 1.6rem); }
/* The gateway's pill row is switched off, but it keeps its height so the header and the
   stage below stay exactly the size they were before the labels were hidden. */
#gallery .head .tags { visibility: hidden; }

/* --- phases 2-4: the stage --- */
.stage {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  display: flex; flex-direction: column;
  padding: clamp(5.5rem, 8vw, 6.5rem) max(var(--gutter), env(safe-area-inset-right, 0px)) clamp(1rem, 2vw, 1.75rem) max(var(--gutter), env(safe-area-inset-left, 0px));
  opacity: calc(var(--lift, 0) * var(--lift, 0));
  transform: translateY(calc((1 - var(--lift, 0)) * 16vh)) scale(calc(.88 + var(--lift, 0) * .12));
  transform-origin: 50% 100%;
}
.stage-inner { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: clamp(1rem, 3vw, 2.5rem); }
.stage-vp { flex: 0 1 auto; height: 100%; width: min(100%, 160svh); min-width: 0; overflow: hidden; }
.stage-track { display: flex; height: 100%; width: 100%; transform: translateX(calc(var(--pos, 0) * -100%)); will-change: transform; }
.gitem { position: relative; flex: none; width: 100%; height: 100%; display: grid; place-items: center; }

/* the card is the click target, and only while it is the centred one */
.gitem-hit { position: absolute; inset: 0; z-index: 2; border: 0; padding: 0; background: transparent; border-radius: 14px; cursor: pointer; pointer-events: none; }
#gallery.lifted .gitem.is-current .gitem-hit { pointer-events: auto; }
.gitem-hit:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* --- the detail that slides in beside the card --- */
.detail { flex: none; width: 0; overflow: hidden; opacity: 0; transform: translateX(1.5rem); transition: width .7s var(--ease), opacity .45s var(--ease), transform .7s var(--ease), max-height .7s var(--ease); }
#gallery.expanded .detail { width: clamp(14rem, 20vw, 19rem); opacity: 1; transform: none; pointer-events: auto; }
.detail-title { margin: 0 0 .6rem; font-size: clamp(1.35rem, 2vw, 1.9rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; min-width: clamp(14rem, 20vw, 19rem); }
.detail-desc { margin: 0; font-size: clamp(1rem, 1.25vw, 1.15rem); line-height: 1.4; color: var(--mute); min-width: clamp(14rem, 20vw, 19rem); }

/* --- the cards: shared by the strip and the stage --- */
.gcard { max-width: 100%; max-height: 100%; position: relative; display: flex; flex-direction: column; border: 2px solid currentColor; border-radius: 14px; overflow: hidden; background: var(--paper); color: var(--ink); container-type: size; }
.marquee .gcard { flex: none; }
.gcard.tone-red { background: var(--red); color: var(--ink); }
.gcard.tone-ink { background: var(--ink); color: var(--cream); }
.gcard.tone-cream { background: var(--cream); color: var(--ink); }
.gcard.tone-paper { background: var(--paper); color: var(--ink); }

/* flyer cards (portrait, sized from the height so the ratio never breaks) */
.gcard-flyer { height: 100%; width: auto; aspect-ratio: var(--ar, 3 / 4); }
.gc-in { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8cqmin; }
.gc-kick { font-family: var(--font-mono); font-size: 3.6cqmin; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.gc-word { margin-top: auto; font-size: 23cqmin; font-weight: 800; letter-spacing: -.06em; line-height: .86; }
.gc-note { margin-top: 4cqmin; font-family: var(--font-mono); font-size: 3.4cqmin; letter-spacing: .07em; text-transform: uppercase; opacity: .7; }

/* email cards (landscape, same sizing rule) */
.gcard-email { height: 100%; width: auto; aspect-ratio: var(--ar, 16 / 10); }
.gcard-email .em-bar { flex: none; display: flex; align-items: center; gap: 1.6cqmin; padding: 3.5cqmin 4.5cqmin; border-bottom: 2px solid currentColor; font-family: var(--font-mono); font-size: 3.4cqmin; letter-spacing: .06em; }
.gcard-email .em-bar i { width: 3.4cqmin; aspect-ratio: 1; border-radius: 50%; border: .5cqmin solid currentColor; }
.gcard-email .em-bar span { margin-left: auto; }
.gcard-email .em-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 3cqmin; padding: 5cqmin 6cqmin; }
.gcard-email .em-subj { font-size: 9.5cqmin; font-weight: 800; letter-spacing: -.04em; line-height: .95; }
.gcard-email .em-hero { flex: 1; min-height: 0; border-radius: 8px; background: var(--red); }
.gcard.tone-ink .em-hero { background: var(--cream); }
.gcard-email .em-btn { align-self: flex-start; border: 2px solid currentColor; border-radius: 999px; padding: 1.6cqmin 4.5cqmin; font-size: 3.8cqmin; font-weight: 600; }

/* phone cards (portrait and narrow, held to a real handset ratio) */
.gcard-phone { height: 100%; width: auto; aspect-ratio: 9 / 19.5; }
.pb-in { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 3cqmin; padding: 6cqmin 7cqmin; }
.pb-status { flex: none; display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 3cqmin; letter-spacing: .04em; opacity: .7; }
.pb-notch { width: 21cqmin; height: 3.4cqmin; border-radius: 99px; background: currentColor; opacity: .3; }
.pb-batt { width: 7cqmin; height: 3.2cqmin; border: .5cqmin solid currentColor; border-radius: 1.2cqmin; opacity: .5; }
.pb-top { flex: none; display: flex; align-items: center; justify-content: space-between; }
.pb-app { font-size: 6.6cqmin; font-weight: 800; letter-spacing: -.04em; }
.pb-av { width: 7.4cqmin; aspect-ratio: 1; border-radius: 50%; background: var(--red); }
.gcard.tone-ink .pb-av { background: var(--cream); }
.pb-hero { flex: none; padding-top: 1cqmin; }
.pb-big { display: block; font-size: 22cqmin; font-weight: 800; letter-spacing: -.07em; line-height: .88; }
.pb-unit { display: block; margin-top: 2cqmin; font-family: var(--font-mono); font-size: 3.2cqmin; letter-spacing: .07em; text-transform: uppercase; opacity: .65; }
.pb-bars { flex: none; display: flex; align-items: flex-end; gap: 1.6cqmin; height: 13cqmin; }
.pb-bars i { flex: 1; border-radius: .8cqmin; background: currentColor; opacity: .28; }
.pb-bars i:nth-child(1) { height: 34%; }
.pb-bars i:nth-child(2) { height: 58%; }
.pb-bars i:nth-child(3) { height: 42%; }
.pb-bars i:nth-child(4) { height: 76%; }
.pb-bars i:nth-child(5) { height: 50%; }
.pb-bars i:nth-child(6) { height: 88%; opacity: 1; background: var(--red); }
.pb-bars i:nth-child(7) { height: 64%; }
.gcard.tone-ink .pb-bars i:nth-child(6) { background: var(--cream); }
.pb-row { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 1.2cqmin 2.6cqmin; align-items: center; }
.pb-dot { grid-row: 1 / 3; width: 6.4cqmin; aspect-ratio: 1; border-radius: 32%; background: currentColor; opacity: .16; }
.pb-l1 { height: 1.8cqmin; border-radius: 99px; background: currentColor; opacity: .32; }
.pb-l2 { height: 1.5cqmin; width: 62%; border-radius: 99px; background: currentColor; opacity: .16; }
.pb-tabs { position: relative; flex: none; margin-top: auto; display: flex; align-items: center; justify-content: space-around; padding-top: 3cqmin; }
.pb-tabs::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: .4cqmin; background: currentColor; opacity: .2; }
.pb-tabs i { width: 4.4cqmin; aspect-ratio: 1; border-radius: 30%; background: currentColor; opacity: .22; }
.pb-tabs i:first-child { opacity: 1; background: var(--red); }
.gcard.tone-ink .pb-tabs i:first-child { background: var(--cream); }

/* desktop app cards (landscape, in the same window frame the other sheets use) */
.gcard-desktop { height: 100%; width: auto; aspect-ratio: var(--ar, 16 / 10); }
.dt-bar { flex: none; display: flex; align-items: center; gap: 1.8cqmin; padding: 3.2cqmin 4cqmin; border-bottom: 2px solid currentColor; font-family: var(--font-mono); font-size: 3.4cqmin; letter-spacing: .06em; }
.dt-bar i { width: 3.4cqmin; aspect-ratio: 1; border-radius: 50%; border: .5cqmin solid currentColor; }
.dt-bar span { margin-left: auto; opacity: .6; }
.dt-body { flex: 1; min-height: 0; display: flex; }
.dt-side { flex: none; width: 25%; display: flex; flex-direction: column; gap: 3.6cqmin; padding: 5.5cqmin 4.5cqmin; border-right: 2px solid currentColor; }
.dt-logo { width: 52%; height: 4.4cqmin; border-radius: 2cqmin; background: currentColor; }
.dt-nav { height: 2.6cqmin; border-radius: 99px; background: currentColor; opacity: .3; }
.dt-nav:nth-child(2) { width: 86%; }
.dt-nav:nth-child(3) { width: 62%; }
.dt-nav:nth-child(4) { width: 74%; }
.dt-nav:nth-child(5) { width: 50%; }
.dt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4.5cqmin; padding: 5.5cqmin 6cqmin; }
.dt-top { flex: none; display: flex; align-items: center; gap: 3cqmin; }
.dt-title { font-size: 6.4cqmin; font-weight: 800; letter-spacing: -.04em; }
.dt-search { flex: 1; max-width: 32%; height: 5.4cqmin; border-radius: 99px; background: currentColor; opacity: .12; }
.dt-btn { flex: none; width: 13cqmin; height: 5.4cqmin; border-radius: 99px; background: var(--red); }
.gcard.tone-ink .dt-btn { background: var(--cream); }
.dt-cards { flex: none; display: flex; gap: 3cqmin; }
.dt-card { flex: 1; height: 14cqmin; border-radius: 3cqmin; background: currentColor; opacity: .1; }
.dt-card:first-child { opacity: .2; }
.dt-chart { flex: 1; min-height: 0; display: flex; align-items: flex-end; gap: 2.4cqmin; }
.dt-chart i { flex: 1; border-radius: 1cqmin; background: currentColor; opacity: .26; }
.dt-chart i:nth-child(1) { height: 38%; }
.dt-chart i:nth-child(2) { height: 56%; }
.dt-chart i:nth-child(3) { height: 44%; }
.dt-chart i:nth-child(4) { height: 68%; }
.dt-chart i:nth-child(5) { height: 52%; }
.dt-chart i:nth-child(6) { height: 82%; opacity: 1; background: var(--red); }
.dt-chart i:nth-child(7) { height: 60%; }
.gcard.tone-ink .dt-chart i:nth-child(6) { background: var(--cream); }

/* the glide never rests on a card, so an opened one eases into the middle as its detail comes out */
#gallery.settling .stage-track { transition: transform .55s var(--ease); }

/* Wide stage cards (emails and desktops) are fitted inside the stage box: whichever of
   width or height runs out first wins, so the card never has to be clamped and the whole
   screen stays visible. A 2.28:1 screenshot sized from the height alone would need more
   width than the viewport has; sized from the width alone a 1.81:1 one would be too tall.
   Desktop only: on narrow screens the stage has no definite height to measure against. */
@media (min-width: 901px) {
  .stage .gitem { container-type: size; }
  .stage .gcard-email,
  .stage .gcard-desktop { height: auto; width: min(100%, calc(100cqh * var(--ar, 16 / 10))); }
}

/* narrow screens: the detail drops below the card instead of beside it, and the cards are
   sized from the width rather than the height. Scoped to .stage so the strip is unaffected. */
@media (max-width: 900px) {
  /* On a phone the strip sits against the screen edge, and the desktop 8px gap made two
     dark cards read as one block. Give the rows the room they get on a wide screen. */
  .marquee .track { gap: 14px; }
  .bands { gap: 12px; }

  .stage-inner { flex-direction: column; gap: 1.25rem; }
  .stage-vp { width: 100%; height: auto; flex: 1 1 auto; min-height: 0; }
  /* Leave room under the card for the caption, which now arrives on its own. */
  .stage .gcard-flyer { height: auto; width: min(100%, 36svh); }
  .stage .gcard-email { height: auto; width: 100%; }
  .stage .gcard-desktop { height: auto; width: 100%; }
  .stage .gcard-phone { height: auto; width: min(100%, 20svh); }
  .detail { width: 100%; max-height: 0; transform: translateY(1rem); }
  /* Touch has no hover to reveal the caption, so the description arrives with the stage
     instead of waiting for a tap. Scrolling away hides it again with --lift. */
  #gallery.expanded .detail,
  #gallery.lifted .detail { width: 100%; max-height: 28svh; opacity: 1; transform: none; }
  .detail-title, .detail-desc { min-width: 0; }
}

/* Portrait: let the stage shrink-wrap the cards instead of filling the sheet. The row is
   sized by its tallest card, so the card and its caption sit together as one centred group
   rather than the caption falling to the bottom of the screen. */
@media (max-width: 900px) and (orientation: portrait) {
  .stage-vp { flex: 0 1 auto; height: auto; }
  .stage-track { height: auto; }
  .stage .gitem { height: auto; }
}

.m5 { background: var(--red); }
.robot { position: absolute; left: 50%; top: 56%; width: 40cqmin; transform: translate(-50%, -50%); }
.robot .head { position: relative; width: 100%; aspect-ratio: 1 / .86; background: var(--cream); border: 1cqmin solid var(--ink); border-radius: 12%; }
.robot .head::before { content: ""; position: absolute; left: 50%; top: -9cqmin; width: 1cqmin; height: 8cqmin; background: var(--ink); transform: translateX(-50%); }
.robot .head::after { content: ""; position: absolute; left: 50%; top: -13cqmin; width: 5cqmin; aspect-ratio: 1; border-radius: 50%; background: var(--ink); transform: translateX(-50%); }
.robot .eye { position: absolute; top: 28%; width: 20%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); }
.robot .eye.l { left: 20%; } .robot .eye.r { right: 20%; }
.robot .mouth { position: absolute; left: 30%; right: 30%; bottom: 17%; height: 7%; border-radius: 99px; background: var(--ink); }
.robot .torso { width: 66%; height: 12cqmin; margin: 1.6cqmin auto 0; background: var(--cream); border: 1cqmin solid var(--ink); border-radius: 18% 18% 8% 8%; }

/* ---------- Footer sheet ---------- */
.foot { position: relative; z-index: 2; background: var(--red); color: var(--ink); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.foot .wrap { position: relative; z-index: 1; padding-block: clamp(3rem, 7vw, 6rem) 0; display: grid; gap: clamp(2.5rem, 6vw, 5rem); }
.about { margin: 0; font-size: clamp(1.5rem, 3.2vw, 3rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 500; max-width: 26ch; }
.tools { margin: 1rem 0 0; }
.askrow { position: relative; }
.ask { margin: 0; font-weight: 800; font-size: clamp(2.4rem, 6.2vw, 6rem); line-height: .95; letter-spacing: -.055em; max-width: 14ch; text-wrap: balance; }
.ticket {
  position: absolute; right: 4%; top: -1rem; width: 14rem; padding: 1rem 1.1rem 1.1rem; background: var(--paper); color: var(--ink);
  border-radius: 10px; transform: rotate(5deg); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: 0 .6rem 0 rgba(27,27,27,.16); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
}
.ticket.drag { cursor: grabbing; box-shadow: 0 1.2rem 0 rgba(27,27,27,.18); }
.ticket .t1 { display: flex; justify-content: space-between; }
.ticket .t2 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; letter-spacing: -.05em; text-transform: none; line-height: .95; margin: .9rem 0 1rem; }
.ticket .tear { border-top: 2px dashed var(--red); padding-top: .55rem; display: flex; justify-content: space-between; }
.ticket .bars { height: 1.6rem; margin-top: .7rem; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 10px); }
.ticket-hint { position: absolute; right: 4%; top: 12.6rem; width: 14rem; text-align: center; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, .8fr); gap: 2rem; align-items: start; }
.mail { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.3rem, 2.2vw, 1.9rem); text-decoration: none; overflow-wrap: anywhere; }
.mail:hover { text-decoration: underline; text-underline-offset: 5px; }
.clock { font-family: var(--font-mono); font-weight: 500; font-size: 1rem; line-height: 1.5; }
.links { display: grid; gap: .1rem; font-size: 1.25rem; }
.links a { text-decoration: none; width: fit-content; }
.links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.word { display: block; width: 100%; height: auto; margin-top: clamp(1rem, 3vw, 3rem); }
.word text { font-family: var(--font-display); font-weight: 900; fill: var(--paper); }

/* ---------- 404 (404.html) ----------
   One red sheet carrying the curtain's own type, so a mistyped URL still lands on something that
   looks like this site: the giant number rises in on the bottom edge, exactly as "Phen" does on
   first load. The page carries no script on purpose — the rise is pure CSS, and script.js is
   written against the home page (it dereferences #intro, #rail and #clock, none of which are here).
   The nav sits over the top of the sheet, so the sheet clears it the way a project sheet does. */
.nf {
  position: relative; min-height: 100svh; overflow: hidden;
  background: var(--red); color: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding-top: clamp(5.5rem, 8vw, 6.5rem); padding-bottom: 0;
}
.nf-meta { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 1rem; }
.nf-mid { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.nf-copy { margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.5rem); line-height: 1.3; letter-spacing: -.01em; max-width: 26rem; }
.nf-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
/* the nav's entrance is timed to the home page's curtain; there is no curtain here */
html.nf-page .nav { animation-delay: .15s; }

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  /* The three links come back inline rather than disappearing; "Say hello" steps aside to make
     the room, and loses nothing by it — Contact is already one of the three. */
  .menu { display: flex; padding: 0 1.1rem; gap: .75rem; }
  .menu a { padding: .65rem 0; }
  .nav > .pill[href="#contact"] { display: none; }
  .body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 1rem; container-type: inline-size; }
  /* The 297:200 frame includes a 2rem title bar, so its interior works out ~1.7:1 while
     the screenshots are 1.60:1 (Cairn 1.485:1). `cover` answered that by trimming the top
     and bottom. In portrait, let the window take the screenshot's own height instead:
     nothing is cropped and nothing is letterboxed. */
  .win:has(> .win-body > img) {
    height: auto;
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    justify-self: end;
    align-self: start;
  }
  .win:has(> .win-body > img) .win-body {
    flex: none;
    /* the base body is size-contained for the mock windows' cq units; an image needs to
       contribute its own height, so drop that containment here */
    container-type: normal;
  }
  .win:has(> .win-body > img) .win-body > img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  .copy { gap: .75rem; }
  .askrow { padding-bottom: 0; }
  .ticket { position: relative; right: auto; top: auto; margin-top: 2rem; margin-left: auto; margin-right: 1rem; }
  .ticket-hint { position: static; width: 14rem; margin: 1rem 1rem 0 auto; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Short, wide viewports have no room for the screenshot's full height. Keep the frame
   capped, but letterbox inside it rather than cropping the capture. */
@media (max-width: 900px) and (orientation: landscape) {
  .win:has(> .win-body > img) {
    height: min(100%, calc(100cqw * 200 / 297));
    width: auto;
    aspect-ratio: 297 / 200;
  }
  .win:has(> .win-body > img) .win-body { flex: 1; min-height: 0; container-type: size; }
  .win:has(> .win-body > img) .win-body > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  /* The stage has almost no vertical room here, so drive its cards from the height and let
     the width follow. Width-driven cards would be taller than the screen and clip. */
  .stage-vp { flex: 1 1 auto; height: auto; }
  .stage .gcard-flyer,
  .stage .gcard-email,
  .stage .gcard-desktop,
  .stage .gcard-phone { height: 100%; width: auto; }
}
@media (max-width: 520px) {
  .pill { height: 3rem; font-size: 1.05rem; padding: 0 1.1rem; }
  .pill.logo img { width: 1.75rem; height: 1.75rem; }
  .menu { height: 3rem; padding: 0 .9rem; gap: .6rem; }
  .menu a { font-size: 1rem; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .win-bar { height: 2rem; }
  /* 404: at 31vw the number is short on a phone, so a centred copy would float with a tall void
     beneath it. Drop it to the bottom of the sheet instead, sitting just above the number. */
  .nf-mid { justify-content: flex-end; padding-bottom: clamp(1.5rem, 6vh, 4rem); }
}
/* Small phones. The nav is [logo][three links] and they have to share ~270-340px. The logo is
   pinned now, so the pill gives the ground instead: type and padding step down, never the logo. */
@media (max-width: 340px) {
  .menu { padding: 0 .8rem; gap: .55rem; }
  .menu a { font-size: .95rem; }
}
@media (max-width: 300px) {
  .pill.logo { padding: 0 .9rem; }
  .menu { padding: 0 .7rem; gap: .45rem; }
  .menu a { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro { display: none; }
  .nav, .stack > .sheet:first-child .inner > * { animation: none; }
  .win { transition: none; }
  /* 404: the number is simply there, rather than rising into place */
  .nf-word .l span { transform: none; animation: none; }
  /* gallery: keep the sequence, but drop the blur, the rise and the detail slide-in. Paging
     stays, because it is scrubbed by scroll position rather than animated. */
  .marquee { overflow-x: auto; }
  .marquee .track { transform: none !important; }
  .head { filter: none !important; transform: none !important; }
  .stage { transform: none !important; }
  .detail { transition: none; }
}


/* Fill real images dropped into the browser mocks and gallery cards */
.win-body > img,
.gcard > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* The Pace homepage is 1.81:1. A centred cover crop in the 16:10 stage card eats the
   left edge and slices the headline, so anchor it left and let the shoe take the trim. */
.gitem[data-title="Pace"] .gcard > img { object-position: left center; }

/* Visit links on project sheets and in the gallery detail */
.copy-foot { display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; }
.visit,
.detail-link {
  display: inline-block; font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em;
  text-transform: uppercase; color: currentColor; text-decoration: none;
  border-bottom: 1.5px solid currentColor; padding-bottom: .15rem;
}
.visit:hover,
.detail-link:hover { opacity: .6; }
.detail-link { margin-top: 1rem; min-width: clamp(14rem, 20vw, 19rem); }
.detail-link[hidden] { display: none; }
