/* =============================================================================================
   Samuel Obadina — portfolio stylesheet (hand-authored, not generated)
   Binding rules: .claude/skills/portfolio-design/SKILL.md (v1.1; finding codes such as [M1] refer to
   context/review/DESIGN_REVIEW_2026-10-06.md). Values marked PROPOSED there are unapproved starting
   points: change them here, in the token block, and nowhere else.
   tools/build.py fails the build on any colour literal outside the token block.
   ============================================================================================= */

/* tokens:start */
:root {
  /* Type — PROPOSED (design skill §1). Every size is in rem so text follows the reader's default
     font size [S7]; the values equal the skill's px at a 16px root. Swap a family in one line. */
  --font-sans: "Geist", ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-slide-title: clamp(2.75rem, 6.6vw, 6.5rem);
  --fs-statement: clamp(1.25rem, 1.8vw, 1.625rem);
  --fs-slide-line: clamp(1.0625rem, 1.35vw, 1.25rem);
  --fs-closing: clamp(2rem, 4.4vw, 4rem);
  --fs-label: .75rem;
  --mark-h: clamp(20px, 12px + 1.1vw, 28px);  /* SO mark height: 20px phones → 28px desktop (≥~1450px) */
  --fs-wordmark: .9375rem;
  --fs-small: .6875rem;
  --fs-case-title: clamp(2.5rem, 5.4vw, 5rem);
  --fs-standfirst: clamp(1.1875rem, 1.8vw, 1.5rem);
  --fs-overview: clamp(1.3125rem, 2vw, 1.625rem);
  --fs-h2: clamp(1.75rem, 3vw, 2.5rem);
  --fs-h3: clamp(1.375rem, 2vw, 1.75rem);
  --fs-body: clamp(1.125rem, 1.25vw, 1.25rem);
  --fs-caption: .9375rem;
  --chrome-row: 1.5rem;     /* the 24px chrome / label row */
  --small-lh: 1rem;         /* 16px line for 11px labels */
  --index-pitch: 1.75rem;   /* 28px index rows [C4] */

  /* Palette — PROPOSED (design skill §2). */
  --ground: #0B0B0C;
  --surface: #141416;
  --line: #26262A;
  --ink: #F5F5F2;
  --ink-2: #B8B8B3;
  --ink-3: #8A8A85;
  --paper: #FAFAF7;
  --paper-2: #EFEEE9;
  --paper-line: #E2E1DA;
  --paper-ink: #141414;
  --paper-body: #2B2B2B;
  --paper-muted: #55554F;
  --paper-meta: #6B6B65;
  /* Loopsave — read from loopsave.com CSS; the soft tints and the label grey are derived for
     legibility on dark [C2]. */
  --ls-brand: #5D15BA; /* Figma variable "brand color", Loopsave brand file, read 8 Oct 2026 */
  --ls-indigo: #1E1452;
  --ls-violet: #6F00FF;
  --ls-lavender: #F9F4FF;
  --ls-violet-soft: #A98BFF;
  --ls-violet-pale: #C9B6FF;
  --ls-ink-3: #CFC8E6; /* derived: 5.72:1 on --ls-brand (the old #A3A0B5 gave 3.62) */
  --ls-screen: #F8FAFC;      /* LOOP 02 screen ground, read from the exported PNG (not a screenshot) */
  --ls-screen-line: #D7D7D7; /* LOOP 02 frame outline, same source */

  /* Spacing scale (design skill §3): use nothing else. */
  --s-4: 4px;
  --s-8: 8px;
  --s-12: 12px;
  --s-16: 16px;
  --s-24: 24px;
  --s-32: 32px;
  --s-48: 48px;
  --s-64: 64px;
  --s-96: 96px;
  --s-128: 128px;
  --s-160: 160px;
  --inset: clamp(20px, 3.4vw, 48px);
  --chrome-y: clamp(16px, 2.2vw, 32px);
  --chrome-h: calc(var(--chrome-y) * 2 + var(--chrome-row));
  --slide-pb: clamp(24px, 3.4vw, 48px);
  --chapter-gap: clamp(64px, 8vw, 128px);
  --h3-gap: clamp(48px, 5vw, 64px);
  --figure-gap: clamp(32px, 4vw, 64px);
  --measure: min(680px, calc(var(--fs-body) * 34)); /* ≈69 characters at 18px, 680px at 20px [S3] */
  --wide: 1120px;
  --hit: 44px;
  --dot: 6px;                                         /* pill state dot [C1] */
  --media-min: calc(var(--s-96) + var(--s-128));      /* concept-visual row floor [C13] */
  --cv-caption: calc(var(--small-lh) + var(--s-12));  /* caption line + gap under a visual [C13] */

  /* Radii (design skill §5). */
  --r-inline: 6px;
  --r-pill: 999px;
  --r-device: 28px; /* the phone frame in the LOOP 02 morph's App view */
  --pan-w: 2400px;  /* LOOP 06 board width while explored: 1.25 image pixels per CSS pixel */

  /* Motion (design skill §10). One curve; the portrait exposure alone has its own [C9]. */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-expose: cubic-bezier(.4, 0, .2, 1);
  --ease-drift: cubic-bezier(.37, 0, .63, 1); /* symmetric, so a looping drift has no kink at the turn */
  --t-fast: 160ms;
  --t-mid: 280ms;
  --t-roll: 300ms;
  --t-slow: 600ms;
  --t-image: 1400ms;
  --stagger: 60ms;
  --travel: 8px;
}
/* tokens:end */

/* ---------------------------------------------------------------------------------------------
   Context roles. Components read --fg / --fg-2 / --fg-3 / --focus, so the same component works
   on the dark shell, the Loopsave scene and the light canvas.
   --------------------------------------------------------------------------------------------- */
:root {
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --fg-3: var(--ink-3);
  --focus: var(--ink);
  --rule: var(--line);
  --note-rule: var(--ink-3);
  --note-label: var(--ink-3);
  --note-text: var(--ink-2);
  --ph-bg: var(--surface);
  --ph-label: var(--ink-3);
  --ph-text: var(--ink-2);
  --caption: var(--ink-2);
  --accent: var(--ink-3);
  --pad-l: max(var(--inset), env(safe-area-inset-left));
  --pad-r: max(var(--inset), env(safe-area-inset-right));
  --pad-b: calc(var(--slide-pb) + env(safe-area-inset-bottom));
}

/* ---------------------------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ground);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-weight: 500; }
strong, b { font-weight: 500; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
main:focus { outline: none; }
main:focus-visible { outline: none; } /* programmatic skip-link target; the skip link itself carries the ring */

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icon { display: inline-block; flex: none; vertical-align: middle; overflow: visible; }

/* Mono label roles */
.index__link, .chrome-link, .menu-btn, .menu__label, .slide__context, .action, .eyebrow,
.next__label, .overview__label, .footer__label, .skip {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-label);
  line-height: var(--chrome-row);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.small, .cv__label, .portrait__code, .portrait__detail, .note__label, .meta dt, .ph__code,
.ph__need-label, .ph__purpose, .fig__code, .fig__open, .route__todo, .pill, .morph__mode,
.pan__enter, .pan__done {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-small);
  line-height: var(--small-lh);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Skip link */
.skip {
  position: fixed;
  z-index: 100;
  top: var(--s-8);
  left: var(--s-8);
  padding: var(--s-8) var(--s-12);
  background: var(--ink);
  color: var(--ground);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }
.skip:focus-visible { outline-color: var(--ink); }

/* ---------------------------------------------------------------------------------------------
   Roller: a label that rolls up to a CSS-generated duplicate (empty alt text, never read twice).
   The plain `content` is declared first so browsers without alt-text syntax still get a duplicate [C10].
   --------------------------------------------------------------------------------------------- */
.roll { position: relative; display: inline-block; overflow: hidden; vertical-align: top; white-space: nowrap; }
.roll__text { display: block; transition: transform var(--t-roll) var(--ease); }
.roll::after {
  content: attr(data-label);
  content: attr(data-label) / "";
  position: absolute;
  left: 0;
  top: 100%;
  transition: transform var(--t-roll) var(--ease);
}
a:hover .roll__text, a:hover .roll::after { transform: translateY(-100%); }

/* ---------------------------------------------------------------------------------------------
   Chrome — fixed, transparent, three zones (design skill §4, §7)
   Without JS it scrolls away with the dark opening, so it can never sit unreadably on paper.
   --------------------------------------------------------------------------------------------- */
.chrome {
  --fg: var(--ink);
  --fg-3: var(--ink-3);
  --focus: var(--ink);
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 30;
  color: var(--fg);
  pointer-events: none;
}
html.js .chrome { position: fixed; }

