/* ==========================================================================
   DESIGN TOKENS — "Portfolio Nº01" editorial magazine
   Three voices, each with one job:
   - Pixel (Silkscreen, 1999): spread titles over photos + all metadata/folios.
     It is the "late-90s digital" voice the owner asked for; keep it to titles
     and small caps-like labels — it is unreadable as running text.
   - Akzidenz-Grotesk Pro: headlines, decks, features (AGENTS invariant 6).
   - Inter: long-form body only, where screen legibility beats character.
   ========================================================================== */
:root {
  /* Light canvas. --bg MUST stay #f6f7f9: it is also the WebGL clear colour and
     the 1x1 placeholder texture in js/dissolve.js — a mismatch shows as a seam
     where dissolved blocks meet the page. */
  --bg: #f6f7f9;
  --bg-surface: #ffffff;
  --rule: rgba(13, 18, 28, 0.14);
  --rule-strong: #0d121c;
  --text: #0d121c;
  --text-muted: #526071;
  --text-dim: #8b98a9; /* rules/decoration only: 2.74:1 on --bg, fails WCAG 1.4.3 for text */
  --accent: #0961f5; /* Y2K "desktop blue", borrowed from the desktopGeneration wallpapers */

  /* Silkscreen is drawn on an 8px grid. Use it ONLY at 16px or >= 32px: at 9-14px each
     font "pixel" lands between device pixels and smears (the a11y audit's main readability
     finding). Small labels use the --font-label recipe below instead. */
  --font-pixel: 'Silkscreen', 'Courier New', monospace;
  --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Akzidenz-Grotesk Pro Bold', 'Inter', sans-serif;
  --font-head-med: 'Akzidenz-Grotesk Pro Med', 'Inter', sans-serif;

  --gutter: clamp(20px, 4vw, 56px);
  --page-max: 1320px;
  /* The content column's side inset. Header and photo overlays use it too, so the logo,
     page labels and headlines share one left edge and the nav and photos one right edge
     (they used to sit 284px apart on a 2000px screen). Percentages, not 100vw: on
     fixed/absolute full-width boxes % resolves to the viewport *without* the scrollbar,
     matching the centred .page-inner; 100vw would drift by half a classic scrollbar. */
  --edge: max(var(--gutter), calc((100% - var(--page-max)) / 2));

  --lh-heading: 1.04;
  --lh-body: 1.62;

  /* Motion vocabulary. Built-in CSS easings are too soft to feel intentional.
     ease-out: anything responding to the user (hover, press, enter).
     ease-in-out: things moving on screen on their own. Never ease-in. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* Pixel title face alternatives for owner review (?type=... in the URL, see js/app.js).
   The fonts themselves are only fetched when the param is present. */
html[data-type="doto"]     { --font-pixel: 'Doto', monospace; }
html[data-type="vt323"]    { --font-pixel: 'VT323', monospace; }
html[data-type="pixelify"] { --font-pixel: 'Pixelify Sans', monospace; }
html[data-type="jersey"]   { --font-pixel: 'Jersey 10', monospace; }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: #ffffff;
}

html {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-inter);
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  overflow-x: hidden;
  min-height: 100vh;
}

/* `hidden` must always win. Author `display` rules (e.g. .link-group { display: flex })
   beat the UA's [hidden] style, which is how the hidden Network placeholders leaked back
   into the colophon after the a11y pass. */
[hidden] {
  display: none !important;
}

/* Every pressable element below has its own :active state, so the grey mobile tap
   flash is redundant (and reads as "website", not "printed object"). */
a,
.brand-lockup {
  -webkit-tap-highlight-color: transparent;
}

/* currentColor, not --accent: focus must stay visible white-on-photo, ink-on-paper and
   white-on-footer, and the accent blue disappears against the iceberg sky. */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Skip link: off-screen until keyboard-focused, then a solid ink tab above the header */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--text);
  color: #ffffff;
  font-family: var(--font-inter);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* Sections focused by js/app.js after an in-page jump (tabindex=-1) shouldn't get a
   giant outline; focus moving there is for the *next* Tab, not a visible state. */
[tabindex="-1"]:focus {
  outline: none;
}

/* Typographic polish: balanced headlines, no one-word orphans in running text */
h1, h2, h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* No film grain anywhere (2026-11-24). It first sat above ALL text and jittered forever,
   which lowered text contrast and failed WCAG 1.4.3 / 2.2.2; then it moved onto the hero
   photos only; now it is gone (see "WebGL Canvases" below). */

