/* ---------- fonts (self-hosted, from Google Fonts; SIL Open Font License) ---------- */

/* JetBrains Mono normal cyrillic-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* JetBrains Mono normal cyrillic */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* JetBrains Mono normal greek */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* JetBrains Mono normal vietnamese */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* JetBrains Mono normal latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono normal latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* JetBrains Mono normal cyrillic-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* JetBrains Mono normal cyrillic */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* JetBrains Mono normal greek */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* JetBrains Mono normal vietnamese */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* JetBrains Mono normal latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono normal latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* JetBrains Mono normal cyrillic-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* JetBrains Mono normal cyrillic */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* JetBrains Mono normal greek */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* JetBrains Mono normal vietnamese */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* JetBrains Mono normal latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono normal latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(assets/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Newsreader italic vietnamese */
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url(assets/fonts/newsreader-italic-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* Newsreader italic latin-ext */
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url(assets/fonts/newsreader-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Newsreader italic latin */
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url(assets/fonts/newsreader-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Newsreader normal vietnamese */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(assets/fonts/newsreader-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* Newsreader normal latin-ext */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(assets/fonts/newsreader-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Newsreader normal latin */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(assets/fonts/newsreader-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Schibsted Grotesk normal latin-ext */
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(assets/fonts/schibsted-grotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Schibsted Grotesk normal latin */
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(assets/fonts/schibsted-grotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Thomas Juldo — portfolio
   Tokens → base → layout → sections → components → motion
   ========================================================================== */

:root {
  /* colour */
  --bg: #ebeae5;
  --bg-elev: #f4f3ef;
  --paper: #fbfaf7;
  --ink: #1b1d1a;
  --muted: #5f645d;
  --line: rgb(27 29 26 / 0.18);
  --line-strong: rgb(27 29 26 / 0.55);
  --accent: #009e60;
  --accent-text: #006b41; /* #009e60 darkened to 5.5:1 for small text on --bg */
  --accent-soft: rgb(0 158 96 / 0.1);
  --on-accent: #0c1a16;
  --glass: rgb(244 243 239 / 0.7);
  --glass-strong: rgb(244 243 239 / 0.92);

  /* swarm (read by script.js) */
  --robot: #fbfaf7;
  --robot-shade-1: #dedcd5;
  --robot-shade-2: #c2bfb6;
  --robot-pcb: #0f7a4f;
  --robot-led: #ff5b37;
  --robot-shadow: rgb(27 29 26 / 0.1);

  /* type */
  --font-sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* layout */
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --gutter-l: max(var(--gutter), env(safe-area-inset-left, 0px));
  --gutter-r: max(var(--gutter), env(safe-area-inset-right, 0px));
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111311;
    --bg-elev: #191c19;
    --paper: #d6d5cf;
    --ink: #e9e9e4;
    --muted: #9ba196;
    --line: rgb(233 233 228 / 0.16);
    --line-strong: rgb(233 233 228 / 0.5);
    --accent: #009e60;
    --accent-text: #1db877;
    --accent-soft: rgb(0 158 96 / 0.14);
    --on-accent: #0c1a16;
    --glass: rgb(25 28 25 / 0.68);
    --glass-strong: rgb(25 28 25 / 0.92);

    --robot: #1c1f1c;
    --robot-shade-1: #161816;
    --robot-shade-2: #101210;
    --robot-pcb: #0b8a55;
    --robot-led: #ff7a57;
    --robot-shadow: rgb(0 0 0 / 0.35);
  }
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-snap-type: y proximity;
}

/* Scrolling settles on the start of each section and project. */
.hero,
.work,
.side,
.about,
.contact {
  scroll-snap-align: start;
}

@media (pointer: coarse) {
  html {
    scroll-snap-type: none;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd,
figure,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

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

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

html {
  -webkit-tap-highlight-color: transparent;
}

a,
button {
  touch-action: manipulation;
}

/* Controls that are tapped or swiped, never read: no text selection or callout. */
button,
.showcase__card,
.slide img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[id] {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
}

.skip-link:focus {
  top: 12px;
}

/* A plain hairline frame. */
.box {
  border: 1px solid var(--line-strong);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.12s var(--ease-out);
}

.icon-btn:active:not(:disabled),
.copy-btn:active,
.contact__links a:active,
.site-nav .box:active {
  transform: scale(0.96);
}

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover:not(:disabled) {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
  }
}

.icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  gap: 0;
  padding: calc(12px + var(--safe-top)) var(--gutter-r) 0 var(--gutter-l);
  pointer-events: none;
}

/* One backdrop pass for the row instead of one per box. */
.site-header::before {
  content: "";
  position: absolute;
  top: calc(12px + var(--safe-top));
  left: var(--gutter-l);
  right: var(--gutter-r);
  height: var(--nav-h, 34px);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.site-header > * {
  pointer-events: auto;
}

.site-header .box {
  display: flex;
  align-items: center;
  position: relative;
  height: var(--nav-h, 34px);
  padding: 0 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.site-header .brand {
  flex: 1 1 auto;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand__short {
  display: none;
}

.brand__dot {
  color: var(--accent-text);
  font-weight: 700;
}

.site-nav {
  display: flex;
  margin-left: -1px;
}

.site-nav .box {
  min-width: 7.5rem;
  margin-left: -1px;
}

@media (hover: hover) and (pointer: fine) {
  .site-nav .box:hover {
    background-color: var(--ink);
    color: var(--bg);
  }
}

.site-nav .box.is-active {
  background-color: var(--ink);
  color: var(--bg);
}

@media (max-width: 720px) {
  .brand {
    flex: 0 0 auto;
  }
  .brand__full {
    display: none;
  }
  .brand__short {
    display: inline;
  }
  .site-nav {
    flex: 1;
  }
  .site-nav .box {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    padding: 0 0.4rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: calc(var(--header-h) + 20px) var(--gutter) clamp(20px, 4vh, 40px);
  overflow: hidden;
  isolation: isolate;
  cursor: crosshair;
}

.hero__swarm {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 3rem;
  color: var(--muted);
}

.hero__fig {
  justify-self: end;
  align-self: start;
  display: grid;
  gap: 0.1rem;
  margin-top: 1.5rem;
  text-align: right;
  color: var(--muted);
}

.hero__fig b {
  color: var(--accent-text);
  font-weight: 700;
}

.hero__real {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding: 0.35rem 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.hero__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
  align-items: end;
  gap: 1.5rem 3rem;
}

.hero__title {
  font-size: clamp(3.75rem, 12vw, 13rem);
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: -0.05em;
  margin-left: -0.04em;
}

.hero__title .word {
  display: block;
  white-space: nowrap;
}

.hero__title .char {
  display: inline-block;
  text-align: center;
}

.hero__aside {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 0.6rem;
}

.hero__lede {
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.4;
  text-wrap: pretty;
}

.hero__cta {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
}

@media (hover: hover) and (pointer: fine) {
  .hero__cta:hover,
  .hero__real:hover {
    border-bottom-color: var(--accent);
  }
}

@media (max-width: 860px) {
  .hero__bottom {
    grid-template-columns: 1fr;
  }
  .hero__fig {
    justify-self: start;
    text-align: left;
  }
  .hero__real {
    justify-self: start;
  }
  .hero__hint {
    display: none;
  }
}

@media (hover: none) {
  .hero {
    cursor: default;
  }
  .hero__hint {
    display: none;
  }
}

/* ---------- section scaffolding ---------- */

.work,
.side,
.about,
.contact {
  padding-top: clamp(4.5rem, 12vw, 9rem);
}

.section-head {
  display: grid;
  gap: 1rem;
  padding-inline: var(--gutter);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  max-width: 64rem;
}

.section-head--row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  max-width: none;
}

.section-head--row > div:first-child {
  display: grid;
  gap: 1rem;
  max-width: 64rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* ---------- showcase (selected work, horizontal cover-flow) ---------- */

.showcase {
  --card-w: clamp(260px, 32vw, 460px);
}

.showcase__track {
  position: relative;
  display: flex;
  gap: clamp(16px, 2.5vw, 36px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* Cards rest at the left gutter; the right padding lets the last one get there too. */
  padding: 1.5rem calc(100% - var(--card-w) - var(--gutter)) 2rem var(--gutter);
  scroll-padding-inline: var(--gutter);
}

.showcase__track::-webkit-scrollbar {
  display: none;
}

.showcase__item {
  flex: 0 0 var(--card-w);
  scroll-snap-align: start;
}

.showcase__card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  text-decoration: none;
}

/* The lift shadow lives on a pseudo-element so only its opacity animates. */
.showcase__card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.45);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.showcase__item.is-active .showcase__card::after {
  opacity: 1;
}

.showcase__item {
  position: relative;
  isolation: isolate;
}

.showcase__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* script.js slides the image against the card (parallax). */
.showcase__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  will-change: transform;
}

.showcase__info {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 0.4rem;
  padding: 1rem 1.1rem 1.15rem;
  border-top: 1px solid var(--line);
  /* Near-opaque so the small text keeps 4.5:1 over any photo. */
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.showcase__cue {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-self: start;
  margin-top: 0.15rem;
  color: var(--accent-text);
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.showcase__item.is-active .showcase__cue {
  opacity: 1;
  transform: none;
}

@media (pointer: coarse) {
  .showcase__info {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

.showcase__meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.showcase__num {
  color: var(--accent-text);
  font-weight: 700;
}

.showcase__title {
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
}

.showcase__desc {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.35;
}

.showcase__tags {
  color: var(--muted);
}

.showcase__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding-inline: var(--gutter);
}

.showcase__count {
  min-width: 4.5rem;
  text-align: center;
  color: var(--muted);
}

.showcase__count [data-showcase-current] {
  color: var(--ink);
}

@media (max-width: 720px) {
  .showcase {
    --card-w: 78vw;
  }
}

/* ---------- project parts ---------- */

.parts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  column-gap: 1.5rem;
  border-top: 1px solid var(--line-strong);
}

.part {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.2rem 0.75rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.part__num {
  grid-row: span 2;
  color: var(--accent-text);
  font-weight: 700;
}

.part__title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
}

.part__desc {
  grid-column: 2;
  font-family: var(--font-serif);
  font-size: 0.975rem;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- project chapter ---------- */

.project {
  margin-top: clamp(5rem, 12vw, 9rem);
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line-strong);
  margin-inline: 0;
}

.project__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 2rem var(--gutter);
  padding-inline: var(--gutter);
}

.project__aside {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  align-self: start;
  display: grid;
  gap: 0.5rem;
}

.project__num {
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: var(--accent-text);
}

.project__main {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  min-width: 0;
}

.project__title {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.project__lede {
  max-width: 38ch;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.2vw, 1.85rem);
  line-height: 1.3;
  text-wrap: pretty;
}

.facts,
.toolbox {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.5rem;
}

.facts > div,
.toolbox > div {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  padding: 0.85rem 1rem 1rem;
}

.facts dt,
.toolbox dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd,
.toolbox dd {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
}

.prose {
  columns: 2 20rem;
  column-gap: 2.5rem;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.prose p {
  break-inside: avoid;
  margin-bottom: 1em;
  text-wrap: pretty;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose--large {
  columns: auto;
  font-size: clamp(1.125rem, 1.5vw, 1.3rem);
  line-height: 1.5;
  max-width: 44rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  a.link:hover {
    border-bottom-color: var(--accent);
  }
}

/* Single-image projects: one figure, no carousel chrome. */
.project__media {
  margin: clamp(2.5rem, 6vw, 4.5rem) var(--gutter-r) 0 var(--gutter-l);
  border: 1px solid var(--line);
  background: var(--bg-elev);
}

.project__media img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  cursor: zoom-in;
}

@media (max-width: 860px) {
  .project__grid {
    grid-template-columns: 1fr;
  }
  .project__aside {
    position: static;
    display: flex;
    align-items: baseline;
    gap: 1rem;
  }
}

/* Phones: show the work right after the lede, before facts and prose. */
@media (max-width: 720px) {
  .project {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  .project__grid,
  .project__main {
    display: contents;
  }
  .project__aside,
  .project__main > * {
    margin-inline: var(--gutter-l) var(--gutter-r);
  }
  .project__aside { order: 0; }
  .project__title { order: 1; }
  .project__lede { order: 2; }
  .project > .carousel,
  .project > .project__media {
    order: 3;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
  }
  .facts { order: 4; }
  .parts { order: 5; }
  .prose { order: 6; }
  .links { order: 7; }
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- carousel: sliding media, fixed counter and controls ---------- */

.carousel {
  --h: clamp(240px, min(62vh, 78vw), 660px);
  --h: clamp(240px, min(62svh, 78vw), 660px);
  position: relative;
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: 2.5rem;
}

.carousel__viewport {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}

.carousel__viewport::-webkit-scrollbar {
  display: none;
}

.carousel__viewport:focus-visible {
  outline-offset: -2px;
}

.carousel__track {
  display: flex;
  gap: clamp(10px, 1.4vw, 20px);
  width: max-content;
  padding-inline: var(--gutter);
}

/* Each slide takes its image's aspect ratio at a shared height; very wide
   images are capped in width and sit centred at their natural height. */
.slide {
  flex: none;
  display: flex;
  align-items: center;
  height: var(--h);
  width: min(calc(var(--h) * var(--ar, 1.5)), 86vw);
  scroll-snap-align: start;
}

.slide figure {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 1.5);
  max-height: 100%;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}

.slide--paper figure {
  background: var(--paper);
}

.slide img,
.slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.js .slide.is-active img {
  cursor: zoom-in;
}

.carousel__card,
.carousel__peek {
  display: none;
}

/* Enhanced carousel (JS on): inactive slides fade back. */
.js .slide figure {
  transition: opacity 0.5s var(--ease-out), filter 0.5s var(--ease-out);
}

.js .slide:not(.is-active) figure {
  opacity: 0.55;
  filter: grayscale(0.6);
}

.js .carousel__card {
  position: absolute;
  right: var(--gutter);
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 0.75rem 0.75rem 1.1rem;
  background-color: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.carousel__count {
  color: var(--muted);
}

.carousel__count [data-current] {
  color: var(--ink);
}

.carousel__controls {
  display: flex;
  gap: 0.5rem;
}

.js .carousel__peek {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  width: clamp(5rem, 14vw, 12rem);
  height: var(--h);
  padding: 0 var(--gutter) 0 0;
  border: 0;
  background: linear-gradient(to right, transparent, var(--bg) 85%);
  cursor: pointer;
  transition: opacity 0.3s;
}

.js .carousel__peek::before {
  content: "";
  width: 4rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.625);
  transform-origin: right;
  transition: transform 0.3s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .js .carousel__peek:hover::before {
    transform: none;
  }
}

.carousel.is-end .carousel__peek {
  opacity: 0;
  pointer-events: none;
}

.carousel.is-single .carousel__peek,
.carousel.is-single .carousel__controls {
  display: none;
}

@media (max-width: 720px) {
  .carousel {
    padding-bottom: 0;
  }
  .js .carousel__card {
    position: relative;
    right: auto;
    margin: 0.5rem var(--gutter-r) 0 var(--gutter-l);
    padding: 0;
    border: 0;
    background-color: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .js .carousel__peek {
    display: none;
  }
}

/* ---------- side projects strip ---------- */

.strip-controls {
  display: flex;
  gap: 0.5rem;
  flex: none;
}

.strip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding: 0 var(--gutter) 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.strip__card {
  flex: 0 0 clamp(260px, 24vw, 330px);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  background-color: var(--bg-elev);
}

.strip__card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: #000;
}

.strip__body {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  flex: 1;
  padding: 1rem 1rem 1.1rem;
}

.strip__meta {
  color: var(--muted);
}

.strip__title {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.strip__desc {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.45;
}

.strip__with {
  font-size: 0.8125rem;
  color: var(--muted);
}

.strip__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-top: auto;
  padding-top: 0.4rem;
}

.strip__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

@media (hover: hover) and (pointer: fine) {
  .strip__links a:hover {
    border-bottom-color: var(--accent);
  }
}

@media (max-width: 720px) {
  .strip-controls {
    display: none;
  }
}

/* ---------- about ---------- */

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 2.5rem var(--gutter);
  padding-inline: var(--gutter);
}

.about__portrait {
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  padding: 0.5rem;
  background-color: var(--bg-elev);
}

.about__portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.5s;
}

@media (hover: hover) and (pointer: fine) {
  .about__portrait:hover img {
    filter: none;
  }
}

@media (hover: none) {
  .about__portrait img {
    filter: none;
  }
}

.about__portrait figcaption {
  padding: 0.6rem 0.25rem 0.1rem;
  color: var(--muted);
}

.about__text {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  min-width: 0;
}

.timeline {
  border-bottom: 1px solid var(--line-strong);
}

.timeline__row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1.2fr) minmax(0, 1.5fr);
  gap: 0.35rem 1.5rem;
  align-items: baseline;
  padding: 1rem 0;
  border-top: 1px solid var(--line-strong);
}

.timeline__when {
  color: var(--accent-text);
  font-weight: 700;
}

.timeline__what {
  font-size: 1rem;
  line-height: 1.35;
}

.timeline__what strong {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.timeline__detail {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--muted);
}

@media (max-width: 860px) {
  .about__grid {
    grid-template-columns: 1fr;
  }
  .about__portrait {
    position: static;
    max-width: 18rem;
  }
  .timeline__row {
    grid-template-columns: 5rem minmax(0, 1fr);
  }
  .timeline__detail {
    grid-column: 2;
  }
}

/* ---------- contact ---------- */

.contact {
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

.contact__intro {
  max-width: 34rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--muted);
}

.contact__email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding-inline: var(--gutter);
}

.contact__email a {
  font-size: clamp(1.6rem, 5.6vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent) 0 0) left bottom / 0 2px no-repeat;
  transition: background-size 0.4s var(--ease-out), color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
  .contact__email a:hover {
    background-size: 100% 2px;
  }
}

.copy-btn {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.12s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .copy-btn:hover {
    background: var(--ink);
    color: var(--bg);
  }
}

.copy-btn.is-done {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.contact__links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.5rem;
  margin: clamp(2rem, 5vw, 3.5rem) var(--gutter) 0;
}

.contact__links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.1rem;
  font-size: 1.125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, transform 0.12s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .contact__links a:hover {
    background-color: var(--ink);
    color: var(--bg);
  }
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  align-items: center;
  padding: 1.25rem var(--gutter-r) calc(1.5rem + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
}

.site-footer__top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

@media (hover: hover) and (pointer: fine) {
  .site-footer__top:hover {
    border-bottom-color: var(--accent);
  }
}

/* ---------- lightbox (tap an image to see it full size) ---------- */

.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: calc(var(--header-h) + var(--safe-top)) var(--gutter-r) var(--gutter) var(--gutter-l);
  border: 0;
  background: transparent;
  color: var(--ink);
}

.lightbox::backdrop {
  background: rgb(10 12 10 / 0.86);
}

.lightbox img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-out;
}

.lightbox .paper {
  background: var(--paper);
}

.lightbox__close {
  position: fixed;
  top: calc(12px + var(--safe-top));
  right: var(--gutter-r);
  background: var(--bg);
}

/* ---------- touch: larger targets ---------- */

@media (pointer: coarse) {
  :root {
    --nav-h: 44px;
    --header-h: 66px;
  }
  .icon-btn {
    width: 2.75rem;
    height: 2.75rem;
  }
  .link,
  .hero__cta,
  .hero__real,
  .strip__links a,
  .site-footer__top {
    padding-block: 0.7rem 0.45rem;
  }
  .strip__links {
    gap: 0 1.25rem;
  }
}

/* ---------- reveal on scroll (only when JS runs) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  }
  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