/* The backdrop is a layer exactly one chrome row tall — never the whole header box, which on the
   homepage includes the five-item index [M1]. site.js sets data-chrome-backdrop / -tone and
   --chrome-surface from the region under the chrome. */
.chrome::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: -2;
  height: calc(max(var(--chrome-y), env(safe-area-inset-top)) + var(--chrome-row) + var(--chrome-y));
  pointer-events: none;
  transition: background-color var(--t-mid) var(--ease);
}

.chrome__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  column-gap: var(--s-24);
  padding: max(var(--chrome-y), env(safe-area-inset-top)) var(--pad-r) var(--chrome-y) var(--pad-l);
}
.chrome a, .chrome button { pointer-events: auto; }

.chrome__left { grid-column: 1; justify-self: start; min-width: 0; }

/* The SO mark and the name share one cell, so neither moves the nav when they swap (skill §9).
   site.js sets html[data-brand]: the mark on the homepage entrance and once the page scrolls, the name
   at the top. Without it (no JS, or the failsafe) the name shows. */
.wordmark {
  grid-column: 2;
  justify-self: center;
  display: inline-grid;
  justify-items: center;
  align-items: center;
  height: var(--chrome-row);
  margin-right: -.16em; /* optical: tracking adds space after the last letter */
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: min(var(--fs-wordmark), 4.6vw); /* never touches "Menu" at 320px with large text [N2] */
  line-height: 1;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity var(--t-fast) var(--ease);
}
.wordmark:active { opacity: .7; }
.wordmark > * { grid-area: 1 / 1; }
.wordmark__name { display: block; }
.wordmark__mark {
  display: block;
  height: var(--mark-h); /* may exceed the 24px row; the chrome's padding absorbs it */
  width: auto;
  margin-right: .16em; /* centre on the letters, not on the name's trailing tracking */
  overflow: visible;
  fill: currentColor;
  opacity: 0;
}
html[data-brand="mark"] .wordmark__mark,
html.enter:not([data-brand]):not(.reveal-all) .wordmark__mark { opacity: 1; }
html[data-brand="mark"] .wordmark__name,
html.enter:not([data-brand]):not(.reveal-all) .wordmark__name { opacity: 0; transform: translateY(calc(var(--s-8) * -1)); }
/* While the name shows, the S halves wait 120 units out along their -27.3deg cut (~6px on screen), so the
   mark assembles as it returns. */
html[data-brand="name"] .mark__s-top { transform: translate(107px, -55px); }
html[data-brand="name"] .mark__s-bot { transform: translate(-107px, 55px); }
/* Hover (fine pointers) or keyboard focus previews the other form: name → mark, mark → name. Same
   travel and timing as the scroll swap; the swap itself is the hover feedback, so no opacity dim. */
@media (hover: hover) and (pointer: fine) {
  html[data-brand="name"] .wordmark:hover .wordmark__mark { opacity: 1; }
  html[data-brand="name"] .wordmark:hover .wordmark__name { opacity: 0; transform: translateY(calc(var(--s-8) * -1)); }
  html[data-brand="name"] .wordmark:hover :is(.mark__s-top, .mark__s-bot) { transform: none; }
  html[data-brand="mark"] .wordmark:hover .wordmark__mark { opacity: 0; }
  html[data-brand="mark"] .wordmark:hover .wordmark__name { opacity: 1; transform: none; }
  html[data-brand="mark"] .wordmark:hover .mark__s-top { transform: translate(107px, -55px); }
  html[data-brand="mark"] .wordmark:hover .mark__s-bot { transform: translate(-107px, 55px); }
}
html[data-brand="name"] .wordmark:focus-visible .wordmark__mark { opacity: 1; }
html[data-brand="name"] .wordmark:focus-visible .wordmark__name { opacity: 0; transform: translateY(calc(var(--s-8) * -1)); }
html[data-brand="name"] .wordmark:focus-visible :is(.mark__s-top, .mark__s-bot) { transform: none; }
html[data-brand="mark"] .wordmark:focus-visible .wordmark__mark { opacity: 0; }
html[data-brand="mark"] .wordmark:focus-visible .wordmark__name { opacity: 1; transform: none; }
html[data-brand="mark"] .wordmark:focus-visible .mark__s-top { transform: translate(107px, -55px); }
html[data-brand="mark"] .wordmark:focus-visible .mark__s-bot { transform: translate(-107px, 55px); }

.chrome__right { grid-column: 3; justify-self: end; display: flex; gap: var(--s-24); }

.chrome-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-8);
  height: var(--chrome-row);
  color: var(--fg-3);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.chrome-link:hover, .chrome-link[aria-current="page"] { color: var(--fg); }
.chrome-link:active { opacity: .7; }

/* Project index (homepage, ≥900px): scroll-spy on a 28px pitch; the progress line sits in the left
   gutter so labels never shift [C4]. It fades out once the work is over (More, Contact) [M1]. */
.index__list {
  display: grid;
  transition: opacity var(--t-mid) var(--ease), visibility 0s linear 0s;
}
html[data-scene="after"] .index__list {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-mid) var(--ease), visibility 0s linear var(--t-mid);
}
.index__link {
  position: relative;
  display: flex;
  align-items: center;
  width: max-content;
  height: var(--index-pitch);
  color: var(--fg-3);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.index__link:hover, .index__link[aria-current="true"] { color: var(--fg); }
.index__link:active { opacity: .7; }
.index__line {
  position: absolute;
  top: 50%;
  right: calc(100% + var(--s-8));
  width: min(24px, calc(var(--inset) - var(--s-16))); /* 8px clear of the screen edge at 900–960px [N4] */
  height: 1px;
  overflow: hidden;
  opacity: 0;
}
.index__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}
.index__link[aria-current="true"] .index__line { opacity: 1; }

/* Menu button and full-screen overlay (<900px) */
.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: var(--hit);
  min-height: var(--hit);
  margin: calc((var(--hit) - var(--chrome-row)) / -2) calc(var(--s-8) * -1) calc((var(--hit) - var(--chrome-row)) / -2) 0;
  padding: 0 var(--s-8);
  color: var(--fg-3);
  transition: color var(--t-fast) var(--ease);
}
.menu-btn:hover, .menu-btn[aria-expanded="true"] { color: var(--fg); }
.menu-btn:active { opacity: .7; }

.menu {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--chrome-h) + var(--s-32)) var(--pad-r) calc(var(--s-48) + env(safe-area-inset-bottom)) var(--pad-l);
  background: var(--surface);
  color: var(--ink);
  pointer-events: auto;
}
.menu[hidden] { display: none; }
.menu__nav { display: grid; gap: var(--s-48); }
.menu__back .chrome-link { color: var(--ink-2); } /* [S5] the way back to the scene, first row */
.menu__back .chrome-link:hover { color: var(--ink); }
.menu__label { color: var(--ink-3); margin-bottom: var(--s-12); }
.menu__list a {
  display: block;
  padding-block: var(--s-8);
  color: var(--ink-2);
  text-decoration: none;
  font-size: var(--fs-statement);
  line-height: 1.35;
  letter-spacing: -.01em;
  transition: color var(--t-fast) var(--ease);
}
.menu__list--primary a {
  color: var(--ink);
  font-weight: 500;
  font-size: var(--fs-closing);
  line-height: 1.05;
  letter-spacing: -.03em;
}
.menu__list a:hover { color: var(--ink); }
.menu__list a:active { opacity: .7; }
.menu__list a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }

html.menu-open, html.menu-open body { overflow: hidden; }

@media (max-width: 899px) {
  .chrome__bar { grid-template-columns: minmax(0, 1fr) auto; }
  .chrome__left, .chrome__right { display: none; }
  .wordmark { grid-column: 1; justify-self: start; justify-items: start; }
  .menu-btn { grid-column: 2; justify-self: end; display: inline-flex; }
  /* Without JS the menu cannot open: show the two links instead. */
  html:not(.js) .menu-btn { display: none; }
  html:not(.js) .chrome__right { display: flex; grid-column: 2; gap: var(--s-16); }
}

/* Chrome over the region beneath it [M1][S4][C2]: dark ink on 92% paper with a 12px blur over the
   light canvas; the solid surface colour (no blur) over dark or indigo text-bearing surfaces;
   nothing over the homepage entrance and project scenes. */