/* Shared blinking block cursor — the PS1 memory-card / BIOS prompt motif */
.cursor {
  display: inline-block;
  /* Blink 3 times, then rest solid. Infinite blinking fails WCAG 2.2.2 (no way to stop
     moving content after 5s) and pulls the eye away from reading. */
  animation: blink 1.06s steps(1) 3;
  margin-left: 0.04em;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ==========================================================================
   HERO TRACKS (scroll runways driving the WebGL dissolve)
   ========================================================================== */
.hero-track {
  position: relative;
  height: 220vh; /* Scroll runway driving the pixel dissolve */
  width: 100%;
}

.hero2-track {
  /* Materialize -> full photo -> natural scroll. Shortened from 240vh: the first ~45vh now
     runs under the overlapping Profile page, and a long pinned tail felt like a dead stop. */
  height: 200vh;
}

/* NO DEAD SCREENS between the photos and the pages (design critique, 2026-10-31).
   Before: after the cover dissolved, an empty pinned frame filled the screen; before the
   forest, an empty canvas scrolled in. Now the neighbouring pages overlap the runways:
   - the Profile page rises over the last part of the cover runway, into the space the
     bottom-up dissolve has already cleared (it used to be a contents page, removed by the
     owner as unnecessary on a site this short);
   - the Profile page slides off *over* the forest while it materializes bottom-up beneath.
   z: pages (10) sit above the canvases (1). Retune these with the runway heights. */
.page-article {
  margin-top: -80vh;    /* -50vh left ~half a screen of empty paper, -70vh still ~70% mid-dissolve */
  margin-bottom: -45vh; /* slides off over the forest */
}

/* In-page nav target for Hero 2. The dissolve finishes when the Profile page has fully slid
   off (track top at -45vh, js/dissolve.js P_END). Land at 54vh, just past that, so the
   finished forest + WORKS title fill the screen. */
.track-anchor {
  position: absolute;
  top: 54vh;
  left: 0;
  width: 1px;
  height: 1px;
}

.hero-sticky-frame {
  position: sticky;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* WebGL Canvases (Hero 1 & Hero 2) */
/* No film grain over the photos (removed 2026-11-24). A static 6% noise layer
   (.hero-sticky-frame::after, opacity driven by --photo from js/app.js) used to sit here to
   unify a grainy iceberg with a cleaner forest. The owner now wants the heroes "super sharp",
   and the grain softened every photo on top of the WebGL texture. Don't re-add it to hide a
   grainy photo: replace the photo instead. */

#hero-canvas,
#hero2-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* ==========================================================================
   SPREAD OVERLAYS — magazine cover furniture + pixel titles set over the photo
   z 2: above canvas (1), below header (100). Non-interactive so wheel/touch
   always reaches the page and the scroll-driven shader never stalls.
   ========================================================================== */
.spread-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  color: #ffffff;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: calc(clamp(24px, 3.5vw, 40px) + clamp(2rem, 1.4rem + 2.2vw, 3.4rem) + 28px) var(--edge) clamp(20px, 3vw, 36px);
  /* --fade is written by js/app.js from the track's effProgress (1 = fully visible) */
  opacity: var(--fade, 1);
}

/* No cover scrim (2026-11-24, dark sea from above, Unsplash IgWNxx7paz4). White vs the lightest
   10% of pixels in the top 22%, centre-cropped like getCoverUv, sRGB, bare photo: 13.8:1 at
   375px, 11.5 at 768, 6.7 at 1440, 5.9 at 2000 (bar 4.5), so nothing darkens the sea. Earlier
   the same day the river cover needed a 0.6 ::before plateau to 44% of a 55% band (3.8:1 at
   0.5); the glacier, 0.5. If a paler cover comes back, re-measure and restore that rule (git
   history). The flyover cover (2026-11-05) needed none either. */
.cover-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-inter);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  padding: 7px 0 6px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
  /* --tuck (0-1, js/app.js) collapses the strip from both sides to the centre as it rises
     towards the header mark, so it is gone before it would run through it. Scroll-scrubbed:
     no transition, the scroll is the timeline. The -12px insets keep the text-shadow and the
     rules uncut while the strip is whole. Opacity follows in the last third so no hairline
     sliver lingers at the centre. */
  clip-path: inset(-12px max(-12px, calc(var(--tuck, 0) * 50%)));
  opacity: clamp(0, (1 - var(--tuck, 0)) * 3, 1);
}

@media (prefers-reduced-motion: reduce) {
  /* Fewer moving parts, not none: the strip simply fades as it nears the mark. */
  .cover-strip {
    clip-path: none;
    opacity: calc(1 - var(--tuck, 0));
  }
}

/* The pixel spread title. Each character is wrapped in a .ch span by js/app.js so it can
   blink out (cover) or in (Works) block-by-block in step with the shader. */
.spread-title {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(4.2rem, 19vw, 22rem);
  line-height: 0.78;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-left: -0.04em; /* optical: pull the pixel stem onto the gutter line */
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}

/* Hard on/off, no transition: pixels either exist or they don't (PS1, not CSS fade) */
[data-pixel-title] .ch { display: inline-block; }
[data-pixel-title] .ch.off { visibility: hidden; }

/* Works spread. Current photo (2026-11-24): black ice with a clear shard (Unsplash KE1voN3Hkb4),
   the frozen half of the owner's pairing: liquid sea on the cover, frozen water here. Measured
   as for the cover (lightest 10%, sRGB, 375/768/1440/2000px). Bare: header band (top 22%)
   17.9/16.2/4.9/4.2:1, title band (18-56%) 4.6/4.1/3.9/3.9:1; the header misses 4.5 at 2000px,
   so a light 0.2 plateau: header 18.3/17.1/6.7/5.9:1, title 6.4/5.7/5.5/5.5:1 (bars 4.5 and 3).
   Earlier the same day: the glacier (7KTlL8vvrMk) needed 0.5, the river (TdJPTQvvlDQ) 0.6.
   Previous photo (2026-11-09 test): the overpass at dusk (39068). Its header band
   measured ~7:1 with a 0.5 top scrim; its title originally sat at the bottom, where the
   bright dusk glow gave ~1.1:1 and the ramps made it messy; since 2026-11-09 the title sits under the
   strip instead (see .spread-title below), so no bottom scrim is needed. The numbers below are for the PREVIOUS photo (the
   blurred freight train against a pale hazy sky, dark road below, 2026-11-05): measured on the photo (white vs the lightest 10% of pixels, sRGB
   blending, 375/1024/1440/2000px wide):
   - header + strip band (top 22%): only 1.5-1.7:1 (the sky and the sun flare are pale), so it
     needs the top scrim below. A 0.5 plateau of near-black gives 4.4-4.9:1 (0.3 only 2.9-3.3).
   - title band (bottom 66-96%): 8.8-10:1 already (dark road), so no bottom scrim.
   Earlier scrims are in git history for other photos (forest: pale-green-black top scrim; storm
   road: 0.40 bottom scrim; tower: none). Re-measure whenever the photo changes.
   Like the old forest scrim, it lives in the overlay, so it fades in with --fade and never
   darkens the empty canvas. */
