/*
  VOICE   Personal and calm, a little playful: a builder's corner of the forest.
  IDEA    A cross-section of a forest floor. You meet Ivan above ground; his work grows below,
          along one root line you follow by scrolling. Each mushroom jumps to its section.
  PICTURE The forest scene on the first screen; the root line with a mushroom drawing at each section.
  COLOUR and TYPE  Time-of-day palette above ground; dark soil below, with each section's accent
          taken from its mushroom. Young Serif for names and titles, Atkinson Hyperlegible Next for reading.
  LAYOUT  Contact card top left, the forest along the bottom of the first screen, then one column of
          sections down the page. A bar with an Email button follows you after the first screen.
*/

/* ---------- fonts (self-hosted: no third-party requests) ---------- */
@font-face { font-family: "Young Serif"; src: url("../assets/fonts/young-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("../assets/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("../assets/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --serif: "Young Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Atkinson Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --pad: clamp(20px, 5vw, 72px);
  --gut: 64px;
  /* below ground: always dark soil, whatever the time of day */
  --ink: #efe8dc; --ink-2: #b9ad9b; --hair: rgba(239, 232, 220, .13); --lift: rgba(255, 244, 228, .05);
  --btn-bd: rgba(239, 232, 220, .3); --solid-bg: #efe8dc; --solid-ink: #1a130e;
  --focus: #9ff0d0;
  --a-projects: #ff957d; --a-growing: #8ff0db; --a-experience: #b6bfff; --a-resume: #f0d3a0; --a-photos: #f2c57c; --a-elsewhere: #cfe6ff;
  /* above ground (scene.js keeps these in step with the time of day) */
  --c-skyTop: #08161f; --c-skyMid: #0e2a32; --c-skyBot: #1f4547; --c-soilBot: #0b0806;
  --n-glow: 1; --n-fogA: .26; --n-shaftA: 0;
}
:root[data-light="dark"] { --l-ink: #edf3eb; --l-ink-2: #b2c5ba; --l-hair: rgba(237, 243, 235, .2); --l-btn-bd: rgba(237, 243, 235, .34); --l-btn-bg: rgba(237, 243, 235, .06); --l-solid-bg: #edf3eb; --l-solid-ink: #0f1f19; --haze: rgba(6, 18, 24, .42); }
:root[data-light="light"] { --l-ink: #12221a; --l-ink-2: #3c5045; --l-hair: rgba(18, 34, 26, .2); --l-btn-bd: rgba(18, 34, 26, .3); --l-btn-bg: rgba(255, 255, 255, .5); --l-solid-bg: #12221a; --l-solid-ink: #f6f8f3; --haze: rgba(240, 240, 226, .78); }
.sec[data-section="projects"], .drawer { --accent: var(--a-projects); }
.sec[data-section="growing"] { --accent: var(--a-growing); }
.sec[data-section="experience"] { --accent: var(--a-experience); }
.sec[data-section="resume"] { --accent: var(--a-resume); }
.sec[data-section="photos"] { --accent: var(--a-photos); }
.sec[data-section="elsewhere"] { --accent: var(--a-elsewhere); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--c-soilBot); scroll-behavior: smooth; }
body { margin: 0; font: 17px/1.55 var(--sans); color: var(--ink); background: var(--c-soilBot); overflow-x: clip; -webkit-font-smoothing: antialiased; }
.drawer-open body, .lb-open body { overflow: hidden; }
img { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid currentColor; border-radius: 6px; font: 600 13px/1 var(--sans); opacity: .75; vertical-align: 1px; }
svg { flex: none; }
.btn svg, .hud-btn svg, .hud-more svg, .icon-btn svg, .drawer-close svg, .lb-btn svg, .pager svg, .else-list svg, .drawer-back svg, .to-top svg, .bar-email svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.skip { position: fixed; z-index: 50; left: 12px; top: -60px; padding: 10px 16px; background: var(--solid-bg); color: var(--solid-ink); border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--btn-bd); background: transparent; color: inherit; text-decoration: none; font-size: 15px; font-weight: 600; white-space: nowrap; transition: border-color .2s, filter .2s; }
.btn:hover { border-color: currentColor; }
.btn-solid { background: var(--solid-bg); color: var(--solid-ink); border-color: var(--solid-bg); }
.btn-solid:hover { border-color: var(--solid-bg); filter: brightness(1.07); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--hair); background: transparent; }
.contact-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.addr { font-size: 15px; color: var(--ink-2); user-select: all; -webkit-user-select: all; padding: 0 4px; }

/* ---------- the bar that follows you ---------- */
.bar { position: fixed; z-index: 10; top: 0; left: 0; right: 0; height: 64px; padding: 0 var(--pad); display: flex; align-items: center; gap: 18px; color: var(--l-ink); transition: background .35s, border-color .35s, color .35s; border-bottom: 1px solid transparent; }
.bar-name { font: 400 21px/1 var(--serif); text-decoration: none; white-space: nowrap; }
.bar-where { font-size: 15px; color: var(--ink-2); display: none; }
.bar-nav { display: flex; gap: 4px 22px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.bar-nav a { text-decoration: none; font-size: 15px; padding: 10px 0; text-underline-offset: 6px; }
.bar-nav a:hover, .bar-nav a[aria-current="true"] { text-decoration: underline; text-decoration-thickness: 1.5px; }
.bar-email { min-height: 40px; padding: 0 16px; }
.bar-name, .bar-email { opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.scrolled .bar { background: rgba(14, 10, 8, .84); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom-color: var(--hair); color: var(--ink); }
.scrolled .bar-name, .scrolled .bar-email { opacity: 1; visibility: visible; }
.bar-nav a[aria-current="true"] { text-decoration-color: currentColor; }
.menu-btn { display: none; margin-left: auto; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--l-btn-bd); background: var(--l-btn-bg); color: inherit; }
.scrolled .menu-btn { border-color: var(--btn-bd); background: transparent; }
.menu { display: none; position: absolute; top: 60px; right: 12px; flex-direction: column; padding: 8px; min-width: 220px; border-radius: 14px; background: #1c1511; color: var(--ink); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); border: 1px solid var(--hair); }
.menu a { padding: 12px 14px; font-size: 17px; border-radius: 8px; text-decoration: none; }
.menu a:hover, .menu a[aria-current="true"] { background: var(--lift); }
.menu-open .menu { display: flex; }

/* ---------- first screen: the forest and the contact card ---------- */
.landing { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; background: var(--c-skyTop); }
.forest { position: absolute; inset: 0; overflow: hidden; }
.sky { position: absolute; inset: 0; background: linear-gradient(180deg, var(--c-skyTop) 0%, var(--c-skyMid) 52%, var(--c-skyBot) 88%); }
#sky-canvas, #fx-canvas, .scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#sky-canvas, #fx-canvas { pointer-events: none; }
.scene { touch-action: pan-y pinch-zoom; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.can-pan .scene { cursor: grab; }
.can-pan .scene:active { cursor: grabbing; }

.hero { position: absolute; z-index: 3; top: 0; left: 0; padding: clamp(84px, 13vh, 136px) var(--pad) 0; pointer-events: none; color: var(--l-ink); }
.hero-in { position: relative; max-width: 620px; }
.hero-in::before { content: ""; position: absolute; z-index: -1; inset: -80px -160px -110px -120px; background: radial-gradient(closest-side, var(--haze), transparent); pointer-events: none; }
.hero a, .hero button, .hero .addr { pointer-events: auto; }
.is-loading .hero { opacity: 0; }
.hero-name { font: 400 clamp(48px, min(8.2vw, 12.4vh), 124px)/.95 var(--serif); letter-spacing: -.012em; margin: 0 0 .2em; text-wrap: balance; }
[data-light="dark"] .hero-name { text-shadow: 0 2px 40px rgba(0, 0, 0, .35); }
.hero-intro { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; margin: 0; max-width: 31em; text-wrap: pretty; }
.hero-open { margin: 12px 0 0; font-size: 15px; color: var(--l-ink-2); display: flex; align-items: flex-start; gap: 9px; }
.dot { width: 8px; height: 8px; margin-top: .5em; border-radius: 50%; background: #5fd3a2; box-shadow: 0 0 0 4px rgba(95, 211, 162, .18); flex: none; }
.hero-contact { margin-top: 24px; }
.hero .btn { border-color: var(--l-btn-bd); background: var(--l-btn-bg); }
.hero .btn-solid { background: var(--l-solid-bg); color: var(--l-solid-ink); border-color: var(--l-solid-bg); }
.hero .addr { color: var(--l-ink-2); }
.hero-reply { margin: 8px 0 0; font-size: 15px; color: var(--l-ink-2); }
.hero-links { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.hero-links a { font-size: 15px; text-underline-offset: 4px; text-decoration-color: var(--l-hair); display: inline-block; padding: 8px 0; }
.hero-links a:hover { text-decoration-color: currentColor; }
.hero-hint { margin: 10px 0 0; font-size: 15px; color: var(--l-ink-2); }

.hud { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; padding: 0 clamp(10px, 2.4vw, 32px) max(12px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; pointer-events: none; }
.hud > * { pointer-events: auto; }
#hud-time { justify-self: start; }
#hud-sound { justify-self: end; }
.hud-btn, .hud-more { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border-radius: 12px; border: 1px solid rgba(255, 246, 232, .14); background: rgba(16, 11, 8, .56); color: #f3ece0; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); text-align: left; text-decoration: none; }
.hud-btn:hover, .hud-more:hover { border-color: rgba(255, 246, 232, .4); }
.hud-btn span { display: flex; flex-direction: column; line-height: 1.2; }
.hud-btn b { font-size: 14px; font-weight: 600; }
.hud-btn small { font-size: 13px; color: #c9bfae; }
.hud-btn kbd { opacity: .55; }
.hud-more { border-radius: 999px; padding: 0 16px 0 20px; font-size: 15px; font-weight: 600; }

/* forest scene parts (colours come from scene.js) */
.far { fill: var(--c-far); }
.mid { fill: var(--c-mid); }
.fog { opacity: var(--n-fogA); pointer-events: none; }
.fog-1 { opacity: calc(var(--n-fogA) * .7); }
.shafts { opacity: var(--n-shaftA); pointer-events: none; }
.soil { fill: url(#g-soil); }
.strata { fill: none; stroke: var(--c-strata); stroke-width: 7; opacity: .5; }
.pebble { fill: var(--c-pebble); opacity: .85; }
.root { fill: none; stroke: var(--c-root); stroke-width: 2.4; stroke-linecap: round; }
.moss { fill: var(--c-moss); }
.moss-hi { fill: none; stroke: var(--c-mossHi); stroke-width: 2; }
.grass { fill: none; stroke: var(--c-grass); stroke-width: 1.3; stroke-linecap: round; }
.leaf { fill: var(--c-leaf); }
.fern path { fill: none; stroke: var(--c-grass); stroke-width: 1.5; stroke-linecap: round; }
.tiny-cap { fill: var(--m-tiny); }
.stem { fill: url(#g-stem); }
.shade { fill: url(#g-shade); pointer-events: none; }
.line { fill: none; stroke: var(--m-stemLo); stroke-width: 1.3; opacity: .6; }
.skirt { fill: var(--m-stemHi); stroke: var(--m-stemLo); stroke-width: .8; }
.undershadow { fill: #000; opacity: .3; }
.gill { fill: var(--m-gill); }
.rim { fill: none; stroke: var(--c-rim); stroke-width: 2.2; stroke-linecap: round; opacity: .55; }
.ag-cap { fill: url(#g-ag); }
.ag-edge { fill: none; stroke: var(--m-agEdge); stroke-width: 3; opacity: .55; }
.wart { fill: var(--m-wart); }
.wart-sh { fill: #000; opacity: .22; }
.pa-cap { fill: url(#g-pa); }
.pa-scale { fill: var(--m-paScale); opacity: .85; }
.pa-umbo { fill: var(--m-paUmbo); }
.skin { fill: none; stroke: var(--m-paScale); stroke-width: 1.1; opacity: .35; }
.pin-cap { fill: url(#g-pin); }
.mat { fill: var(--c-myc); opacity: .5; }
.fuzz { fill: none; stroke: var(--c-myc); stroke-width: .8; opacity: .6; }
.bark { fill: url(#g-bark); }
.bark-line { fill: none; stroke: var(--m-barkLo); stroke-width: 1.3; opacity: .65; }
.log-moss { fill: var(--m-logMoss); }
.wood { fill: var(--m-wood); }
.ring { fill: none; stroke: var(--m-woodRing); stroke-width: 1; }
.tt1 { fill: var(--m-tt1); } .tt2 { fill: var(--m-tt2); } .tt3 { fill: var(--m-tt3); } .tt4 { fill: var(--m-tt4); } .tt5 { fill: var(--m-tt5); }
.fan-sh { fill: #000; opacity: .28; }
.fan-top { fill: none; stroke: #000; stroke-width: 1.2; opacity: .35; }
.mo-cap { fill: url(#g-mo); }
.mo-pit { fill: var(--m-moPit); opacity: .9; }
.pu-body { fill: url(#g-pu); }
.pu-dot { fill: var(--m-puDot); opacity: .8; }
.pu-hole { fill: var(--m-puDot); }
.glow { opacity: calc(var(--n-glow) * .7); transition: opacity .5s; pointer-events: none; }
.pool { opacity: calc(var(--n-glow) * .45); pointer-events: none; }
.shroom.is-hot .glow, .shroom:focus-visible .glow { opacity: var(--n-glow); }
.shroom { cursor: pointer; outline: none; }
.shroom .body { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0); transition: transform .9s cubic-bezier(.34, 1.56, .64, 1); }
.shroom.born .body { transform: scale(1); }
.shroom.born.is-hot .body { transform: scale(1.05); }
.sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 6.5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-.7deg); } 50% { transform: rotate(.7deg); } }
.tag { opacity: 0; transition: opacity .6s .25s; }
.shroom.born .tag { opacity: 1; }
.tag-bg { fill: rgba(14, 10, 8, .74); stroke: rgba(255, 255, 255, .12); stroke-width: 1; transition: fill .3s, stroke .3s; }
.key { fill: none; stroke: rgba(255, 244, 228, .45); stroke-width: 1; }
.key-t { fill: #f1e9dc; font: 600 13px var(--sans); text-anchor: middle; }
.tag-t { fill: #f6efe3; font: 500 15px var(--sans); }
.shroom.is-hot .tag-bg { fill: rgba(14, 10, 8, .92); stroke: var(--glow-c); }
.shroom:focus-visible .tag-bg { stroke: var(--focus); stroke-width: 2.5; }

/* ---------- below ground: the sections ---------- */
.roots { position: relative; background: var(--c-soilBot); }
.roots-in { position: relative; max-width: 960px; margin: 0 auto; padding: 0 var(--pad) 40px; }
.spine { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.spine path { fill: none; stroke-linecap: round; }
.spine-dim { stroke: rgba(212, 248, 230, .16); stroke-width: 1.6; }
.spine-hy { stroke: rgba(212, 248, 230, .14); stroke-width: 1; }
.spine-lit { stroke: #d4f8e6; stroke-width: 2; filter: drop-shadow(0 0 5px rgba(143, 240, 219, .7)); }
.sec { position: relative; padding: 96px 0 8px var(--gut); scroll-margin-top: 56px; }
.sec:first-child { padding-top: 72px; }
.sec-head { position: relative; display: flex; align-items: center; gap: 20px; margin-bottom: 30px; }
.sec-node { position: absolute; left: calc(24px - var(--gut) - 8px); top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; border: 2px solid var(--accent); background: var(--c-soilBot); box-shadow: 0 0 0 5px var(--c-soilBot); transition: background .5s, box-shadow .5s; }
.sec.is-lit .sec-node { background: var(--accent); box-shadow: 0 0 0 5px var(--c-soilBot), 0 0 22px var(--accent); }
.sec-plate { width: 72px; height: 72px; flex: none; }
.sec-plate svg { width: 100%; height: 100%; }
.sec-plate * { fill: none; stroke: var(--accent); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.sec-plate .shade, .sec-plate .undershadow, .sec-plate .wart-sh, .sec-plate .fan-sh, .sec-plate .fan-top, .sec-plate .mat, .sec-plate .fuzz, .sec-plate .rim, .sec-plate title { display: none; }
.sec-plate .wart, .sec-plate .pa-scale ellipse, .sec-plate .mo-pit ellipse, .sec-plate .pu-dot circle, .sec-plate .pu-hole { fill: var(--accent); stroke: none; opacity: .5; }
.sec h2 { font: 400 clamp(34px, 4.4vw, 48px)/1.05 var(--serif); margin: 0 0 8px; text-wrap: balance; }
.sec-blurb { margin: 0; color: var(--ink-2); max-width: 40em; text-wrap: pretty; }
.sec-body { container-type: inline-size; }
.sec-body a:not(.btn):not(.proj), .drawer a:not(.btn):not(.pager a) { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.sample-note { font-size: 15px; color: var(--ink-2); border: 1px dashed var(--hair); border-radius: 10px; padding: 10px 14px; margin: 0 0 26px; }
.lede { font-size: 21px; line-height: 1.5; margin: 0 0 8px; text-wrap: pretty; }
.prose p { margin: 0 0 1em; max-width: 64ch; line-height: 1.65; }

/* experience: a timeline, newest first */
.xp-list { list-style: none; margin: 0; padding: 0; }
.xp { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 22px; }
.xp-when { margin: 3px 0 0; font-size: 15px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.xp-main { position: relative; padding: 0 0 34px 26px; border-left: 1px solid var(--hair); }
.xp:last-child .xp-main { border-left-color: transparent; }
.xp-main::before { content: ""; position: absolute; left: -8px; top: 5px; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--accent); background: var(--c-soilBot); box-shadow: 0 0 0 3px var(--c-soilBot), 0 0 0 4px var(--hair); }
.xp h3 { font: 400 25px/1.2 var(--serif); margin: 0 0 2px; }
.xp-org { margin: 0 0 10px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.xp-type { font-size: 13px; padding: 2px 9px; border-radius: 99px; background: var(--lift); color: var(--ink-2); }
.xp-main > p { margin: 0 0 .6em; }
.xp-bullets { margin: 6px 0 0; padding-left: 1.1em; }
.xp-bullets li { margin: 4px 0; }
.xp-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.xp-photos button, .strip button { display: block; padding: 0; border: 0; background: var(--lift); border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.xp-photos img { display: block; width: 112px; height: 84px; object-fit: cover; }
@container (max-width: 520px) {
  .xp { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .xp-when { text-align: left; padding: 0 0 4px 27px; border-left: 1px solid var(--hair); margin: 0; }
}

/* projects */
.proj-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 34px 26px; }
.proj { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.proj-fig, .grow-fig { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--lift); }
.proj-fig { margin-bottom: 14px; }
.cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-title { font: 400 25px/1.15 var(--serif); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.proj:hover .proj-title, .proj:focus-visible .proj-title { text-decoration: underline; text-decoration-color: var(--accent); }
.proj-meta { font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.proj-sum { margin-top: 8px; }
.proj-more { margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--accent); }

/* now (in progress) */
.grow-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; }
.grow { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: 24px; align-items: start; scroll-margin-top: 80px; }
.grow h3 { font: 400 25px/1.15 var(--serif); margin: 0 0 4px; }
.grow-stage { font-size: 15px; color: var(--ink-2); margin: 0 0 14px; }
.grow-text p { margin: 0 0 .8em; }
.meter { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.meter-track { flex: 1; height: 8px; border-radius: 99px; background: var(--lift); overflow: hidden; }
.meter-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.meter b { font-size: 15px; font-variant-numeric: tabular-nums; min-width: 3.2ch; text-align: right; }
.grow-next span { display: block; font-size: 13px; color: var(--ink-2); }
@container (max-width: 520px) { .grow { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

/* photos */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chips button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--hair); background: transparent; font-size: 15px; }
.chips button:hover { border-color: currentColor; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--solid-ink); border-color: var(--ink); }
.masonry { columns: 3 220px; column-gap: 14px; }
.masonry figure { break-inside: avoid; margin: 0 0 16px; }
.masonry button { display: block; width: 100%; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--lift); cursor: zoom-in; }
.masonry img { display: block; width: 100%; height: auto; }
.masonry figcaption { font-size: 15px; color: var(--ink-2); margin-top: 6px; }

/* resume */
.resume section { margin-top: 32px; }
.resume h3 { font: 400 21px/1.2 var(--serif); margin: 0 0 10px; }
.skills { margin: 0; }
.skills div { display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--hair); }
.skills dt { color: var(--ink-2); font-size: 15px; padding-top: 1px; }
.skills dd { margin: 0; }
.cv-list { list-style: none; margin: 0; padding: 0; }
.cv-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--hair); }
.cv-what small { display: block; font-size: 15px; color: var(--ink-2); }
.cv-when { white-space: nowrap; color: var(--ink-2); font-size: 15px; font-variant-numeric: tabular-nums; }

/* links and the last way to say hi */
.say-hi { margin: 0 0 34px; }
.say-hi .lede { margin-bottom: 16px; }
.say-hi-note { margin: 10px 0 0; font-size: 15px; color: var(--ink-2); }
.else-list { list-style: none; margin: 0; padding: 0; }
.else-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name icon" "handle icon" "note icon"; column-gap: 16px; padding: 16px 0; border-top: 1px solid var(--hair); color: inherit; text-decoration: none; }
.else-name { grid-area: name; font: 400 25px/1.15 var(--serif); }
.else-handle { grid-area: handle; font-size: 15px; font-weight: 600; color: var(--accent); margin-top: 2px; }
.else-note { grid-area: note; font-size: 15px; color: var(--ink-2); }
.else-list svg { grid-area: icon; align-self: center; color: var(--ink-2); }
.else-list a:hover .else-name { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.end { max-width: 960px; margin: 0 auto; padding: 40px var(--pad) 64px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink-2); font-size: 15px; border-top: 1px solid var(--hair); }
.end p { margin: 0; }
.to-top { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; }
.to-top:hover { color: var(--ink); }

/* ---------- a project's own page ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(4, 3, 2, .55); opacity: 0; transition: opacity .4s; }
.drawer-open .scrim { opacity: 1; }
.drawer { position: fixed; z-index: 21; top: 0; right: 0; bottom: 0; width: min(700px, 100%); background: #17110d; color: var(--ink); box-shadow: -24px 0 70px rgba(0, 0, 0, .45); transform: translateX(104%); transition: transform .5s var(--ease); display: flex; }
.drawer-open .drawer { transform: none; }
.drawer-scroll { width: 100%; height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 clamp(22px, 4vw, 48px) 40px; }
.drawer-head { padding: 64px 0 24px; border-bottom: 1px solid var(--hair); margin-bottom: 26px; }
.drawer h2 { font: 400 clamp(34px, 4vw, 46px)/1.05 var(--serif); margin: 0 0 10px; text-wrap: balance; outline: none; }
.drawer-blurb { margin: 0; color: var(--ink-2); max-width: 34em; }
.drawer-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 14px -8px; min-height: 44px; padding: 0 12px 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 15px; }
.drawer-back:hover { color: var(--ink); background: var(--lift); }
.drawer-close { position: absolute; z-index: 2; top: 14px; right: 14px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--hair); background: #17110d; color: var(--ink); }
.drawer-close:hover { border-color: currentColor; }
.detail-cover { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--lift); cursor: zoom-in; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 20px 0 22px; padding: 0 0 18px; border-bottom: 1px solid var(--hair); }
.facts dt { font-size: 13px; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-size: 17px; }
.strip-wrap { margin-top: 26px; }
.strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.strip figure { flex: none; scroll-snap-align: start; margin: 0; }
.strip img { display: block; height: 200px; width: auto; max-width: none; }
.strip figcaption { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.strip-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--hair); }
.pager a { display: flex; align-items: center; gap: 10px; min-height: 56px; color: inherit; text-decoration: none; }
.pager a:last-child { justify-content: flex-end; text-align: right; }
.pager small { display: block; font-size: 13px; color: var(--ink-2); }
.pager a:hover span { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }

/* ---------- photo viewer ---------- */
.lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(5, 4, 3, .95); color: #f1ece4; }
.lb-stage { position: absolute; inset: 0; display: grid; place-items: center; padding: 64px 76px 40px; }
.lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; }
.lb-fig img { display: block; max-width: 100%; max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); object-fit: contain; border-radius: 4px; opacity: 0; transition: opacity .3s; }
.lb-fig img.is-in { opacity: 1; }
.lb-fig figcaption { font-size: 17px; text-align: center; max-width: 40em; }
.lb-count { position: absolute; top: 24px; left: 24px; margin: 0; font-size: 15px; color: #bdb3a4; }
.lb-btn { position: absolute; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); color: #fff; }
.lb-btn:hover { background: rgba(255, 255, 255, .14); }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 14px; right: 16px; }

.noscript { position: relative; z-index: 9; max-width: 640px; margin: 18vh auto; padding: 0 24px; color: #edf3eb; }
.noscript h1 { font: 400 64px/1 var(--serif); margin: 0 0 16px; }
.no-forest .landing { background: linear-gradient(180deg, #08161f, #0e2a32 60%, #1f4547); }

/* ---------- smaller screens ---------- */
@media (max-width: 960px) {
  .bar-nav { display: none; }
  .menu-btn { display: inline-flex; align-items: center; }
  .bar-email { margin-left: auto; }
  .scrolled .menu-btn { margin-left: 0; }
}
@media (hover: none) { .hud-btn kbd, .hero-hint kbd { display: none; } }
@media (max-width: 760px) {
  :root { --gut: 40px; }
  .bar { height: 58px; gap: 10px; }
  .scrolled .bar-where { display: block; }
  .bar-email span { display: none; }
  .bar-email { width: 44px; height: 44px; min-height: 0; padding: 0; justify-content: center; }
  .hero { padding-top: 70px; }
  .hero-intro { font-size: 17px; }
  .addr { width: 100%; padding: 0 2px; }
  .hud-btn small { display: none; }
  .hud-btn { padding: 6px 10px; }
  .sec { padding-top: 76px; }
  .sec-node { left: calc(15px - var(--gut) - 7px); width: 14px; height: 14px; margin-top: -7px; }
  .sec-head { gap: 14px; align-items: flex-start; }
  .sec-plate { width: 48px; height: 48px; margin-top: 4px; }
  .masonry { columns: 2 140px; column-gap: 10px; }
  .drawer { top: auto; left: 0; width: auto; height: calc(100% - 8vh); height: calc(100dvh - 8vh); border-radius: 20px 20px 0 0; transform: translateY(104%); }
  .drawer-head { padding-top: 58px; }
  .lb-stage { padding: 64px 12px 96px; }
  .lb-prev, .lb-next { top: auto; bottom: 22px; transform: none; }
  .lb-prev { left: calc(50% - 60px); } .lb-next { right: calc(50% - 60px); }
}
@media (max-width: 420px) { .hud-btn span { display: none; } .hud-btn { padding: 6px 12px; } .hud-more { padding: 0 14px 0 16px; } }
@media (max-height: 800px) and (min-width: 761px) {
  .hero { padding-top: 84px; }
  .hero-reply { display: none; }
  .hero-contact { margin-top: 16px; }
  .hero-links { margin-top: 8px; }
  .hero-hint { margin-top: 6px; }
}
@media (max-height: 640px) and (min-width: 761px) { .hero { padding-top: 70px; } .hero-hint, .hero-open { display: none; } }
@media (max-width: 760px) and (max-height: 760px) { .hero-reply, .hero-hint { display: none; } .hero-links { margin-top: 6px; } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
