@font-face {
  font-family: 'Editorial New';
  src: url('./fonts/PPEditorialNew-Regular-BF644b214ff145f.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Editorial New';
  src: url('./fonts/PPEditorialNew-Italic-BF644b214fb0c0a.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Chrome silver: cool, slightly blue-leaning so it sits with Klein blue. */
  --bone: #e5e9ed;
  --bone-soft: #d5dbe1;
  --ink: #002fa7;
  --void: #070a13;       /* obsidian darkroom for Photography */
  --stage: #04091a;      /* deep Klein-tinted void behind receding sheet transitions */
  --walnut: var(--ink);
  --cream: var(--bone);
  --rule: rgba(0, 47, 167, 0.18);
  --rule-cream: rgba(229, 233, 237, 0.2);

  /* POLISH — light surfaces carry one soft band of light across them, like a
     studio light on a metal sheet. It runs on x only, so every section, the
     body and the curve strips (SVG gradients #sheen / #sheenSoft in
     index.html read these same stops) line up at the seams. */
  --sheen-0: #dde2e7;
  --sheen-1: #e8ecef;
  --sheen-2: #f1f3f5;
  --sheen-3: #e7ebee;
  --sheen-4: #dbe0e5;
  --sheen-soft-0: #cdd4db;
  --sheen-soft-1: #d8dee4;
  --sheen-soft-2: #e1e6ea;
  --sheen-soft-3: #d7dde2;
  --sheen-soft-4: #cad1d8;
  --sheen: linear-gradient(90deg, var(--sheen-0) 0%, var(--sheen-1) 28%, var(--sheen-2) 50%,
    var(--sheen-3) 74%, var(--sheen-4) 100%);
  --sheen-soft: linear-gradient(90deg, var(--sheen-soft-0) 0%, var(--sheen-soft-1) 28%,
    var(--sheen-soft-2) 50%, var(--sheen-soft-3) 74%, var(--sheen-soft-4) 100%);
  --wave-front: var(--ink);

  /* Film grain tile, shared by the hero and every blue section (see GRAIN). */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.036 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");

  --font-display: 'Editorial New', serif;
  --font-body: 'Mona Sans', 'Roboto Flex', -apple-system, BlinkMacSystemFont, sans-serif;

  --pad-x: clamp(1rem, 2.6vw, 2.4rem);

  /* One flat caret thickness for every typist/selection cursor on the
     page, so they read identically regardless of the text size. */
  --caret-w: 2px;

  /* Type scale: display (Editorial New) → lead (the first paragraph of a
     section) → body (follow-on paragraphs). */
  --fs-lead: clamp(1.15rem, min(0.95rem + 0.85vw, 2.9vh), 1.6rem);
  --fs-body: clamp(0.95rem, 0.88rem + 0.25vw, 1.08rem);
}

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

html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

/* Native scroll with proximity snapping (script.js, SNAP POINTS): the page
   only snaps when it comes to rest near a section's start or end. Off when
   Lenis runs (html.lenis), which fights CSS snapping. */
html:not(.lenis) {
  scroll-snap-type: y proximity;
}

.snap-rail {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 0;
  pointer-events: none;
}

.snap-point {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  scroll-snap-align: start;
}

/* Hide the native scrollbar (Lenis drives the scroll) */
html,
body {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* old Edge */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;                  /* Chrome / Safari */
}

/* Above 1920px wide the whole page scales with the screen: every size is in
   rem (or capped in rem), so a 1440p or 4K screen at 100% gets the same
   proportions as 1080p instead of the same pixel sizes on a canvas twice as
   big. Below 1920px the root stays at the browser's default. */
html {
  font-size: clamp(100%, 0.8333vw, 200%);
  background: var(--stage);
}

body {
  font-family: var(--font-body);
  font-variation-settings: 'wdth' 100;
  background: var(--stage);
  color: var(--ink);
  overflow-x: clip;   /* preserves native position: sticky on deck sheets */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1;
}

/* Off-screen holder for the SVG goo filter — never part of layout (an inline
   <svg> can otherwise leave a stray box at the top of the page). */
.goo-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

::selection {
  background: var(--ink);
  color: var(--bone);
}

/* GRAIN
   Film grain sits in the BACKGROUND layer of each blue surface (rule lives
   after `.work--dark` below, so it wins over the `background:` shorthands),
   screen-blended with the Klein blue UNDER the type. A fixed full-page overlay
   used to sit above the text and randomly brightened the anti-aliased edge
   pixels of every glyph, which read as a dithered, bitten outline. The old
   6% element opacity is baked into the SVG alpha (0.6 x 0.06 = 0.036). */

/* NAV */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem var(--pad-x);
  z-index: 100;
  /* Bone over blue/dark sections, ink over silver ones; script.js tweens
     --nav-color by the section under the bar. Normal-case Mona Sans
     replaces tracked all-caps across the whole site. */
  color: var(--nav-color, var(--cream));
  font-size: 0.88rem;
  letter-spacing: 0.005em;
  font-weight: 500;
  font-variation-settings: 'wdth' 92;
}

.nav__right {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
}

.nav a {
  color: inherit;
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s cubic-bezier(0.25, 1, 0.3, 1);
}

.nav a:hover::after,
.nav a:focus-visible::after {
  width: 100%;
}

/* Keyboard focus. The browser's default ring barely registers on Klein
   blue, so every link gets a ring in its own text colour. */
a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* INDEX COUNTER + JUMP DRAWER */
.index-counter {
  position: fixed;
  left: 0;
  bottom: 0;
  padding: 1.5rem var(--pad-x);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--counter-color, var(--ink));
  font-family: var(--font-body);
  font-size: 0.86rem;
  letter-spacing: 0.005em;
  font-weight: 500;
  font-variation-settings: 'wdth' 92;
  font-variant-numeric: tabular-nums;
  transition: padding 0.3s ease, color 0.4s ease;
}

.index-counter--light-text {
  --counter-color: var(--cream);
}

.index-counter__btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.index-counter__btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.index-counter__sep {
  opacity: 0.45;
}