html[data-chrome-backdrop] .chrome::before { background: var(--chrome-surface, var(--ground)); }
html[data-chrome-backdrop][data-chrome-tone="light"] .chrome::before {
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
html[data-chrome-tone="light"] .chrome {
  --fg: var(--paper-ink);
  --fg-3: var(--paper-meta);
  --focus: var(--paper-ink);
}
html[data-chrome-tone="indigo"] .chrome { --fg-3: var(--ls-ink-3); }
/* Over the Loopsave artwork the right-hand links sit on a plate of the brand colour, so they stay legible
   when a coin passes behind them. */
html[data-chrome-tone="indigo"] .chrome__right {
  background: var(--ls-brand);
  padding: 0 var(--s-12);
  margin-right: calc(var(--s-12) * -1);
}
/* The menu overlay is dark whatever sits underneath: keep the chrome dark while it is open. */
html.menu-open .chrome { --fg: var(--ink); --fg-3: var(--ink-3); --focus: var(--ink); }
html.menu-open .chrome::before { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------------------------------------------------------------------------------------------
   Actions and links
   --------------------------------------------------------------------------------------------- */
.action {
  display: inline-flex;
  align-items: center;
  gap: var(--s-8);
  color: var(--fg);
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: var(--s-4);
}
.action .icon { transition: transform var(--t-fast) var(--ease); }
.action:hover { text-decoration-line: underline; }
.action:hover .icon { transform: translateX(4px); }
.action:active { opacity: .7; }
/* The whole slide is clickable, with one tab stop (the link itself). */
.action--stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }

/* ---------------------------------------------------------------------------------------------
   Homepage slides (design skill §4, §12)
   --------------------------------------------------------------------------------------------- */
html.page-home { scroll-padding-top: 0; }

.slide {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: minmax(var(--row-min, 0px), 1fr) auto;
  padding: calc(var(--chrome-h) + var(--s-24)) var(--pad-r) var(--pad-b) var(--pad-l);
  background: var(--slide-bg, var(--ground));
  color: var(--ink);
}
.slide__body { grid-row: 2; min-width: 0; }

.slide__context { color: var(--fg-3); margin-bottom: var(--s-16); }
.slide__title {
  font-size: var(--fs-slide-title);
  line-height: .98;
  letter-spacing: -.035em;
  color: var(--ink);
  text-wrap: balance;
}
.slide__line {
  max-width: 32em;
  margin-top: var(--s-16);
  font-size: var(--fs-slide-line);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}
.slide__action { margin-top: var(--s-24); }

/* Entrance: a portrait emerging from black, one statement bottom-left */
.slide--entrance { grid-template-rows: 1fr auto; overflow: hidden; }
.slide--entrance .slide__body { position: relative; z-index: 1; }
.statement {
  max-width: 22em;
  font-weight: 400;
  font-size: var(--fs-statement);
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--ink-2);
  text-wrap: balance;
}

.portrait { position: absolute; inset: 0; overflow: hidden; }
.portrait__light {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 30% 44% at 64% 40%,
      color-mix(in srgb, var(--ink) 9%, transparent) 0%,
      color-mix(in srgb, var(--ink) 4%, transparent) 46%,
      transparent 100%);
}
.portrait__label {
  position: absolute;
  left: 64%;
  top: 40%;
  translate: -50% -50%;
  display: grid;
  justify-items: center;
  gap: var(--s-4);
  width: max-content;
  max-width: min(80vw, 22rem);
  text-align: center;
}
.portrait__code { color: var(--ink-2); }
.portrait__detail { color: var(--ink-3); text-wrap: balance; }
/* Supplied portrait (HOME 01). The photo's black is pure black; `lighten` against an opaque
   ground layer lifts it to exactly --ground, so the photo melts into the page with no visible
   rectangle at any point of the exposure animation. The mask is the allowed edge fade. */
.portrait--photo { background: var(--ground); }
.portrait__img, .portrait__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  mix-blend-mode: lighten;
  -webkit-mask-image: radial-gradient(ellipse 72% 88% at 50% 36%, black 58%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 88% at 50% 36%, black 58%, transparent 100%);
}
/* Entrance head turn: the clip shares the photo's box, so every crop below applies to both. Both
   use `lighten`, so the still is hidden while the clip shows (it would show through). At the end
   the still returns under the clip's last frame (the same picture) and only the clip fades out:
   browsers colour-manage video and images differently (Chrome draws this clip ~8% brighter), so
   a cut would step and a two-layer crossfade would dip; one layer fading over the other moves
   evenly between the two. The clip is then removed: iOS can repaint a paused video at its first
   (face-on) frame. site.js sets the state; without it the clip never shows. */
.portrait__video { opacity: 0; pointer-events: none; }
.portrait.is-turning .portrait__video { opacity: 1; }
.portrait.is-settling .portrait__video { transition: opacity 1s linear; }
.portrait.is-turning .portrait__img { opacity: 0; }
/* Allowed slide scrim: ground from 0 to 70% over the lowest 45%, so the statement stays legible. */
.portrait--photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, color-mix(in srgb, var(--ground) 70%, transparent), transparent);
}
/* Portrait-orientation tablets: a shorter box keeps the 16:9 photo from cropping to the face. */
@media (max-aspect-ratio: 3/4) {
  .portrait__img, .portrait__video {
    height: min(100%, 130vw);
    object-position: 50% 28%;
    -webkit-mask-image: linear-gradient(to bottom, black 62%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 62%, transparent 100%);
  }
}
/* Phones [M2]: the photo starts under the chrome and runs down into the statement, no empty band.
   Variant B, tuned on measurement: a 150vw cap left 73–115px of black above the statement on
   375–430px phones, so the cap is 170vw and the face sits a little left (54%), leaving room for the
   gaze; the glasses stay in frame at 360–430px. */
@media (max-width: 599px) and (max-aspect-ratio: 3/4) {
  .portrait__img, .portrait__video {
    top: var(--chrome-h);
    height: min(100% - var(--chrome-h) - var(--fs-statement) * 5, 170vw); /* leaves room for the statement at any text size [M5] */
    object-position: 54% 28%;
    -webkit-mask-image: linear-gradient(to bottom, black 58%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 58%, transparent 100%);
  }
}
/* Short landscape screens [M3]: the photo sits in the right 62%, so the statement never lies on the face. */
@media (orientation: landscape) and (max-height: 520px) {
  .portrait__img, .portrait__video { left: auto; right: 0; width: 62%; }
}