.spread-overlay--works::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 55%;
  z-index: -1;
  pointer-events: none;
  /* header + strip only since the title moved to the bottom: plateau to ~24%, gone by 55% */
  background: linear-gradient(rgba(6, 10, 16, 0.2) 0%, rgba(6, 10, 16, 0.2) 44%, rgba(6, 10, 16, 0) 100%);
}

/* Bottom scrim for the WORKS title (2026-11-24, black ice). Bare, the bottom title band measured
   18.7/10.2:1 at 375/768px but only 3.3/2.8:1 at 1440/2000px, where the bright shard crosses it
   (bar 3, large text). 0.3 from 60% down: 5.8/5.0:1 at 1440/2000. Mirror of the top scrim. */
.spread-overlay--works::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(rgba(6, 10, 16, 0) 0%, rgba(6, 10, 16, 0.3) 25%, rgba(6, 10, 16, 0.3) 100%);
}

.spread-overlay--works {
  grid-template-rows: auto 1fr auto; /* strip / space / title */
  /* minmax(0,1fr): the title's box is wider than its ink (the S's right bearing sticks out past
     the column), and with the default auto column that overhang widened the track and
     stretched the strip past the right edge (found 2026-11-05). */
  grid-template-columns: minmax(0, 1fr);
  /* 100cqw below is this overlay's content box (the strip's column). Needs a definite width:
     the overlay is position:absolute with inset:0, so it has one. */
  container-type: inline-size;
}

/* Title position (2026-11-24, black ice, owner: "maybe works could be in the bottom?"): grid row
   3, bottom, with its own bottom scrim (above). History: row 2 under the strip for the
   2026-11-09 dusk overpass (row 3 crossed its ramps and glow, owner: "messy") and for the
   glacier; row 3 for the 2026-11-05 train (dark road); ink at the bottom over the glacier was
   tried (dfbfc2a, owner: the text should be white). Re-measure and pick the row again if the
   photo changes.
   Its INK spans the whole column, strip
   rule to strip rule. Silkscreen (measured 2026-11-05 with canvas measureText) leaves 0.125em of
   side bearing left of the W and right of the S, and the -0.02em letter-spacing trims 5
   advances: box = 3.775em, ink = 3.545em. So font-size = column / 3.545, and margin-left
   -0.125em puts the W's stem on the gutter line (replacing the generic -0.04em optical pull).
   If the face, the word or the letter-spacing changes, re-measure or the title stops short of /
   overruns the right edge. */
.spread-overlay--works .spread-title {
  grid-row: 3;
  align-self: end;
  justify-self: start;
  font-size: calc(100cqw / 3.545);
  margin-left: -0.125em;
}


/* Cover spread (iceberg): only the issue strip in the sky; nothing on the snow, no scroll
   cue (see index.html for everything tried). Any text added on the lower half must be ink,
   not white: the snow there is near-white. */



/* ==========================================================================
   PERSISTENT STICKY BRANDMARK & NAVIGATION
   Colour of .brand-lockup and .nav-link is driven inline by js/dissolve.js
   (AGENTS invariant 4) — do not hardcode colour here without that in mind.
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: clamp(24px, 3.5vw, 40px) var(--edge);
  z-index: 100;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  /* Happens once per pass over the cover, so a layout-triggering padding change is
     acceptable here; keep it short so the header doesn't feel like it lags the scroll. */
  transition: padding 240ms var(--ease-out);
}

.site-header.scrolled {
  padding: 18px var(--edge);
}

/* Paper backing so page headlines don't run under the mark. Opacity is --paper, written by
   js/dissolve.js as (1 - white-mark weight): 0 over photos/footer, 1 over light pages.
   Only in .scrolled state — on the cover the header must stay fully transparent. */