/* Intro, index, now and contact carry no number — just the name. */
.index-counter--unnumbered .index-counter__current,
.index-counter--unnumbered .index-counter__sep {
  display: none;
}

.index-counter__name {
  opacity: 0.65;
  transition: opacity 0.25s ease;
}

.index-counter__toggle {
  display: inline-block;
  margin-left: 0.2rem;
  opacity: 0.45;
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.3, 1), opacity 0.25s ease;
}

.index-counter__btn:hover .index-counter__name,
.index-counter__btn:hover .index-counter__toggle,
.index-counter--open .index-counter__name,
.index-counter--open .index-counter__toggle {
  opacity: 1;
}

.index-counter--open .index-counter__toggle {
  transform: rotate(45deg);
}

.counter-menu {
  display: flex;
  flex-direction: column;
  min-width: 11rem;
  padding: 0.4rem 0;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  background: var(--counter-menu-bg, var(--ink));
  transform-origin: bottom left;
  animation: menu-in 0.22s cubic-bezier(0.25, 1, 0.3, 1);
}

.counter-menu[hidden] {
  display: none;
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.counter-menu a {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  color: inherit;
  text-decoration: none;
  opacity: 0.65;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.counter-menu a:hover,
.counter-menu a:focus-visible,
.counter-menu a.is-active {
  opacity: 1;
}

.counter-menu a:hover,
.counter-menu a:focus-visible {
  background: var(--counter-color, var(--ink));
  color: var(--counter-menu-bg, var(--ink));
}

.counter-menu__num {
  opacity: 0.55;
  font-size: 0.66rem;
}

/* HERO */
.hero-wrapper {
  position: relative;
  overflow: hidden;
  /* Klein blue field. The fluid canvas fades to this flat blue at its foot,
     so the hero runs into the (also blue) index with no seam and no curve. */
  background: var(--ink);
  /* Own stacking context so the fluid canvas (z -1) paints above this blue
     and below the positioned .hero content. */
  isolation: isolate;
}

/* Grain for the whole hero field: a positioned layer painted after the canvas
   (z -1) and before the later-in-tree .hero, so it sits over the fluid and
   under the wordmark. Plain white at 3.6% alpha reads the same as the screen
   blend used on the flat sections. */
.hero-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 720px 720px;
}

/* HERO FLUID (trial) — a WebGL quad behind the wordmark; see script.js.
   Removed by JS under reduced motion / no WebGL, leaving the flat blue. */
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
  pointer-events: none;
}

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad-x);
  background: transparent;
  color: var(--cream);
  position: relative;
  overflow: visible;
}


.hero__name-line {
  display: block;
  overflow: visible;
}


.hero__title-block {
  width: 100%;
  position: relative;
}

.hero__name {
  /* Bold, wide Mona Sans: near-even stroke weight gives the mercury the same
     amount of metal to pull everywhere in the word, and the sans owns the
     wordmark while the serif stays with the section headings. script.js
     draws the mercury canvas in whatever face this rule resolves to
     (font-stretch included), so change it here only. */
  font-family: var(--font-body);
  font-weight: 800;
  /* 112.5 = the canvas's `semi-expanded`, so mask and DOM share one width */
  font-stretch: 112.5%;
  font-variation-settings: 'wght' 800, 'wdth' 112.5;
  /* Tracking lives on the letters (margin), not here — see .hero__char.
     letter-spacing interacts unevenly with inline-block widths. */
  letter-spacing: 0;
  line-height: 0.82;
  text-transform: lowercase;
  white-space: nowrap;
  display: inline-block;
  font-size: clamp(4rem, 25vw, 15rem);
  position: relative;
}

.hero__name-clip {
  position: relative;
  overflow: visible;
}

/* Each letter is its own inline-block carrying its own variable-font weight
   (--wght), so the reveal can develop weight per-glyph and the cursor can
   thicken individual letters. */
/* Word spans carry the liquid filter; inline-block gives the filter a box. */
#typed1,
#typed2 {
  display: inline-block;
}

.hero__char {
  display: inline-block;
  /* Each letter's weight and scale change every frame under the cursor;
     layout containment keeps that invalidation inside the letter's own box
     instead of re-laying-out the whole wordmark. (No paint containment: the
     swollen glyph is meant to spill past its slot into the neighbour.) */
  contain: layout;
  /* Width is set in JS to each glyph's real KERNED advance (measured from the
     un-split word), so the split letters reproduce the font's true spacing —
     kerning and all. The glyph is centred in that slot so weight/scaleX swell
     it symmetrically past its box into the neighbour, where the goo welds. */
  text-align: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variation-settings: 'wght' var(--wght, 800), 'wdth' 112.5;
}

/* MERCURY TYPE — a WebGL canvas over the whole hero paints the wordmark and
   its droplets (script.js). Once it has drawn, the DOM letters turn
   transparent but keep the layout and the accessible name; without WebGL or
   under reduced motion they stay visible and keep the weight hover. */