/* Scroll cue: next slide, or back to top on the last one */
.cue {
  position: absolute;
  right: var(--pad-r);
  bottom: calc(var(--slide-pb) + env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  place-items: center;
  width: var(--hit);
  height: var(--hit);
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: var(--r-pill);
  color: var(--ink-3);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
html.js .cue { position: fixed; }
.cue:hover { color: var(--ink); border-color: currentColor; }
.cue:active { opacity: .7; }
.cue .icon { transition: transform var(--t-mid) var(--ease); }
.cue.is-up .icon { transform: rotate(180deg); }

/* Project slides */
.slide--project { --row-min: var(--media-min); }
.slide--project .slide__body { position: static; }
.slide__media {
  grid-row: 1;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
  padding-bottom: var(--s-64); /* ≥64px clear between the visual's caption and the context label [C3] */
}
.theme-loopsave { --slide-bg: var(--ls-brand); }
:is(.slide, .opening, .next).theme-loopsave { --fg-3: var(--ls-ink-3); } /* labels on the brand colour [C2] */

/* More: the about line and the supporting work */
.about-line {
  max-width: 24em;
  font-size: var(--fs-h2);
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--ink-2);
  text-wrap: pretty;
}
.slide--more .slide__body { max-width: 60rem; }
.more-list { margin-top: var(--s-48); border-top: 1px solid var(--line); }
.more-item {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: var(--s-24);
  padding-block: var(--s-16);
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  font-size: var(--fs-slide-line);
  line-height: 1.45;
}
.more-item__label { color: var(--ink); font-weight: 500; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.more-item .icon { align-self: center; color: var(--ink-3); transition: transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.more-item:hover .more-item__label { text-decoration-line: underline; }
.more-item:hover .icon { color: var(--ink); transform: translateX(4px); }
.more-item:active { opacity: .7; }

/* The scenes after the work clear only the chrome row: the index fades out there [M1]. */
.page-home :is(.slide--more, .footer--slide) { padding-top: calc(var(--chrome-h) + var(--s-48)); }

@media (max-width: 599px) {
  .more-item { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--s-4); }
  .more-item__line { grid-column: 1; }
  .more-item .icon { grid-column: 2; grid-row: 1 / span 2; }
}

/* Below 900px the cue belongs to the entrance only (it would otherwise float over the taller
   More and Contact slides); the entrance keeps a clear band for it under the statement. */
@media (max-width: 899px) {
  html.js .cue { position: absolute; }
  .slide--entrance { --pad-b: calc(var(--slide-pb) + var(--hit) + var(--s-16) + env(safe-area-inset-bottom)); }
}
/* Phones keep the base `place-items: center`, so the concept visual centres in the space above the
   text, still in the top half [M2]. The visual row never drops below 320px, so in-visual labels can
   stay at 11px or more [S1]: on short phones the scene grows a little past the screen (never clipped). */
@media (max-width: 599px) {
  .slide--project { --row-min: calc(var(--s-160) * 2); }
  .about-line { font-size: var(--fs-overview); line-height: 1.45; letter-spacing: -.01em; }
}
/* From 900px the fixed cue sits bottom-right on every scene: keep the More list clear of it [M4]. */
@media (min-width: 900px) {
  .slide--more .slide__body { padding-right: calc(var(--hit) + var(--s-24)); }
}

@media (hover: hover) and (pointer: fine) {
  html.page-home { scroll-snap-type: y proximity; }
  .page-home .slide, .page-home .footer--slide { scroll-snap-align: start; }
}

/* ---------------------------------------------------------------------------------------------
   Concept visuals (brief §7). The SVG attributes are the final still; site.js moves
   data-state idle → play → done, and the animations below exist only while idle (paused at
   their first frame) or playing, only with JS and only without reduced motion.
   --------------------------------------------------------------------------------------------- */
.cv {
  --cv-max: 100cqw;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-12);
  max-width: 100%;
}
.cv__svg {
  display: block;
  width: min(100%, var(--measure)); /* fallback without container query units */
  /* Fit the space, but never beyond 1.35× the drawing's own size. */
  width: min(var(--cv-max), calc(var(--vbw, 400) * 1.35px), calc((100cqh - var(--cv-caption)) * var(--ratio)));
  height: auto;
  aspect-ratio: var(--ratio);
  overflow: visible;
}
.cv__label { color: var(--fg-3); text-align: center; }
/* Labels drawn inside the SVG render at 12px at every size [S1]: site.js sets --cv-k (rendered
   width ÷ viewBox width) and the size is counter-scaled in user units, capped where the drawings
   were checked for collisions. Without JS the drawing's own 12-unit size applies. */
.cv text {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: .08em;
  font-size: min(calc(12px / var(--cv-k, 1)), 17px);
}
.cv [class^="a-"] { transform-box: fill-box; transform-origin: center; }
@media (min-width: 900px) {
  .slide .cv { --cv-max: min(100cqw, 60vw); }
}

@keyframes cv-in { from { opacity: 0; transform: var(--from, none); } to { opacity: var(--o, 1); transform: none; } }
@keyframes cv-out { from { opacity: var(--o, 1); } to { opacity: 0; } }
@keyframes cv-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes cv-go { from { transform: none; } to { transform: var(--to); } }
@keyframes cv-shift { from { transform: var(--from); } to { transform: none; } }
@keyframes cv-travel {
  0% { opacity: 0; transform: var(--from); }
  18% { opacity: 1; }
  82% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}
@keyframes cv-blink { 0% { opacity: 0; } 25% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cv-clasp { 0% { opacity: 0; transform: var(--from); } 12% { opacity: 1; } 70% { opacity: 1; transform: var(--over); } 100% { opacity: 1; transform: none; } }
@keyframes cv-drift { 0%, 100% { transform: none; } 50% { transform: translate(var(--sway, 0px), var(--bob, -8px)) rotate(var(--tilt, 0deg)); } }
/* Pause control: only meaningful while motion is allowed and the script is running. A round icon-only
   button, 44px hit area like the scroll cue; the icon shows the action (pause bars while moving, play when paused). */
.cv__pause {
  appearance: none; background: var(--slide-bg, var(--ground)); color: var(--ink);
  border: 1px solid currentColor; border-radius: var(--r-pill);
  width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.cv__pause:hover { background: var(--ink); color: var(--slide-bg, var(--ground)); }
.cv__pause:active { opacity: .7; }
.cv__pause-icon { grid-area: 1 / 1; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cv__pause-icon--play, [data-paused] .cv__pause-icon--pause { display: none; }
[data-paused] .cv__pause-icon--play { display: block; }
html:not(.js) .cv__pause, html.reveal-all .cv__pause { display: none; }
@media (prefers-reduced-motion: reduce) { .cv__pause { display: none; } }
/* Entrance artwork: a sharp vector, shown whole (nothing cropped, no blur or fade). Phones: in flow, full
   width. Desktop: it takes the right-hand side of the scene at the largest size that still fits the scene's
   height and just over half its width (the title needs the rest), with the pause control (off for now, see PAUSE_CONTROL in build.py) in the scene's
   bottom-right corner. Phones: the pause control sits on the artwork's bottom-right corner instead of taking
   a row of its own, so the title and standfirst stay high on the screen. */
.cv--hi-five { --cv-caption: calc(44px + var(--s-12)); }
.cv--hi-five .cv__label { display: flex; justify-content: center; }
.cv--hi-five .cv__svg { overflow: visible; } /* hands and coins enter from beyond the artwork's box */
@media (max-width: 899px) {
  .opening--case .opening__media:has(.cv--hi-five) { height: auto; container-type: normal; display: block; }
  .cv--hi-five { position: relative; width: 100%; gap: 0; }
  .cv--hi-five .cv__svg { width: 100%; height: auto; }
  .cv--hi-five .cv__label { position: absolute; right: 0; bottom: 0; z-index: 1; }
}
@media (min-width: 900px) {
  :is(.slide, .opening):has(.cv--hi-five) { overflow: hidden; }
  /* 15 Oct 2026: no 100svh override; the opening keeps the 72svh every case study uses, so it reads as
     an article opening rather than a second cover. */
  .opening--case .opening__media:has(.cv--hi-five) { grid-column: auto; grid-row: auto; } /* out of the grid: the scene's whole box */
  :is(.slide__media, .opening__media):has(.cv--hi-five) {
    position: absolute; inset: 0; padding: 0; display: block; container-type: size; pointer-events: none;
    --art-room: calc(var(--chrome-h) + var(--s-96)); /* chrome above, pause row below */
  }
  .cv--hi-five { position: absolute; inset: 0; display: block; margin: 0; max-width: none; }
  .cv--hi-five .cv__svg {
    position: absolute; top: var(--chrome-h); right: var(--inset);
    width: min(52cqw, calc((100cqh - var(--art-room)) * var(--ratio))); max-width: none; height: auto;
  }
  .cv--hi-five .cv__label { position: absolute; right: var(--inset); bottom: var(--s-24); pointer-events: auto; }
  :is(.slide, .opening):has(.cv--hi-five) :is(.slide__body, .opening__text) { position: relative; z-index: 1; }
  .opening:has(.cv--hi-five) .standfirst { max-width: 22em; }
}
.cv .a-clasp-l { transform-origin: 0% 100%; }
.cv .a-clasp-r { transform-origin: 100% 100%; }
@keyframes cv-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  html.js:not(.reveal-all) .cv:is([data-state="idle"], [data-state="play"]) .a-in { animation: cv-in var(--t) var(--ease) var(--d) both; }
  html.js:not(.reveal-all) .cv:is([data-state="idle"], [data-state="play"]) .a-out { animation: cv-out var(--t) var(--ease) var(--d) both; }
  html.js:not(.reveal-all) .cv:is([data-state="idle"], [data-state="play"]) .a-draw { stroke-dasharray: var(--len); animation: cv-draw var(--t) var(--ease) var(--d) both; }
  html.js:not(.reveal-all) .cv:is([data-state="idle"], [data-state="play"]) .a-go { animation: cv-go var(--t) var(--ease) var(--d) both; }
  html.js:not(.reveal-all) .cv:is([data-state="idle"], [data-state="play"]) .a-shift { animation: cv-shift var(--t) var(--ease) var(--d) both; }
  html.js:not(.reveal-all) .cv:is([data-state="idle"], [data-state="play"]) .a-travel { animation: cv-travel var(--t) var(--ease) var(--d) both; }
  html.js:not(.reveal-all) .cv:is([data-state="idle"], [data-state="play"]) .a-blink { animation: cv-blink var(--t) var(--ease) var(--d) both; }
  html.js:not(.reveal-all) .cv:is([data-state="idle"], [data-state="play"]) .a-clasp { animation: cv-clasp var(--t) var(--ease) var(--d) both; }
  /* The drift loops, so it runs in every state (the entrance's "done" removes only one-shot animations). */
  html.js:not(.reveal-all) .cv .a-drift { animation: cv-drift var(--t) var(--ease-drift) var(--d) infinite both; }
  html.js:not(.reveal-all) .cv:is([data-state="idle"], [data-state="play"]) .a-pop { animation: cv-pop var(--t) var(--ease) var(--d) both; }
  /* Idle = paused on the first frame, so nothing flashes before the slide becomes current. */
  html.js:not(.reveal-all) .cv[data-state="idle"] [class^="a-"] { animation-play-state: paused; }
  html.js:not(.reveal-all) .cv[data-paused] [class^="a-"] { animation-play-state: paused; }
  /* Arriving through the shared view transition: show the still the visitor just saw. */
  html.handoff :is(.opening, :target) .cv [class^="a-"] { animation: none !important; stroke-dasharray: none !important; }
}

/* ---------------------------------------------------------------------------------------------
   Reading pages: opening (dark or theme), then the light canvas (design skill §4, §12)
   --------------------------------------------------------------------------------------------- */
html.page-reading, html.page-dark { scroll-padding-top: var(--chrome-h); }

.opening {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr;
  min-height: 72svh;
  padding: calc(var(--chrome-h) + var(--s-48)) var(--pad-r) var(--s-96) var(--pad-l);
  background: var(--slide-bg, var(--ground));
  color: var(--ink);
}
.opening--supporting, .opening--dark { min-height: 48svh; }
.opening__text { grid-row: 1; align-self: end; max-width: 50rem; min-width: 0; }
.eyebrow { color: var(--fg-3); margin-bottom: var(--s-16); }
.opening__title {
  font-size: var(--fs-case-title);
  line-height: 1.02;
  letter-spacing: -.03em;
  color: var(--ink);
  text-wrap: balance;
}
/* About opening: icon-only contact links under the title (15 Oct 2026). Same round 44px control as Pause. */
.icon-links { display: flex; gap: var(--s-12); margin-top: var(--s-24); }
.icon-link {
  color: var(--ink); background: var(--slide-bg, var(--ground));
  border: 1px solid currentColor; border-radius: var(--r-pill);
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-link:hover { background: var(--ink); color: var(--slide-bg, var(--ground)); }
.icon-link:active { opacity: .7; }
.standfirst {
  max-width: 34em;
  margin-top: var(--s-24);
  font-size: var(--fs-standfirst);
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--ink-2);
  text-wrap: pretty;
}
.opening__media { container-type: size; display: grid; place-items: center; min-height: 0; }

@media (max-width: 899px) {
  .opening--case { grid-template-rows: auto 1fr; row-gap: var(--s-32); }
  .opening--case .opening__media { grid-row: 1; height: clamp(calc(var(--s-128) * 2), 40svh, calc(var(--s-160) * 2)); }
  .opening--case .opening__text { grid-row: 2; }
}
@media (min-width: 900px) {
  .opening--case { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--s-64); }
  .opening--case .opening__media { grid-column: 2; grid-row: 1; align-self: stretch; min-height: calc(var(--s-160) * 2); }
}

/* Real project media in the opening (site.json "opening_figure"): a standard figure, not a concept
   visual. It sizes from its own width, so it leaves the concept visual's fixed-height box; on dark it
   keeps a 1px --line edge so a dark capture does not merge with the ground (§7). */
.opening__media--image { container-type: normal; display: block; align-self: end; min-width: 0; }
.fig--opening { margin: 0; }
.fig--opening img { border: 1px solid var(--line); }
@media (max-width: 899px) {
  .opening--case .opening__media--image { height: auto; }
}
@media (min-width: 900px) {
  .opening--case:has(.opening__media--image) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .opening--case .opening__media--image { align-self: end; min-height: 0; }
}

/* Canvas: light reading ground (dark variant for About and Speaking) */
.canvas {
  --fg: var(--paper-ink);
  --fg-2: var(--paper-body);
  --fg-3: var(--paper-meta);
  --focus: var(--paper-ink);
  --rule: var(--paper-line);
  --note-rule: var(--paper-meta);
  --note-label: var(--paper-meta);
  --note-text: var(--paper-muted);
  --ph-bg: var(--paper-2);
  --ph-label: var(--paper-meta);
  --ph-text: var(--paper-muted);
  --caption: var(--paper-muted);
  --accent: var(--paper-meta);
  padding: var(--s-64) 0 var(--chapter-gap);
  background: var(--paper);
  color: var(--paper-body);
  color-scheme: light;
}
.canvas.theme-loopsave { --accent: var(--ls-brand); }
.canvas--dark {
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --fg-3: var(--ink-3);
  --focus: var(--ink);
  --rule: var(--line);
  --note-rule: var(--ink-3);
  --note-label: var(--ink-3);
  --note-text: var(--ink-2);
  --ph-bg: var(--surface);
  --ph-label: var(--ink-3);
  --ph-text: var(--ink-2);
  --caption: var(--ink-2);
  --accent: var(--ink-3);
  padding-top: var(--s-32);
  background: var(--ground);
  color: var(--ink-2);
  color-scheme: dark;
}

.canvas__head {
  width: min(100% - 2 * var(--inset), var(--measure));
  margin-inline: auto;
  display: grid;
  gap: var(--s-32);
}
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--s-24) var(--s-32); }
.meta dt { color: var(--fg-3); margin-bottom: var(--s-8); }
.meta dd { font-size: var(--fs-caption); line-height: 1.55; color: var(--fg-2); }
.review { display: grid; justify-items: start; gap: var(--s-16); padding-top: var(--s-24); border-top: 1px solid var(--rule); }
.canvas__head > .review:first-child { padding-top: 0; border-top: 0; }
.review .note { margin: 0; width: 100%; }

