/* Style rules live in CLAUDE.md — use the tokens. */
:root {
  --bg: #efefef;
  --surface: #ffffff;
  --ink: #0f0f0f;
  --ink-2: #5c5c5c;
  --mute: #c4c4c4;
  --line: rgba(0, 0, 0, 0.12);
  --ph: #dcdcdc;                       /* placeholder media */
  --ph-sheen: rgba(255, 255, 255, 0.55);
  --fig-ink: #211d1e;                  /* canvas drawing inks */
  --fig-red: #a1413b;
  --fig-paper: none;                   /* dark mode: light silhouette the ink is cut out of */
  --accent: #ff4f12;                   /* the one pop colour: signal orange */
  --on-accent: #0f0f0f;                /* text/icons on an accent fill */
  color-scheme: light;

  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --radius: 28px;
  --max: 1100px;
}

/* Dark mode: system preference unless the toggle chose explicitly. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111; --surface: #1d1d1d; --ink: #ededed; --ink-2: #9b9b9b; --mute: #3d3d3d;
    --line: rgba(255, 255, 255, 0.13); --ph: #1c1c1c; --ph-sheen: rgba(255, 255, 255, 0.05);
    --fig-ink: #ece8e4; --fig-red: #a1413b; --fig-paper: #e9e5e0; --accent: #ff6a2b; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111111; --surface: #1d1d1d; --ink: #ededed; --ink-2: #9b9b9b; --mute: #3d3d3d;
  --line: rgba(255, 255, 255, 0.13); --ph: #1c1c1c; --ph-sheen: rgba(255, 255, 255, 0.05);
  --fig-ink: #ece8e4; --fig-red: #a1413b; --fig-paper: #e9e5e0; --accent: #ff6a2b; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  font-size: clamp(16px, 0.3vw + 15px, 18px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
  font-feature-settings: "ss01" 0, "cv11" 1;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
.wrap { max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

.label, .hero-meta, .count, .card-text p, .r-status, .r-year, .facts dt, .footer-meta {
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 500;
}

/* ─── header ─── */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* equal sides keep the menu on the page's centre line */
  align-items: center;
  gap: 24px;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 22px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.name { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; justify-self: start; }
.logo { display: block; flex: none; width: 38px; height: 38px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 600; letter-spacing: -0.04em; line-height: 38px; text-align: center; } /* the toggle's twin, on the other end of the header */

/* The menu is one surface: a pill that grows outward from its centre into a panel when About
   or Work is hovered. main.js sets its width and height; .nav only holds its place so the
   header never moves. */
.nav { position: relative; height: 38px; --nav-ease: cubic-bezier(.2,.8,.2,1); }
.nav-shell {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: max-content; /* the resting size without hover or JS; main.js sets it otherwise */
  height: 38px;
  border-radius: 19px;
  background: var(--surface);
  overflow: hidden;
  transition: width 0.42s var(--nav-ease), height 0.42s var(--nav-ease), box-shadow 0.3s;
}
.nav-shell.is-expanded { box-shadow: 0 0 0 1px var(--line); } /* a hairline, so the panel holds its edge over photos */
.nav-bar { display: flex; width: max-content; margin: 0 auto; padding: 0 6px; } /* centred, so links stay put as the shell widens */
.nav-link { position: relative; display: block; padding: 0 12px; font-size: 15px; line-height: 38px; letter-spacing: -0.01em; white-space: nowrap; }
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 5px;
  width: 0; height: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width 0.25s ease;
}
.nav-link.is-active::after, .nav-link:hover::after, .nav-link.is-open::after { width: 18px; }
.nav-link:focus-visible { outline-offset: -4px; border-radius: 14px; }