.site-header::before {
  content: '';
  position: absolute;
  /* Extends 40px below the header so the fade has room. The old version (solid to 70%,
     then a ~25px linear ramp) showed a hard band, worst over photos: a short linear
     alpha ramp has a visible start edge. Solid behind mark + nav (first 56px of the 64px
     scrolled header), then an eased ("scrim") fall-off with stops bunched toward the end,
     so there's no edge. The fall-off is 48px: it was 74px and read as text fading out too
     early under the header (owner, 2026-11-02). Stops are in px so its length doesn't
     change with the header height. */
  inset: 0 0 -40px 0;
  z-index: -1;
  background: linear-gradient(
    rgb(var(--paper-rgb)) 0,
    rgb(var(--paper-rgb)) 56px, /* = PAPER_SOLID in js/dissolve.js */
    rgb(var(--paper-rgb) / 0.94) 63px,
    rgb(var(--paper-rgb) / 0.82) 69px,
    rgb(var(--paper-rgb) / 0.65) 76px,
    rgb(var(--paper-rgb) / 0.46) 83px,
    rgb(var(--paper-rgb) / 0.28) 89px,
    rgb(var(--paper-rgb) / 0.13) 96px,
    rgb(var(--paper-rgb) / 0.04) 101px,
    rgb(var(--paper-rgb) / 0) 104px
  );
  /* Canvas by default, ink over the dark footer (.over-footer). Cut off at the footer's top
     edge while it slides up (--paper-clip, px from the viewport top, set by js/dissolve.js),
     so the light fade never lies over the ink. */
  --paper-rgb: 246 247 249;
  clip-path: inset(0 0 max(0px, calc(100% - var(--paper-clip, 100%))) 0);
  opacity: 0;
  pointer-events: none;
  /* Without this the backing pops in on the single frame .scrolled is added */
  transition: opacity 200ms var(--ease-out);
}

.site-header.scrolled::before {
  opacity: var(--paper, 0);
}

.site-header.over-footer::before { --paper-rgb: 13 18 28; }

.brand-lockup {
  display: inline-flex;
  align-items: baseline;
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3.4rem);
  line-height: 1;
  color: #ffffff;
  /* No colour transition: js/dissolve.js writes the colour every frame from an already
     eased weight. A CSS transition on top re-targets each frame and adds ~250ms of lag. */
  transition: font-size 240ms var(--ease-out), transform 160ms var(--ease-out);
  transform-origin: left center;
  user-select: none;
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none; /* it's an <a> now (keyboard reachable); colour comes from dissolve.js */
}

/* Clicking the mark scrolls to top — acknowledge the press */
.brand-lockup:active {
  transform: scale(0.97);
}

.site-header.scrolled .brand-lockup {
  font-size: clamp(1.4rem, 1.1rem + 0.8vw, 1.8rem);
}

/* sona wordmark (SVG <symbol id="sona-mark"> in index.html, assets/sona-mark.svg).
   Sized in em so the existing font-size rules on .brand-lockup / .footer-mark (and the
   header's shrink-on-scroll) keep working unchanged. The margins reproduce exactly where
   the old live-text logo's ink sat inside its 1em line box, so header and footer layout
   did not move when it became an SVG:
     hhea ascent 0.998 / descent 0.277, line-height 1 -> baseline 0.8605em from the top;
     ink spans 0.546em above to 0.016em below the baseline -> top 0.3145em, height 0.562em.
   Width follows the viewBox ratio (2841 / 562). Colour is currentColor, so the inline colour
   js/dissolve.js writes on #brand-lockup still applies. */
.sona-mark {
  display: block;
  height: 0.562em;
  width: calc(0.562em * 2841 / 562);
  margin: 0.3145em 0 0.1235em;
  fill: currentColor;
  overflow: visible;
}

/* The sonaworks logo (the default since the owner's A/B, 2026-11-01; ?mark=sona shows the old
   mark without this class). Same scale as sona (1 font unit = 0.001em), so the shared letters are exactly the same size. The k's ascender makes the ink
   box 160 units taller (706 vs 546 above the baseline), so the top margin shrinks by that
   much and the baseline stays where it was. */
.sona-mark--works {
  height: 0.722em;
  width: calc(0.722em * 6226 / 722);
  margin-top: 0.1545em;
}

/* At full size sonaworks is 2.2x as wide as sona: on a 375px phone it ran into the nav
   (0px gap, sona leaves 39px). Below 480px the header copy is drawn at half size: measured
   gap 31px at 375, at the cost of letters half the size of sona's there. The footer mark has
   the width to stay full size. */
@media (max-width: 480px) {
  /* At half size its box would be only half the lockup's 1em, and the coarse-pointer padding
     below assumes 1em of content (it measured 28px tall, under the 44px target). Adding half
     an em (= 1em at this font-size) of margin, split top and bottom, restores the 1em box
     without moving the ink off centre. */
  .brand-lockup .sona-mark--works { font-size: 0.5em; margin: 0.6545em 0 0.6235em; }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 36px);
  pointer-events: auto;
}

.nav-link {
  font-family: var(--font-inter);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 200ms ease, transform 160ms var(--ease-out);
  position: relative;
  padding: 6px 0;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  user-select: none;
}

/* Hover underline. A colour change alone can't be the hover cue: over the photos
   js/dissolve.js already sets the links to pure white inline, so there is nothing
   brighter to change to. A growing rule works on photo, paper and ink alike, and is
   transform-only. */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 200ms var(--ease-out);
}

/* Gated: on touch, :hover sticks after a tap and leaves the underline stranded */
@media (hover: hover) and (pointer: fine) {
  .nav-link:hover::after {
    transform: scaleX(1);
  }

  .site-header.scrolled .nav-link:hover {
    color: var(--accent);
  }
}

.nav-link:active {
  transform: scale(0.97);
}

.site-header.scrolled .nav-link {
  color: var(--text-muted);
}

/* ==========================================================================
   PAGES — every section between spreads is a magazine "page" with a running
   head (.page-head).
   ========================================================================== */
.page {
  position: relative;
  z-index: 10;
  background: var(--bg);
  padding: clamp(96px, 12vw, 160px) var(--gutter) clamp(40px, 5vw, 64px);
}