/* Review-notes toggle: pressed (notes shown) = 100% border and a filled dot; never a solid
   capsule [C1]. Not pressed = 35% border and a hollow dot. */
.pill {
  display: none;
  align-items: center;
  gap: var(--s-8);
  min-height: var(--s-32);
  padding: 0 var(--s-12);
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: var(--r-pill);
  color: var(--fg);
  transition: border-color var(--t-fast) var(--ease);
}
html.js .pill { display: inline-flex; }
.pill:hover, .pill[aria-pressed="true"] { border-color: currentColor; }
.pill:active { opacity: .7; }
.pill__dot {
  flex: none;
  width: var(--dot);
  height: var(--dot);
  border: 1px solid currentColor;
  border-radius: var(--r-pill);
  transition: background-color var(--t-fast) var(--ease);
}
.pill[aria-pressed="true"] .pill__dot { background: currentColor; }
.pill__off { display: none; }
html[data-notes="off"] .pill__on { display: none; }
html[data-notes="off"] .pill__off { display: inline; }

/* Review notes (design skill §7) */
.note { margin-block: var(--s-24); padding: var(--s-4) 0 var(--s-4) var(--s-16); border-left: 2px solid var(--note-rule); }
.note__label { color: var(--note-label); margin-bottom: var(--s-4); }
.note__text { font-size: var(--fs-caption); line-height: 1.6; color: var(--note-text); }
.note__text + .note__text { margin-top: var(--s-4); }
.note--dark { --note-rule: var(--ink-3); --note-label: var(--ink-3); --note-text: var(--ink-2); }
html[data-notes="off"] .note { display: none; }

/* Reading flow: body and placeholders at the measure [S2][S3]; real figures may go wide */
.flow > * { width: min(100% - 2 * var(--inset), var(--measure)); margin-inline: auto; }
.flow > .fig { width: min(100% - 2 * var(--inset), var(--wide)); }
.flow > .chapter { width: 100%; }
.flow p:not([class]) { margin-block-end: 1em; font-size: var(--fs-body); line-height: 1.65; text-wrap: pretty; }
.flow a { color: var(--fg); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.flow a:hover { text-decoration-thickness: 2px; }
.flow a:active { opacity: .7; }

.overview { margin-top: var(--h3-gap); }
.overview__label { color: var(--fg-3); margin-bottom: var(--s-16); }
.overview .overview__text {
  margin-block-end: .75em;
  font-size: var(--fs-overview);
  line-height: 1.45;
  letter-spacing: -.01em;
  color: var(--fg);
  text-wrap: pretty;
}
/* Callout: a key line from the copy, set large so a skimming reader still gets the story (">> text") */
.flow .callout {
  margin-block: var(--s-48);
  padding-left: var(--s-24);
  border-left: 2px solid var(--accent);
  font-size: var(--fs-overview);
  line-height: 1.45;
  letter-spacing: -.01em;
  color: var(--fg);
  text-wrap: pretty;
}
.story--plain { margin-top: var(--figure-gap); } /* About, Speaking, Maker: no "Full story" heading [C12d] */

.story__title {
  margin-block: var(--chapter-gap) var(--s-32);
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--fg);
}
.chapter__title {
  margin-block: var(--h3-gap) var(--s-16);
  font-size: var(--fs-h3);
  line-height: 1.25;
  letter-spacing: -.015em;
  color: var(--fg);
  text-wrap: balance;
}
.chapter__title::before {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  margin-bottom: var(--s-16);
  background: var(--accent);
}

