@property --fl { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --fr { syntax: '<length>'; inherits: false; initial-value: 0px; }
/* adamzinzan.com — Option 3, "Satin"
   The qualities of silk, not the fabric: light sliding over a liquid
   surface, slow heavy motion, nothing that snaps. Hyper-modern type:
   one grotesk, ultra-thin at display sizes, firm at UI sizes. One renderer draws the
   hero, the footer and every image; the page itself stays still and quiet. */

@font-face { font-family: 'Geist'; src: url(../fonts/geist.woff2) format('woff2-variations'); font-weight: 100 900; font-display: swap; }

:root {
  --porcelain: #EDEEF1;
  --tint: #E2E4E9;
  --ink: #0F1115;
  --mute: #5E626C;
  --night: #0C0E13;
  --pearl: #F1EEF4;
  --line: rgba(21, 20, 26, .14);
  --display: 'Geist', 'Helvetica Neue', Arial, sans-serif;
  --sans: 'Geist', 'Helvetica Neue', Arial, sans-serif;
  --m: clamp(20px, 4vw, 72px);
  --gap: clamp(16px, 1.8vw, 32px);
  --pour: cubic-bezier(.16, .84, .2, 1);   /* slow in, long settle */
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--porcelain); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font: 400 clamp(16.5px, 1.1vw, 18.5px) / 1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--pearl); }
:focus-visible { outline: 1.5px solid currentColor; outline-offset: 4px; border-radius: 2px; }
.wrap { width: min(100% - 2 * var(--m), 1640px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--ink); color: var(--pearl); padding: 10px 16px; }
.skip:focus { top: 12px; }
.ico { width: 1em; height: 1em; vertical-align: -.15em; transition: transform .8s var(--pour); }

/* one canvas behind everything; the page sits on top of it */
.satin { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
main, footer, .top { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- top */
.top { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; justify-content: space-between; align-items: center; padding: 22px var(--m); color: var(--pearl); transition: color .6s var(--pour); }
html[data-tone="light"] .top { color: var(--ink); }
/* the name and Ask line up with the page's own margin (.wrap) on wide screens too, where the content stops at 1640px */
html:not([data-tone-fixed]) .top { padding-inline: max(var(--m), (100% - 1640px) / 2); }
.top a, .top button { text-decoration: none; font-size: 15px; }
.top::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; background: color-mix(in srgb, var(--bar-ground, var(--porcelain)) 72%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent); transition: opacity .6s var(--pour); }
/* the bar is the page's own ground, frosted, with no saturate() (Adam, 27 Nov: it read as tinted where it sat on that same ground) */
html[data-tone="light"][data-scrolled="1"] .top::before { opacity: 1; }
.top__name { font: 600 16px/1 var(--display); letter-spacing: -.02em; }
.top__nav { display: flex; gap: 28px; align-items: center; }
.top__nav a { position: relative; }
.top__nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .9s var(--pour); }
.top__nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.top__ask { position: relative; border: 0; cursor: pointer; padding: 8px 17px; border-radius: 999px; box-shadow: inset 0 0 0 1px currentColor; transition: box-shadow .5s var(--pour);
  /* the same lens as the cursor over anything clickable: a faint fill that blurs what is behind it */
  background: color-mix(in srgb, var(--ink) 7%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3); }
html:not([data-tone="light"]) .top__ask, .gal .top__ask[data-bg-theme="light"] { background: rgba(255, 255, 255, .1); }
/* on rollover (and while the guide is open) the outline becomes the same thin-film rim as the guide's own edges, running */
.top__ask::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--rim), transparent 0 12%, #7cc4f2 34%, #b49ae0 51%, #eca6c8 66%, #f1d79e 81%, transparent 97%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .5s var(--pour); }
.top__ask:hover, .top__ask:focus-visible, .top__ask[aria-expanded="true"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); animation: rim-run 1.8s linear infinite; }
.top__ask:hover::after, .top__ask:focus-visible::after, .top__ask[aria-expanded="true"]::after { opacity: 1; }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --ang: 360deg; } }
::selection { background: #c9b8ff; color: var(--ink); }
@media (max-width: 760px) { .top__nav a { display: none; } }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; height: 100svh; min-height: 640px; display: grid; place-items: center; text-align: center; color: var(--pearl); background: var(--night); overflow: hidden; }
.gl-on .hero { background: transparent; }
/* the page's own ground, under its content and over the surface canvas: it owns the edges the live surfaces share
   with the page, so those edges scroll natively (app.js draws each surface a little past them) */
.gl-on main::before { content: ''; position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -1; background: var(--porcelain); pointer-events: none; }
.gl-on.home main::before, .gl-on .home main::before { top: var(--hero-h, max(100svh, 640px)); }
.hero__in { padding: 0 var(--m); }
.hero__h { font: 180 clamp(76px, 15vw, 280px) / .84 var(--display); letter-spacing: -.055em; text-wrap: balance; }
.hero__l { font-size: clamp(17px, 1.35vw, 22px); line-height: 1.45; max-width: 38ch; text-wrap: balance; margin: clamp(24px, 3vw, 40px) auto 0; opacity: .86; text-shadow: 0 1px 14px rgba(5, 6, 10, .7); }
.hero__h { text-shadow: 0 2px 30px rgba(5, 6, 10, .35); }
.hero__at { display: block; }
/* one orchestrated entrance: the name surfaces from the liquid */
@media (prefers-reduced-motion: no-preference) {
  .hero__h { animation: surface 2.4s var(--pour) .2s both; }
  .hero__l { animation: surface 2s var(--pour) .9s both; }
  @keyframes surface { from { opacity: 0; filter: blur(14px); transform: translateY(24px) scale(1.02); } }
}

/* ---------------------------------------------------------------- lede */
.lede { padding-block: clamp(120px, 16vw, 260px); text-align: center; }
.lede p { font: 300 clamp(30px, 3.7vw, 64px) / 1.1 var(--display); letter-spacing: -.03em; max-width: 24ch; margin-inline: auto; text-wrap: balance; }

/* ---------------------------------------------------------------- sections */
.sec { padding-block: clamp(80px, 11vw, 180px); }
.sec--tint { background: var(--tint); }
/* dark band (Lab, On the bench): scrolls in light, then fades to night once it holds the middle of the screen.
   The tokens are registered so they can transition; everything inside re-reads them. */