.page-inner {
  max-width: var(--page-max);
  margin: 0 auto;
}

.page-head {
  display: flex;
  justify-content: space-between;
  border-top: 2px solid var(--rule-strong);
  padding-top: 10px;
  margin-bottom: clamp(40px, 6vw, 88px);
}

/* Label recipe (--font-label): Inter 12px / 600 / 0.08em caps. Replaces the 10-12px pixel
   face for all running heads, labels, metadata and folios. Colour never lighter than
   --text-muted (5.99:1). */
.kicker,
.side-label {
  font-family: var(--font-inter);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.side-label {
  display: block;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* The Profile's folio bar ("sona / Profile / p.04-07") was removed at owner request
   (2026-11-02); its footprint was kept as padding here so the Works timing would not move.
   Dropped on 2026-11-25 when the owner found the gap from the Clients list to the Works photo
   too long: the photo starts building when the Profile's bottom edge is 70% down the screen
   (P_START in js/dissolve.js), so every pixel of paper below the Clients is seen as empty
   canvas before it. Paper under the Clients is now ~120px at 1440 (was 230). */
.page-article .page-inner { padding-bottom: 0; }

/* --- Article (Profile) --------------------------------------------------- */
.article-headline {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 6rem);
  line-height: var(--lh-heading);
  letter-spacing: -0.035em;
  max-width: 14ch;
}

/* Profile opener, text first (owner's pick on 2026-11-25 of three layout prototypes, "B"):
   headline, greeting, story and Clients in one column on the left, the full uncropped 2:3
   portrait on the right. Story cols 1-6, an empty col 7 as a channel, photo cols 8-12.
   The owner knows it is the most standard of the three and chose it anyway: it read best.
   Edges: headline cap tops on the photo's top edge, last client's baseline on its bottom edge
   (both checked by tests/verify.js). History: until 2026-11-25 the headline ran full width
   above a 1.45:1 text/photo grid with a 4:5 crop; the shorter bio left a ~220px hole above
   Clients there. A 2.2:1 grid was tried and called broken (hole between text and photo). */
.profile-headline {
  font-size: clamp(2.2rem, 3.6vw, 3.6rem);
  line-height: 1.06;
  max-width: none;
  /* -0.18em lifts the cap tops of Akzidenz Bold (line-height 1.06) onto the photo's top edge. */
  margin: -0.18em 0 clamp(28px, 3vw, 48px);
}

.profile-opener {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(20px, 3vw, 48px);
  align-items: stretch; /* text column spans the photo's height (see .profile-intro) */
  margin-bottom: clamp(40px, 4vw, 56px); /* see .page-article .page-inner: shorter run-out to Works */
}

.profile-intro {
  grid-column: 1 / 7;
  display: flex;
  flex-direction: column;
  /* Capped at 20px: the column stops growing at 1320px while type would keep growing, and at
     22px the text ran past the photo at 2000. */
  font-size: clamp(17px, 1.4vw, 20px);
  /* The story sits at the top with natural 1.1em gaps (margins below, not flex gap, so the
     headline can keep its own larger step); the Clients list is pushed to the bottom
     (.profile-facts margin-top: auto) so its last baseline lands on the photo's bottom edge.
     Whatever height the photo has over the text collects in that one space above Clients. */
}

/* Type ladder: headline 80 > greeting ~30 > body 17.5 (at 2000px). The ~23px standfirst step
   was dropped with the 2026-11-01 copy: five lines of display type read as a heavy block. */
.profile-greet {
  font-family: var(--font-head-med);
  font-size: clamp(1.2rem, 1.9vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 1.1em;
}

.profile-lede {
  font-family: var(--font-inter);
  line-height: 1.62;
  letter-spacing: -0.005em;
  color: var(--text-muted);
  margin-bottom: 1.1em;
}

.profile-lede strong { color: var(--text); font-weight: 600; }

/* The portrait rides alongside the story: if the text runs longer than the photo at some
   width, the photo stays in view instead of leaving a gap under it. top clears the
   shrunk header (~65px) plus breathing room. */
.profile-portrait {
  grid-column: 8 / -1;
  position: sticky;
  top: 96px;
  align-self: start; /* sticky needs a box shorter than its row */
}

/* The whole 2:3 photo (assets/portrait-anton.jpg, 1334x2000), uncropped: the owner wants the
   full figure. Never crop it to fit one screen (an earlier cap cut it to ~1:1). */
.profile-portrait img {
  aspect-ratio: 2 / 3;
  height: auto;
  object-fit: cover;
}

/* 901-1100px: body type sits at its 17px floor, so the story's height barely changes while
   the 12-column photo shrinks with the screen. With 5 photo columns the text ran up to ~90px
   past the photo (1000-1060px); with 6 it fell ~110px short (1060-1080). Measured across the
   range, the photo needs ~420-440px to match the text, so it gets that width outright here and
   the text column takes the rest. */
@media (min-width: 901px) and (max-width: 1100px) {
  .profile-opener { grid-template-columns: minmax(0, 1fr) 432px; column-gap: 7vw; } /* ~ the empty channel column above 1100 */
  .profile-intro { grid-column: 1; }
  .profile-portrait { grid-column: 2; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Clients, closing the text column beside the portrait (was a row under the spread, with a
   "Currently" block that the 2026-11-01 bio made redundant). */
.profile-facts {
  margin-top: auto; /* anchors Clients to the photo's bottom edge (see .profile-intro) */
  border-top: 1px solid var(--rule);
  padding-top: clamp(16px, 1.5vw, 24px);
}

.profile-facts .credit-list {
  /* Smaller than the shared .credit-list size: at 2000px the full size pushed the column
     ~5px past the photo, where it has no slack left (all paragraph gaps at their minimum). */
  font-size: clamp(1.05rem, 1.25vw, 1.25rem);
  /* Two rows of four, filled column by column. A grid with content-sized columns, not CSS
     columns: with four equal columns "Motionvolt Games" wrapped, the list grew a third row
     and the column ran ~50px past the photo (2026-11-02). Names never wrap; the spare width
     goes between the columns. */
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: space-between;
  column-gap: clamp(16px, 2vw, 32px);
  white-space: nowrap;
  /* Last client's baseline on the photo's bottom edge: Akzidenz Bold at line-height 1.25
     leaves 0.2778em below the baseline (measured). Checked by tests/verify.js. */
  margin-bottom: -0.2778em;
}

.credit-list {
  list-style: none;
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
}

/* --- Works features ------------------------------------------------------ */
.page-works {
  padding-top: clamp(64px, 9vw, 120px);
  /* Mirrors the top: the last project otherwise sat ~50px above the dark colophon. */
  padding-bottom: clamp(64px, 9vw, 120px);
}

.feature {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  align-items: end;
  margin-bottom: clamp(80px, 12vw, 180px);
}

.feature-media {
  overflow: hidden;
  background: #e9ecf0;
}

/* <picture> (AVIF + fallback) must not add a box: the img keeps sizing against the figure. */
.feature-media picture { display: contents; }

.feature-media img {
  display: block;
  width: 100%;
  height: auto;
}

/* Keeps a compound together at a line break (the Profile headline broke as "AI-" / "native"). */
.nowrap { white-space: nowrap; }

/* No scroll reveal on the images (owner, 2026-11-03): they used to "print" in with a clip-path
   wipe and an overscale settle the first time they scrolled into view; the owner asked for
   that to go, on the Works page and the Profile portrait as on the case studies. They are
   simply there. Don't bring back a .js-gated hidden state: a JS failure would hide the work. */

.feature--portrait .feature-media { grid-column: 1 / span 6; }
.feature--portrait .feature-text  { grid-column: 8 / span 5; }

.feature--square .feature-media { grid-column: 6 / span 7; }
.feature--square .feature-text  { grid-column: 1 / span 4; grid-row: 1; }

.feature-num {
  display: block;
  font-family: var(--font-pixel);
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: 0.8;
  color: var(--accent);
  margin-bottom: 20px;
}

.feature-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4.2vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.feature-meta {
  font-family: var(--font-inter);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 14px;
}
/* A second meta line (project type, then role and status) belongs to the first: keep them one block. */
.feature-meta + .feature-meta { margin-top: 4px; }

/* Links inside a project's caption: the title (to its case study) and "Live demo" (to the
   hosted build). They inherit the caption's type and colour so the layout is unchanged. The
   title shows the underline on hover only (gated); "Live demo" is always underlined because
   it sits in running meta text, where nothing else marks it as a link (and touch has no hover). */
.feature-link {
  color: inherit;
  text-decoration: none;
  transition: color 200ms var(--ease-out);
}
.feature-link--meta {
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* The meta "Live demo" link keeps its colour on hover and press (owner, 2026-11-02: blue read
   as odd inside the grey label line); it is already underlined, so it needs no extra cue. */
.feature-link:not(.feature-link--meta):active { color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .feature-link:not(.feature-link--meta):hover { color: var(--accent); text-decoration: underline; text-underline-offset: 0.1em; text-decoration-thickness: 0.06em; }
}

.feature-desc {
  font-family: var(--font-inter);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 20px;
  max-width: 38ch;
}

.feature-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 40px);
}

.feature--wide {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  margin-bottom: 0;
}

.feature--wide .feature-text {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 16px;
  align-items: baseline;
}

.feature--wide .feature-num {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  margin: 0;
  grid-row: span 2;
}

.feature--wide .feature-title { font-size: clamp(1.4rem, 2.2vw, 2rem); }
.feature--wide .feature-meta { margin-top: 6px; }

/* Project features with a framed screenshot (EventStudio, Kitefly). The screenshots are app
   UIs: at full column width (1320px) they overwhelmed the page and read as a wallpaper, so the
   image takes 8 of 12 columns and the caption sits beside it, bottom-aligned (.feature already
   has align-items: end). --flip mirrors it so consecutive projects zig-zag.
   Pale UIs on the pale canvas had no edge, so the figure gets a darker mat plus a hairline.
   The mat is padding on the figure, not a box-shadow: the figure is overflow:hidden, which
   would clip any outer shadow. The image
   keeps its own radius so the UI corners don't poke out of the mat. */
.feature--split .feature-media { grid-column: 1 / span 8; }
.feature--split .feature-text  { grid-column: 9 / span 4; }
.feature--split.feature--flip .feature-media { grid-column: 5 / span 8; }
.feature--split.feature--flip .feature-text  { grid-column: 1 / span 4; grid-row: 1; }

.feature--split .feature-media {
  padding: clamp(8px, 1.2vw, 18px);
  background: #e3e7ec;
  border-radius: clamp(10px, 1.2vw, 16px);
}
.page-works .feature:last-child { margin-bottom: 0; } /* .page-works padding-bottom spaces the colophon */
.feature--split .feature-media img {
  border-radius: clamp(5px, 0.7vw, 9px);
  box-shadow: 0 0 0 1px rgba(13, 18, 28, 0.08);
}

/* ==========================================================================
   CONTACT / COLOPHON
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 10;
  background: var(--text);
  color: #f6f7f9;
  padding: clamp(96px, 12vw, 160px) var(--gutter) clamp(28px, 4vw, 48px);
}

.footer-title {
  font-family: var(--font-pixel);
  font-weight: 400;
  /* Never wraps: at 375px the 3.6rem floor was wider than the column, and the cursor "_"
     dropped to its own line where it read as a stray dash. "CONTACT_" measures 5.92em in
     Silkscreen, so the size is capped to fit the column (/ 6.1 leaves a little air). */
  font-size: min(clamp(3.6rem, 15vw, 16rem), calc((100vw - 2 * var(--gutter)) / 6.1));
  white-space: nowrap;
  line-height: 0.8;
  text-transform: uppercase;
  margin-left: -0.04em;
}

.footer-mail {
  display: inline-block;
  margin-top: clamp(32px, 5vw, 64px);
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 4.4vw, 4rem);
  letter-spacing: -0.035em;
  color: #ffffff;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  transition: color 200ms ease, transform 160ms var(--ease-out);
  transform-origin: left center; /* press shrinks toward the text start, not the middle */
  word-break: break-all;
}

@media (hover: hover) and (pointer: fine) {
  .footer-mail:hover { color: #7fb0ff; }
}

.footer-mail:active {
  transform: scale(0.98);
}

.colophon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: clamp(72px, 10vw, 140px);
  padding-top: 24px;
  border-top: 1px solid rgba(246, 247, 249, 0.2);
}

.site-footer .side-label { color: rgba(246, 247, 249, 0.5); }

.link-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-static {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(246, 247, 249, 0.8);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: clamp(64px, 9vw, 120px);
}

.footer-mark { font-size: clamp(2.4rem, 5vw, 4rem); }

.footer-copy {
  font-family: var(--font-inter);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 247, 249, 0.65);
}