/* Figure placeholder: never a broken-image look */
.ph { margin-block: var(--figure-gap); }
.ph__frame {
  display: grid;
  grid-template-rows: auto 1fr auto;
  aspect-ratio: 16 / 9;
  padding: var(--s-16);
  border-radius: var(--r-inline);
  background: var(--ph-bg);
}
.canvas--dark .ph__frame { border: 1px solid var(--line); } /* never a void on dark [S2] */
.ph__frame::after { content: ""; height: var(--small-lh); }
.ph--3x2 .ph__frame { aspect-ratio: 3 / 2; }
.ph__code { color: var(--ph-label); }
.ph__need { align-self: center; justify-self: center; max-width: 34em; padding: var(--s-24) var(--s-16); text-align: center; }
.ph__need-label { color: var(--ph-label); margin-bottom: var(--s-8); }
.ph__asset { font-size: var(--fs-caption); line-height: 1.55; color: var(--ph-text); text-wrap: balance; }
.ph__caption, .fig__text {
  max-width: var(--measure);
  font-size: var(--fs-caption);
  line-height: 1.55;
  color: var(--caption);
}
.ph__caption { margin-top: var(--s-12); }
.ph__purpose, .fig__code { color: var(--ph-label); margin-right: var(--s-4); }

/* Real image figure: no matte; dense images open full size [C6] */
.fig { margin-block: var(--figure-gap); }
.fig img { width: 100%; border-radius: var(--r-inline); }
.fig figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-8) var(--s-32);
  margin-top: var(--s-12);
}
.fig__open {
  display: inline-flex;
  align-items: center;
  gap: var(--s-8);
  color: var(--fg);
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: var(--s-4);
}
.fig__open .icon { transition: transform var(--t-fast) var(--ease); }
.fig__open:hover { text-decoration-line: underline; }
.fig__open:hover .icon { transform: translateX(4px); }
.fig__open:active { opacity: .7; }
/* Phones and tablets: inline figures run edge to edge with square corners; the caption keeps the gutter */
@media (max-width: 899px) {
  .flow > .fig { width: 100%; }
  .flow > .fig img { border-radius: 0; }
  .flow > .fig figcaption { padding-inline: var(--inset); }
}

/* Screen morph (LOOP 02): one screen, four frames. The radios work without script; :has() sets the
   frame width, and the screen keeps its width, which is the point the figure makes. */
/* The options: one small segmented control, centred over the frame (Samuel, 16 Oct 2026: "smaller …
   low profile … centred … the outline can be softer … have the icon"). 40px tall; each option keeps a
   44px hit area through ::after. */
.morph__modes {
  display: flex;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto var(--s-24);
  padding: 3px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-pill);
}
.morph__mode {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--s-32);
  padding: 0 var(--s-12);
  border-radius: var(--r-pill);
  color: var(--paper-meta);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.morph__mode::after { content: ""; position: absolute; inset: -6px -1px; }
.morph__mode:hover { color: var(--paper-ink); }
.morph__mode:has(input:checked) { background: var(--paper-2); color: var(--paper-ink); }
.morph__mode:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.morph__mode:active { opacity: .7; }
@media (max-width: 599px) {
  .morph__mode { padding: 0 var(--s-12); }
  .morph__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.morph__stage { container-type: inline-size; --col: 32cqw; --tablet: 58cqw; }
.morph__frame {
  --w: 100cqw;
  display: grid;
  justify-items: center;
  width: var(--w);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--ls-screen-line);
  border-radius: var(--r-inline);
  background: var(--ls-screen);
  transition: width var(--t-slow) var(--ease), border-radius var(--t-slow) var(--ease);
}
.fig .morph__screen { width: var(--col); max-width: none; border-radius: 0; }
.morph:has(input[value="tablet"]:checked) .morph__frame { --w: var(--tablet); }
.morph:has(input[value="mobile"]:checked) .morph__frame { --w: calc(var(--col) + 2px); }
.morph:has(input[value="app"]:checked) .morph__frame {
  --w: calc(var(--col) + 2 * var(--s-8));
  border: var(--s-8) solid var(--paper-ink);
  border-radius: var(--r-device);
}
@media (max-width: 599px) { .morph__stage { --col: 56cqw; --tablet: 78cqw; } }
@media (prefers-reduced-motion: reduce) { .morph__frame { transition: none; } }

/* Pannable board (LOOP 06): fitted until explored, then 2400px wide in a scrolling view. Drag with
   a mouse, swipe on touch, arrow keys once focused; Done or Esc returns it to fitted. */
.pan__box { position: relative; }
html.js .pan:not(.is-panning) .pan__view img { cursor: zoom-in; }
.pan.is-panning .pan__view {
  height: min(75svh, 640px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--paper-2);
  cursor: grab;
}
.pan.is-dragging .pan__view { cursor: grabbing; user-select: none; }
.fig.pan.is-panning .pan__view img { width: var(--pan-w); max-width: none; border-radius: 0; }
/* Same language as the LOOP 02 switcher (Samuel, 16 Oct 2026: "so everything is consistent"): a soft
   1px ring with 3px padding around a chosen-style face, 40px tall, a 44px hit area through ::after.
   Centred at the foot of the board; Explore and Done never show together, so they share the spot. */
.pan__btn {
  position: absolute;
  bottom: var(--s-12);
  left: 50%;
  display: none;
  padding: 3px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--paper-ink);
  cursor: pointer;
  transform: translateX(-50%);
}
.pan__btn::after { content: ""; position: absolute; inset: -2px; }
.pan__face {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--s-32);
  padding: 0 var(--s-12);
  border-radius: var(--r-pill);
  background: var(--paper-2);
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease);
}
.pan__btn:hover .pan__face { background: var(--paper-line); }
.pan__btn:focus-visible { outline-offset: 2px; }
.pan__btn:active { opacity: .7; }
html.js .pan:not(.is-panning) .pan__enter, .pan.is-panning .pan__done { display: inline-flex; }

/* Speaking topics */
.topics { display: grid; gap: var(--s-24); margin-block: var(--s-24) var(--s-32); }
.topic { padding-top: var(--s-16); border-top: 1px solid var(--rule); }
.topic__title { font-size: var(--fs-body); line-height: 1.45; color: var(--fg); }
.topic__desc { margin-top: var(--s-4); font-size: var(--fs-body); line-height: 1.65; color: var(--fg-2); }

/* Next project band — keeps the next project's theme [C5] */
.next { --fg-3: var(--ink-3); background: var(--slide-bg, var(--ground)); color: var(--ink); }
.next__link {
  --focus: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--s-16);
  min-height: 36svh;
  padding: var(--s-96) var(--pad-r) var(--s-64) var(--pad-l);
  color: inherit;
  text-decoration: none;
}
.next__label { color: var(--fg-3); }
.next__title {
  display: inline-flex;
  align-items: center;
  gap: var(--s-24);
  font-weight: 500;
  font-size: var(--fs-closing);
  line-height: 1.05;
  letter-spacing: -.03em;
}
.next__name { text-decoration-thickness: 2px; text-underline-offset: .12em; }
.next__title .icon { transition: transform var(--t-fast) var(--ease); }
.next__link:hover .next__name { text-decoration-line: underline; }
.next__link:hover .icon { transform: translateX(4px); }
.next__link:active { opacity: .7; }
.next__link:focus-visible { outline: none; }
.next__link:focus-visible .next__title { outline: 2px solid var(--focus); outline-offset: 4px; }

/* ---------------------------------------------------------------------------------------------
   Footer (#contact) — on the homepage it is the final slide
   --------------------------------------------------------------------------------------------- */
.footer {
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --fg-3: var(--ink-3);
  --focus: var(--ink);
  --rule: var(--line);
  padding: var(--s-128) var(--pad-r) calc(var(--s-48) + env(safe-area-inset-bottom)) var(--pad-l);
  border-top: 1px solid var(--line);
  background: var(--ground);
  color: var(--ink);
}
.footer--slide {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--chrome-h) + var(--s-48)) var(--pad-r) var(--pad-b) var(--pad-l);
  border-top: 0;
}
.footer__inner { display: grid; gap: var(--s-48); }
.footer__heading {
  max-width: 14em;
  font-size: var(--fs-closing);
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--ink);
  text-wrap: balance;
}
.routes { border-top: 1px solid var(--line); max-width: 40rem; }
.route {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-4) var(--s-24);
  padding-block: var(--s-12);
  border-bottom: 1px solid var(--line);
}
.route__label { min-width: 8rem; font-size: var(--fs-slide-line); line-height: 1.45; color: var(--ink); }
.route__value { font-size: var(--fs-slide-line); line-height: 1.45; color: var(--ink); text-underline-offset: 4px; }
.route__todo { color: var(--ink-3); }
.footer__lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--s-32) var(--s-48); }
.footer__label { color: var(--ink-3); margin-bottom: var(--s-8); }
.footer__list li { padding-block: var(--s-4); font-size: var(--fs-slide-line); line-height: 1.45; color: var(--ink-2); }
.footer__list a { color: var(--ink); text-decoration: none; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.footer__list a:hover, .footer__list a[aria-current="page"] { text-decoration-line: underline; }
.footer__list a:active { opacity: .7; }
.footer__review { display: grid; justify-items: start; gap: var(--s-16); max-width: var(--measure); }
.footer__notes { width: 100%; }
.footer__notes .note { margin-block: var(--s-16) 0; }
.footer__base {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-8) var(--s-32);
  padding-top: var(--s-24);
  border-top: 1px solid var(--line);
  color: var(--ink-3);
}