.hero__mercury {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.hero__name--mercury .hero__char {
  color: transparent;
}

/* Zero-size marker on each line's baseline, measured by the mercury. */
.hero__probe {
  display: inline-block;
  width: 0;
  height: 0;
}

/* Blink shared by the index + section-heading typewriters */
@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* The page's single caret (script.js, "ONE CARET"): it moves from heading
   to heading and inherits the text colour, so it works on light and dark. */
.type-cursor {
  display: inline-block;
  width: var(--caret-w);
  height: 0.82em;
  background: currentColor;
  margin-left: 0.04em;
  /* takes no room: resting after the last word of a full line it used to
     push that word onto a new line (the Now lines) */
  margin-right: calc(-0.04em - var(--caret-w));
  vertical-align: -0.06em;
  animation: cursor-blink 0.72s step-end infinite;
}

/* Placed by a click (script.js, "Click to place"): laid over the text at
   the gap, never inside it, so no letter moves; centred on the gap, with
   its height and colour set from the text under it. */
.type-cursor--placed {
  position: absolute;
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

/* stepped aside while the reader types in a field (their cursor is the
   caret then) */
.type-cursor--away {
  visibility: hidden;
}

/* in italic text it leans with the letters */
.type-cursor--italic {
  transform: translateX(-50%) skewX(-11deg);
  transform-origin: 50% 100%;
}

/* solid for a beat after it lands, then blinking again */
.type-cursor--fresh {
  animation-delay: 0.5s;
}

/* ---- HERO COLOPHON (bottom right) -------------------------------------
   Set exactly like the section counter opposite it (bottom left): same
   face, size, width and weight, on the same baseline, with the same muted
   second half ("01 / me" ↔ "MSc Artificial Intelligence / Rotterdam"). So
   the hero is one family — the wordmark and its labels — and its foot
   reads as one line. (It used to pair the sans with an Editorial New
   italic on its own baseline: a third voice on the screen.) */
.hero__subtitle {
  position: absolute;
  bottom: 1.5rem;            /* the counter's padding: a shared baseline */
  right: var(--pad-x);
  display: flex;
  align-items: baseline;
  gap: 0.4em;
  font-family: var(--font-body);
  font-size: 0.86rem;
  letter-spacing: 0.005em;
  font-weight: 500;
  font-variation-settings: 'wdth' 92;
  white-space: nowrap;
}

.hero__subtitle--ink {
  color: var(--cream);
  z-index: 1;
}

.hero__sep {
  opacity: 0.45;
}

.hero__loc {
  opacity: 0.65;
}

/* STICKY DECK & GRAND SHEET TRANSITIONS
   Every section before Contact pins natively via position: sticky (with
   --stick-top computed in JS so tall sections scroll freely to their foot
   before pinning). As the next .sheet-panel sweeps up over it from an inset
   architectural frame (9% → 0%, 32px → 0px), the pinned section behind it
   scales back (1 → 0.92) and dims into the Klein-obsidian void (--stage). */
.index,
/* The deck (script.js) writes each sheet's clip-path and the scale-back of
   the one under it straight to the element. */
.sheet-panel {
  position: relative;
  transform-origin: center 55%;
  will-change: transform, clip-path;
}

.index,
.sheet-panel:not(:last-of-type) {
  position: sticky;
  top: var(--stick-top, 0px);
}

/* The covered section dims into the stage (an element, added by the deck,
   so its opacity can be written directly). */
.deck-dim {
  position: absolute;
  inset: 0;
  background: var(--stage);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  /* its own compositor layer: the fade changes every scroll frame, and
     without one each step repainted the whole covered section (grain and
     all) */
  will-change: opacity;
}

#p01 { z-index: 2; }
#p02 { z-index: 3; }
#p03 { z-index: 4; }
#p04 { z-index: 5; }
#now { z-index: 6; }
#contact { z-index: 7; }

/* INDEX — borderless, grand editorial stage with staggered typography,
   ghostly colossal numeral watermark, and a live explanatory side folio. */
.index {
  background: var(--walnut);
  color: var(--cream);
  /* One full screen (85% left the next sheet always peeking in at the foot,
     with the deck's dark corners beside it). */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(5.5rem, 9vh, 8rem) var(--pad-x) clamp(5.5rem, 9vh, 8rem);
  overflow: hidden;
  z-index: 1;
}

.index__ghost {
  position: absolute;
  /* inside the gutter, with room for the italic's overhang, so it's never
     cut off by the screen edge */
  right: calc(var(--pad-x) + 0.06em);
  bottom: clamp(2rem, 6vh, 6rem);
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(10rem, min(24vw, 30vh), 26rem);   /* held by the height too: on a short laptop it ran into the last line */
  line-height: 0.78;
  letter-spacing: -0.05em;
  color: var(--cream);
  opacity: 0;               /* only while a row is pointed at (.is-pointing) */
  pointer-events: none;
  user-select: none;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
}

.index.is-pointing .index__ghost {
  opacity: 0.055;
}

.index__ghost.is-swapping {
  opacity: 0;
  transform: translateY(28px);
}

.index__head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 6vh, 5rem);
}

/* The same size as every other section title: the index is a section like
   the rest, and its heading sits above its entries, not below them. */
.index__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, min(7.5vw, 13vh), 9rem);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 0.95;
  text-transform: lowercase;
  min-height: 0.95em;
}

/* The list, centred in the space under the heading (it used to sit at the
   foot, its staircase running the last entry into a side preview and
   leaving the upper right empty). */
.index__stage {
  position: relative;
  z-index: 1;
  margin-block: auto;
}

.index__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1.4vh, 1.2rem);
}

/* Flush left, no staircase: a list you can scan down one edge. */

/* Depth focus: hovering or focusing any row dims its siblings so the active
   choice snaps cleanly forward. Zero horizontal borders. */
.index__list:hover .index__item,
.index__list:focus-within .index__item {
  opacity: 0.22;
}

.index__list .index__item:hover,
.index__list .index__item:focus-visible {
  opacity: 1;
}

/* A full-width row: number, name, and its note in the right-hand column,
   the same column (--cv-note) the CV ledger's notes sit in, so the index
   reads at a glance without hovering. */
.index__item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) var(--cv-note);
  align-items: baseline;
  column-gap: clamp(1rem, 2vw, 2rem);
  padding: clamp(0.65rem, 1.4vh, 1.2rem) 0;   /* the note ends on the gutter, like the CV notes */
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.28s ease;
}

.index__num {
  font-family: var(--font-body);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  font-variation-settings: 'wdth' 90;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.28s ease;
}

/* A step below the title, and held by the screen's height as well as its
   width, so a wide screen doesn't blow the entries up past the heading. */
.index__name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, min(6vw, 9.5vh), 7rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.94;
  display: inline-block;
  position: relative;
  color: var(--cream);
  transition: transform 0.38s cubic-bezier(0.25, 1, 0.3, 1);
}

.index__item:hover .index__name,
.index__item:focus-visible .index__name {
  transform: translateX(0.75rem);
}

/* The note: a quiet tag at rest, on the name's baseline. Pointing at the
   row swaps it for the row's sentence, in the same place, growing upward
   into the row's own height so it never runs into the next row. */
.index__note {
  position: relative;
  font-family: var(--font-body);
}

