@font-face {
  font-family: 'Josefin Sans';
  src: url(../fonts/josefin-sans-latin.woff2) format('woff2');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
  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;
}

:root {
  --bar: 0px;
  --bg: #07080c;
  --ink: #ece3d0;
  --ink-2: #cfc5b2;
  --muted: #a89e8c;
  --line: #3a3631;
  --panel: rgba(22, 20, 18, .92);
  --tile: #24211d;
  --tile-hover: #2f2b26;
  /* Side accents. --teal is the primary accent (links, buttons, focus); --flare is glows and highlights.
     html[data-side] switches them: balance (default) = blue + red, light = all blue, dark = all red. */
  --blue: #5ea8e0;
  --blue-ink: #08131f;
  --red: #e05a50;
  --red-ink: #1f0907;
  --teal: var(--blue);
  --teal-ink: var(--blue-ink);
  --flare: var(--red);
  --glow: rgba(224, 90, 80, .45);
  --torch-tint: rgba(224, 90, 80, .05);
  --streak: rgba(200, 218, 255, .5);
  --terra: #d0704c;
  --sand: #d2bf9a;
  --sand-ink: #1d1915;
  --sand-muted: #4a4034;
  --sand-label: #6b5a48;
  --rust: #7a3a22;
  --font: 'Josefin Sans', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --corners: polygon(0 5px, 5px 5px, 5px 0, calc(100% - 5px) 0, calc(100% - 5px) 5px, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 5px calc(100% - 5px), 0 calc(100% - 5px));
  color-scheme: dark;
  scrollbar-gutter: stable;
}

html[data-side="light"] { --flare: #8fc6f2; --glow: rgba(120, 185, 240, .45); --torch-tint: rgba(110, 175, 235, .06); }
html[data-side="dark"] { --streak: rgba(255, 200, 190, .5); --teal: var(--red); --teal-ink: var(--red-ink); --flare: #ff7a5c; --glow: rgba(240, 96, 72, .5); --torch-tint: rgba(230, 80, 60, .07); }

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg) url(../img/wall.png) 0 0 / 320px 320px repeat;   /* night-sky stone */
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--ink); }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--teal); color: var(--teal-ink); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--teal); color: var(--teal-ink); font-weight: 700; }
.skip-link:focus { top: 12px; }

/* ---------- type ---------- */
.display {
  font-family: var(--font);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  line-height: 1.04;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent, var(--teal));
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.lede { font-size: 19px; color: var(--ink-2); max-width: 56ch; text-wrap: pretty; }
.arrow { font-family: system-ui, sans-serif; font-weight: 400; }