@media (min-width: 900px) {
  .footer--slide .footer__base { padding-right: calc(var(--hit) + var(--s-24)); } /* clear of the fixed cue */
  .footer__inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--s-96); }
  .footer__heading, .routes { grid-column: 1; }
  /* The Focus and Work columns start on the heading's line [C7]. */
  .footer__lists { grid-column: 2; grid-row: 1 / span 3; align-self: start; }
  .footer__review { grid-column: 1; } /* [N1] keeps the Contact scene within the screen at 900–1100px */
  .footer__base { grid-column: 1 / -1; }
}
/* Laptops: the contact scene must fit with its heading clear of the chrome [M1]. */
@media (min-width: 900px) and (max-height: 860px) {
  .footer--slide .footer__inner { row-gap: var(--s-32); }
}

/* ---------------------------------------------------------------------------------------------
   Motion (design skill §10). Hidden start states exist only under html.js and only without
   reduced motion; a 2.5s failsafe (inline head script) adds .reveal-all if site.js never runs.
   --------------------------------------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(var(--travel)); } to { opacity: 1; transform: none; } }
@keyframes expose { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Entrance: the portrait exposes from black once its image has decoded (site.js adds
     .is-exposed after img.decode()) [C9]; chrome and statement fade up from 150ms regardless. */
  html.enter:not(.reveal-all) .portrait:not(.is-exposed) { opacity: 0; }
  html.enter .portrait.is-exposed { animation: expose var(--t-image) var(--ease-expose) both; }
  html.enter .e-fade { animation: rise var(--t-slow) var(--ease) calc(150ms + var(--i, 0) * var(--stagger)) both; }

  /* Mark <-> name (skill §9): live only after site.js has set the first state, so a page never
     animates into its starting state. */
  html[data-brand-live] .wordmark__mark,
  html[data-brand-live] .wordmark__name { transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); }
  html[data-brand-live] .mark__s-top,
  html[data-brand-live] .mark__s-bot { transition: transform var(--t-mid) var(--ease); }

  /* Slides and openings: fade up once when current or in view. */
  html.js:not(.reveal-all) .reveal:not(.is-in) { opacity: 0; }
  html.js:not(.reveal-all) .reveal.is-in { animation: rise var(--t-slow) var(--ease) calc(var(--i, 0) * var(--stagger)) both; }

  /* Index progress line follows the current slide (value set by site.js). */
  .index__line::after { transition: transform var(--t-fast) linear; }

  /* Cross-document view transitions, progressive enhancement. */
  @view-transition { navigation: auto; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation-duration: var(--t-mid); animation-timing-function: var(--ease); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
    transition-delay: 0ms !important;
  }
  .roll::after { display: none; }
  a:hover .roll__text { transform: none; }
  .index__line::after { transform: none; }
}


/* ---------------------------------------------------------------------------------------------
   Navigator overview additions (6 Oct 2026): role timeline, tool chips, stacked brand cards.
   Only tokens; no colour literals. Hover reveals are mirrored on focus and click.
   --------------------------------------------------------------------------------------------- */
.timeline { display: grid; gap: var(--s-12); }
.timeline__item { display: grid; grid-template-columns: 9.5rem 1fr; gap: var(--s-4) var(--s-16); }
.timeline__when { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-label); line-height: var(--small-lh); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.timeline__when--pending { border-bottom: 1px dashed var(--fg-3); align-self: start; justify-self: start; }
.timeline__what { color: var(--fg); }

.tool { position: relative; display: inline-block; white-space: nowrap; }
.tool__btn {
  display: inline-flex; align-items: center; gap: .45em;
  padding: .12em .75em .12em .5em; border: 1px solid var(--rule); border-radius: var(--r-pill);
  font-size: .92em; line-height: 1.4; transition: border-color var(--t-fast) var(--ease);
}
.tool__btn:hover, .tool__btn[aria-expanded="true"] { border-color: var(--fg); }
.tool__logo { display: block; width: 1.05em; height: 1.05em; flex: none; object-fit: contain; }
.tool__shot { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: var(--r-inline); border: 1px solid var(--rule); }
.tool__pop {
  position: absolute; z-index: 5; inset-inline-start: 0; top: calc(100% + var(--s-8));
  display: grid; gap: var(--s-8); width: min(24rem, 80vw); padding: var(--s-16);
  white-space: normal; border-radius: var(--r-inline); background: var(--ph-bg); border: 1px solid var(--rule);
  opacity: 0; visibility: hidden; transform: translateY(var(--s-4));
  transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease), visibility 0s linear var(--t-mid);
}
.tool:hover .tool__pop, .tool:focus-within .tool__pop, .tool__btn[aria-expanded="true"] + .tool__pop {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.tool__pop-code { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-label); line-height: var(--small-lh); letter-spacing: .08em; text-transform: uppercase; color: var(--ph-label); }
.tool__pop-text { font-size: var(--fs-caption); line-height: 1.55; color: var(--ph-text); }

.stack { margin-block: var(--figure-gap); }
.stack__cards { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 30rem; min-height: 11rem; outline-offset: var(--s-8); }
.stack__card {
  grid-area: 1 / 1; display: grid; align-content: space-between; gap: var(--s-16);
  width: min(14rem, 100%); aspect-ratio: 4 / 3; padding: var(--s-16);
  border-radius: var(--r-inline); border: 1px solid var(--rule); background: var(--ph-bg);
  transition: transform var(--t-mid) var(--ease);
}
.stack__card--m { transform: translate(0, 0); z-index: 3; }
.stack__card--l { transform: translate(var(--s-16), calc(var(--s-8) * -1)); z-index: 2; }
.stack__card--d { transform: translate(var(--s-32), calc(var(--s-16) * -1)); z-index: 1; }
.stack__cards:hover .stack__card--l, .stack__cards:focus .stack__card--l { transform: translate(calc(var(--s-64) + var(--s-8)), calc(var(--s-8) * -1)); }
.stack__cards:hover .stack__card--d, .stack__cards:focus .stack__card--d { transform: translate(calc(var(--s-128) + var(--s-16)), calc(var(--s-16) * -1)); }
.stack__logo { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-label); line-height: var(--small-lh); letter-spacing: .08em; text-transform: uppercase; color: var(--ph-label); }
.stack__name { font-weight: 500; color: var(--fg); }
.stack__caption { margin-top: var(--s-16); font-size: var(--fs-caption); line-height: 1.55; color: var(--caption); }
@media (max-width: 599px) { .stack__cards:hover .stack__card--l, .stack__cards:focus .stack__card--l { transform: translate(var(--s-48), calc(var(--s-8) * -1)); } .stack__cards:hover .stack__card--d, .stack__cards:focus .stack__card--d { transform: translate(var(--s-96), calc(var(--s-16) * -1)); } }
@media (prefers-reduced-motion: reduce) { .tool__pop { transition: none; } }
.meta__item:has(.timeline) { grid-column: 1 / -1; }


/* ---------------------------------------------------------------------------------------------
   CV page (7 Oct 2026). Dark hero, light canvas; scannable role cards, count-up tiles, a focus
   filter. Everything is visible without JavaScript; motion respects reduced-motion; print is a
   one-column paper CV (this is what the downloadable PDF is made from).
   --------------------------------------------------------------------------------------------- */