.index__meta {
  display: block;
  font-size: 0.86rem;
  letter-spacing: 0.005em;
  font-weight: 500;
  font-variation-settings: 'wdth' 92;
  opacity: 0.55;
  transition: opacity 0.25s ease;
}

.index__about {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 34ch;
  font-size: clamp(0.95rem, 1.05vw, 1.08rem);
  line-height: 1.5;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 1, 0.3, 1);
  pointer-events: none;
}

.index__item:hover .index__meta,
.index__item:focus-visible .index__meta {
  opacity: 0;
}

.index__item:hover .index__about,
.index__item:focus-visible .index__about {
  opacity: 0.9;
  transform: none;
}

/* THE INDEX AS A SENTENCE — one block of display serif across the blue,
   the four sections as words in it. Pointing at one dims the rest of the
   sentence and runs the selection sweep across just that word, like someone
   marking up a manuscript. */
.index__prose {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, min(4.6vw, 8vh), 5.8rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 19em;
  /* at rest the prose sits back and the four links stay full white, so
     it's clear what's clickable without underlines */
  color: rgba(229, 233, 237, 0.95);
  text-wrap: pretty;
  transition: color 0.3s ease;
}

/* pointing at one: three tiers — that word, the other links, the prose */
.index__prose:has(.index__word:hover),
.index__prose:has(.index__word:focus-visible) {
  color: rgba(229, 233, 237, 0.28);
}

.index__word {
  color: var(--cream);
  text-decoration: none;
  white-space: nowrap;      /* a word and its number never part */
  transition: color 0.3s ease;
}

.index__prose:has(.index__word:hover) .index__word,
.index__prose:has(.index__word:focus-visible) .index__word {
  color: rgba(229, 233, 237, 0.55);
}

.index__prose .index__word:hover,
.index__prose .index__word:focus-visible {
  color: var(--cream);
}

/* a little air round the highlight, offset by a matching negative margin
   so the word never moves; more below for the descenders (p, g, y) */
.index__prose .sel__hi {
  padding: 0.04em 0.09em 0.15em;
  margin: -0.04em -0.09em -0.15em;
}

/* the word takes the sentence's type, not the old list's */
.index__prose .index__name {
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

/* the 01-04, as footnote marks */
.index__ref {
  font-family: var(--font-body);
  font-size: 0.26em;
  font-weight: 500;
  font-variation-settings: 'wdth' 92;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  vertical-align: 1.9em;
  line-height: 0;
  margin-left: 0.15em;
  margin-right: -0.35em;    /* pulls the comma after "me" back in */
  opacity: 0.55;
  transition: opacity 0.25s ease;
}

.index__word:hover .index__ref,
.index__word:focus-visible .index__ref {
  opacity: 1;
}

/* Progressive text-selection on hover (shared across index, CV, research,
   contact). The inverted highlight and its caret snap to each character
   boundary, reading --sel-bg / --sel-fg from the enclosing light or dark
   section. */
.sel {
  position: relative;
  display: inline-block;
}

.index__sel,
.sel__hi {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  color: var(--sel-fg, var(--walnut));
  background: var(--sel-bg, var(--cream));
  padding: 0.1em 0;
  margin: -0.1em 0;
  clip-path: inset(0 100% 0 0);
  /* clean, quick follow — the rectangle stays crisp, only its edge moves */
  transition: clip-path 0.09s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.index__caret,
.sel__caret {
  position: absolute;
  top: 50%;
  left: 0;
  width: var(--caret-w);
  height: 1.05em;
  margin-left: calc(var(--caret-w) / -2);
  transform: translate(0, -50%);
  background: var(--sel-bg, var(--cream));
  opacity: 0;
  pointer-events: none;
  /* slight overshoot so the caret "settles" onto each glyph edge */
  transition: transform 0.11s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.18s ease;
}

.index__item:hover .index__num,
.index__item:focus-visible .index__num {
  opacity: 1;
}

/* Inset: the revealed row's clip-path would cut an outset ring. */
.index__item:focus-visible {
  outline-offset: -2px;
}

/* WORK BLOCKS (full-viewport minimum so each pinned deck sheet fills the frame cleanly) */
/* Section padding is held by the screen's height as well as its width, so a
   one-screen section (Me, Research) fits a laptop screen instead of running a
   few dozen pixels past it. The tokens are reused by the Me photo. */
.work {
  --sec-pt: clamp(5rem, min(10vw, 15vh), 10rem);
  --sec-pb: clamp(4.5rem, min(11vw, 13vh), 11rem);
  min-height: 100svh;
  padding: var(--sec-pt) var(--pad-x) var(--sec-pb);
}

.work--light {
  --sel-bg: var(--ink);
  --sel-fg: var(--bone);
  background: var(--bone) var(--sheen);
  color: var(--ink);
}

.work--dark {
  --sel-bg: var(--cream);
  --sel-fg: var(--walnut);
  background: var(--walnut);
  color: var(--cream);
}

/* Obsidian darkroom surface for Photography */
.work--void {
  --sel-bg: var(--cream);
  --sel-fg: var(--void);
  background-color: var(--void);
  background-image: var(--grain);
  background-size: 720px 720px;
  background-blend-mode: screen;
  color: var(--cream);
}

.work--void .gallery__frame {
  background: rgba(229, 233, 237, 0.03);
  border-color: rgba(229, 233, 237, 0.14);
}

.work--void .gallery__frame:hover {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}


/* Grain on every blue surface — see the GRAIN note near the top. Declared
   after the shorthands above so the image layer is not reset. Text and
   images paint above the background, so glyph edges stay crisp. */
.index,
.work--dark,
.now {
  background-color: var(--ink);
  background-image: var(--grain);
  background-size: 720px 720px;
  background-blend-mode: screen;
}

.work__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  /* Top-aligned: with `end` the text sank to the bottom of an 800px image row
     and the top-left of every work section was empty. */
  align-items: start;
}

/* Single column: header row, then a full-width block (gallery). */
.work__inner--stack {
  grid-template-columns: 1fr;
  gap: 3.5rem;
}

.work__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, min(7.5vw, 13vh), 9rem);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 0.95;
  text-transform: lowercase;
  margin-bottom: clamp(1.25rem, 3vh, 2.25rem);
  min-height: 0.95em;
}