/* ==========================================================================
   CASE STUDY PAGE (eventstudio.html, body.page-case)
   A plain light page: no WebGL, no js/dissolve.js. That script is what normally colours the
   header from the scroll position over the photos, so here the header is fixed in its
   "scrolled" look by hand: ink mark (the default colour is white, for the cover photo) and a
   fully opaque paper backing (--paper is otherwise written inline every frame). Without these
   two rules the white mark is invisible on the pale canvas. The nav already turns
   --text-muted through `.site-header.scrolled .nav-link`, which the markup applies.
   ========================================================================== */
.page-case .site-header { --paper: 1; }
.page-case .brand-lockup { color: var(--text); }
/* Over the dark footer (.over-footer, toggled by initCaseHeader() in js/app.js): mark and nav go
   white, as on the index. The :hover line keeps the nav from turning accent blue on the ink. */
.page-case .site-header.over-footer .brand-lockup,
.page-case .site-header.over-footer .nav-link,
.page-case .site-header.over-footer .nav-link:hover { color: #ffffff; }

.case-back {
  text-decoration: none;
  /* Grown by padding and pulled back by margin so the row keeps its height but the tap target
     reaches 44px on touch (the head row is only 12px of text). */
  padding-block: 4px;
}
@media (pointer: coarse) {
  .case-back { padding-block: 16px; margin-block: -16px; }
}
@media (hover: hover) and (pointer: fine) {
  .case-back:hover { text-decoration: underline; text-underline-offset: 4px; }
}
.case-back:active { transform: scale(0.97); transform-origin: left center; }

.case-title { max-width: none; }

.case-intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  margin-top: clamp(32px, 5vw, 64px);
}