/* ---------- light & atmosphere ---------- */
.torch, .dark { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.stars { position: fixed; left: 0; top: 0; z-index: 0; pointer-events: none; }   /* twinkling wall tiles, under the hero art */
.torch {
  background: radial-gradient(circle at var(--x, 50%) var(--y, 45%), var(--torch-tint) 0, transparent 32vmax), radial-gradient(circle at var(--x, 50%) var(--y, 45%), rgba(255, 184, 110, .13) 0, rgba(12, 10, 9, .1) 15vmax, rgba(12, 10, 9, .5) 39vmax, rgba(10, 9, 8, .78) 70vmax);
}
.dark {
  background: radial-gradient(circle at var(--x, 50%) var(--y, 45%), rgba(0, 0, 0, .3) 0, rgba(0, 0, 0, .62) max(130px, 9vmax), rgba(0, 0, 0, .9) max(220px, 15vmax), #000 max(290px, 20vmax));
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.4s ease .6s, visibility 0s linear 2s;
}
.gated .dark { opacity: 1; visibility: visible; transition: none; }
.instant .dark { transition: opacity .3s ease, visibility 0s linear .3s; }

/* ---------- layout ---------- */
.wrap { position: relative; z-index: 3; max-width: 1180px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }
.page { padding-top: clamp(56px, 8vw, 104px); padding-bottom: 96px; display: flex; flex-direction: column; gap: 40px; }
.page-head { display: flex; flex-direction: column; gap: 14px; max-width: 700px; }
.page-head h1 { font-size: clamp(38px, 5.6vw, 64px); }
.section { padding-block: 44px; display: flex; flex-direction: column; gap: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.section-head > div { display: flex; flex-direction: column; gap: 10px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 36px); }
.more { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }

/* ---------- menu: the 3×3 icon blooms into a 3×3 grid of tiles ---------- */
.menu-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 61;
  display: grid;
  grid-template-columns: repeat(3, 14px);
  grid-auto-rows: 14px;
  gap: 2px;
  width: 56px;
  height: 56px;
  padding: 5px;
  border: 0;
  cursor: pointer;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 10px 24px rgba(0, 0, 0, .5);
  transition: opacity .15s ease .5s, box-shadow .25s;
}
.menu-btn i { transition: transform .3s var(--ease), background .3s; }
.menu-btn:hover { box-shadow: 0 0 0 1px var(--teal), 0 10px 24px rgba(0, 0, 0, .5); }
.menu-btn:hover i { transform: scale(.78); }
.menu-btn:hover i:nth-child(5) { background: var(--teal) !important; transform: none; }
.gated .menu-btn { opacity: .7; }

.scrim { position: fixed; inset: 0; z-index: 59; background: rgba(5, 4, 3, .5); opacity: 0; pointer-events: none; transition: opacity .3s ease; }

.bloom {
  --tw: 128;            /* tile size, unitless so it can divide in calc() */
  --th: 80;
  --gap: 4px;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(3, calc(var(--tw) * 1px));
  grid-auto-rows: calc(var(--th) * 1px);
  gap: var(--gap);
  visibility: hidden;
  transition: visibility 0s linear .65s;
}
.tile {
  /* Closed, each tile sits exactly on its 14px square in the icon (whose squares are 16px apart, 12px from the corner). */
  --rc: calc(2 - var(--c));
  --rr: calc(2 - var(--r));
  --tx: calc(var(--rc) * (var(--tw) * 1px + var(--gap)) + var(--tw) * .5px - 12px - var(--rc) * 16px);
  --ty: calc(var(--rr) * (var(--th) * 1px + var(--gap)) + var(--th) * .5px - 12px - var(--rr) * 16px);
  --open: #33302b;
  --ink-open: var(--ink);
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border: 0;
  cursor: pointer;
  color: var(--ink-open);
  background: var(--from);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-align: left;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .12), inset -2px -2px 0 rgba(0, 0, 0, .35);
  transform: translate(var(--tx), var(--ty)) scale(calc(14 / var(--tw)), calc(14 / var(--th)));
  transition: transform .45s cubic-bezier(.5, 0, .75, 0) calc((var(--c) + var(--r)) * 30ms), background .3s ease calc((var(--c) + var(--r)) * 30ms), filter .2s;
}
.tile:nth-child(even) { --open: #2a2723; }
.tile[aria-current] { --open: var(--teal); --ink-open: var(--teal-ink); }
.tile-cv { --open: var(--sand); --ink-open: var(--sand-ink); }
.tile-ext { --open: #1f1c19; --ink-open: var(--ink-2); }
.tile-close { --open: #0b0a09; justify-content: center; align-items: center; color: var(--teal); font-size: 18px; }
.tile:hover { filter: brightness(1.18); color: var(--ink-open); }
.tile > * { opacity: 0; transition: opacity .1s ease; }
.tile i { position: absolute; top: 12px; right: 14px; width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); opacity: 0; }
.tile-ext i, .tile-cv i { width: auto; height: auto; background: none; transform: none; font-style: normal; }
.tile-ext i::before { content: '↗'; font-family: system-ui, sans-serif; }
.tile-cv i::before { content: '↓'; font-family: system-ui, sans-serif; }
.tile-close span { transition: opacity .1s ease, transform .3s var(--ease); }
.tile-close:hover span { transform: rotate(90deg); }

.menu-open .scrim { opacity: 1; pointer-events: auto; }
.menu-open .bloom { visibility: visible; transition-delay: 0s; }
.menu-open .menu-btn { opacity: 0; pointer-events: none; transition: opacity 0s; }
.menu-open .tile {
  transform: none;
  background: var(--open);
  transition: transform .55s cubic-bezier(.2, .9, .25, 1) calc((var(--rc) + var(--rr)) * 45ms), background .35s ease calc((var(--rc) + var(--rr)) * 45ms + 80ms), filter .2s;
}
.menu-open .tile > * { opacity: 1; transition: opacity .25s ease calc((var(--rc) + var(--rr)) * 45ms + 260ms), transform .3s var(--ease); }
.menu-open .tile i { opacity: .8; }
@media (max-width: 440px) { .bloom { --tw: 100; --th: 68; } .tile { padding-inline: 10px; letter-spacing: .1em; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 12px;
  border: 0;
  cursor: pointer;
  background: var(--teal);
  color: var(--teal-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  clip-path: var(--corners);
  transition: background .2s, color .2s, transform .2s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--teal-ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), inset 0 0 16px var(--glow); text-shadow: 0 0 10px var(--glow); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: rgba(236, 227, 208, .08); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: rgba(236, 227, 208, .16); color: var(--ink); }
.btn-dark { background: var(--sand-ink); color: var(--sand); }
.btn-dark:hover { background: var(--rust); color: var(--ink); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; }
.hero-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.mask-hit { position: absolute; z-index: 4; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.mask-hit:focus-visible { outline-offset: -12px; }
.hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-inline: 16px;
  text-align: center;
}
.hero-name { font-size: clamp(30px, 3.4vw + 8px, 96px); letter-spacing: .1em; }
.hero.side .hero-copy { left: 50%; padding-inline: 12px 24px; }
.hero.side .hero-name { font-size: clamp(24px, 4.2vw, 40px); }
.hero-name:focus { outline: none; }
.hero-name .w { display: inline-block; white-space: nowrap; margin: 0 .12em; }
.hero-name .w + .w { color: var(--sand); }
.hero-name .ch { display: inline-block; }
.hero-tag { font-size: clamp(12px, .55vw + 6px, 22px); font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-2); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.hero-cta .btn { font-size: clamp(13px, .45vw + 6.5px, 18px); padding: 1.1em 1.7em .95em; }
.hero-hint {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--sand);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility 0s linear .4s;
}
.hero-hint > span { animation: hintPulse 2.4s ease-in-out infinite; }
.hero-hint.nudge > span { animation: nudge .9s ease-out, hintPulse 2.4s ease-in-out .9s infinite; }
.skip-intro { padding: 0; border: 0; background: none; cursor: pointer; color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.skip-intro:hover { color: var(--ink); }

.js .hero:not(.ready) .hero-copy { visibility: hidden; }
/* Wide screens: name and buttons overlay the mural's lower edge on a soft fade. */
.hero.overlay .hero-copy {
  gap: 12px;
  padding: clamp(36px, 7vh, 90px) 16px clamp(18px, 4vh, 44px);
  background: linear-gradient(to bottom, rgba(5, 6, 9, 0), rgba(5, 6, 9, .42) 45%, rgba(5, 6, 9, .78));
}
.hero.overlay .hero-name, .hero.overlay .hero-tag { text-shadow: 0 2px 18px rgba(0, 0, 0, .85), 0 0 3px rgba(0, 0, 0, .9); }
.hero.overlay .hero-hint { top: auto; bottom: clamp(34px, 8vh, 80px); }
/* No JS: the hero is just the name, centred. */
html:not(.js) .hero { display: grid; place-items: center; }
html:not(.js) .hero-copy { position: static; }

.gated .hero-hint { opacity: 1; visibility: visible; transition: none; }
.gated .hero-name, .gated .hero-tag, .gated .hero-cta { opacity: 0; pointer-events: none; }
.gated { overflow: hidden; }
.gated .home-content, .gated .site-footer { visibility: hidden; }
.entered .hero-name .ch { animation: charDrop .9s cubic-bezier(.3, .7, .3, 1) calc(1s + var(--n) * 50ms) backwards; }
.entered .hero-tag { animation: rise .7s var(--ease) 1.6s backwards; }
.entered .hero-cta { animation: rise .7s var(--ease) 1.75s backwards; }
.entered .home-content, .entered .site-footer { animation: rise .8s var(--ease) 1.3s backwards; }
.entered.instant .hero-name .ch { animation-delay: calc(var(--n) * 25ms); animation-duration: .6s; }
.entered.instant .hero-tag, .entered.instant .hero-cta, .entered.instant .home-content, .entered.instant .site-footer { animation-delay: .25s; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 290px)), 1fr)); }
.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform .35s var(--ease), border-color .3s;
}
.card:hover, .card:focus-within { color: var(--ink); transform: translateY(-5px); border-color: var(--accent, var(--teal)); box-shadow: 0 14px 34px -14px var(--glow); }
.cover { width: 100%; height: auto; background: #0e0d0c; }
.card > .cover { padding: 8px 8px 0; }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 22px; }
.card-title { font-size: 20px; letter-spacing: .06em; }
.card p { color: var(--muted); font-size: 16px; text-wrap: pretty; }
.card-links { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { list-style: none; padding: 4px 8px 2px; background: var(--tile); font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--ink-2); }
.tags { margin: 0; padding: 0; }