/* Lead: the middle of the scale. Big enough to read as a voice, not a
   caption; tracked a hair tighter than body, as larger sans wants. */
.work__desc {
  font-family: var(--font-body);
  font-size: var(--fs-lead);
  line-height: 1.38;
  max-width: 31ch;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-wrap: pretty;
  opacity: 0.85;
}

.work__desc--follow {
  margin-top: min(1.6rem, 2.2vh);   /* held by the height too: Me fits a 720px screen */
  font-size: var(--fs-body);
  line-height: 1.6;
  max-width: 44ch;
  letter-spacing: 0.01em;
}

/* Research carries three body paragraphs next to the paper: let them use the
   column's width instead of the 44ch measure, so it stays one screen at 1080p */
#p03 .work__desc--follow {
  max-width: 60ch;
}

/* A true 4:5 portrait, as tall as the section's content area allows (the
   screen minus the section padding) and set against the right gutter. It
   used to be the full column width with a px height cap, which turned the
   portrait into a landscape box on a wide screen and still ran past the
   fold on a laptop. */
.work__image {
  width: min(100%, calc((100svh - var(--sec-pt) - var(--sec-pb)) * 0.8));
  aspect-ratio: 4 / 5;
  justify-self: end;
  background: var(--bone-soft);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work__image img,
.gallery__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The portrait rests in the site's blue (cyanotype) and develops into
   colour on hover. The blue is a second copy of the photo with the tint
   baked in (portrait-blue-*.jpg, the #cyanotype filter's own maths), laid
   over the colour one and faded out: an SVG filter can't be transitioned,
   so swapping it snapped. Only the portrait: the Photography frames show
   the photos as they were edited. */
.work__image .work__image-tint {
  position: absolute;
  inset: 0;
  transition: opacity 0.7s cubic-bezier(0.25, 1, 0.3, 1);
}

.work__image:hover .work__image-tint {
  opacity: 0;
}

.work--dark .work__image {
  background: rgba(229, 233, 237, 0.07);
}

.work__image:empty::before,
.gallery__frame:empty::before {
  content: 'image';
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-variation-settings: 'wdth' 90;
  letter-spacing: 0.02em;
  opacity: 0.42;
  font-weight: 500;
}

/* PAPER (Research, right column)
   The paper is set the way the index sets its entries: straight on the bone,
   no container — a serif name, tracked meta, hairlines between rows. Label
   column + value, like the CV ledger. The title row and the last row link to
   the PDF; hovering a row lifts its meta to full opacity, as index rows do. */
.paper {
  border-top: 1px solid var(--rule);   /* level with the top of the "research" headline */
}

.paper__row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 2rem;
  align-items: baseline;
  padding: 1.4rem 0.25rem;
  border-bottom: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
}

.paper__label,
.paper__value {
  font-family: var(--font-body);
  font-size: 0.92rem;
  letter-spacing: 0.005em;
  font-weight: 500;
  font-variation-settings: 'wdth' 92;
  opacity: 0.62;
  transition: opacity 0.3s ease;
}

.paper__label {
  font-variant-numeric: tabular-nums;
}

.paper__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.05;
  text-wrap: balance;
}

.paper__nb {
  white-space: nowrap;   /* keep hyphenated compounds on one line */
}

.paper__row:hover .paper__label,
.paper__row:hover .paper__value,
a.paper__row:focus-visible .paper__label,
a.paper__row:focus-visible .paper__value {
  opacity: 1;
}

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

.paper__row--read .paper__value {
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
}

/* Expandable abstract folio inside .paper */
.paper__folio {
  display: flex;
  flex-direction: column;
}

.paper__toggle {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-family: var(--font-body);
  font-size: 0.92rem;
  letter-spacing: 0.005em;
  font-weight: 500;
  font-variation-settings: 'wdth' 92;
  opacity: 0.72;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity 0.25s ease;
}

.paper__toggle:hover,
.paper__toggle:focus-visible,
.paper__toggle[aria-expanded="true"] {
  opacity: 1;
}

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

.paper__toggle-icon {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.3, 1);
}

.paper__toggle[aria-expanded="true"] .paper__toggle-icon {
  transform: rotate(45deg);
}

.paper__drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s cubic-bezier(0.25, 1, 0.3, 1);
}

.paper__drawer.is-open {
  grid-template-rows: 1fr;
}

.paper__drawer-inner {
  overflow: hidden;
}

.paper__drawer-inner p {
  padding-top: 0.9rem;
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1vw, 1rem);
  line-height: 1.6;
  letter-spacing: 0.01em;
  opacity: 0.85;
  max-width: 46ch;
}

.paper__row--ongoing .paper__label {
  opacity: 0.8;
}

.paper__ongoing {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.15rem, 1.6vw, 1.55rem);
  line-height: 1.25;
  opacity: 0.85;
}


/* SPLIT HEADER (CV) — meta + title on the left half, intro on the right,
   bottom-aligned. The intro starts on the same column edge as the ledger's
   notes below (right half of a 4rem-gap two-column grid, as .work__inner). */
/* The split header and the CV ledger share one right-hand column, a fixed
   measure (--cv-note) that ends on the right gutter: the intro and every
   note start on the same edge and end where the hairlines end. (It used to
   be the right half with the text capped in ch, so on a wide screen the
   text stopped ~400px short of the rules.) */
.work__head--split,
.cv,
.index {
  --cv-note: clamp(26rem, 36vw, 38rem);
}

.work__head--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--cv-note);
  column-gap: 2rem;
  align-items: end;
}

.work__head--split .work__title {
  margin-bottom: 0;
}

/* Nudge the intro's last baseline onto the title's (the title's line box
   runs lower than its baseline). Measured, not derived. */
.work__head--split .work__desc {
  margin-bottom: 0.6rem;
  max-width: none;
}

/* CV LEDGER — set the way the index sets its entries: a serif name with a
   tracked org under it, hairlines between rows, no axis, no markers. Every
   column hangs off the entry's first baseline (the serif title), so the years
   and the note read as one line with it. */
.cv {
  list-style: none;
  border-top: 1px solid var(--rule-cream);
}