.case-lede {
  grid-column: 1 / span 7;
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.1vw, 1.9rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
}

.case-side { grid-column: 9 / span 4; }

.case-facts div + div { margin-top: 18px; }
.case-facts .side-label { margin-bottom: 4px; }
.case-facts dd {
  font-family: var(--font-inter);
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--text);
}

/* Outlined button in the label voice (Inter 12px caps). Ink on paper, inverted on hover; the
   arrow is text, so it inherits the colour. 48px tall clears the 44px touch target. */
.case-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  margin-top: 32px;
  border: 2px solid var(--text);
  font-family: var(--font-inter);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out), transform 160ms var(--ease-out);
  transform-origin: left center;
}
@media (hover: hover) and (pointer: fine) {
  .case-cta:hover { background: var(--text); color: #ffffff; }
}
.case-cta:active { transform: scale(0.97); }

/* The screenshot: 10 of 12 columns, my call (2026-11-02). Full column width was tried on the
   Works page and the owner called it too big; this is the case study's one big image, so it
   gets more room than the 8 columns there but not the whole column. Same matte and hairline as
   .feature--split, which is scoped to that class and so cannot be reused. It is
   not a .feature-media (which only means the shared figure sizing now): the owner wants this
   image there immediately, as on the Works page. */
.case-shot {
  max-width: 83.34%;
  margin-top: clamp(48px, 7vw, 96px);
}
.case-media {
  padding: clamp(8px, 1.2vw, 18px);
  background: #e3e7ec;
  border-radius: clamp(10px, 1.2vw, 16px);
}
.case-media picture { display: contents; }
.case-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(5px, 0.7vw, 9px);
  box-shadow: 0 0 0 1px rgba(13, 18, 28, 0.08);
}