.card-wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.card-wide > .cover { padding: 8px; align-self: center; }
/* Project screenshots: cropped to the same 16:9 frame as the mosaic covers */
.cover.shot { aspect-ratio: 16 / 9; object-fit: cover; object-position: left top; }
.cover-link { display: block; }
.cover-link > .cover { padding: 8px 8px 0; }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--accent, var(--teal)); }
.card-wide .card-body { justify-content: center; }

/* ---------- sand panels ---------- */
.sand {
  position: relative;
  z-index: 3;
  padding: 16px;
  border-radius: 4px;
  background: #3a3128 url(../img/sand.png) 0 0 / 400px 400px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
}
.sand-inner {
  position: relative;
  padding: clamp(24px, 4.5vw, 52px);
  background: var(--sand);
  color: var(--sand-ink);
  box-shadow: inset 0 0 0 1px rgba(40, 30, 20, .35), inset 0 3px 14px rgba(40, 30, 20, .25);
}
.sand .eyebrow { --accent: var(--rust); }
.sand a:not(.btn) { color: var(--rust); }
.sand a:not(.btn):hover { color: var(--sand-ink); }
.sand :focus-visible { outline-color: var(--rust); }
.cta-panel { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-panel > div { display: flex; flex-direction: column; gap: 12px; max-width: 540px; }
.cta-panel h2 { font-size: clamp(26px, 3.6vw, 38px); }
.cta-panel p { color: var(--sand-muted); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(24px, 4vw, 52px); }
.portrait { align-self: start; max-width: 360px; width: 100%; padding: 8px; background: var(--sand-ink); box-shadow: 0 0 0 3px #8a857b, 0 0 0 6px var(--sand-ink); }
.portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 22%; }
.about-text { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.about-text h1 { font-size: clamp(34px, 4.6vw, 54px); }
.about-text .lede { color: var(--sand-ink); font-size: 21px; line-height: 1.45; }
.about-text p { color: #3d342a; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin-top: 6px; font-size: 16px; }
.facts dt { padding-top: 3px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sand-label); }
.panel { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 18px; padding: 26px; background: var(--panel); border: 1px solid var(--line); }
.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px; align-items: start; }
.toolkit { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 3px; padding: 3px; margin: 0; background: #0e0d0c; }
.toolkit li { list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--tile); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .05), inset -1px -1px 0 rgba(0, 0, 0, .4); transition: background .25s; }
.toolkit li:hover { background: var(--tile-hover); }
.toolkit i { width: 10px; height: 10px; background: var(--c); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .25); }
.toolkit b { font-size: 15px; letter-spacing: .07em; text-transform: uppercase; line-height: 1.15; }
.toolkit span { font-size: 14px; color: var(--muted); }
.climb { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; }
.climb li {
  list-style: none;
  margin-left: calc(var(--i) * clamp(0px, 2.5vw, 24px));
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  background: var(--tile);
  border-left: 5px solid var(--c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.climb .yr { font-size: 14px; font-weight: 700; color: var(--sand); }
.climb b { display: block; font-size: 15px; letter-spacing: .07em; text-transform: uppercase; line-height: 1.2; }
.climb span:not(.yr) { font-size: 14px; color: var(--muted); }

/* ---------- papers ---------- */
.papers { margin: 0; padding: 0; display: flex; flex-direction: column; }
.papers li { list-style: none; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 18px 0; border-bottom: 1px solid #2c2925; }
.papers li:first-child { padding-top: 0; }
.papers li:last-child { padding-bottom: 0; border-bottom: 0; }
.papers b { display: block; font-size: 18px; letter-spacing: .04em; }
.papers span { font-size: 15px; color: var(--muted); }

/* ---------- blog ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.filters button {
  padding: 9px 14px 7px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: rgba(22, 20, 18, .9);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: background .2s, color .2s;
}
.filters button:hover { color: var(--ink); background: var(--tile); }
.filters button[aria-pressed="true"] { background: var(--teal); color: var(--teal-ink); border-color: var(--teal); }
.post-list { position: relative; z-index: 3; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); }
.post-row {
  display: grid;
  grid-template-columns: clamp(90px, 15vw, 160px) minmax(0, 1fr);
  gap: clamp(14px, 2.4vw, 26px);
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid #2c2925;
  color: var(--ink);
  transition: background .25s;
}
.post-row:last-child { border-bottom: 0; }
.post-row:hover { background: var(--tile); color: var(--ink); }
.post-row .cover { transition: transform .35s var(--ease); }
.post-row:hover .cover { transform: scale(1.04); }
.post-row > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.post-row h2 { font-size: clamp(17px, 2vw, 22px); letter-spacing: .06em; }
.post-row p { color: var(--muted); font-size: 16px; max-width: 72ch; text-wrap: pretty; }

.post-wrap { max-width: 800px; }
.post-inner { display: flex; flex-direction: column; gap: 22px; }
.back { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.post .meta { color: var(--sand-label); }
.post .meta span:first-child { color: var(--rust); }
.post h1 { font-size: clamp(30px, 4.4vw, 46px); }
.post figure { padding: 6px; background: var(--sand-ink); }
.prose { display: flex; flex-direction: column; gap: 18px; font-size: 18px; line-height: 1.7; color: #2a231c; text-wrap: pretty; }
.prose h2 { margin-top: 14px; color: var(--sand-ink); font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase; }
.prose a { color: var(--rust); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { color: var(--sand-ink); }
.prose h2 + ul { margin-top: -4px; }
.prose ul { display: flex; flex-direction: column; gap: 10px; margin: 0; padding-left: 1.3em; list-style: square; }
.prose li::marker { color: var(--rust); }
.prose figure, .project-hero { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.prose figure img, .project-hero img { display: block; width: 100%; height: auto; padding: 6px; background: var(--sand-ink); }
.prose figure.pair { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 8px; }
.prose figure.pair figcaption { grid-column: 1 / -1; }
figcaption { font-size: 14px; line-height: 1.5; letter-spacing: .02em; color: var(--sand-label); }
.project-hero { margin: 0; }
.post .prose figure, .post .project-hero { padding: 0; background: none; }
.prose figure img.tall { width: auto; max-width: min(100%, 520px); align-self: center; }
.prose figure.pair img.tall { width: 100%; max-width: none; }
.project-line { font-size: clamp(17px, 1.9vw, 20px); line-height: 1.55; color: #2a231c; text-wrap: pretty; }
.project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.project-links .btn { padding: 13px 18px 11px; font-size: 13px; }
.project-note { font-size: 14px; color: var(--sand-label); }
.project .tags li { background: #c9b48f; color: var(--sand-ink); }
/* Demo video: a still with a play tile until clicked, then the Drive player */
.video { position: relative; display: block; }
.video .play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  display: flex; align-items: center; gap: 12px; padding: 16px 24px 14px;
  background: rgba(14, 13, 12, .88); color: var(--sand); box-shadow: inset 0 0 0 1px rgba(236, 227, 208, .25);
  font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap;
  transition: background .2s, box-shadow .2s;
}
.video .play i { width: 0; height: 0; margin-top: -2px; border-block: 8px solid transparent; border-left: 13px solid currentColor; }
.video:hover .play, .video:focus-visible .play { background: var(--teal); color: var(--teal-ink); box-shadow: 0 0 22px var(--glow); }
.video-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 6px solid var(--sand-ink); background: var(--sand-ink); }
.pager { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 3px; padding: 3px; margin-top: 12px; background: var(--sand-ink); }
.pager a { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: #c9b48f; color: var(--sand-ink); transition: background .2s; }
.pager a:hover { background: #e0cfac; color: var(--sand-ink); }
.pager a:last-child { text-align: right; align-items: flex-end; }
.pager small { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sand-label); }
.pager b { font-size: 15px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.25; }
.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 55;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--teal) 0 10px, transparent 10px 12px);
  filter: drop-shadow(0 0 4px var(--glow));
  clip-path: inset(-12px calc((1 - var(--p, 0)) * 100%) -12px 0);
}