.cv__item {
  display: grid;
  /* when | what | note — the note column is the header's right column, so
     it starts on the intro's edge above and ends on the gutter. */
  grid-template-columns: 9rem minmax(0, 1fr) var(--cv-note);
  column-gap: 2rem;
  align-items: baseline;
  padding: 1.9rem 0 2rem;
  border-bottom: 1px solid var(--rule-cream);
}

.cv__when {
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.005em;
  font-weight: 500;
  font-variation-settings: 'wdth' 90;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: rgba(229, 233, 237, 0.62);
}

/* A running entry ends in "now" set in the display italic, the same voice
   as "& curious." in the motto: warmer, and at full strength. */
.cv__live {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.32em;
  letter-spacing: 0;
  color: var(--cream);
}

/* On silver (Research). Two classes, so it outranks .cv__live wherever the
   two rules sit in the file — it used to lose on source order and render
   silver on silver. */
.cv__live.cv__live--ink {
  color: var(--ink);
}

.cv__body {
  display: flex;
  flex-direction: column;
}

.cv__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.05;
  text-wrap: balance;
}

.cv__org {
  font-family: var(--font-body);
  font-size: 0.88rem;
  letter-spacing: 0.005em;
  font-weight: 500;
  font-variation-settings: 'wdth' 92;
  line-height: 1.4;
  opacity: 0.62;
  margin-top: 0.7rem;
}

.cv__note {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.05vw, 1.1rem);
  line-height: 1.6;
  letter-spacing: 0.01em;
  opacity: 0.8;
}

.cv__item--action {
  padding: 1.5rem 0;
}

.cv__download {
  grid-column: 2 / -1;
  color: var(--cream);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.1;
  justify-self: start;
}

/* GALLERY (Photography — photos in their own colour and shape)
   Rows of photos at their own aspect ratio, nothing cropped. Each frame
   carries --r (width / height); with a zero basis and a grow of --r, a row
   shares its width in proportion to --r, so every photo in it comes out the
   same height and the row ends flush on both gutters. A .gallery__break
   (full-width, no height) ends a row. Vertical spacing is the frames'
   margin, not row-gap, so a break adds no extra gap. */
.gallery {
  --g: 1.25rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--g);
  margin-bottom: calc(-1 * var(--g));
}

.gallery__frame {
  position: relative;
  flex: var(--r, 1) 1 0;
  min-width: 0;
  aspect-ratio: var(--r, 1);
  margin-bottom: var(--g);
  background: rgba(229, 233, 237, 0.05);
  border: 1px solid var(--rule-cream);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.gallery__break {
  flex: 0 0 100%;
  height: 0;
}

.gallery__frame:hover {
  border-color: rgba(229, 233, 237, 0.55);
}

.gallery__frame--interactive {
  cursor: zoom-in;
}

/* On a phone a row may wrap: each photo asks for --r x 11rem, so a row of
   three portraits stays one line while a landscape and a portrait split,
   and every line still fills the width at one height. */
@media (max-width: 768px) {
  .gallery {
    --g: 0.75rem;
  }

  .gallery__frame {
    flex-basis: calc(var(--r, 1) * 11rem);
  }
}

/* LIGHTBOX (Photography: the photo as a small article)
   The photo on the left, as large as the screen allows; beside it a text
   column set like a newspaper feature: the caption line, a serif headline,
   body paragraphs, the link to the original. On a phone the photo sits on
   top and the text runs under it. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--ink);
  color: var(--cream);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(18rem, 26vw, 30rem);
  column-gap: clamp(2rem, 4vw, 4.5rem);
  align-items: center;
  padding: clamp(3.5rem, 6vh, 5rem) var(--pad-x);
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  overscroll-behavior: contain;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

html.has-lightbox {
  overflow: hidden;
}

.lightbox__figure {
  margin: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox__text {
  align-self: center;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  cursor: auto;
  padding-right: 0.5rem;
}

.lightbox__meta {
  font-family: var(--font-body);
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  font-variation-settings: 'wdth' 92;
  font-weight: 500;
  opacity: 0.75;
}

.lightbox__story h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, min(2.6vw, 4.6vh), 3rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 1.1rem 0 1.4rem;
}

.lightbox__story p {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  max-width: 38ch;
}

.lightbox__story p + p {
  margin-top: 0.9em;
}

.lightbox__full {
  display: inline-block;
  margin-top: 1.6rem;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-variation-settings: 'wdth' 92;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  opacity: 0.75;
}

.lightbox__full[hidden] {
  display: none;
}

.lightbox__full:hover,
.lightbox__full:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.lightbox__close {
  position: absolute;
  top: clamp(1rem, 2.4vh, 1.6rem);
  right: var(--pad-x);
  background: none;
  border: 0;
  padding: 0.3rem 0;
  font: inherit;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  color: inherit;
  cursor: pointer;
  opacity: 0.75;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  opacity: 1;
}

@media (max-width: 768px) {
  .lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: start;
    row-gap: 1.25rem;
    overflow-y: auto;
    padding-top: 3.5rem;
  }

  .lightbox__figure {
    height: auto;
  }

  .lightbox__img {
    max-height: 62svh;
  }

  .lightbox__text {
    max-height: none;
    overflow: visible;
    padding: 0 0 2rem;
  }
}

/* NOW — the old motto's setting (centred display serif on Klein blue, typed
   in by the caret, lines drifting apart) with what Luuk is doing now. The
   lines are sentences, so they wrap; each typed line sits over a hidden
   copy of itself (.now__ghost) that holds the block at its final size, so
   typing never shifts the page. */
.now {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6rem, 10vw, 10rem) var(--pad-x);
  color: var(--cream);
  overflow: hidden;
}

.now__inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.now__label {
  font-family: var(--font-body);
  font-size: 0.92rem;
  letter-spacing: 0.005em;
  font-variation-settings: 'wdth' 92;
  font-weight: 500;
  opacity: 0.62;
  margin-bottom: clamp(2.8rem, 5.5vw, 5rem);
}

.now__kinetic {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4.4vw, 5.4rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.08;
}

.now__line {
  position: relative;
  display: block;
  max-width: 15em;
  will-change: transform;
}