.nav-panel {
  position: absolute;
  top: 38px; left: 50%;
  width: 340px;
  margin-left: -170px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.3s var(--nav-ease), visibility 0s 0.16s;
}
.nav-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.26s ease 0.06s, transform 0.42s var(--nav-ease), visibility 0s;
}
.nav-panel a:focus-visible { outline-offset: -2px; border-radius: 13px; }
.nav-tile { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 13px; background: var(--bg); transition: background 0.3s; }
.nav-title { display: block; font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; }
.nav-meta { display: block; margin-top: 2px; font-size: 13px; letter-spacing: 0; text-transform: uppercase; color: var(--ink-2); }
.nav-arrow { transition: transform 0.25s, color 0.25s; }
.nav-panel a:hover .nav-arrow { transform: translateX(3px); color: var(--accent); }
.nav-socials { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.nav-social { align-items: flex-end; min-height: 64px; font-size: 15px; }
.nav-social .nav-arrow { align-self: flex-start; }
.nav-social:hover .nav-arrow { transform: translate(2px, -2px); }
.nav-case-media { display: block; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 13px; background: var(--ph); }
.nav-case-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.nav-case:hover .nav-case-media img { transform: scale(1.03); }
.nav-case-text { display: block; padding: 10px 8px 12px; }
.nav-all { display: flex; justify-content: space-between; padding: 11px 8px 6px; border-top: 1px solid var(--line); font-size: 15px; }

.connect { display: flex; align-items: center; gap: 14px; justify-self: end; }
.theme-toggle {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 0; border-radius: 999px;
  background: var(--surface); color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover { background: var(--accent); color: var(--on-accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
/* a theme switch is one crossfade of the whole page (main.js), so no element may fade on its own clock */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.pill:hover { background: var(--accent); color: var(--on-accent); }
.pill--lg { font-size: clamp(16px, 2vw, 22px); padding: 14px 26px; }
/* the external-link arrow, drawn as a shape: phones turn the ↗ character into an emoji */
.icon-ne {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Cpath d='M1.5 14.5 14.5 1.5M5.75 1.5h8.75v8.75'/%3E%3C/svg%3E");
  display: inline-block;
  flex: none;
  width: 0.85em;
  height: 0.85em;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.pill .icon-ne { margin-left: calc(0.3em - 10px); } /* cancels the pill's gap, so it sits a word-space from the label */

/* ─── display type ─── */
.display {
  margin: 0;
  font-size: clamp(3.2rem, 11vw, 9.5rem);
  line-height: 0.95;
  font-weight: 600;
  letter-spacing: -0.045em;
  text-align: center;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* sized by width and height, so short laptop screens still get the drawing above the fold */
.hero-title { font-size: clamp(3rem, min(9.5vw, 13.5vh), 8.6rem); }
.rotator { display: inline-block; will-change: transform, opacity; }
.display .dot { color: var(--accent); }
/* standalone page title (About, Work, Writing) */
.page-head { padding-top: clamp(64px, 10vh, 120px); }
.page-title { font-size: clamp(2.8rem, 9vw, 8rem); }
.section-top .page-title { text-align: left; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.title {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  line-height: 0.95;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.lead {
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin: 0 0 0.6em;
}

/* ─── hero ─── */
.hero { padding-top: clamp(32px, 8vh, 112px); padding-bottom: clamp(16px, 3vh, 40px); }
.hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 560px;
  margin: clamp(18px, 3vh, 30px) auto 0;
  line-height: 1.25;
}
.hero-meta p { margin: 0; }
.hero-meta p:last-child { white-space: nowrap; }

.portrait-wrap { position: relative; margin: 0 auto; width: min(440px, calc(100% - var(--gutter) * 2)); }
/* hero pen drawing: bottom fades into the page, revealed top-down like a pen sweep */
.figure {
  margin: 0;
  --fade: linear-gradient(to bottom, #000 58%, rgba(0,0,0,.95) 64%, rgba(0,0,0,.82) 70%, rgba(0,0,0,.62) 76%, rgba(0,0,0,.4) 82%, rgba(0,0,0,.2) 88%, rgba(0,0,0,.07) 94%, transparent 100%);
  -webkit-mask-image: var(--fade);
          mask-image: var(--fade);
}
.figure-canvas, .figure noscript img { display: block; width: 100%; height: auto; }
/* No-JS fallback drawing in dark mode: keep it positive on a paper card (never a negative) */
@media (prefers-color-scheme: dark) {
  .figure noscript img { background: var(--fig-paper); border-radius: var(--radius); }
}

/* ─── statement (scroll-reveal) ─── */
.statement {
  padding-top: clamp(120px, 18vh, 220px);
  padding-bottom: clamp(80px, 12vh, 160px);
  max-width: 820px;
  text-align: center;
}
.scrub {
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin: 0 0 1.4em;
}
.scrub .w { color: var(--mute); transition: color 0.35s ease; }
.scrub .w.on { color: var(--ink); }

/* ─── section tops ─── */
.section-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 28px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.count { color: var(--ink-2); padding-bottom: 6px; }

/* ─── homepage: selected work + latest writing ─── */
.home-section { padding-top: clamp(80px, 13vh, 150px); }
.section-title { font-size: clamp(2.6rem, 6vw, 5.2rem); letter-spacing: -0.04em; text-align: left; }
.section-more { white-space: nowrap; transition: color 0.2s; }
.section-more .r-arrow { display: inline-block; }
.section-more:hover { color: var(--ink); }
.section-more:hover .r-arrow { transform: translateX(4px); color: var(--accent); }

/* ─── work cards ─── */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 56px 28px; }
.card-media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.card-media > * { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-media > * { transform: scale(1.03); }
.card-text { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 16px; }
.card-text h3 { margin: 0; font-size: clamp(1.4rem, 2.2vw, 1.9rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.card-text p { margin: 0; color: var(--ink-2); white-space: nowrap; }

/* placeholder media */
.ph {
  display: grid;
  place-items: end start;
  padding: 20px;
  background:
    linear-gradient(135deg, var(--ph-sheen), transparent 60%),
    var(--ph);
}
.ph span { font-size: 12px; text-transform: uppercase; color: var(--ink-2); background: var(--surface); padding: 5px 10px; border-radius: 999px; }

/* ─── experiment rows ─── */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-bottom: 1px solid var(--line); }
.rows a {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) 2fr 64px 84px 24px;
  gap: 24px;
  align-items: baseline;
  padding: 24px 16px;
  margin: 0 -16px;
  border-radius: 16px;
  transition: background 0.25s;
}
.rows a:hover { background: var(--surface); }
.r-name { font-size: clamp(1.15rem, 1.6vw, 1.4rem); font-weight: 600; letter-spacing: -0.03em; }
.r-desc { color: var(--ink-2); }
.r-status, .r-year { color: var(--ink-2); white-space: nowrap; }
.r-arrow { transition: transform 0.25s, color 0.25s; justify-self: end; }
.rows a:hover .r-arrow { transform: translateX(4px); color: var(--accent); }

/* ─── two-column editorial split ─── */
.split {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 24px 48px;
  padding: clamp(40px, 6vw, 72px) 0;
  border-top: 1px solid var(--line);
}
.split .label { margin: 4px 0 0; }
.split-body { min-width: 0; } /* wide content (code blocks) scrolls inside the column instead of stretching the grid */
.split-body p { margin: 0 0 1em; max-width: 56ch; }
.split-body p:last-child { margin-bottom: 0; }
.split-body .lead { margin-bottom: 0.7em; }
.about .split { border-top: 0; } /* whitespace separates the sections here; the rows carry the hairlines */
/* the opening sentence takes the statement size and stands alone, above the label/content rows */
.about-lead { margin: clamp(32px, 5vw, 64px) 0 clamp(32px, 5vw, 64px); max-width: 820px; font-size: clamp(1.8rem, 3.6vw, 3rem); line-height: 1.05; font-weight: 600; letter-spacing: -0.04em; }

.xp { list-style: none; margin: 0; padding: 0; }
.xp li { display: grid; grid-template-columns: 1fr auto; gap: 0 16px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); }
.xp li:first-child { padding-top: 0; }
.xp li:last-child { padding-bottom: 0; border-bottom: 0; }
.xp li > span:first-child { font-weight: 600; }
.xp li > span:nth-child(2) { color: var(--ink-2); font-size: 13.5px; text-transform: uppercase; letter-spacing: 0; white-space: nowrap; }

/* ─── case page ─── */
.case-hero { padding-top: clamp(64px, 10vh, 120px); padding-bottom: clamp(36px, 5vh, 56px); }
.case-title { font-size: clamp(2.8rem, 9vw, 8rem); }
.case-media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 7; }
.case-media > * { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.case-media.case-media--video { aspect-ratio: 16 / 9; }
.case-lead { max-width: 24ch; padding-top: clamp(40px, 6vw, 72px); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 40px 0 clamp(48px, 7vw, 96px); }
.facts dt { color: var(--ink-2); margin-bottom: 4px; }
.facts dd { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.stats strong { display: block; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 600; letter-spacing: -0.055em; line-height: 1; margin-bottom: 10px; }
.stats span { color: var(--ink-2); font-size: 0.92em; display: block; max-width: 20ch; }
.next { padding-top: clamp(40px, 6vw, 72px); }
.next a { display: block; border-top: 1px solid var(--line); padding-top: 32px; }
.next .label { display: block; color: var(--ink-2); margin-bottom: 10px; }
.next .title { display: inline-block; transition: transform 0.3s; }
.next a:hover .title { transform: translateX(8px); }

/* ─── article page (post.html): the case layout + long-form text ─── */
.post-title { font-size: clamp(2.6rem, 6.4vw, 5.6rem); max-width: 16ch; margin-inline: auto; }
.post .case-lead { max-width: 30ch; }
.post-side .toc { position: sticky; top: 96px; list-style: none; margin: 14px 0 0; padding: 0; counter-reset: toc; }
.post-side { min-width: 0; }
.toc li { counter-increment: toc; display: grid; grid-template-columns: 2.2em 1fr; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.35; }
.toc li::before { content: counter(toc, decimal-leading-zero); color: var(--ink-2); font-size: 12px; padding-top: 1px; }
.toc a { color: var(--ink-2); transition: color 0.2s; }
.toc a:hover { color: var(--ink); }
.toc li.active::before { color: var(--accent); }
.toc li.active a { color: var(--ink); }
.post-body { border-top: 0; padding-top: clamp(8px, 2vw, 24px); }
.prose { font-size: 18px; line-height: 1.6; }
.prose > *:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { max-width: 62ch; margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: 0.35em 0; }
.prose h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin: 2.2em 0 0.6em; scroll-margin-top: 96px; }
.prose h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.02em; margin: 1.8em 0 0.4em; }
.prose a { text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 1.6em 0; padding-left: 1.1em; border-left: 2px solid var(--ink); }
.prose blockquote p { margin-bottom: 0.4em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.6em 0; max-width: 62ch; }
.prose code { font-size: 0.9em; background: var(--surface); padding: 0.1em 0.35em; border-radius: 6px; }
.prose pre { background: var(--surface); padding: 18px 20px; border-radius: 16px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.prose pre code { background: none; padding: 0; }
.post-figure { margin: 2em 0; }
.post-figure img { display: block; width: 100%; border-radius: var(--radius); }
.post-figure figcaption { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.post-drawing canvas { --fig-red: var(--accent); --fig-paper: none; } /* line drawings: ink plus accent, no knockout in dark mode */
.post-note { margin: 1.6em 0; padding: 18px 22px; background: var(--surface); border-radius: 16px; font-size: 16px; }
.post-note > :last-child { margin-bottom: 0; }
.prose .post-pullquote { border: 0; padding: 0; margin: 1.6em 0; font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.12; }

/* ─── footer ─── */
.footer { padding-top: clamp(120px, 20vh, 240px); padding-bottom: 32px; }
.display.small { font-size: clamp(3rem, 10vw, 8.5rem); }
.footer-row { display: flex; flex-direction: column; align-items: center; gap: 22px; margin: 40px 0 clamp(80px, 14vh, 160px); }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.footer-meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--ink-2); padding-top: 22px; border-top: 1px solid var(--line); }

/* ─── ink accents: fine hand-drawn lines ─── */
.ink { display: block; overflow: visible; filter: url(#ink); }
.ink path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.6s cubic-bezier(.6,.05,.25,1);
  transition-delay: calc(var(--i, 0) * 0.12s);
}
.ink.drawn path { stroke-dashoffset: 0; }
.ink.done path { stroke-dasharray: none; transition: none; }
.doodle-slot { position: absolute; pointer-events: none; }
.doodle-slot .ink { width: 100%; height: auto; }
.doodle-pyramid { width: min(1200px, calc(100vw - var(--gutter) * 2)); left: 50%; top: 1%; transform: translate(-50%, var(--parallax, 0px)); will-change: transform; }
.doodle-pyramid canvas { display: block; width: 100%; height: auto; --fig-ink: var(--accent); --fig-red: var(--accent); --fig-paper: none; }
.doodle-pyramid .doodle-clouds { position: absolute; left: 0; top: 0; transform: translateY(var(--cloud-drift, 0px)); will-change: transform; }
.statement--single { padding-top: clamp(64px, 10vh, 120px); padding-bottom: clamp(64px, 10vh, 120px); }
.statement--single .scrub { margin-bottom: 0; }
.statement { position: relative; z-index: 1; } /* stays above the figure's scroll drift */
.figure-backing, .portrait-wrap > .figure { transform: translateY(var(--figure-drift, 0px)); will-change: transform; }
.figure-backing { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.doodle-inline { position: relative; display: inline-block; width: 0.42em; margin-left: 0.12em; vertical-align: 0.5em; }
.doodle-inline .ink path { stroke-width: 2.6; }
/* footer: the head from the hero drawing, drawn live on canvas; neck fades out */
.sketch-wrap { position: relative; --head: clamp(180px, 22vw, 250px); }
.footer-cloud { position: absolute; top: 20%; display: block; height: auto; width: min(300px, calc((100% - var(--head)) / 2 - 10px)); --fig-ink: var(--accent); --fig-red: var(--accent); --fig-paper: none; }
.footer-cloud--left { right: calc(50% + var(--head) / 2 + 6px); }
.footer-cloud--right { left: calc(50% + var(--head) / 2 + 6px); }
.sketch {
  width: var(--head);
  margin: 0 auto 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}
/* Dark mode: the small head in the header menu stands on its tile and ends on a crisp crop.
   The footer head fades out in both themes, like the hero figure. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sketch.nav-head { -webkit-mask-image: none; mask-image: none; }
}
:root[data-theme="dark"] .sketch.nav-head { -webkit-mask-image: none; mask-image: none; }
/* the same head, small, standing on the bottom edge of the About tile in the header menu */
.nav-about { align-items: flex-end; padding-top: 8px; padding-bottom: 0; }
.sketch.nav-head { display: block; flex: none; width: 72px; margin: 0; }
.nav-about-text { flex: 1; align-self: center; }
.nav-about .nav-arrow { align-self: center; }
.mark { position: relative; white-space: nowrap; }
.mark .ink { position: absolute; left: -2%; width: 104%; bottom: -0.16em; height: 0.3em; }
.mark .ink path { stroke-width: 3.2; transition-duration: 0.7s; }
.circled { position: relative; }
.circled .ink { position: absolute; left: -14px; top: -9px; width: calc(100% + 28px); height: calc(100% + 18px); }
.circled .ink path { stroke-width: 1.2; }
/* a case that shows a live pen drawing instead of a photo */
.figure-frame { display: grid; place-items: center; background: var(--surface); }
.figure-frame > canvas { width: 76%; }
.figure-frame:not(.figure-frame--portrait) canvas { --fig-red: var(--accent); --fig-paper: none; }
/* the hero in miniature: the figure keeps its own inks and dark-mode knockout, the pyramid and clouds are accent line work.
   --bg is the card colour here, so the backing silhouette hides the pyramid behind the body. */
.figure-frame--portrait { --bg: var(--surface); position: relative; overflow: hidden; align-items: start; }
.figure-frame--portrait > canvas { position: absolute; left: 0; top: 0; display: block; width: 100%; height: auto; margin-top: 5%; --fig-ink: var(--accent); --fig-red: var(--accent); --fig-paper: none; }
.figure-frame--portrait .portrait-wrap { width: 38%; margin: 5% auto 0; }
.figure-frame--portrait .figure { -webkit-mask-image: none; mask-image: none; }
.figure-frame--portrait::after { content: ""; position: absolute; inset: 62% 0 0; background: linear-gradient(to bottom, transparent, var(--surface)); pointer-events: none; }
.ph { position: relative; }
.ph-art { position: absolute; left: 50%; top: 46%; width: 56%; max-width: 420px; transform: translate(-50%, -50%); }
.ph-art path { stroke: var(--ink); stroke-width: 1.5; opacity: 0.85; }

/* ─── content additions ─── */
.section-intro { margin: -12px 0 40px; max-width: 52ch; color: var(--ink-2); }
.cards .card:first-child { grid-column: 1 / -1; }
.cards .card:first-child .card-media { aspect-ratio: 16 / 8; }
.xp li p { grid-column: 1 / -1; margin: 4px 0 0; color: var(--ink-2); font-size: 0.95em; max-width: 52ch; }
.case-link { margin: -40px 0 clamp(48px, 7vw, 96px); }
.case-link .pill, .case-try .pill { text-decoration: none; }
.chat-line { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 22px; background: var(--surface); border-radius: 28px; }
.chat-text { flex: 1; min-width: 0; color: var(--ink-2); }
.chat-cmd { color: var(--ink); font-weight: 600; }
.chat-send { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 16px; }

/* ─── reveal ─── */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.7,.2,1); }
[data-reveal].in { opacity: 1; transform: none; }

/* ─── responsive ─── */
@media (max-width: 900px) {
  .rows a { grid-template-columns: 1fr auto 24px; gap: 6px 16px; }
  .r-desc { grid-column: 1 / -1; grid-row: 2; }
  .r-year { display: none; }
}
@media (max-width: 760px) {
  :root { --radius: 20px; }
  .cards { grid-template-columns: 1fr; gap: 40px; }
  .split { grid-template-columns: 1fr; }
  .facts, .stats { grid-template-columns: 1fr; }
  .cards .card:first-child .card-media { aspect-ratio: 4 / 3; }
  .case-media { aspect-ratio: 4 / 3; }
  .post-side { display: none; }
  .prose { font-size: 17px; }
}
@media (max-width: 640px) {
  /* logo, menu and toggle share one slim pinned row. The name doesn't fit, so its text goes to
     zero size: screen readers still get "Thomas Hutten" as the link's name */
  .header { padding-top: 10px; padding-bottom: 10px; }
  .name { font-size: 0; gap: 0; }
  /* "Thomas Hutten." stays on one line, so the title is always two lines */
  .hero .display { font-size: 12.6vw; }
  .hero-meta { flex-direction: column; align-items: center; gap: 6px; text-align: center; }
  /* the title and its link don't fit on one line */
  .home-section .section-top { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 359px) {
  .nav-link { padding: 0 8px; } /* keeps the centred pill clear of the toggle on the narrowest phones */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .scrub .w { transition: none; }
  .ink path { stroke-dashoffset: 0; stroke-dasharray: none; transition: none; }
  .card-media > *, .next .title, .r-arrow { transition: none; }
  .nav-shell, .nav-panel, .nav-panel.is-open, .nav-arrow, .nav-case-media img { transition: none; }
  .nav-panel { transform: none; }
  .nav-panel a:hover .nav-arrow, .nav-case:hover .nav-case-media img, .section-more:hover .r-arrow { transform: none; }
}