.page-cv { --cv-w: 960px; }
.cv-hero { padding: calc(var(--chrome-h) + var(--s-64)) var(--pad-r) var(--s-64) var(--pad-l); background: var(--ground); color: var(--ink); }
.cv-hero__inner { width: min(100%, var(--cv-w)); margin-inline: auto; display: grid; gap: var(--s-16); justify-items: start; }
.cv-hero__title { font-size: var(--fs-case-title); line-height: 1.02; letter-spacing: -.03em; }
.cv-hero__role { font-size: var(--fs-standfirst); line-height: 1.3; color: var(--ink); }
.cv-hero__tag { font-size: var(--fs-slide-line); line-height: 1.45; color: var(--ink-2); max-width: 36em; }
.cv-hero__place { display: inline-flex; align-items: center; gap: var(--s-8); font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.cv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-12); margin-top: var(--s-16); }
.cv-mail { display: inline-flex; align-items: center; gap: var(--s-8); }
.cv-btn {
  display: inline-flex; align-items: center; gap: var(--s-8); min-height: var(--hit); padding: 0 var(--s-16);
  border: 1px solid var(--fg-3); border-radius: var(--r-pill); font-size: var(--fs-caption); text-decoration: none; color: var(--fg);
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.cv-hero .cv-btn { --fg: var(--ink); --fg-3: var(--ink-3); }
.cv-btn:hover { border-color: var(--fg); }
.cv-btn--primary { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.cv-btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.canvas .cv-btn--primary { background: var(--paper-ink); color: var(--paper); border-color: var(--paper-ink); }
.canvas .cv-btn--primary:hover { background: var(--paper-body); }
.cv-btn--primary .icon { transition: transform var(--t-fast) var(--ease); }
.cv-btn--primary:hover .icon { transform: translateY(2px); }
.cv-copy {
  min-height: var(--hit); padding: 0 var(--s-12); border-radius: var(--r-pill); border: 1px solid var(--ink-3);
  font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
}
.cv-copy:hover, .cv-copy.is-done { color: var(--ink); border-color: var(--ink); }

.cv > .canvas__head, .cv-sec { width: min(100% - 2 * var(--inset), var(--cv-w)); margin-inline: auto; }
.cv > .canvas__head { margin-bottom: var(--s-48); }
.cv-sec { margin-bottom: var(--chapter-gap); }
.cv-sec__title { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); padding-bottom: var(--s-12); margin-bottom: var(--s-24); border-bottom: 1px solid var(--rule); }
.cv-summary { font-size: var(--fs-overview); line-height: 1.45; letter-spacing: -.01em; color: var(--paper-ink); max-width: 30em; text-wrap: pretty; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--s-16); }
.tile { display: grid; align-content: start; gap: var(--s-8); padding: var(--s-24); border: 1px solid var(--rule); border-radius: var(--r-inline); background: var(--paper); transition: transform var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease); }
.tile:hover { transform: translateY(calc(var(--s-4) * -1)); border-color: var(--paper-ink); background: var(--paper-2); }
.tile__value { font-size: var(--fs-closing); line-height: 1; letter-spacing: -.03em; font-weight: 500; color: var(--paper-ink); font-variant-numeric: tabular-nums; }
.tile__label { font-size: var(--fs-caption); line-height: 1.45; color: var(--paper-body); }
.tile__src { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-small); letter-spacing: .08em; text-transform: uppercase; color: var(--paper-meta); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-8); margin-bottom: var(--s-32); }
.chip { min-height: var(--s-32); padding: 0 var(--s-16); border: 1px solid var(--rule); border-radius: var(--r-pill); font-size: var(--fs-caption); color: var(--paper-body); transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.chip:hover { border-color: var(--paper-ink); }
.chip[aria-pressed="true"] { background: var(--paper-ink); border-color: var(--paper-ink); color: var(--paper); }

.roles { display: grid; gap: var(--s-48); }
.role { position: relative; display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: var(--s-24); transition: opacity var(--t-mid) var(--ease); }
.role:not(:last-child)::before { content: ""; position: absolute; left: 1.5rem; top: calc(3rem + var(--s-8)); bottom: calc(var(--s-48) * -1 + var(--s-8)); border-left: 1px dashed var(--paper-line); }
.role.is-dim { opacity: .3; }
.logo { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: var(--r-inline); background: var(--paper-2); border: 1px solid var(--paper-line); color: var(--paper-ink); font-weight: 500; font-size: var(--fs-h3); line-height: 1; transition: transform var(--t-mid) var(--ease); }
.logo--loopsave { background: var(--ls-indigo); border-color: var(--ls-indigo); color: var(--ls-violet-pale); }
.role:hover .logo { transform: rotate(-6deg) scale(1.06); }
.role__company { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -.015em; color: var(--paper-ink); }
.role__place { font-size: var(--fs-caption); font-weight: 400; color: var(--paper-meta); letter-spacing: 0; }
.role__positions { display: grid; gap: var(--s-4); margin-top: var(--s-8); }
.role__pos { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-16); align-items: baseline; }
.role__title { font-weight: 500; color: var(--paper-ink); font-size: var(--fs-caption); }
.role__dates { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; color: var(--paper-meta); }
.role__dates--pending { border-bottom: 1px dashed var(--paper-meta); }
.role__line { margin-top: var(--s-16); font-size: var(--fs-body); line-height: 1.5; color: var(--paper-ink); text-wrap: pretty; }
.role__bullets { margin-top: var(--s-12); display: grid; gap: var(--s-8); }
.role__bullets li { position: relative; padding-left: var(--s-16); font-size: var(--fs-caption); line-height: 1.6; color: var(--paper-body); }
.role__bullets li::before { content: ""; position: absolute; left: 0; top: .72em; width: var(--s-8); border-top: 1px solid var(--paper-meta); }
.role__link { display: inline-flex; align-items: center; gap: var(--s-8); margin-top: var(--s-16); font-size: var(--fs-caption); color: var(--paper-ink); text-underline-offset: 3px; }
.role__link .icon { transition: transform var(--t-fast) var(--ease); }
.role__link:hover .icon { transform: translateX(var(--s-4)); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s-24); }
.fact { display: grid; align-content: start; gap: var(--s-8); padding-top: var(--s-16); border-top: 1px solid var(--rule); }
.fact__title { font-weight: 500; color: var(--paper-ink); }
.fact__meta, .fact__text { font-size: var(--fs-caption); line-height: 1.6; color: var(--paper-body); }
.skills { display: grid; gap: var(--s-24); }
.skills__label { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-small); letter-spacing: .08em; text-transform: uppercase; color: var(--paper-meta); margin-bottom: var(--s-8); }
.skills__list { display: flex; flex-wrap: wrap; gap: var(--s-8); }
.skill { padding: var(--s-4) var(--s-12); border: 1px solid var(--rule); border-radius: var(--r-pill); font-size: var(--fs-caption); color: var(--paper-body); transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.skill:hover { transform: translateY(calc(var(--s-4) * -1)); border-color: var(--paper-ink); }
.cv-end { display: grid; gap: var(--s-16); justify-items: start; }

@media (max-width: 599px) {
  .role { grid-template-columns: 2.5rem minmax(0, 1fr); gap: var(--s-16); }
  .logo { width: 2.5rem; height: 2.5rem; }
  .role:not(:last-child)::before { left: 1.25rem; top: calc(2.5rem + var(--s-8)); }
}
@media (prefers-reduced-motion: reduce) {
  .tile:hover, .skill:hover { transform: none; }
  .role:hover .logo { transform: none; }
}
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  :root { --ground: var(--paper); --ink: var(--paper-ink); --ink-2: var(--paper-body); --ink-3: var(--paper-meta); --line: var(--paper-line); color-scheme: light; }
  html, body, .canvas, .cv-hero { background: var(--paper) !important; color: var(--paper-ink) !important; color-scheme: light; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chrome, .skip, .footer, .review, .chips, .cv-actions, .role__link, .cv-end, .tile__src, .role:not(:last-child)::before { display: none !important; }
  .cv-hero { padding: 0 0 var(--s-16); }
  .cv-hero__title { font-size: 2.2rem; } .cv-hero__role, .cv-hero__tag, .cv-hero__place { color: var(--paper-body); }
  .cv-hero .eyebrow { display: none; }
  .canvas { padding: 0; } .cv-sec { margin-bottom: var(--s-24); width: 100%; }
  .cv > .canvas__head { display: none; }
  .cv-summary { font-size: 1rem; } .tile__value { font-size: 1.6rem; } .tile { padding: var(--s-12); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .roles { gap: var(--s-24); } .role { break-inside: avoid; opacity: 1 !important; }
  .role__company { font-size: 1.1rem; } .role__line { font-size: .95rem; margin-top: var(--s-8); }
  .role__bullets li, .fact__meta, .fact__text, .skill { font-size: .8rem; line-height: 1.45; }
  .logo { width: 2rem; height: 2rem; font-size: 1rem; } .role { grid-template-columns: 2rem 1fr; gap: var(--s-12); }
  .cv-sec__title { margin-bottom: var(--s-12); } .skill { padding: 0 var(--s-8); }
  * { transition: none !important; }
}