.now__ghost {
  display: block;
  visibility: hidden;
}

.now__line .word {
  position: absolute;
  inset: 0;
  display: block;
}

/* the second line in the italic, as the motto's second half was (on the
   line, so its ghost wraps the same way) */
.now__line--right {
  font-style: italic;
}

/* CONTACT — the last sheet, arriving like every other one. On it: the
   hero's fluid and a letter. The page's one caret has typed every heading on
   the way down; here it types "Dear Luuk," and stops on an empty line that
   is the reader's to write on. The rest (address, links) sits bottom right,
   in the hero colophon's place, opposite the counter. */
.contact {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--cream);
}

.contact__stage {
  --sel-bg: var(--cream);
  --sel-fg: var(--ink);
  position: absolute;
  inset: 0;
  display: flex;           /* the letter fills the screen down to the links */
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;      /* canvas (z -1) over the blue, under the type */
  background: var(--ink);
}

/* Grain over the fluid, under the type — as on the hero. */
.contact__stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 720px 720px;
}

.contact__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
  pointer-events: none;
}

/* THE LETTER — set like Now: the display serif, the second voice in
   italic. The salutation is Luuk's line; what the reader writes is theirs. */
.letter {
  /* A column from the salutation down to just above the links: a long
     letter grows into the page and only scrolls inside its box once the
     screen has no room left. */
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: 0 var(--pad-x);
  padding: clamp(7rem, 27vh, 17rem) 0 4.5rem;
  max-width: 15.5em;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, min(5.6vw, 9vh), 6.6rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--cream);
}

.letter__salute {
  margin: 0;
  min-height: 1.08em;
}

/* Everything under the salutation is indented a step, like the body of a
   letter; the Enter key hangs in that indent, in front of the line. */
.letter__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0.42em;
  padding-left: 0.9em;
}

.letter__salute,
.letter__sign,
.letter__actions {
  flex: none;
}

/* The reader's line: well under the salutation's size, so their words read
   as a letter's body rather than a second heading. */
.letter__line {
  position: relative;
  min-height: 1.3em;
  font-size: 0.4em;       /* the sans runs larger than the serif */
  line-height: 1.3;
  cursor: text;
  /* A long letter scrolls inside its own box instead of running down the
     page and under the links (the limit below keeps it short anyway). */
  flex: 0 1 auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(229, 233, 237, 0.35) transparent;
}

/* Over the limit: the line refuses with a small shake, like a wrong
   password, and the count pops in under it (script.js, THE LETTER). */
@keyframes letter-refuse {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-0.22em); }
  40% { transform: translateX(0.2em); }
  60% { transform: translateX(-0.12em); }
  80% { transform: translateX(0.07em); }
}

/* written: a block filling the line, so a click anywhere on the text (or
   beside it) places the cursor there instead of at the start */
.letter.has-text .letter__write {
  display: block;
}

/* only a written line is a scroll box: empty, the invitation may wrap
   past it without a scrollbar appearing */
.letter.has-text .letter__line {
  overflow: hidden;
}

/* and only once it's really full (script.js): a sub-pixel overflow from
   rounding must not bring up a scrollbar */
.letter.has-text .letter__line.is-scrollable {
  overflow-y: auto;
}

.letter__line.is-overflowing {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), transparent);
}