@property --ink { syntax: '<color>'; inherits: true; initial-value: #0F1115; }
@property --mute { syntax: '<color>'; inherits: true; initial-value: #5E626C; }
@property --line { syntax: '<color>'; inherits: true; initial-value: rgba(21, 20, 26, .14); }
.sec--dark { transition: background-color 1.4s var(--pour), --ink 1.4s var(--pour), --mute 1.4s var(--pour), --line 1.4s var(--pour); }
.sec--dark .pic { transition: background-color 1.4s var(--pour); }
.sec--dark.is-dark { --ink: var(--pearl); --mute: #9DA1AB; --line: rgba(241, 238, 244, .16); background-color: var(--night); color: var(--ink); }
.sec--dark.is-dark ::selection { color: var(--night); }
.sec--dark.is-dark .slot { outline: 1px solid rgba(241, 238, 244, .1); outline-offset: -1px; }
.sec--dark.is-dark .pic { background-color: #000; }   /* Lab tiles: black like the studies, no edge line (Adam, 28 Nov) */
@media (prefers-reduced-motion: reduce) { .sec--dark, .sec--dark .pic { transition-duration: .01s; } }
.dark-now :is(.sec--dark, .sec--dark .pic) { transition: none !important; }   /* landing already in the dark part: no fade (build.py) */
html[data-tone="band"] .top::before { opacity: 1; background: color-mix(in srgb, var(--bar-ground, var(--night)) 72%, transparent); box-shadow: 0 1px 0 rgba(241, 238, 244, .08); }
/* Desktop (Adam, 28 Nov): no bar and no pill frames. Wherever the bar used to show, the name and the links get a
   soft blur instead (no colour of its own), feathered out to nothing on every side so it has no edge.
   Two eased linear masks (across, down), intersected, give a rounded feather that hugs the text on any length.
   Phones keep the frosted bar; Lab studies keep their solid one. */
@media (min-width: 761px) {
  html:not([data-tone-fixed]) .top::before { display: none; }
  html:not([data-tone-fixed]) :is(.top__name, .top__nav) { position: relative; z-index: 0; }
  html:not([data-tone-fixed]) :is(.top__name, .top__nav)::before { content: ''; position: absolute; z-index: -1; top: 50%; left: -44px; right: -44px; height: 92px; translate: 0 -50%;
    pointer-events: none; opacity: 0;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);   /* blur only, no wash of colour (Adam, 28 Nov) */
    --halo-x: linear-gradient(90deg, transparent, rgba(0,0,0,.1) 10px, rgba(0,0,0,.5) 24px, rgba(0,0,0,.9) 38px, #000 46px, #000 calc(100% - 46px), rgba(0,0,0,.9) calc(100% - 38px), rgba(0,0,0,.5) calc(100% - 24px), rgba(0,0,0,.1) calc(100% - 10px), transparent);
    --halo-y: linear-gradient(180deg, transparent, rgba(0,0,0,.1) 8px, rgba(0,0,0,.5) 19px, rgba(0,0,0,.9) 30px, #000 36px, #000 calc(100% - 36px), rgba(0,0,0,.9) calc(100% - 30px), rgba(0,0,0,.5) calc(100% - 19px), rgba(0,0,0,.1) calc(100% - 8px), transparent);
    -webkit-mask: var(--halo-x), var(--halo-y); -webkit-mask-composite: source-in; mask: var(--halo-x), var(--halo-y); mask-composite: intersect;
    transition: opacity .6s var(--pour); }
  html[data-tone="light"][data-scrolled="1"] :is(.top__name, .top__nav)::before,
  html[data-tone="band"]:not([data-tone-fixed]) :is(.top__name, .top__nav)::before { opacity: 1; }
  /* over a picture the name and each link take the colour that reads against it (ui.js measures; no attribute = tone) */
  html:not([data-tone-fixed]) body:not(.gal) :is(.top__name, .top__nav > a, .top__nav > button) { transition: color .4s var(--pour), box-shadow .5s var(--pour), background-color .4s var(--pour); }
  html:not([data-tone-fixed]) body:not(.gal) .top [data-bg-theme="light"] { color: var(--pearl); }
  html:not([data-tone-fixed]) body:not(.gal) .top [data-bg-theme="dark"] { color: var(--ink); }
  html:not([data-tone-fixed]) body:not(.gal) .top .top__ask[data-bg-theme="light"] { background: rgba(255, 255, 255, .1); }
  html:not([data-tone-fixed]) body:not(.gal) .top .top__ask[data-bg-theme="dark"] { background: color-mix(in srgb, var(--ink) 7%, transparent); }
  /* the On-this-page pill: the same frosted glass as the Work page's view switch (Adam, 28 Nov evening), in the
     ground under it: porcelain, or night over the dark band */
  html:not([data-tone-fixed]) .otp { background-color: color-mix(in srgb, var(--porcelain) 74%, transparent); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6); }
  html:not([data-tone="light"]):not([data-tone-fixed]) .otp { background-color: color-mix(in srgb, var(--night) 74%, transparent); }
}
.sec__h { font: 260 clamp(46px, 6.4vw, 116px) / .92 var(--display); letter-spacing: -.055em; }
.sec__l { font-size: clamp(18px, 1.35vw, 22px); color: var(--mute); margin-top: 18px; max-width: 34ch; }

/* pictures: the renderer draws them; the <img> stays for layout, alt text and fallback */
.pic { position: relative; aspect-ratio: var(--ar, 1.5); overflow: hidden; border-radius: 14px; background: var(--tint); }
.pic img, .pic video { width: 100%; height: 100%; object-fit: cover; }
/* the slight zoom on rollover (of the picture, or of the link it sits in) */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pic img { transition: transform 1.4s var(--pour); }
  .pic:hover img, a:hover .pic img { transform: scale(1.03); }
  .ix:hover .pic img, .ix:focus-visible .pic img { transform: none; }   /* list thumbnails stay still on rollover (Adam) */
}
.pic.is-gl { background: transparent; }
.pic.is-gl img { opacity: 0; }

/* work */
.wks { display: grid; gap: clamp(100px, 13vw, 220px); margin-top: clamp(56px, 7vw, 120px); }
.wk__a { display: grid; gap: 26px; text-decoration: none; align-items: end; }
@media (min-width: 900px) {
  .wk__a { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
  .wk--l .wk__pic { grid-column: 1 / span 8; } .wk--l .wk__txt { grid-column: 9 / span 4; }
  .wk--r .wk__pic { grid-column: 5 / span 8; order: 2; } .wk--r .wk__txt { grid-column: 1 / span 4; order: 1; text-align: right; }
  .wk--r .wk__h, .wk--r .wk__d { margin-left: auto; }
}
.wk__t { font: 260 clamp(40px, 4.4vw, 80px) / .95 var(--display); letter-spacing: -.055em; transition: letter-spacing 1.2s var(--pour); }
.wk__a:hover .wk__t { letter-spacing: -.005em; }
/* lines are set at the rollover width (initTitles in app.js), so widening never re-breaks them */
.wk__t.is-measure { letter-spacing: -.005em !important; transition: none !important; }
.nx__t.is-measure { letter-spacing: -.01em !important; transition: none !important; }
.wk__t .ln, .nx__t .ln { display: block; white-space: nowrap; }
.wk__h { font-size: clamp(19px, 1.5vw, 24px); line-height: 1.3; margin-top: 16px; max-width: 24ch; }
.wk__d { color: var(--mute); font-size: 15px; margin-top: 10px; max-width: 30ch; }
.wk__go { display: inline-flex; gap: 10px; align-items: center; margin-top: 24px; font-size: 15px; font-weight: 600; border-bottom: 1px solid currentColor; padding-bottom: 3px; }
.wk__a:hover .ico { transform: translateX(6px); }

/* approach: a real sequence */
.sts { display: grid; gap: 40px var(--gap); margin-top: clamp(48px, 6vw, 96px); }
@media (min-width: 1000px) { .sts { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.st { border-top: 1px solid var(--line); padding-top: 22px; }
.st__n { font: 500 13px/1 var(--display); color: var(--mute); font-variant-numeric: tabular-nums; }
.st__t { font: 320 clamp(32px, 2.6vw, 44px) / 1 var(--display); letter-spacing: -.04em; margin: 14px 0 18px; }
.st__me { font-size: 17px; line-height: 1.45; }
.st__ai { font-size: 15px; color: var(--mute); margin-top: 14px; line-height: 1.5; }
.st__ai b { display: block; color: var(--ink); font-weight: 600; font-size: 13px; margin-bottom: 2px; }

/* lab */
.lbs { display: grid; gap: var(--gap); margin-top: clamp(48px, 6vw, 96px); }
@media (min-width: 700px) { .lbs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .lbs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lb--w { grid-column: span 2; } .lbs .lb--w .pic, .lbs .lb--w .slot { aspect-ratio: 32 / 9; } }   /* .lbs: must beat the 16:9 rule below, so a wide tile is as tall as its row */
.lb .pic, .lb .slot { aspect-ratio: 16 / 9; }
.lb__c { margin-top: 12px; font-size: 15px; color: var(--mute); } .lb__c b { color: var(--ink); font-weight: 600; margin-right: 6px; }
/* live studies (C-View II): the tile opens the study */
.lb__a { display: block; text-decoration: none; }
.lb__go { display: inline-flex; gap: 6px; align-items: center; margin-left: 12px; color: var(--ink); font-weight: 600; }
.lb__a:hover .ico, .lb__a:focus-visible .ico { transform: translateX(6px); }
/* two columns: an odd last tile takes the full row, so nothing is left alone */
@media (min-width: 700px) and (max-width: 1099px) { .lbs > li:last-child:nth-child(odd) { grid-column: span 2; } .lbs > li:last-child:nth-child(odd) :is(.pic, .slot) { aspect-ratio: 32 / 9; } }
.slot { position: relative; overflow: hidden; border-radius: 14px; min-height: 200px; background: var(--bg, none) center / cover, linear-gradient(135deg, #2a2734, #121019); }
.slot::before { content: ''; position: absolute; inset: 0; background: rgba(18, 16, 25, .62); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.slot::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(241, 238, 244, .16) 48%, transparent 66%); background-size: 260% 100%; animation: glint 5s var(--pour) infinite; }
@keyframes glint { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.slot p { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 1; color: var(--pearl); font-size: 14px; line-height: 1.45; max-width: 44ch; }
.slot span { display: block; font: 600 14px/1.2 var(--display); margin-bottom: 4px; }

/* bench */
.bns { display: grid; gap: var(--gap); margin-top: clamp(48px, 6vw, 96px); }
@media (min-width: 1000px) { .bns { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bn { border-top: 1px solid var(--ink); padding-top: 22px; display: grid; gap: 14px; align-content: start; }
.bn__k { font-size: 13px; font-weight: 600; color: var(--mute); }
.bn__t { font: 320 clamp(32px, 2.8vw, 48px) / 1 var(--display); letter-spacing: -.04em; }
.bn ul { display: grid; gap: 6px; font-size: 15px; color: var(--mute); }
.bn ul li::before { content: '— '; }
.bn__s { font: 500 13px var(--display); color: var(--mute); }

/* index */
.ixs { margin-top: clamp(40px, 5vw, 80px); border-top: 1px solid var(--line); }
.ix { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 4px 20px; padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none; align-items: center; }
.ix__p { grid-row: span 2; }
.ix__p .pic { width: 88px; }
.ix__t { font: 320 clamp(26px, 2.6vw, 44px) / 1 var(--display); letter-spacing: -.04em; transition: letter-spacing 1.2s var(--pour); }
.ix:hover .ix__t, .ix:focus-visible .ix__t { letter-spacing: -.005em; }   /* same rollover as the featured headlines (.wk__t) */
.ix__h { color: var(--mute); font-size: 16px; }
.ix__d { display: none; }
@media (min-width: 900px) {
  .ix { grid-template-columns: 120px 5fr 4fr 3fr; padding: 22px 0; }
  .ix__p { grid-row: auto; } .ix__p .pic { width: 120px; }
  .ix__d { display: block; font-size: 15px; color: var(--mute); text-align: right; }
}

/* about */
.ab { display: grid; gap: clamp(40px, 5vw, 96px); }
@media (min-width: 900px) { .ab { grid-template-columns: 4fr 7fr; } .ab__p { position: sticky; top: 100px; align-self: start; } }
.ab__c > p { font-size: clamp(18px, 1.35vw, 22px); line-height: 1.5; max-width: 40ch; margin-top: 1.1em; }
.ab__c > p:first-of-type { margin-top: 0; font: 300 clamp(26px, 2.4vw, 42px) / 1.14 var(--display); letter-spacing: -.03em; }
.ab__l { display: grid; gap: 28px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .ab__l { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ab__l h3 { font-size: 13px; font-weight: 600; color: var(--mute); margin-bottom: 10px; }
.ab__l li { font-size: 16px; line-height: 1.65; }

/* footer */
.foot { color: var(--pearl); background: var(--night); min-height: 100svh; display: grid; align-items: end; padding: 160px 0 40px; overflow: hidden; }
.gl-on .foot { background: transparent; }
.foot__h { font: 260 clamp(48px, 7.4vw, 140px) / .9 var(--display); letter-spacing: -.055em; max-width: 13ch; }
.foot__mail { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 48px; }
.foot__mail a { font: 300 clamp(26px, 3.2vw, 56px) / 1.1 var(--display); letter-spacing: -.03em; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 1.2s var(--pour); overflow-wrap: anywhere; }
.foot__mail a:hover { background-size: 100% 1px; }
.ghost { border: 1px solid rgba(241, 238, 244, .45); background: none; color: var(--pearl); border-radius: 999px; padding: 9px 18px; cursor: pointer; font-size: 15px; }
.ghost:hover { border-color: var(--pearl); }
.foot__row { display: grid; gap: 10px; margin-top: 110px; padding-top: 20px; border-top: 1px solid rgba(241, 238, 244, .18); font-size: 14px; opacity: .7; }
@media (min-width: 900px) { .foot__row { grid-template-columns: 1fr 1fr; } .foot__row p:last-child { text-align: right; } }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 300; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; padding: 12px 20px; border-radius: 999px; background: var(--pearl); color: var(--ink); font-size: 15px; transition: opacity .5s, transform .8s var(--pour); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- case study */
.cs__head { padding-top: clamp(108px, 13vh, 160px); text-align: center; }
.back { font-size: 15px; text-decoration: none; display: inline-flex; gap: 10px; align-items: center; color: var(--mute); }
.back::before { content: ''; width: 22px; height: 1px; background: currentColor; transition: width .8s var(--pour); }
.back:hover::before { width: 36px; }
.cs__t { font: 260 clamp(56px, 10vw, 190px) / .88 var(--display); letter-spacing: -.055em; margin-top: -.06em; padding: .06em 0 .16em; margin-bottom: -.16em; text-wrap: balance; }
.cs__tag { font-size: clamp(19px, 1.6vw, 26px); line-height: 1.35; max-width: 34ch; margin: 26px auto 0; color: var(--mute); }
.cs__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 48px; margin-top: 32px; font-size: 15px; }
.cs__meta dt { font-size: 13px; color: var(--mute); }
.cs__lead { margin-top: clamp(40px, 5vw, 72px); }
.cs__k { font: 500 13px/1.2 var(--display); color: var(--mute); margin-bottom: 16px; }
.cs__brief, .cs__body, .cs__res, .cs__ai { max-width: 1100px; padding-top: clamp(72px, 9vw, 150px); }
.cs__i { font: 300 clamp(28px, 2.9vw, 50px) / 1.12 var(--display); letter-spacing: -.03em; max-width: 30ch; }
.cs__body > div { display: grid; gap: 1.1em; max-width: 64ch; font-size: clamp(17px, 1.2vw, 20px); }
@media (min-width: 1000px) { .cs__body { display: grid; grid-template-columns: 3fr 7fr; } }
.cs__ai ol { display: grid; gap: 28px var(--gap); counter-reset: a; }
@media (min-width: 900px) { .cs__ai ol { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cs__ai li { border-top: 1px solid var(--line); padding-top: 16px; }
.cs__ai h3 { font: 400 24px/1.1 var(--display); letter-spacing: -.03em; margin-bottom: 10px; }
.cs__ai p { font-size: 15px; color: var(--mute); }
/* 28 Nov (Adam): case figures sit in composed rows (gallery_rows in build.py), not a staggered grid. A row is justified:
   each picture grows by its aspect, so all share one height and the captions line up. A row is never taller than
   --rh; a narrower row is centred. Phones stack everything except the phone recordings. */
.gs { --rh: min(78vh, 820px); display: grid; gap: clamp(44px, 5.4vw, 100px); padding-top: clamp(72px, 9vw, 150px); }
.gr { display: flex; flex-direction: column; gap: clamp(44px, 5.4vw, 100px); }
.gr > .g { min-width: 0; margin: 0; }
@media (min-width: 700px) {
  .gr { flex-direction: row; align-items: flex-start; gap: var(--gap);
    width: min(100%, calc(var(--sa) * var(--rh) + (var(--n) - 1) * var(--gap))); margin-inline: auto; }
  .gr > .g { flex: var(--a) 1 0; }
}
.gr--phone { flex-direction: row; justify-content: center; gap: clamp(20px, 4vw, 72px); width: 100%; }
.gr--phone > .g { flex: 0 0 auto; width: min(300px, 40vw); }
.gr--phone .pic { max-width: none; }
.g figcaption { font-size: 14px; color: var(--mute); margin-top: 12px; }
.g--phone .pic { border-radius: 28px; box-shadow: 0 0 0 5px var(--ink); max-width: 360px; margin-inline: auto; }
.g .slot { aspect-ratio: 16 / 9; }
.cs__res p { font: 300 clamp(26px, 2.4vw, 42px) / 1.16 var(--display); letter-spacing: -.03em; max-width: 32ch; }
.nx { display: grid; justify-items: center; text-align: center; gap: 8px; padding-block: clamp(120px, 14vw, 240px); text-decoration: none; }
.nx__t { font: 260 clamp(52px, 9vw, 170px) / .9 var(--display); letter-spacing: -.055em; transition: letter-spacing 1.2s var(--pour); }
.nx:hover .nx__t { letter-spacing: -.01em; }
.nx__h { color: var(--mute); font-size: 19px; }

/* ---------------------------------------------------------------- ask
   A drop of the site's liquid surface that talks. It docks at the foot of the screen and leaves the page in use.
   The iridescence lives in three places: the drop itself (the hero's shader, live), a thin-film rim that turns to
   face the pointer, and the words, which condense out of a split of colour as they arrive. */
@property --rim { syntax: '<angle>'; inherits: true; initial-value: 140deg; }
/* the rim's film (Adam, 27 Nov evening): the game cards' foil, pastel and widely spaced, four hues fading in and out over
   most of the edge instead of five saturated bands packed into a third of it (here and on the Ask button) */
.ask { --glass: rgba(13, 15, 21, .78); --edge: rgba(246, 244, 250, .12); --soft: rgba(246, 244, 250, .62);
  position: fixed; inset: var(--ask-top, 76px) var(--ask-right, 12px) auto auto; z-index: 40; margin: 0; padding: 0; border: 0; background: none; overflow: visible;
  width: min(440px, calc(100vw - 20px)); max-height: none; color: var(--pearl); display: none; gap: 8px; }
.ask[open] { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; align-content: start; align-items: start; }
/* Safari gives an open dialog a tall box and would stretch the three parts to fill it: size to the content, always.
   The box itself never takes clicks, only its parts do. */
.ask { height: auto; height: max-content; min-height: 0; pointer-events: none; }
.ask > * { pointer-events: auto; }
.ask__card, .ask__f { position: relative; background: var(--glass); -webkit-backdrop-filter: blur(26px) saturate(1.7); backdrop-filter: blur(26px) saturate(1.7);
  box-shadow: 0 0 0 1px var(--edge), 0 24px 60px -24px rgba(8, 9, 14, .55); }
/* the rim: a thin film whose colours sit on the side nearest the pointer */
.ask__card::before, .ask__f::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--rim), transparent 0 12%, #7cc4f2 34%, #b49ae0 51%, #eca6c8 66%, #f1d79e 81%, transparent 97%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .55; transition: opacity .6s var(--pour); }
.ask.is-busy .ask__card::before, .ask.is-busy .ask__f::before, .ask__f:focus-within::before { opacity: 1; }
.ask.is-busy { animation: rim-run 1.4s linear infinite; }
@keyframes rim-run { to { --rim: 500deg; } }

.ask__card { border-radius: 26px; display: grid; }
.ask__log { max-height: min(calc(100vh - 320px), 400px); overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 20px; display: grid; gap: 12px; align-content: start; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; }
@media (hover: hover) and (pointer: fine) { .ask__log { max-height: min(calc(100vh - 300px), 520px); } }   /* no on-screen keyboard: room for a whole answer */
/* the bottom matches the sides (Adam, 28 Nov): 20px under buttons and follow-ups; when a paragraph ends the log, its baseline sits 20px from the edge (the line's 7px below the baseline is taken back) */
.ask__log > :last-child > p:last-child { margin-bottom: -7px; }
.ask__log.fade-b { -webkit-mask-image: linear-gradient(#000 calc(100% - 56px), transparent); mask-image: linear-gradient(#000 calc(100% - 56px), transparent); }   /* more below */
.ask__n { padding: 8px 20px 14px; font-size: 12px; line-height: 1.4; color: var(--soft); }
.m { display: grid; gap: 10px; }
.m--you { font-size: 13px; line-height: 1.4; color: var(--soft); }
.m--me p { font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.m--me .who { display: none; }
/* each word condenses: split into colour and out of focus, then whole */
.w { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .w { animation: condense .7s var(--pour) both; animation-delay: calc(min(var(--n), 46) * 26ms); }
  @keyframes condense { from { opacity: 0; filter: blur(7px); transform: translateY(5px); text-shadow: -7px 0 #ff6ad5, 7px 0 #6ad8ff, 0 5px #ffd36a; } 60% { opacity: 1; filter: blur(0); } to { text-shadow: 0 0 transparent, 0 0 transparent, 0 0 transparent; } }
  /* it grows out of the Ask button: the bar starts as the button's own pill, then the rest unfolds beneath it */
  .ask[open] .ask__f { transform-origin: 100% 0; animation: ask-morph .75s var(--pour) both; }
  @keyframes ask-morph { from { transform: translate(var(--tx, 0px), var(--ty, -46px)) scale(var(--sx, .18), var(--sy, .6)); background-color: transparent; box-shadow: 0 0 0 1px transparent, 0 0 0 0 transparent; } }
  .ask[open] .ask__f > * { animation: ask-fade .45s var(--pour) .28s both; }
  @keyframes ask-fade { from { opacity: 0; } }
  .ask[open] .ask__chips, .ask[open] .ask__card, .ask[open] .ask__x { transform-origin: 100% 0; animation: ask-in .7s var(--pour) .3s both; }
  .ask[open] .ask__card { animation-delay: .4s; }
  @keyframes ask-in { from { opacity: 0; filter: blur(12px); transform: translateY(-14px) scale(.96); } }
  .ask.is-closing .ask__f { animation: ask-unmorph .32s var(--pour) both; }
  @keyframes ask-unmorph { to { transform: translate(var(--tx, 0px), var(--ty, -46px)) scale(var(--sx, .18), var(--sy, .6)); opacity: 0; } }
  .ask.is-closing .ask__chips, .ask.is-closing .ask__card, .ask.is-closing .ask__x { animation: ask-out .22s ease both; }
  @keyframes ask-out { to { opacity: 0; transform: translateY(-8px); } }
  .srcs, .acts, .ask__next { animation: ask-in .7s var(--pour) 1s both; }
}
.ask a:not(.act) { color: inherit; }
.srcs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.srcs > p { display: none; }
.src { flex: none; display: flex; gap: 10px; align-items: center; text-decoration: none; padding: 6px 14px 6px 6px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--edge); max-width: 230px; transition: background-color .4s; }
.src:hover { background: rgba(246, 244, 250, .1); }
.src .ico { flex: none; width: 14px; height: 14px; margin-left: -4px; vertical-align: 0; }   /* opens a page: arrow after the text, like the project labels */
.src:hover .ico, .src:focus-visible .ico { transform: translateX(4px); }
.src img { width: 40px; height: 40px; object-fit: cover; border-radius: 11px; flex: none; }
.src > span:first-child { padding-left: 8px; }   /* a card with no picture: even sides */
.src span { display: grid; font-size: 13px; line-height: 1.25; min-width: 0; } .src b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .src i { display: none; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.act { cursor: pointer; text-decoration: none; padding: 8px 16px; border-radius: 999px; font-size: 14px; border: 0; background: var(--pearl); color: var(--night); }
.act + .act { background: none; color: var(--pearl); box-shadow: inset 0 0 0 1px var(--edge); }
.thinking { font-size: 14px; color: var(--soft); }
/* follow-up questions under an answer: quieter than the preset chips, the same pill */
.ask__next { display: flex; gap: 6px; flex-wrap: wrap; }
.ask__nx { cursor: pointer; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 0; color: var(--soft); background: none; box-shadow: inset 0 0 0 1px var(--edge); transition: color .3s, background-color .3s; }
.ask__nx:hover, .ask__nx:focus-visible { color: var(--pearl); background: rgba(246, 244, 250, .08); }
.ask__chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 4px; --fl: 0px; --fr: 0px; -webkit-mask: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent); mask: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent); transition: --fl .35s ease, --fr .35s ease; }
.ask__chips.fade-l { --fl: 48px; }
.ask__chips.fade-r { --fr: 48px; }
.ask__chips button { flex: none; cursor: pointer; font-size: 13px; padding: 7px 13px; border-radius: 999px; border: 0; color: var(--pearl); background: rgba(13, 15, 21, .92); -webkit-backdrop-filter: blur(26px) saturate(1.7); backdrop-filter: blur(26px) saturate(1.7); box-shadow: inset 0 0 0 1px var(--edge); transition: background-color .3s; }
.ask__chips button:hover { background: rgba(40, 44, 56, .9); }
.ask__bar { display: flex; align-items: center; gap: 8px; }   /* the bar, and the close circle off its right end (Adam, 28 Nov) */
.ask__f { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 999px; }   /* 32px circles sit 8px in from every edge of the 48px bar (Adam, 28 Nov: they were 36px) */
.ask__drop { width: 32px; height: 32px; flex: none; border-radius: 50%; background: conic-gradient(from 200deg, #1a1d27, #6ad8ff, #a06aff, #ff6ad5, #ffd36a, #1a1d27); box-shadow: inset 0 0 0 1px var(--edge); transition: transform .9s var(--pour); }
.ask.is-busy .ask__drop { transform: scale(1.12); }
.ask__f input { flex: 1; min-width: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 16px; outline: none; padding: 0 6px; height: 36px; }
.ask__f input::placeholder { color: var(--soft); }
.ask__f button { width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center; font-size: 17px; background: var(--pearl); color: var(--night); }
.ask__x { flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--pearl);
  background: var(--glass); -webkit-backdrop-filter: blur(26px) saturate(1.7); backdrop-filter: blur(26px) saturate(1.7);
  box-shadow: 0 0 0 1px var(--edge), 0 24px 60px -24px rgba(8, 9, 14, .55); transition: background-color .4s; }
.ask__x:hover { background: rgba(40, 44, 56, .9); }
.ask__x svg { width: 16px; height: 16px; }
.ask :focus-visible { outline: 2px solid #6ad8ff; outline-offset: 2px; }
.ask__f input:focus-visible { outline: 0; }   /* the rim lights up instead */

::view-transition-old(root) { animation: .5s var(--pour) both fade-out; }
::view-transition-new(root) { animation: .9s var(--pour) both fade-in; }
@keyframes fade-out { to { opacity: 0; filter: blur(8px); } }
@keyframes fade-in { from { opacity: 0; filter: blur(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } html { scroll-behavior: auto; } }

/* Portfolio V2: the veil pages pass through on the way to and from the gallery */
.veil { position: fixed; inset: 0; z-index: 45; background: var(--porcelain); pointer-events: none; opacity: 1; transition: opacity .52s var(--pour); }
.veil.is-off { opacity: 0; }
@media (max-width: 760px) { .top__nav a.top__gal { display: inline; } }

/* Portfolio V2: the custom cursor from adamzinzan.com, in the site's ink and type (assets/gallery/ui.js) */
/* the system cursor stays hidden: a see-through 1px image first, `none` as the fallback. Some browsers let the arrow
   back over a bare `none` while the page scrolls under a still mouse (Adam, 28 Nov); an image cursor is held */
html.has-cursor, html.has-cursor *, html.has-cursor ::backdrop { cursor: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7") 0 0, none !important; }
#cursor { position: fixed; top: 0; left: 0; width: 0; height: 0; pointer-events: none; z-index: 9999; opacity: 0; transition: opacity 220ms ease; will-change: transform; }
#cursor.is-active { opacity: 1; }
#cursor .cursor-shape { position: absolute; transform: translate(-50%, -50%); width: 15px; height: 15px; border-radius: 50%; background: var(--ink);
  transition: width 220ms cubic-bezier(.2,.8,.2,1), height 220ms cubic-bezier(.2,.8,.2,1), border-radius 220ms cubic-bezier(.2,.8,.2,1), background-color 280ms ease, opacity 200ms ease, transform 220ms cubic-bezier(.2,.8,.2,1); }
#cursor[data-theme="light"] .cursor-shape { background: #E9E9EC; }
#cursor[data-mode="ibeam"] .cursor-shape { width: 3px; height: 19px; border-radius: 2px; }
/* over anything clickable the cursor becomes a lens: it blurs what shows through it. No edge (Adam, 28 Nov): the glass
   itself is tinted, ink over light things and pearl over dark ones, just enough to clear 3:1 against what is under it
   (WCAG 1.4.11). ui.js measures what is under the cursor and sets --lens; the fallback suits the porcelain ground */
#cursor[data-mode="link"] .cursor-shape { width: 19px; height: 19px; background: var(--lens, rgba(15, 17, 21, .52));
  -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3); }
#cursor.is-down .cursor-shape { transform: translate(-50%, -50%) scale(.8); }
#cursor[data-mode="tile-label"] .cursor-shape { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
#cursor .cursor-label, #mobile-label { height: 34px; padding: 0 16px; border-radius: 999px; background: var(--ink); color: var(--pearl); display: inline-flex; align-items: center; white-space: nowrap;
  font: 500 14px/1 var(--sans); letter-spacing: -.01em; box-shadow: 0 10px 24px -12px rgba(15, 17, 21, .5); }
#cursor .cursor-label { position: absolute; transform: translate(-50%, -50%) scale(.4); opacity: 0; transition: opacity 180ms ease, transform 240ms cubic-bezier(.2,.8,.2,1); }
#cursor[data-mode="tile-label"] .cursor-label { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#mobile-label { position: fixed; z-index: 60; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: none; opacity: 0; transition: opacity 160ms ease; }
#mobile-label.is-shown { opacity: 1; }

/* Portfolio V2: arriving from the gallery, the lead shows the tile's image at once while the full one loads */
/* the gallery tile's own image sits under the lead and is decoded before the first paint, so the frame is never empty */
.cs__lead .pic .pic__ph { position: absolute; inset: 0; z-index: 0; }
.cs__lead .pic img:not(.pic__ph) { position: relative; z-index: 1; }
/* case studies come into focus on load (the inverse of the gallery tiles receding).
   Arriving from the gallery the heading and lead are already in place, so only what follows does. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes focus-in { from { opacity: 0; filter: blur(18px); transform: scale(.9); } }
  /* not in the gallery: there the copy of the heading that flies in is animated by gallery.js, and Safari let this
     animation fight that one (the heading appeared, vanished, then popped back) */
  html:not(.from-gal) body:not(.gal) .cs__head > * { animation: focus-in 1.1s var(--pour) calc(.25s + var(--i, 0) * .09s) both; }
  .cs__head > :nth-child(2) { --i: 1; } .cs__head > :nth-child(3) { --i: 2; } .cs__head > :nth-child(4) { --i: 3; }
  html.from-gal .cs__lead ~ :not(.cs__head) { animation: focus-in 1.1s var(--pour) .15s both; }   /* the heading already came into focus in the gallery */
}
/* arriving from the gallery: the full-size lead fades in over the tile's image, no pop */
html.from-gal .cs__lead .pic img:not(.pic__ph) { opacity: 0; transition: opacity .5s, transform 1.4s var(--pour); }
html.from-gal .cs__lead .pic img.is-in { opacity: 1; }
html.from-gal .cs__lead .pic.is-gl img { opacity: 0; transition: none; }

/* ---------------------------------------------------------------- page to page
   Shared pictures move from their old place to their new one; the rest of the new page fades in over the old.
   The names are given by the small script in each page's head (VT_JS in tools/build.py). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-group(*) { animation-duration: .72s; animation-timing-function: cubic-bezier(.16, .84, .2, 1); }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: vt-in .38s ease both; }
@keyframes vt-in { from { opacity: 0; } }
::view-transition-image-pair(*) { overflow: hidden; }
::view-transition-old(*), ::view-transition-new(*) { height: 100%; object-fit: cover; }
html.vt-in .veil { opacity: 0 !important; transition: none !important; }

/* text blocks: the build glues each block's last two words (no orphans at any width); 'pretty' also evens the rag
   where the browser supports it */
p, li, dd, figcaption, blockquote { text-wrap: pretty; }
.nb { white-space: nowrap; }
/* the tight line-height puts descenders outside the heading's box; Safari clips a blurred element to its box,
   so the box is padded to hold them (the negative margin keeps the layout as it was) */
.wk__t, .nx__t { padding-bottom: .14em; margin-bottom: -.14em; }

/* pictures (project pages, home rows, lab and portrait; not the More work thumbnails) come into focus as they enter the view, growing to their size (initReveal in app.js) */
@media (prefers-reduced-motion: no-preference) {
  html.js :is(.gs .pic, .gs .slot, .wk__pic, .lb .pic, .ab__p .pic) { opacity: 0; filter: blur(10px); transform: scale(.94);
    transition: opacity .9s var(--pour), filter 1.1s var(--pour), transform 1.3s var(--pour); }
  html.js :is(.gs .pic, .gs .slot, .wk__pic, .lb .pic, .ab__p .pic).is-in { opacity: 1; filter: none; transform: none; }
}

/* Portfolio V2: List | Gallery, one switch between the two ways to browse the same work.
   The same tinted glass as the Ask button and the cursor lens; the current view is filled. */
.view { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }
html:not([data-tone="light"]) .view { background: rgba(255, 255, 255, .1); }
a.view__o { display: inline-flex; align-items: center; gap: 5px; padding: 5px 13px 5px 10px; border-radius: 999px; font-size: 14px; line-height: 1;
  opacity: .6; transition: opacity .5s var(--pour), background-color .5s var(--pour), color .3s ease; }
a.view__o::after { display: none; }
a.view__o:hover, a.view__o:focus-visible { opacity: 1; }
a.view__o[aria-current] { opacity: 1; background: color-mix(in srgb, currentColor 13%, transparent); }
.view__i { width: 16px; height: 16px; flex: none; }
@media (max-width: 760px) {
  a.view__o { display: inline-flex; padding: 5px 9px; }
  .view__o span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* the Ask button matches the switch: 32px tall, 14px type, the same faint ring and glass (the rim still runs on hover) */
.top .top__ask { display: inline-flex; align-items: center; height: 32px; padding: 0 15px; font-size: 14px; line-height: 1;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }

/* the switch's knob slides between the two views (SWITCH_JS in build.py) */
.view { position: relative; }
.view__o { position: relative; z-index: 1; }
.view__k { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px; pointer-events: none; opacity: 0;
  background: color-mix(in srgb, currentColor 13%, transparent); transition: transform .45s var(--pour), width .45s var(--pour), opacity .3s; }
.view.has-k .view__k { opacity: 1; }
.view.has-k .view__o[aria-current] { background: none; }
.view.is-moving .view__o[aria-current] { opacity: .6; }
.view[data-to="list"] .view__o[data-v="list"], .view[data-to="gallery"] .view__o[data-v="gallery"], .view[data-to="game"] .view__o[data-v="game"] { opacity: 1; }

/* Portfolio V2: Impact. Each figure is a link to the case study it comes from. */
.ims { display: grid; gap: 0 clamp(24px, 3vw, 56px); margin-top: clamp(56px, 7vw, 120px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.ims li { display: flex; border-top: 1px solid var(--line); }
.im { display: grid; align-content: start; gap: 10px; width: 100%; padding: clamp(28px, 3vw, 44px) 0 clamp(36px, 4vw, 64px); text-decoration: none; }
.im__f { font: 200 clamp(56px, 6vw, 104px) / .9 var(--display); letter-spacing: -.06em; }
.im__l { font-weight: 500; font-size: 17px; margin-top: 8px; }
.im__t { color: var(--mute); font-size: 15px; line-height: 1.45; max-width: 34ch; text-wrap: pretty; }
/* the project link matches the featured rows' "View case study" link (.wk__go) */
.im__go { justify-self: start; display: inline-flex; gap: 10px; align-items: center; margin-top: 14px; font-size: 15px; font-weight: 600; border-bottom: 1px solid currentColor; padding-bottom: 3px; }
.im:hover .im__go .ico, .im:focus-visible .im__go .ico { transform: translateX(6px); }

/* Portfolio V2 nav (26 Nov): Work · About · Ask. The List | Gallery switch shows only on the Work page.
   Phones show the words too (they fit); the Work page hides its own Work link there to make room for the switch. */
@media (max-width: 760px) {
  .top__nav { gap: 18px; }
  .top__nav a { display: inline; }
  a.view__o { display: inline-flex; }
}
.top__nav a[aria-current="page"]::after { transform: scaleX(1); }
/* the bar iPhone Safari 26 samples for the strip around the Dynamic Island (build.py SB): masked, so nobody sees it;
   near-black (or a study's own ground) under a dark header, porcelain under a light one (Adam, 28 Nov) */
.sb { position: fixed; top: 4px; left: 50%; transform: translateX(-50%); width: 89%; height: 11px; z-index: 999; pointer-events: none;
  background-color: var(--bar-ground, var(--porcelain)); -webkit-mask-image: linear-gradient(transparent, transparent); mask-image: linear-gradient(transparent, transparent); }
html:not([data-tone="light"]) .sb { background-color: var(--bar-ground, var(--night)); }

/* Portfolio V2 home sub-nav: "On this page", desktop only. Centred in the header, the same tinted glass as the
   List | Gallery switch; hidden over the hero, fades in after it; the section you are in is filled. */
.otp { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: none; gap: 2px; padding: 3px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .6s var(--pour), transform .8s var(--pour), visibility 0s .6s, background-color .6s var(--pour); }
html:not([data-tone="light"]) .otp { background: rgba(255, 255, 255, .1); }
html.otp-on .otp { opacity: 1; visibility: visible; transform: none; transition: opacity .6s var(--pour), transform .8s var(--pour), visibility 0s, background-color .6s var(--pour); }
.top .otp a { padding: 6px 13px; border-radius: 999px; font-size: 14px; line-height: 1; opacity: .6; transition: opacity .5s var(--pour), background-color .5s var(--pour); }
.top .otp a:hover, .top .otp a:focus-visible { opacity: 1; }
.top .otp a[aria-current] { opacity: 1; background: color-mix(in srgb, currentColor 13%, transparent); }
@media (min-width: 1024px) { .otp { display: inline-flex; } }
/* toggles: a knob glides under the chosen item (ui.js glide()); the same timing as the view switch's knob */
.glide { position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: 999px; pointer-events: none; opacity: 0;
  transition: transform .45s var(--pour), width .45s var(--pour), height .45s var(--pour), opacity .3s; }
.has-glide > :not(.glide) { position: relative; z-index: 1; }
.otp .glide { background: color-mix(in srgb, currentColor 13%, transparent); }
.top .otp.has-glide a[aria-current] { background: none; }
.sec, #about { scroll-margin-top: 70px; }

/* Contact toast: clickable "Open mail app" link (desktop) */
.toast.has-link.is-on { pointer-events: auto; }
.toast a { color: inherit; text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }

/* Work page (26 Nov, Adam): Work stays in the nav, underlined. The List | Gallery switch leaves the nav cluster:
   centred in the header row on desktop (like home's "On this page" pill), a larger floating pill at the bottom on phones. */
.top > .view { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
@media (max-width: 760px) {
  .top > .view { position: fixed; top: auto; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; padding: 4px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent), 0 8px 28px rgba(13, 15, 21, .18); }
  .top > .view a.view__o { padding: 10px 18px 10px 15px; font-size: 15px; gap: 6px; }
  .top > .view .view__o span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .top > .view .view__i { width: 19px; height: 19px; }
  .top > .view .view__k { top: 4px; bottom: 4px; }
}
/* Memory is for desktops and tablets: phones, either way up, don't offer it (Adam, 28 Nov); game.js doesn't start there */
@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) { .view a.view__o[data-v="game"]:not([aria-current]) { display: none; } }
.no-game .view a.view__o[data-v="game"] { display: none; }
@media (max-width: 380px) {
  .top > .view a.view__o { padding: 10px 13px 10px 11px; gap: 6px; font-size: 14px; }
  .gv__in { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* Persistent nav (26 Nov, Adam): the veil between pages sits under the header (veil 45, header 50), so the nav never
   leaves the screen. While the veil is up the header takes the ink it has on the porcelain veil. */
html:has(.veil:not(.is-off)) .top, html:has(.veil:not(.is-off)) .top :is(a, button) { color: var(--ink); }
/* the lead picture stays above the veil on the way back to the Work page (initReturn in app.js) */
html.lead-up main { z-index: auto; }   /* main is its own layer (z-index 1); let the picture out of it while leaving */
html.lead-up #lead .pic { position: relative; z-index: 46; }
/* the switch lists the default view first: Gallery on desktop, List on phones (27 Nov) */
@media (min-width: 761px) { .view .view__o.top__gal { order: -1; } }
/* footer headline: 'AI-native design?' stays on one line (it broke after the hyphen on phones), lines balanced */
.foot__h { text-wrap: balance; }
.nw { white-space: nowrap; }
@media (max-width: 359px) { .foot__h { font-size: 38px; } }
/* home: More work moved to the Work page; Selected work ends with a link there (27 Nov) */
.wks__all { margin-top: clamp(40px, 5vw, 72px); }
.wks__all .wk__go .ico { transition: transform .5s var(--pour); }
.wks__all .wk__go:hover .ico, .wks__all .wk__go:focus-visible .ico { transform: translateX(6px); }

/* Portfolio V2 (27 Nov): Impact figures and the AI process steps sit on white cards with the images' 14px radius.
   Below 1000px each row side-scrolls (snapping, bleeding to the screen edge, the next card peeking) so the
   page doesn't stack 7 + 5 tall blocks on a phone. Desktop keeps the grid. */
.ims li { border-top: 0; }
.im, .st { background: #fff; border-radius: 14px; }
.im { padding: clamp(26px, 2.4vw, 40px) clamp(22px, 2vw, 36px) clamp(28px, 2.6vw, 44px); gap: 8px;
  transition: transform .5s var(--pour), box-shadow .5s var(--pour); }
/* raised: on a mouse, the card under the pointer; on touch rows (below), only the card snapped under the heading */
@media (hover: hover) and (pointer: fine) { a.im:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(15, 17, 21, .35); } }
a.im:focus-visible, .ims .im.is-on { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(15, 17, 21, .35); }
.im { display: flex; flex-direction: column; align-items: flex-start; }
.im__t { margin-bottom: 18px; } .im__go { margin-top: auto; }
.ims { gap: var(--gap); }
.st { border-top: 0; padding: clamp(22px, 2vw, 32px); }
.st__t { font-size: clamp(30px, 2.2vw, 40px); }
@media (min-width: 1000px) and (max-width: 1400px) { .sts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 999px) {
  .ims, .sts { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: min(80vw, 380px);
    gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(-1 * var(--m)); padding-inline: var(--m); scroll-padding-inline: var(--m); padding-bottom: 4px; }
  .ims::-webkit-scrollbar, .sts::-webkit-scrollbar { display: none; }
  .ims > li, .sts > li { scroll-snap-align: start; }
  .sts { grid-auto-columns: min(84vw, 400px); }

}
/* figures fit their card: one line, sized to the card's width */
.im { container-type: inline-size; }
.im__f { white-space: nowrap; font-size: min(104px, 23cqi); }
@media (max-width: 999px) { .im__f { font-size: min(84px, 23cqi); } }
/* 27 Nov: touch screens have no pointer for the rim to face, so it orbits slowly instead; asking still runs the fast orbit */
@keyframes rim-idle { from { --rim: 0deg; } to { --rim: 360deg; } }
@media (hover: none), (pointer: coarse) { @media (prefers-reduced-motion: no-preference) {
  .ask[open]:not(.is-busy) { animation: rim-idle 9s linear infinite; } } }
@media (hover: none), (pointer: coarse) { @media (prefers-reduced-motion: no-preference) {
  .ask.is-busy { animation: rim-idle 1.4s linear infinite; } } }


/* 27 Nov (Adam): tighter. Section headings sit about half as far from their content as before, and the phone
   header bar is about 18% shorter (76px → 62px). */
.wks, .ims { margin-top: clamp(28px, 3.6vw, 64px); }
.sts, .lbs, .bns { margin-top: clamp(26px, 3.2vw, 56px); }
.ixs { margin-top: clamp(24px, 2.8vw, 48px); }
.sec__l { margin-top: 12px; }
@media (max-width: 760px) { .top { padding-block: 15px; } }

/* 27 Nov (Adam): the Impact figures are filled with a soft repeating gradient in the footer's palette (deepened for
   white); each band is about one character wide, so a number shows two or three colours. Scroll moves it hard:
   --fy (0 → 1 while the section crosses the screen; CSS view timeline, JS fallback) and --fx (each card's own
   place in the swiped row, -1 … 1, set by app.js) turn its angle, stretch its bands and slide the colours through.
   Pure CSS paint. Background-clip:text clips to the box, so the box reaches under the descenders. */
@property --fx { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --fy { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --hv { syntax: '<number>'; inherits: true; initial-value: 0; }
/* 28 Nov (Adam): rollover shifts each number's fill by half a cycle; roll-off eases it back */
.im__f { transition: --hv .9s var(--pour); }
@media (hover: hover) and (pointer: fine) { a.im:hover .im__f { --hv: 1; } }
a.im:focus-visible .im__f { --hv: 1; }
.im__f { --o: 0; --bw: calc(.55em + var(--fy) * 1.3em + var(--fx) * .4em);   /* 28 Nov (Adam): much more dramatic on scroll (was .8em + fy * .5em, slide fy * 10) */
  --ph: calc((var(--o) + var(--fy) * 30 + var(--fx) * 12) * -1em - var(--hv) * var(--bw) * 3);   /* --hv: hover slides half a cycle (3 of 6 bands) */   /* the colours slide by shifting the stops (no tile seams) */
  font-weight: 240; padding-bottom: .16em; margin-bottom: -.16em;
  background: repeating-linear-gradient(90deg,   /* left to right (Adam); scroll slides and stretches the bands */
    #3d5bb0 var(--ph), #7b4fc0 calc(var(--ph) + var(--bw)), #b04a8c calc(var(--ph) + var(--bw) * 2), #c0703a calc(var(--ph) + var(--bw) * 3),
    #5f8f3e calc(var(--ph) + var(--bw) * 4), #2e8a8f calc(var(--ph) + var(--bw) * 5), #3d5bb0 calc(var(--ph) + var(--bw) * 6)) border-box no-repeat;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.ims li:nth-child(7n+2) .im__f { --o: 2.1; }
.ims li:nth-child(7n+3) .im__f { --o: 4.3; }
.ims li:nth-child(7n+4) .im__f { --o: 1.2; }
.ims li:nth-child(7n+5) .im__f { --o: 3.4; }
.ims li:nth-child(7n+6) .im__f { --o: 5.1; }
.ims li:nth-child(7n+7) .im__f { --o: 2.7; }
@supports (animation-timeline: view()) { @media (prefers-reduced-motion: no-preference) {
  #impact { animation: foil-y linear both; animation-timeline: view(block); }
  @keyframes foil-y { from { --fy: 0; } to { --fy: 1; } } } }

/* 27 Nov (Adam): the side-scrolling rows clip to their box, so they get room above and below for the raised card's
   lift and shadow (taken back with negative margins, so the layout doesn't move). app.js marks the snapped card .is-on. */
@media (max-width: 999px) {
  .ims, .sts { padding-top: 8px; padding-bottom: 44px; margin-top: calc(clamp(28px, 3.6vw, 64px) - 8px); margin-bottom: -40px; }
  .sts { margin-top: calc(clamp(26px, 3.2vw, 56px) - 8px); }
}

/* 27 Nov (Adam): "More featured work" is a card, not a small link: white, the images' 14px radius, display type,
   a peek at four more projects and a round arrow. It keeps the lens transition (data-veil). */
.wks__all { margin-top: clamp(48px, 6vw, 96px); }
.more { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "pics t go"; align-items: center; gap: clamp(16px, 2.2vw, 36px);
  padding: clamp(22px, 2.4vw, 40px) clamp(22px, 2.6vw, 44px); background: #fff; border-radius: 14px; text-decoration: none; color: var(--ink);
  transition: transform .6s var(--pour), box-shadow .6s var(--pour); }
.more__pics { grid-area: pics; display: flex; padding-left: 14px; }
.more__pics img { width: clamp(46px, 4.4vw, 72px); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; margin-left: -14px;
  box-shadow: 0 0 0 3px #fff; background: var(--tint); transition: margin .6s var(--pour), transform .6s var(--pour); }
.more__pics img:nth-child(odd) { transform: rotate(-4deg); } .more__pics img:nth-child(even) { transform: rotate(3deg); }
.more__t { grid-area: t; font: 260 clamp(30px, 4vw, 64px) / 1 var(--display); letter-spacing: -.045em; text-wrap: balance; }
.more__go { grid-area: go; width: clamp(48px, 4.4vw, 72px); aspect-ratio: 1; border-radius: 50%; background: var(--ink); color: var(--porcelain);
  display: grid; place-items: center; }
.more__go .ico { width: 36%; height: auto; transition: transform .5s var(--pour); }
@media (hover: hover) and (pointer: fine) {
  .more:hover { transform: translateY(-3px); box-shadow: 0 22px 48px -26px rgba(15, 17, 21, .4); }
  .more:hover .more__pics img { margin-left: -6px; transform: none; }
  .more:hover .more__go .ico { transform: translateX(4px); }
}
.more:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (max-width: 640px) {
  .more { grid-template-columns: 1fr auto; grid-template-areas: "pics pics" "t go"; row-gap: 20px; }
}
/* Game's star has thin points and empty corners, so it reads further from Gallery than Gallery does from List:
   the option starts closer to its neighbour (Adam, 27 Nov) */
a.view__o[data-v="game"] { padding-left: 6px; }
a.view__o[data-v="game"] .view__i { margin-left: -1px; }
@media (max-width: 760px) { .top > .view a.view__o[data-v="game"] { padding-left: 9px; } }
@media (max-width: 380px) { .top > .view a.view__o[data-v="game"] { padding-left: 6px; } }

/* 28 Nov (Adam): previous / next project tiles at the foot of each case study, in the "More featured work" card style.
   Side by side from 900px, stacked below. The picture is a .pic so View Transitions fly it into the next lead. */
.pn { display: grid; gap: clamp(12px, 1.6vw, 24px); padding-block: clamp(96px, 11vw, 180px); }
@media (min-width: 900px) { .pn { grid-template-columns: 1fr 1fr; } }
.pn .pn__a { grid-template-columns: auto 1fr auto; grid-template-areas: "pics t go"; }
.pn .pn--prev { grid-template-columns: auto 1fr auto; grid-template-areas: "go t pics"; }   /* 28 Nov (Adam): previous is mirrored: arrow left, picture right, name set right against the picture */
.pn--prev .pn__txt { text-align: right; justify-items: end; }
.pn__pic { grid-area: pics; width: clamp(56px, 5.6vw, 96px); aspect-ratio: 1; border-radius: 10px; flex: none; }
.pn__txt { grid-area: t; display: grid; gap: 6px; min-width: 0; }
.pn__txt .cs__k { margin: 0; }
.pn__t { font: 260 clamp(24px, 2.5vw, 44px) / 1.02 var(--display); letter-spacing: -.045em; text-wrap: balance; }
.pn .pn__go { width: clamp(44px, 3.6vw, 60px); }
@media (hover: hover) and (pointer: fine) { .pn--prev:hover .more__go .ico { transform: translateX(-4px); } }