/* ---------- contact & guestbook ---------- */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 32px; align-items: start; }
.contact-intro { display: flex; flex-direction: column; gap: 22px; }
.contact-intro h1 { font-size: clamp(34px, 5vw, 58px); }
.reach { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.email { font-size: clamp(20px, 2.4vw, 24px); font-weight: 700; letter-spacing: .04em; }
.socials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; max-width: 440px; padding: 3px; background: #0e0d0c; }
.socials-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.socials a { padding: 16px; background: var(--tile); color: var(--ink); font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; transition: background .2s, color .2s; }
.socials a:hover { background: var(--teal); color: var(--teal-ink); }
.gb { display: flex; flex-direction: column; gap: 14px; padding: clamp(20px, 3vw, 32px); }
.gb h2 { font-size: 26px; }
.gb form { display: flex; flex-direction: column; gap: 12px; }
.gb label { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sand-label); }
.field { display: flex; flex-direction: column; gap: 6px; }
.gb input[type=text], .gb textarea {
  padding: 12px 14px 10px;
  border: 0;
  background: #efe3c8;
  color: var(--sand-ink);
  font-size: 16px;
  box-shadow: inset 0 2px 4px rgba(40, 30, 20, .25);
  resize: none;
}
.gb input[type=text]:focus-visible, .gb textarea:focus-visible { outline: 2px solid var(--rust); outline-offset: 0; }
.gb ::placeholder { color: #8b7c66; }
.gb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.swatches { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; }
.swatches legend { float: left; margin-right: 4px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sand-label); }
.swatches label { position: relative; display: block; width: 26px; height: 26px; cursor: pointer; }
.swatches input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatches .sw { position: absolute; inset: 0; background: var(--c); clip-path: polygon(8% 0, 92% 6%, 100% 88%, 10% 100%, 0 40%); }
.swatches input:checked + .sw { box-shadow: inset 0 0 0 3px var(--sand-ink); }
.swatches input:focus-visible + .sw { outline: 2px solid var(--rust); }
.gb-count { font-size: 13px; color: var(--sand-label); }
.stones { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; min-height: 120px; padding: 6px; margin-top: 6px; background: #3a3128; }
.stone { flex: 1 1 160px; display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .22), inset -3px -3px 0 rgba(0, 0, 0, .22); }
.stone.fresh { animation: stoneDrop .7s cubic-bezier(.3, .7, .3, 1) both; }
.stone-msg { font-size: 15px; line-height: 1.35; color: var(--sand-ink); overflow-wrap: anywhere; }
.stone-name { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #2e261e; }
.gb-note { font-size: 14px; color: var(--sand-muted); }

/* ---------- footer ---------- */
.site-footer { position: relative; z-index: 3; border-top: 1px solid var(--line); background: rgba(14, 13, 12, .94); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding-block: 24px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.site-footer nav { display: flex; gap: 18px; }

/* ---------- motion ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .card.reveal.in:hover, .js .card.reveal.in:focus-within { transition: transform .35s var(--ease), border-color .3s; transform: translateY(-5px); }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes charDrop { 0% { opacity: 0; transform: translateY(-140%) rotate(var(--cr)); } 60% { opacity: 1; transform: translateY(7%) rotate(0); } 80% { transform: translateY(-3%); } 100% { opacity: 1; transform: none; } }
@keyframes hintPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes nudge { 0%, 100% { transform: none; opacity: 1; } 25% { transform: translateY(-5px); } 55% { transform: translateY(2px); } }
@keyframes stoneDrop { 0% { opacity: 0; transform: translateY(-60px) rotate(-8deg); } 70% { opacity: 1; transform: translateY(4px) rotate(1deg); } 100% { transform: none; } }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

/* Page-to-page: the wall and top bar stay put, only the content swaps. */
@view-transition { navigation: auto; }
/* main is a stacking context (view-transition-name), so the torch layers live inside it to keep canvas < torch < content. */
main { view-transition-name: main; }
::view-transition-group(main) { animation: none; }
::view-transition-old(main) { animation: vt-out .16s ease both; }
::view-transition-new(main) { animation: vt-in .34s var(--ease) .06s both; }
.vt-filter main { view-transition-name: none; }

/* Subtle hyperspace: light streaks radiate from the centre while the content swaps. */
.hyper { position: fixed; inset: 0; z-index: 70; pointer-events: none; view-transition-name: hyper; }
.vt-filter .hyper { view-transition-name: none; }
::view-transition-group(hyper) {
  background: repeating-conic-gradient(from 0deg at 50% 50%, transparent 0deg 2.6deg, var(--streak) 2.6deg 2.85deg, transparent 2.85deg 5.3deg, var(--streak) 5.3deg 5.45deg);
  -webkit-mask: radial-gradient(closest-side at 50% 50%, transparent 55%, #000 85%, #000 100%);   /* edges only; content stays clean */
  mask: radial-gradient(closest-side at 50% 50%, transparent 55%, #000 85%, #000 100%);
  animation: hyper .38s cubic-bezier(.3, .6, .4, 1) both;
}
::view-transition-old(hyper), ::view-transition-new(hyper) { animation: none; opacity: 0; }
@keyframes hyper { 0% { opacity: 0; transform: scale(.7); } 30% { opacity: .5; } 100% { opacity: 0; transform: scale(1.6); } }
::view-transition-group(.row) { animation-duration: .4s; animation-timing-function: var(--ease); }
::view-transition-old(.row):only-child { animation: vt-out .16s ease both; }
::view-transition-new(.row):only-child { animation: vt-in .3s var(--ease) .1s both; }

@media (max-width: 759px) {
  body { font-size: 16px; }
  .card-wide { grid-template-columns: 1fr; }
  .card-wide > .cover { padding: 8px 8px 0; }
  .post-row { grid-template-columns: 1fr; }
  .site-footer .wrap { padding-bottom: 84px; }
}

@media (max-width: 480px) {
  .email { font-size: clamp(14px, 4.4vw, 20px); letter-spacing: .02em; }
  .socials-3 a { padding-inline: 12px; letter-spacing: .12em; }
  .display { letter-spacing: .045em; }
  .page-head h1, .contact-intro h1 { font-size: clamp(28px, 9.5vw, 40px); }
  .about-text h1 { font-size: clamp(26px, 8.6vw, 36px); }
  .post h1 { font-size: clamp(24px, 7.6vw, 32px); }
  .section-head h2, .cta-panel h2 { font-size: clamp(24px, 7.5vw, 30px); }
  .sand { padding: 10px; }
  .sand-inner { padding: 22px 18px; }
  .lede { font-size: 17px; }
  .about-text .lede { font-size: 18px; }
  .prose { font-size: 17px; }
  .prose figure.pair { grid-template-columns: 1fr; }
  .video .play { gap: 9px; padding: 11px 14px 9px; font-size: 11px; letter-spacing: .14em; }
  .video .play i { border-block-width: 6px; border-left-width: 10px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
  .pager { grid-template-columns: 1fr; }
  .card-body { padding: 16px 16px 20px; }
  .hero-cta .btn { padding-inline: 1.15em; letter-spacing: .14em; }
}

@media (min-width: 1920px) {
  body { font-size: 18px; }
  .wrap { max-width: 1360px; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js .reveal { transform: none; }
}
@media (min-width: 760px) and (max-width: 1260px) { .site-footer .wrap { padding-right: 88px; } }

@media (max-width: 360px) { .hero-cta .btn { font-size: 12px; padding-inline: .95em; letter-spacing: .12em; } .hero-cta { gap: 8px; } }

/* ---------- side switch (bottom-left, mirrors the menu icon) ---------- */
.side-switch {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 61;
  display: flex;
  gap: 3px;
  padding: 5px;
  margin: 0;
  border: 0;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 10px 24px rgba(0, 0, 0, .5);
  transition: opacity .3s ease;
}
.side-switch legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.side-switch button {
  position: relative;
  width: 22px;
  height: 46px;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: var(--c);
  opacity: .3;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .15), inset -1px -1px 0 rgba(0, 0, 0, .35);
  transition: opacity .2s, box-shadow .2s;
}
.side-switch button:hover { opacity: .8; }
.side-switch button[aria-pressed="true"] { opacity: 1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), 0 0 14px var(--c-glow); }
.side-switch .s-light { --c: var(--blue); --c-glow: rgba(94, 168, 224, .7); }
.side-switch .s-dark { --c: var(--red); --c-glow: rgba(224, 90, 80, .7); }
.side-switch .s-balance { --c: linear-gradient(90deg, var(--blue) 50%, var(--red) 50%); --c-glow: rgba(200, 140, 170, .6); }
.side-switch span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  padding: 5px 8px 3px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.side-switch button:hover span, .side-switch button:focus-visible span { opacity: 1; }
.gated .side-switch { opacity: .7; }
.menu-open .side-switch { opacity: 0; pointer-events: none; }

/* ---------- saber line divider ---------- */
.saber {
  position: relative;
  z-index: 3;
  height: 3px;
  margin: 0 auto;
  border: 0;
  max-width: 1180px;
  filter: drop-shadow(0 0 6px var(--glow));
  opacity: .8;
}
.saber::before {   /* the striped line lives here so the mask doesn't clip the parent's glow */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--teal) 18%, var(--teal) 50%, var(--flare) 50%, var(--flare) 82%, transparent);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px);
  mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px);
}