.letter__line.is-refused {
  animation: letter-refuse 0.32s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes letter-count-pop {
  0% { opacity: 0; transform: scale(0.8); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.letter__count {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform-origin: 100% 50%;
  transition: opacity 0.3s ease;
}

.letter__count.is-on {
  opacity: 0.7;
  animation: letter-count-pop 0.28s ease-out;
}

.letter__count.is-full {
  opacity: 1;
}

/* Two voices by typeface, not by slant: Luuk's line is the display serif,
   the reader's words (message, invitation, sign-off) are the body sans —
   what typing into a page looks like. (The serif's italic read too thick at
   this size in regular and mannered in ultralight.) */
.letter__write,
.letter__ghost,
.letter__sign,
.letter__from {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 400;
  font-variation-settings: 'wdth' 100;
  letter-spacing: -0.032em;   /* set a little closer than the sans's default */
}


.letter__write {
  display: inline;            /* empty: the page's caret sits right after it */
  outline: none;
  caret-color: currentColor;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The Enter key, mirrored (↳: the line starts here), hung in the indent in
   front of the line, greyed like the invitation. It stays as the line's
   marker once the reader writes. */
/* The indent, as a gutter: the key sits at its right edge, just before
   the line, whatever the indent is at this width. As tall as the line's
   first row, so the key centres on it. */
.letter__gutter {
  position: absolute;
  left: 0;
  top: 0;
  width: 0.9em;
  height: 0.52em;          /* the line: 0.4em × 1.3 */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.2em;
  box-sizing: border-box;
  pointer-events: none;
}

.letter__mark {
  display: inline-block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.248em;      /* 0.62 of the line's 0.4em */
  font-weight: 500;
  line-height: 1;
  padding: 0.32em 0.5em 0.26em;
  border: 1px solid currentColor;
  border-radius: 0.3em;
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.letter__mark > span {
  display: inline-block;
  transform: scaleX(-1);
}

/* The invitation: greyed on the empty line, just after the page's caret.
   It goes as soon as there's a letter. */
.letter__ghost {
  position: absolute;
  top: 0;
  left: 0.12em;
  right: 0;
  opacity: 0.38;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.letter.has-text .letter__ghost,
.letter.has-text .letter__mark,
.letter__line.is-waiting .letter__ghost,
.letter__body:has(.letter__line.is-waiting) .letter__mark {
  opacity: 0;
}

/* the page's caret rests on the empty line until the reader takes it */
.letter__line .type-cursor {
  margin-left: 0;
}

.letter__line.is-writing .type-cursor {
  display: none;
}

/* The sign-off: once there's a letter, "Kind regards," is typed in (as
   the reader moves on to it), then a line for their name — both at the
   letter's own size, as a sign-off is — and under it, smaller, how to
   reach them. */
.letter__sign {
  position: relative;
  display: block;
  max-width: 22em;
  margin-top: 1.15em;
  font-size: 0.4em;
  line-height: 1.3;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.3em);
  transition: opacity 0.35s ease, transform 0.35s ease;   /* visibility flips at once, so focus can land */
}

.letter.has-text .letter__sign {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.letter__regards {
  margin: 0;
  min-height: 1.3em;   /* holds the line while it is typed */
}

.letter__regards .type-cursor {
  margin-left: 0.02em;
}

/* one caret at a time: the name line's own waits for "Kind regards," */
.letter__sign.is-typing .letter__from {
  caret-color: transparent;
}

.letter__from {
  display: block;
  width: 100%;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  outline: none;
  caret-color: currentColor;
}

/* the line to sign on: the letter's own size, on a rule */
.letter__from {
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--rule-cream);
}

.letter__from::placeholder {
  color: inherit;
  opacity: 0.38;
}

.letter__from:focus {
  border-bottom-color: currentColor;
}

/* a field only bots fill in */
.letter__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.letter__actions {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  margin-top: clamp(2.4rem, 6.5vh, 4.4rem);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-style: normal;
  letter-spacing: 0.005em;
  font-variation-settings: 'wdth' 92;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
}

.letter.has-text .letter__actions {
  opacity: 1;
  visibility: visible;
}

/* Send, in the same small voice as every other link on the page (and the
   same selection on hover), with the key that does it beside it. */
.letter__send {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  font: inherit;
  font-size: 1.3em;        /* a step above the hint and count beside it */
  font-variation-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.letter__send-key {
  opacity: 0.55;
}

.letter__send:disabled {
  opacity: 0.35;
  cursor: default;
}

.letter__hint {
  opacity: 0.6;
}

.letter__hint a {
  color: inherit;
}

/* Sent: the letter stays on the page, quiet, and can't be edited. */
.letter.is-sent .letter__write,
.letter.is-sent .letter__from {
  pointer-events: none;
}

.letter.is-sent .letter__line,
.letter.is-sent .letter__sign {
  opacity: 0.5;
}

.letter.is-sent .letter__send {
  display: none;
}

/* The rest, in the hero colophon's place: bottom right, on the counter's
   baseline, in the counter's voice. */
.contact__foot {
  position: absolute;
  z-index: 2;
  right: var(--pad-x);
  bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1.6rem;
  font-family: var(--font-body);
  font-size: 0.86rem;
  letter-spacing: 0.005em;
  font-variation-settings: 'wdth' 92;
  font-weight: 500;
  white-space: nowrap;
}

.contact__foot a {
  color: inherit;
  text-decoration: none;
}

.contact__mail {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
}

.contact__status {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.contact__status.is-copied {
  opacity: 0.65;
}

@media (max-width: 640px) {
  .letter {
    padding: 6.5rem 0 6.6rem;   /* the links stack above the counter here */
    font-size: clamp(2rem, 10vw, 2.8rem);
  }
  .letter__body {
    padding-left: 0.75em;
  }
  .letter__gutter {
    width: 0.75em;
    height: 0.78em;        /* 0.6em × 1.3 */
    padding-right: 0.16em;
  }
  .letter__mark {
    font-size: 0.34em;
  }
  .letter__line {
    font-size: 0.6em;
  }
  .letter__sign {
    font-size: 0.6em;
  }
  /* the counter keeps the bottom left; the links stack above it */
  .contact__foot {
    left: var(--pad-x);
    right: var(--pad-x);
    bottom: 3.4rem;
    flex-wrap: wrap;
    gap: 0.5rem 0.95rem;
  }
  /* the address on its own line, the four links under it */
  .contact__foot .contact__mail {
    flex-basis: 100%;
  }
}

/* NOW (.now--light): on the deeper silver, so the page ends
   black → silver → blue instead of on two blue screens. */
.now.now--light {
  background: var(--bone-soft) var(--sheen-soft);
  color: var(--ink);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .work {
    --sec-pt: 6rem;
    --sec-pb: 6rem;
  }
  .index {
    padding-top: 5rem;
  }
  .now {
    padding: 6rem var(--pad-x) 4rem;
  }
}

@media (max-width: 768px) {
  .index-counter {
    padding: 1rem var(--pad-x);
  }

  .hero__subtitle {
    bottom: 1rem;            /* the counter's padding at this width */
  }

  .index {
    min-height: auto;
  }

  .index__ghost {
    font-size: 14rem;
    opacity: 0.04;
  }

  .index__head {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2.25rem;
  }

  .index__item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .index__note {
    grid-column: 2;
    margin-top: 0.35rem;
  }

  .index__about {
    display: none;            /* no hover on a phone; the tag stays */
  }

  .index__item:hover .index__meta,
  .index__item:focus-visible .index__meta {
    opacity: 0.55;
  }


  .work__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .work__head--split {
    grid-template-columns: 1fr;
    row-gap: 2.25rem;
  }
  .work__head--split .work__desc {
    margin-bottom: 0;
  }
  .cv__item {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    row-gap: 1rem;
    column-gap: 1.25rem;
    padding: 1.5rem 0 1.6rem;
  }
  .cv__note {
    grid-column: 2;
  }

  .work {
    --sec-pt: 4.5rem;
    --sec-pb: 4.5rem;
  }
  .index {
    padding-top: 4rem;
  }
  .now {
    padding: 4.5rem var(--pad-x);
  }
}

@media (max-width: 480px) {
  .index-counter {
    padding: 0.8rem var(--pad-x);
  }

  .hero__subtitle {
    bottom: auto;
    top: 5.5rem;
    left: var(--pad-x);
    right: var(--pad-x);
  }

  .cv__item {
    grid-template-columns: 1fr;
    row-gap: 0.6rem;
  }
  .cv__note {
    grid-column: 1;
    margin-top: 0.3rem;
  }
  .cv__download {
    grid-column: 1;
  }
  .paper__row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .nav__right {
    gap: 1rem;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .index-counter {
    padding: 0.6rem var(--pad-x);
  }
  .hero {
    padding-bottom: 2rem;
  }
  .hero__subtitle {
    bottom: 0.6rem;          /* the counter's padding here */
  }
}