.case-end { margin-top: clamp(32px, 5vw, 56px); }
.case-end .case-cta { margin-top: 0; }

/* Narrative sections, for the owner's copy (see the placeholder comment in eventstudio.html). */
.case-section { margin-top: clamp(56px, 8vw, 112px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.case-h { grid-column: 1 / span 4; font-family: var(--font-head); font-size: clamp(1.4rem, 2.2vw, 2rem); letter-spacing: -0.03em; line-height: 1.05; }
.case-body { grid-column: 5 / span 7; }
.case-body .case-p + .case-p { margin-top: 1.1em; }
/* Footnote marker and source line. The marker is a link to the note; 12px label voice for the note. */
.case-fn { font-size: 0.7em; line-height: 0; margin-left: 2px; }
.case-fn a { color: inherit; text-decoration: none; }
.case-source { margin-top: 28px; max-width: 62ch; font-family: var(--font-inter); font-size: 12px; line-height: 1.5; letter-spacing: 0.02em; color: var(--text-muted); }
.case-source sup { font-size: 12px; line-height: 0; margin-right: 2px; } /* default sup size would drop it under the 12px minimum */
.case-source a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.case-p { font-family: var(--font-inter); font-size: 17.5px; line-height: var(--lh-body); color: var(--text-muted); max-width: 62ch; }
/* Bulleted list in a case section (EventStudio "How it works", 2026-11-24). Items reuse .case-p for
   the body voice; the list gets the same 1.1em rhythm as paragraphs so it doesn't read as a separate block. */
.case-body .case-list { margin: 1.1em 0 0; padding-left: 1.2em; list-style: disc; }
.case-body .case-list + .case-p { margin-top: 1.1em; }
.case-list .case-p + .case-p { margin-top: 0.6em; }
.case-list strong { font-weight: 600; color: var(--text); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .case-lede, .case-side, .case-h, .case-body { grid-column: 1 / -1; }
  .case-shot { max-width: none; }

  /* Stacked order the owner liked on phones: headline, greeting, photo, then the ledes.
     .profile-intro dissolves (display: contents) so its children can be ordered around the
     figure inside one flex column. */
  .profile-opener { display: flex; flex-direction: column; gap: clamp(16px, 4vw, 24px); align-items: stretch; }
  .profile-intro { display: contents; }
  .profile-greet { order: 1; margin-top: 0; }
  .profile-intro { margin-bottom: 0; }
  .profile-portrait { order: 2; margin: 8px 0; position: static; }
  .profile-intro > :not(.profile-greet) { order: 3; }
  /* The headline lives in .profile-intro since 2026-11-25; it still leads on phones. */
  .profile-intro > .profile-headline { order: 0; margin: 0 0 clamp(16px, 4vw, 24px); font-size: clamp(2.4rem, 4.6vw, 5rem); }
  .profile-greet, .profile-lede { margin-bottom: 0; }
  .profile-portrait { grid-column: auto; }
  .profile-portrait img { aspect-ratio: 1 / 1; object-position: 50% 15%; max-height: none; } /* square: cap to hips */
  .profile-facts { margin-top: 16px; }
  .profile-facts .credit-list { grid-template-rows: repeat(4, auto); justify-content: start; column-gap: 32px; margin-bottom: 0; }

  .feature--portrait .feature-media,
  .feature--portrait .feature-text,
  .feature--square .feature-media,
  .feature--square .feature-text,
  .feature--split .feature-media,
  .feature--split .feature-text,
  .feature--split.feature--flip .feature-media,
  .feature--split.feature--flip .feature-text {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .feature-pair { grid-template-columns: 1fr; gap: clamp(56px, 10vw, 96px); }
}

/* Touch: 44px-tall nav targets (WCAG 2.5.5). Padding, not font size, so the line stays calm. */
@media (pointer: coarse) {
  .nav-link { padding: 14px 0; }
  /* The mark's box is 1em tall (32px on phones, ~22px once the header shrinks), so pad it up
     to 44px from its own size: em here is .brand-lockup's font-size, so this tracks the
     shrink-on-scroll. Symmetric padding keeps the ink where it was, and the 44px nav links
     already set the header row height, so nothing else moves. */
  .brand-lockup { padding-block: max(0px, calc((44px - 1em) / 2)); }
}

/* Below 360px the mark and nav were 2px apart */
@media (max-width: 360px) {
  .brand-lockup { font-size: 1.7rem; }
  .site-nav { gap: 10px; }
  .nav-link { font-size: 12px; letter-spacing: 0.06em; }
}

@media (max-width: 640px) {
  .hide-sm { display: none; }

  .site-nav { gap: 14px; }

  .colophon { grid-template-columns: 1fr; }
}

/* Reduced Motion: fewer and gentler, not zero. Movement goes (cursor blink,
   smooth scroll, slides, press scales); colour and opacity changes that
   help comprehension stay. The title block-dissolve in js/app.js degrades to a fade, and
   app.js also switches its scrollIntoView calls to 'auto'. */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  .cursor {
    animation: none !important;
  }
  .brand-lockup:active,
  .nav-link:active,
  .footer-mail:active {
    transform: none !important;
  }
}
