/* ==========================================================================
   Aaditya Goswami — portfolio theme
   Two themes, one set of role names. Components only ever use var(--role).
   Dark  = "Da Vinci's workshop at night" (default)
   Light = "Paper & Ink"
   Toggle by setting data-theme="light" | "dark" on <html>.
   ========================================================================== */

/* Fonts (Bricolage Grotesque + IBM Plex Mono) load from a <link> in each page's <head>, which starts
   the download sooner than an @import here would. */

/* ---------- Tokens ---------- */
:root,
[data-theme="dark"] {
  --ink:      #121829; /* base background */
  --espresso: #3B2A22; /* cards, surfaces, sections */
  --copper:   #B5652B; /* secondary accent: borders, tags, hover */
  --ember:    #E8A33D; /* primary accent: CTAs, active links, key numbers (5–10% max) */
  --stone:    #8A8F98; /* muted text, dividers, metadata */
  --paper:    #EFE6D2; /* main text, headings */
  /* Small copper text on ink is 4.1:1 here; lifting it toward paper gives 5.0:1 (also ink-on-it: 5.0:1). */
  --copper-text: color-mix(in srgb, var(--copper) 85%, var(--paper));
  --ember-text:  var(--ember);
  color-scheme: dark;
}

[data-theme="light"] {
  --ink:      #FFFDF8; /* base background */
  --espresso: #FFF1DC; /* cards, surfaces, sections */
  --copper:   #1B63E0; /* secondary accent */
  --ember:    #D4400B; /* primary accent */
  --stone:    #6B6358; /* muted text, dividers, metadata */
  --paper:    #1A1712; /* main text, headings */
  --copper-text: var(--copper);
  /* Small ember text on espresso is 4.2:1 here; 10% toward paper gives 4.8:1. */
  --ember-text:  color-mix(in srgb, var(--ember) 90%, var(--paper));
  color-scheme: light;
}

/* Derived tokens (same formula in both themes) */
:root,
[data-theme] {
  --paper-soft: color-mix(in srgb, var(--paper) 80%, transparent); /* secondary body copy */
  --line:       color-mix(in srgb, var(--stone) 30%, transparent); /* dividers, card borders */

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --radius-sm: 18px;
  --radius-md: 24px;
  --radius-lg: 28px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  --gutter: 80px;          /* desktop side padding; see media queries */
  --maxw: 1280px;          /* content width at 1440 */
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

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

html { transition: background-color .4s ease, color .4s ease; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--paper); text-decoration: none; }
a:hover { color: var(--copper); }

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

h1, h2, h3 { margin: 0; letter-spacing: -0.03em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

.mono { font-family: var(--font-mono); }
.eyebrow {                       /* "01 — A BIT ABOUT ME" section labels */
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--copper);
}
.meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }
.muted { color: var(--paper-soft); }
.accent { color: var(--ember); }

.container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }

/* ---------- Components ---------- */

/* Buttons: ember bg + ink text, hover shifts to copper */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 18px 28px; border-radius: var(--radius-pill);
  background: var(--ember); color: var(--ink);
  font-weight: 600; font-size: 17px;
  transition: background-color .2s;
}
.btn:hover { background: var(--copper); color: var(--ink); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 18px 28px; border-radius: var(--radius-pill);
  border: 1px solid var(--copper); color: var(--paper);
  font-weight: 600; font-size: 17px;
}

/* Floating header nav: centered pill, no name/logo, theme toggle is the last item inside the pill */
.site-header { position: sticky; top: 16px; z-index: 50; display: flex; justify-content: center; padding: 12px var(--gutter); pointer-events: none; }
.site-header > * { pointer-events: auto; }
.site-nav { box-shadow: 0 12px 40px -12px rgba(0,0,0,.45); backdrop-filter: blur(10px); }
[data-theme="light"] .site-nav { box-shadow: 0 12px 40px -16px rgba(26,23,18,.25); }
.site-nav { display: flex; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--espresso); }
.site-nav a { padding: 12px 20px; border-radius: var(--radius-pill); font-size: 15px; }
.site-nav a:hover { background: var(--ink); color: var(--paper); }
.site-nav a[aria-current="page"] { background: var(--ember); color: var(--ink); font-weight: 600; }

/* Theme toggle */
.theme-toggle {
  width: 44px; height: 44px; margin-left: 4px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--ink); color: var(--paper);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: border-color .2s, color .2s;
}
.theme-toggle:hover { border-color: var(--copper); color: var(--copper); }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Cards */
.card {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 32px; display: flex; flex-direction: column; gap: 16px;
  transition: transform .3s var(--ease-out), border-color .3s, background-color .3s;
}
.card:hover { transform: translateY(-6px) rotate(-.4deg); border-color: var(--copper); background: var(--espresso); color: var(--paper); }
.card--surface { background: var(--espresso); }

/* Tags / pills */
.tag { font-family: var(--font-mono); font-size: 12px; padding: 6px 12px; border: 1px solid var(--copper); border-radius: var(--radius-pill); color: var(--paper-soft); }

/* Filter chips (blog notebooks, project categories) */
.chip {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 20px;
  border-radius: var(--radius-pill); border: 1px solid var(--copper);
  background: transparent; color: var(--paper);
  font-family: var(--font-mono); font-size: 14px; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--paper); }
.chip[aria-pressed="true"] { background: var(--ember); border-color: var(--ember); color: var(--ink); }

/* Status dot + pill */
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid currentColor; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--live { color: var(--ember); }
.status--active { color: var(--paper); }
.status--progress { color: var(--copper); }
.status--done { color: var(--stone); }

/* Search input */
.search { height: 48px; padding: 0 20px; border-radius: var(--radius-pill); border: 1px solid var(--copper); background: var(--espresso); color: var(--paper); font: inherit; font-size: 16px; }
.search::placeholder { color: var(--stone); }

/* Ticker strip */
.ticker { background: var(--espresso); color: var(--paper); overflow: hidden; transform: rotate(-1.2deg); margin-inline: -40px; }
.ticker__track { display: flex; gap: 48px; width: max-content; padding: 20px 0; white-space: nowrap; font-family: var(--font-mono); font-size: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; animation: marquee 38s linear infinite; }

/* Starfield texture for hero sections */
.stars {
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, color-mix(in srgb, var(--paper) 70%, transparent), transparent 60%),
    radial-gradient(1px 1px at 34% 62%, color-mix(in srgb, var(--paper) 50%, transparent), transparent 60%),
    radial-gradient(1.4px 1.4px at 58% 26%, color-mix(in srgb, var(--paper) 80%, transparent), transparent 60%),
    radial-gradient(1px 1px at 76% 74%, color-mix(in srgb, var(--paper) 45%, transparent), transparent 60%),
    radial-gradient(1.2px 1.2px at 88% 12%, color-mix(in srgb, var(--copper) 80%, transparent), transparent 60%),
    radial-gradient(1px 1px at 22% 88%, color-mix(in srgb, var(--paper) 40%, transparent), transparent 60%),
    radial-gradient(1px 1px at 48% 8%, color-mix(in srgb, var(--paper) 50%, transparent), transparent 60%),
    radial-gradient(1.3px 1.3px at 95% 48%, color-mix(in srgb, var(--ember) 70%, transparent), transparent 60%);
  background-size: 520px 420px;
  animation: drift 120s linear infinite;
}

/* ---------- Motion ---------- */
@keyframes drift   { from { background-position: 0 0; } to { background-position: -520px 420px; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes rise    { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes flick   { 50% { opacity: .45; } }
@keyframes pulse   {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ember) 60%, transparent); }
  50%      { box-shadow: 0 0 0 8px color-mix(in srgb, var(--ember) 0%, transparent); }
}

.rise   { animation: rise .9s var(--ease-out) both; }
.d1 { animation-delay: .1s; } .d2 { animation-delay: .25s; } .d3 { animation-delay: .4s; }
.pulse  { animation: pulse 2s infinite; }
.flame  { animation: flick .16s steps(2) infinite; }
.orbit  { animation: spin 30s linear infinite; }
.orbit2 { animation: spin 20s linear infinite reverse; }
.orbit3 { animation: spin 12s linear infinite; }
.tilt   { transition: transform .4s var(--ease-out); }
.tilt:hover { transform: rotate(-1.5deg) scale(1.02); }

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

/* ---------- Responsive ---------- */
@media (max-width: 1024px) { :root, [data-theme] { --gutter: 40px; } }
@media (max-width: 640px)  { :root, [data-theme] { --gutter: 16px; } }


/* ==========================================================================
   Site layer
   Everything above this line is the design handoff's theme.css. Everything below builds the pages
   from it, using the same role tokens only.
   ========================================================================== */

/* ---------- Base additions ---------- */
html { scroll-padding-top: 104px; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; padding-bottom: clamp(72px, 8.4vw, 120px); }
main.main--flush { padding-bottom: 0; }
img { max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--ember); color: var(--ink); }

/* small copper/ember text uses the contrast-safe variants (see tokens) */
a:hover { color: var(--copper-text); }
.eyebrow { color: var(--copper-text); }
.eyebrow--stone { color: var(--stone); }
.status--live { color: var(--ember-text); }
.status--progress { color: var(--copper-text); }

/* the italic, light "signature" word in each hero and heading */
.sig { font-style: italic; font-weight: 300; }
.sig--400 { font-weight: 400; }
.c-ember { color: var(--ember); }
.c-copper { color: var(--copper); }
.c-stone { color: var(--stone); }

.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 {
  position: absolute; left: 16px; top: -120px; z-index: 100;
  padding: 12px 20px; border-radius: var(--radius-pill);
  background: var(--ember); color: var(--ink); font-weight: 600;
}
.skip:focus { top: 16px; color: var(--ink); }

.section { padding-top: clamp(72px, 9.7vw, 140px); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; }
.section-head__text { display: flex; flex-direction: column; gap: 16px; }
.h2 { font-size: clamp(36px, 4.45vw, 64px); line-height: 1; letter-spacing: -0.03em; font-weight: 700; }
.lede { font-size: clamp(18px, 1.46vw, 21px); line-height: 1.6; color: var(--paper-soft); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-weight: 600; font-size: 17px; white-space: nowrap;
}
.link-arrow svg, .arrow { transition: transform .3s var(--ease-out); flex: none; }
.link-arrow:hover svg { transform: translateX(4px); }
.link-arrow--ember { color: var(--ember-text); }
.link-arrow--ember:hover { color: var(--paper); }

.btn, .btn-ghost { min-height: 44px; }
.btn { border: 0; }
.btn-ghost { transition: background-color .2s, border-color .2s; }
.btn-ghost:hover { background: var(--espresso); border-color: var(--paper); color: var(--paper); }
/* ink on raw copper is 4.1:1 in dark, so the hover fill uses the lifted copper */
.btn:hover { background: var(--copper-text); }

.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); flex: none; }
.statusline {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--stone);
}

/* placeholder label ([YOUR PHOTO]); stone on espresso is under 4.5:1, so it uses paper-soft */
.ph-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; color: var(--paper-soft); text-align: center; }

/* ---------- Header: floating pill nav ---------- */
.site-nav { position: relative; max-width: 100%; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.site-nav a[aria-current="true"] { background: var(--ember); color: var(--ink); font-weight: 600; }
.site-nav a[aria-current]:hover { background: var(--ember); color: var(--ink); }
.nav-links { display: contents; }
.nav-menu { display: none; }
.theme-toggle { flex: none; }
.theme-toggle svg { width: 22px; height: 22px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 28px; }
.site-footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 8px 28px; flex-wrap: wrap; }
.site-footer__copy { font-family: var(--font-mono); font-size: 13px; color: var(--stone); }
.social { display: flex; flex-wrap: wrap; gap: 0 28px; font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.social a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Shared grid ---------- */
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }

/* ---------- Ticker ---------- */
.ticker-band { overflow-x: clip; padding-block: 28px; margin-block: -28px; }
.ticker__track > * { flex: none; }
.ticker:hover .ticker__track { animation-play-state: paused; }

/* ==========================================================================
   Home
   ========================================================================== */
.home-hero { padding-block: clamp(32px, 3.4vw, 48px) clamp(64px, 6.7vw, 96px); }
.home-hero .grid12 { align-items: center; row-gap: 48px; }
.home-hero__text { grid-column: span 7; display: flex; flex-direction: column; }
.home-hero h1 { margin-top: 28px; font-size: clamp(46px, 7.22vw, 104px); line-height: .92; letter-spacing: -0.045em; font-weight: 700; }
.home-hero__intro { margin-top: 36px; max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 44px; }

.moon { grid-column: span 5; position: relative; width: 100%; max-width: 520px; aspect-ratio: 520 / 560; margin-inline: auto; container-type: inline-size; }
.moon > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.moon__chips { list-style: none; margin: 0; padding: 0; }
.moon__chip {
  position: absolute; left: var(--x); top: var(--y); transform: rotate(var(--r));
  padding: 8px 14px; border-radius: var(--radius-pill); white-space: nowrap;
  font-family: var(--font-mono); font-size: 13px; font-size: clamp(10px, 2.5cqi, 13px); letter-spacing: .08em; text-transform: uppercase;
}
.moon__chip--ember { background: var(--ember); color: var(--ink); }
.moon__chip--copper { background: var(--copper-text); color: var(--ink); }
.moon__chip--line { border: 1px solid var(--paper); color: var(--paper); }
.moon__chip--surface { background: var(--espresso); color: var(--paper); }

.about-teaser .grid12 { align-items: start; row-gap: 32px; }
.about-teaser__side { grid-column: span 4; display: flex; flex-direction: column; gap: 16px; }
.about-teaser__main { grid-column: span 8; display: flex; flex-direction: column; gap: 32px; }
.photo-round {
  width: min(240px, 100%); aspect-ratio: 1; border-radius: 50%; border: 1px dashed var(--copper);
  display: grid; place-items: center; margin-top: 24px; transform: rotate(-4deg);
}
.statement { font-size: clamp(28px, 3.61vw, 52px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 500; }
.about-teaser .lede { max-width: 760px; }

.things { display: flex; flex-direction: column; gap: 48px; }
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.bento > .card { border-radius: var(--radius-lg); padding: 36px; min-height: 300px; }
.bento .card__top { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.bento .card__top > :first-child { color: var(--stone); }
.bento h3 { margin-top: auto; font-size: clamp(28px, 2.5vw, 36px); letter-spacing: -0.02em; font-weight: 700; line-height: 1.05; }
.bento p { font-size: 17px; line-height: 1.55; color: var(--paper-soft); }
.bento__link { min-height: 340px; }
.bento__lx1 {
  grid-column: span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: center;
  padding: 40px; background: var(--espresso);
}
.bento__lx1 > div { display: flex; flex-direction: column; gap: 16px; }
.bento__lx1 .card__top { justify-content: flex-start; }
.bento__lx1 .card__top > :first-child { color: var(--paper-soft); }
.bento__lx1 h3 { margin: 0; font-size: clamp(36px, 3.33vw, 48px); line-height: 1; letter-spacing: -0.03em; }
.bento__lx1 svg { width: 100%; height: auto; }
.bento__solid { border: 0; background: var(--espresso); }
.bento__solid .card__top > *, .bento__solid .card__top > :first-child, .bento__solid p { color: var(--paper); }
.dotlabel::before { content: "● "; }
.st-live { color: var(--ember-text); }
.st-active { color: var(--paper); }
.st-progress { color: var(--copper-text); }
.st-done { color: var(--stone); }

.post-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

.cta-box {
  margin-top: clamp(72px, 8.4vw, 120px); border-radius: var(--radius-xl); border: 1px solid var(--line);
  padding: clamp(40px, 6.7vw, 96px) clamp(24px, 5.6vw, 80px);
  display: flex; flex-direction: column; gap: 32px; align-items: flex-start;
}
.cta-box h2 { font-size: clamp(36px, 5vw, 72px); line-height: .98; letter-spacing: -0.035em; font-weight: 700; max-width: 1000px; }
.cta-box__note { font-size: 18px; color: var(--paper-soft); }
.email-link {
  display: inline-flex; align-items: center; gap: 16px; max-width: 100%;
  font-size: clamp(19px, 2.78vw, 40px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2;
  color: var(--ember); border-bottom: 2px solid var(--ember); padding-bottom: 6px; overflow-wrap: anywhere;
}
.email-link:hover { color: var(--paper); border-color: var(--paper); }
.email-link svg { width: .8em; height: .8em; flex: none; }

/* ==========================================================================
   Blog cards (home, blog index, notebook pages)
   ========================================================================== */
[data-nb="tech"] { --nb: var(--ember); --nb-text: var(--ember-text); --nb-fill: var(--ember); }
[data-nb="mind"] { --nb: var(--copper); --nb-text: var(--copper-text); --nb-fill: var(--copper-text); }
[data-nb="food"] { --nb: var(--paper); --nb-text: var(--paper); --nb-fill: var(--paper); }
[data-nb="all"]  { --nb: var(--paper); --nb-text: var(--paper); --nb-fill: var(--paper); }

.post-card { padding: 0; gap: 0; overflow: hidden; border-radius: var(--radius-lg); min-height: 440px; position: relative; }
.post-card__band { height: 10px; background: var(--nb); flex: none; }
.post-card__body { position: relative; padding: 36px; display: flex; flex-direction: column; gap: 18px; flex-grow: 1; }
.post-card__num {
  position: absolute; right: 28px; top: 8px; font-size: 120px; font-weight: 800; line-height: 1; letter-spacing: -0.06em;
  color: var(--nb); opacity: .16; pointer-events: none;
}
/* decorative, so it comes from CSS content rather than page text */
.post-card__num::before { content: attr(data-num); }
/* decorative, so it comes from CSS content rather than page text */
.post-card__num::before { content: attr(data-num);
}
.post-card__kicker { display: flex; flex-wrap: wrap; gap: 0 10px; align-items: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); position: relative; }
.post-card__kicker .nb-name { color: var(--nb-text); }
.post-card__title { font-size: clamp(26px, 2.22vw, 32px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; max-width: 760px; position: relative; }
.post-card__excerpt { font-size: 18px; line-height: 1.55; color: var(--paper-soft); max-width: 620px; position: relative; }
.post-card__meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }
.post-card__meta .arrow { color: var(--paper); }
.card:hover .arrow { transform: translate(6px, -6px); }
.post-card.is-wide .post-card__title { font-size: clamp(34px, 3.61vw, 52px); }
.post-card.is-wide .post-card__num { font-size: clamp(120px, 13.9vw, 200px); }

/* compact version on the home page */
.post-card--compact { min-height: 340px; border-radius: var(--radius-md); }
.post-card--compact .post-card__band { height: 8px; }
.post-card--compact .post-card__body { padding: 32px; gap: 16px; }
.post-card--compact .post-card__kicker { color: var(--nb-text); }
.post-card--compact .post-card__title { font-size: clamp(24px, 2.08vw, 30px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; }
.post-card--compact .post-card__excerpt { font-size: 16px; }

/* ==========================================================================
   About
   ========================================================================== */
.about-hero { padding-block: clamp(40px, 4.4vw, 64px) clamp(64px, 6.7vw, 96px); }
.about-hero .grid12 { align-items: center; row-gap: 48px; }
.about-hero__text { grid-column: span 8; display: flex; flex-direction: column; gap: 28px; }
.about-hero h1 { font-size: clamp(64px, 10.83vw, 156px); line-height: .84; letter-spacing: -0.055em; font-weight: 800; }
.about-hero__intro { max-width: 620px; font-size: clamp(18px, 1.53vw, 22px); line-height: 1.5; color: var(--paper-soft); }
.about-art { grid-column: span 4; position: relative; width: 100%; max-width: 404px; aspect-ratio: 404 / 480; justify-self: center; }
.about-art__photo {
  position: absolute; left: 5%; top: 0; width: 84%; aspect-ratio: 340 / 420; border-radius: var(--radius-lg);
  border: 1px dashed var(--copper); background: var(--espresso); display: grid; place-items: center; transform: rotate(3deg);
}
.sticker {
  position: absolute; left: 0; bottom: 4%; padding: 16px 24px; border-radius: var(--radius-pill);
  background: var(--espresso); color: var(--paper); font-size: clamp(20px, 1.95vw, 28px); font-weight: 700; font-style: italic;
  letter-spacing: -0.02em; transform: rotate(-8deg); white-space: nowrap;
}

.story { padding-top: clamp(48px, 5.6vw, 80px); }
.story .grid12 { row-gap: 24px; }
.story__label { grid-column: span 3; padding-top: 14px; }
.story__body { grid-column: span 9; display: flex; flex-direction: column; gap: 36px; }
.story__big { font-size: clamp(26px, 2.78vw, 40px); line-height: 1.2; letter-spacing: -0.025em; font-weight: 500; }
.story__body .lede { line-height: 1.65; max-width: 820px; }

.path { display: flex; flex-direction: column; gap: 48px; }
.timeline { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; list-style: none; margin: 0; padding: 0; }
.timeline::before {
  content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px;
  background: linear-gradient(90deg, var(--copper), var(--paper), var(--copper), var(--ember));
}
.timeline__step { position: relative; display: flex; flex-direction: column; gap: 20px; }
.timeline__dot { width: 24px; height: 24px; border-radius: 50%; border: 5px solid var(--ink); background: var(--dot, var(--copper)); flex: none; }
.timeline__label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--copper-text); }
.timeline__label--paper { color: var(--paper); }
.timeline h3 { font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.timeline p { font-size: 17px; line-height: 1.55; color: var(--paper-soft); }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 0; }
.fact { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.fact dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--stone); }
.fact dd { margin: 0; font-size: clamp(22px, 1.95vw, 28px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

.quote-band { margin: clamp(72px, 9.7vw, 140px) 0 0; background: var(--espresso); color: var(--paper); padding-block: clamp(56px, 6.7vw, 96px); }
.quote-band .container { display: flex; flex-direction: column; gap: 24px; }
.quote-band figcaption { font-family: var(--font-mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.quote-band blockquote { margin: 0; font-size: clamp(36px, 5.83vw, 84px); line-height: .98; letter-spacing: -0.045em; font-weight: 700; max-width: 1180px; text-wrap: balance; }

/* ==========================================================================
   Projects
   ========================================================================== */
.projects-hero { padding-block: clamp(40px, 4.4vw, 64px) clamp(48px, 5vw, 72px); }
.projects-hero .grid12 { align-items: end; row-gap: 40px; }
.projects-hero__text { grid-column: span 8; display: flex; flex-direction: column; gap: 24px; }
.projects-hero h1 { font-size: clamp(56px, 9.17vw, 132px); line-height: .86; letter-spacing: -0.05em; font-weight: 800; }
.tally { grid-column: span 4; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.tally__item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; }
.tally__item dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }
.tally__item dd { margin: 0; font-size: 40px; font-weight: 700; line-height: 1; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; padding-block: 24px; border-block: 1px solid var(--line); }
.chip { min-height: 44px; }
.chip--caps { height: 46px; padding: 0 18px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.chip__count { opacity: .75; }
.chip[aria-pressed="true"] .chip__count { opacity: 1; }

.proj-list { display: flex; flex-direction: column; gap: 36px; }
.proj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-content: start; list-style: none; margin: 0; padding: 0; }
.proj-grid > li { display: flex; min-width: 0; }
.proj-grid > li[hidden] { display: none; }
.proj-card { width: 100%; padding: 32px; gap: 18px; min-height: 300px; position: relative; overflow: hidden; }
.proj-card__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }
.proj-card h3 { margin-top: 12px; font-size: clamp(26px, 2.22vw, 32px); line-height: 1; letter-spacing: -0.03em; font-weight: 700; }
.proj-grid > .is-wide h3 { font-size: clamp(34px, 3.89vw, 56px); }
.proj-card p { font-size: 17px; line-height: 1.55; color: var(--paper-soft); max-width: 640px; }
.proj-card__tags { margin: auto 0 0; display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; }
.proj-card__link { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--copper-text); }
.status { white-space: nowrap; }

.empty-state {
  grid-column: 1 / -1; border: 1px dashed var(--copper); border-radius: var(--radius-lg); padding: clamp(32px, 4.4vw, 64px);
  display: flex; flex-direction: column; gap: 16px; align-items: flex-start;
}
.empty-state[hidden] { display: none; }
.empty-state strong { font-size: clamp(28px, 2.78vw, 40px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }

/* ==========================================================================
   Blog index
   ========================================================================== */
.blog-hero { position: relative; padding-block: clamp(40px, 4.4vw, 64px) clamp(56px, 6.1vw, 88px); overflow: hidden; }
.blog-hero .container { position: relative; display: flex; flex-direction: column; gap: 28px; }
.blog-hero h1 { font-size: clamp(76px, 13.6vw, 196px); line-height: .82; letter-spacing: -0.06em; font-weight: 800; position: relative; }
.blog-hero__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 48px; flex-wrap: wrap; position: relative; }
.blog-hero__row p { max-width: 640px; font-size: clamp(19px, 1.67vw, 24px); line-height: 1.45; color: var(--paper-soft); }
.blog-hero__row p a { color: var(--copper-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.blog-hero__row p a:hover { color: var(--paper); }
.rss-pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border: 1px solid var(--copper); border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
}
.rss-pill:hover { border-color: var(--paper); color: var(--paper); background: var(--espresso); }
.blog-orbits { position: absolute; right: 60px; top: -10px; width: 360px; height: 360px; opacity: .9; pointer-events: none; }
.blog-orbits g { transform-origin: 50% 50%; transform-box: view-box; }
.blog-orbits .orbit { animation-duration: 40s; }
.blog-orbits .orbit2 { animation-duration: 26s; }

.post-ticker { border-block: 1px solid var(--line); overflow: hidden; background: var(--espresso); }
.post-ticker .ticker__track {
  display: flex; gap: 40px; width: max-content; padding: 22px 0; white-space: nowrap; align-items: center;
  font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -0.01em; text-transform: none;
  animation: marquee 45s linear infinite;
}
.post-ticker .ticker__track > span { display: flex; align-items: center; gap: 40px; }
.post-ticker .tdot { width: 10px; height: 10px; border-radius: 50%; background: var(--nb); flex: none; }
.post-ticker:hover .ticker__track { animation-play-state: paused; }

  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  border-radius: var(--radius-xl); background: var(--paper); color: var(--ink); overflow: hidden; min-height: 500px;
}
  grid-column: span 5; margin-left: -24px; background: var(--espresso); color: var(--paper); position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: clamp(28px, 3.3vw, 48px);
}

.top-posts { padding-top: clamp(56px, 6.7vw, 96px); display: flex; flex-direction: column; gap: 40px; }
.top-posts .post-card { min-height: 340px; }
.browse { padding-top: clamp(48px, 5vw, 72px); display: flex; flex-direction: column; gap: 36px; }
.browse__bar { display: flex; justify-content: space-between; align-items: center; gap: 20px 32px; flex-wrap: wrap; }
.searchbox { display: flex; align-items: center; gap: 12px; }
.searchbox label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--stone); }
.searchbox .search { width: 320px; max-width: 100%; }
.search:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-content: start; }
.post-grid > * { min-width: 0; }
.post-grid > [hidden] { display: none; }

.notebooks { display: flex; flex-direction: column; gap: 40px; }
.nb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.nb-card {
  text-align: left; border: 0; border-top: 10px solid var(--nb); border-radius: var(--radius-lg); padding: 36px;
  background: var(--espresso); color: var(--paper); display: flex; flex-direction: column; gap: 20px; min-height: 420px; width: 100%;
}
.nb-card:hover { color: var(--paper); }
a.nb-card { text-decoration: none; }
.nb-card__top { display: flex; justify-content: space-between; gap: 12px; width: 100%; font-family: var(--font-mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.nb-card__name { font-size: clamp(40px, 3.61vw, 52px); line-height: .95; letter-spacing: -0.04em; font-weight: 800; }
.nb-card__blurb { font-size: 17px; line-height: 1.5; color: var(--paper-soft); }
.nb-card__posts { margin-top: auto; display: flex; flex-direction: column; width: 100%; }
.nb-card__posts > span { padding: 12px 0; border-top: 1px solid var(--line); font-size: 16px; font-weight: 600; }
.nb-card__posts .nb-card__none { font-weight: 400; color: var(--paper-soft); }
.nb-card__latest { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: 12px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--paper-soft); }

.archive { display: flex; flex-direction: column; gap: 24px; }
.archive__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center;
  padding: 36px 0; border-bottom: 1px solid var(--line); transition: padding .3s var(--ease-out), color .3s;
}
.row:hover { padding-left: 16px; color: var(--ember); }
.row:hover .arrow { transform: translate(6px, -6px); }
.row__kind { grid-column: span 2; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--paper); }
.row__title { grid-column: span 9; font-size: clamp(24px, 2.78vw, 40px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; }
.row .arrow { grid-column: span 1; justify-self: end; }

.rss-cta {
  margin-top: clamp(72px, 8.4vw, 120px); border-radius: var(--radius-xl); border: 1px solid var(--line); padding: clamp(32px, 5.6vw, 80px);
  display: flex; justify-content: space-between; align-items: center; gap: 32px 48px; flex-wrap: wrap;
}
.rss-cta > div { display: flex; flex-direction: column; gap: 16px; }
.rss-cta h2 { font-size: clamp(32px, 4.17vw, 60px); line-height: 1; letter-spacing: -0.03em; font-weight: 700; max-width: 760px; }
.rss-cta .btn { padding: 20px 32px; font-size: 18px; white-space: nowrap; }

/* ---------- Notebook pages (blog/tech, blog/mind, blog/food) and About this blog ---------- */
.nb-hero { padding-block: clamp(40px, 4.4vw, 64px); }
.nb-hero .container { display: flex; flex-direction: column; gap: 24px; }
.nb-hero h1 { font-size: clamp(56px, 9.17vw, 132px); line-height: .86; letter-spacing: -0.05em; font-weight: 800; }
.nb-hero__lede { max-width: 640px; font-size: clamp(19px, 1.67vw, 24px); line-height: 1.45; color: var(--paper-soft); }
.nb-rule { height: 10px; width: 120px; border-radius: var(--radius-pill); background: var(--nb); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; font-family: var(--font-mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--paper); text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: .25em; }
.crumbs a:hover { color: var(--copper-text); }
.sub-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.sub-chips .chip[aria-pressed="true"] { background: var(--nb-fill); border-color: var(--nb-fill); color: var(--ink); }
.links-row { display: flex; flex-wrap: wrap; gap: 12px; }
.prose { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }
.prose p { font-size: clamp(18px, 1.46vw, 21px); line-height: 1.6; color: var(--paper-soft); }
.prose strong { color: var(--paper); }
.nb-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.nb-link { border-top: 10px solid var(--nb); border-radius: var(--radius-lg); background: var(--espresso); min-height: 240px; }
.nb-link h3 { font-size: clamp(30px, 2.5vw, 36px); letter-spacing: -0.03em; font-weight: 800; }
.nb-link p { color: var(--paper-soft); font-size: 17px; }
.nb-link .link-arrow { margin-top: auto; }

/* ---------- Blog bar on post / notebook pages ---------- */
.blogbar { display: flex; justify-content: space-between; align-items: center; gap: 0 24px; flex-wrap: wrap; padding-top: 8px; }
.blogbar__tools { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.blogbar__tools a { display: inline-flex; align-items: center; min-height: 44px; }
.search-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--copper); background: transparent; text-transform: uppercase; letter-spacing: .1em; font-family: var(--font-mono); font-size: 13px;
}
.search-btn:hover { border-color: var(--paper); }
.kbd { font-family: var(--font-mono); font-size: 12px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--paper-soft); background: transparent; }

/* ==========================================================================
   Post pages: a reading column of 680px
   ========================================================================== */
.post { --col: 680px; }
.post article { padding-top: clamp(32px, 4.4vw, 64px); }
.phead, .pbody, .pend { width: min(100% - 2 * var(--gutter), var(--col)); margin-inline: auto; }
.phead { display: flex; flex-direction: column; gap: 20px; }
.phead__tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ctag {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--nb-fill); color: var(--ink); font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
}
.ctag:hover { color: var(--ink); background: var(--paper); }
.phead h1 { font-size: clamp(38px, 4.45vw, 64px); line-height: .98; letter-spacing: -0.04em; font-weight: 800; }
.phead__lede { font-size: clamp(19px, 1.53vw, 22px); line-height: 1.5; color: var(--paper-soft); }
.meta-line { display: flex; flex-wrap: wrap; gap: 4px 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }

.ph {
  position: relative; overflow: hidden; border-radius: var(--radius-md); border: 1px dashed var(--copper);
  background: var(--espresso); aspect-ratio: 3 / 2;
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* a file whose name still contains "placeholder-" stays invisible, so the labelled box shows through */
.ph img[src*="placeholder-"] { opacity: 0; }
.ph > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.phl { position: absolute; inset: auto 16px 14px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; color: var(--paper-soft); text-align: center; }

.phero { width: min(100% - 2 * var(--gutter), 1040px); margin: clamp(32px, 3.9vw, 56px) auto 0; }
.phero .ph { aspect-ratio: 1200 / 550; }
.phero figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 15px; color: var(--paper-soft); }
.phero figcaption .mono { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }
.cap { font-style: italic; }

.pbody { margin-top: clamp(40px, 4.4vw, 64px); font-size: clamp(18px, 1.32vw, 19px); line-height: 1.7; color: var(--paper-soft); }
.pbody > * + * { margin-top: 1.1em; }
.pbody p.lead { font-size: 1.2em; line-height: 1.55; color: var(--paper); }
.pbody h2 { margin-top: 2.2em; font-size: clamp(26px, 2.08vw, 32px); line-height: 1.1; color: var(--paper); letter-spacing: -0.02em; }
.pbody h2 .n { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-size: 13px; letter-spacing: .14em; font-weight: 500; color: var(--ember-text); }
.pbody a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: .2em; }
.pbody a:hover { color: var(--copper-text); }
.pbody strong { color: var(--paper); }
.pbody ul { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.pbody ul li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pbody ul li .mono { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--copper-text); padding-top: .35em; }
.pbody ol { padding-left: 1.3em; }
.pbody ol li + li { margin-top: .5em; }
.pbody ol li::marker { font-family: var(--font-mono); color: var(--ember-text); }
.note { display: flex; gap: 14px; padding: 20px 24px; border-radius: var(--radius-sm); background: var(--espresso); color: var(--paper); font-size: 17px; line-height: 1.6; }
.note svg { flex: none; color: var(--ember); margin-top: 3px; }
.ic { font-family: var(--font-mono); font-size: .85em; padding: 2px 7px; border-radius: 6px; background: var(--espresso); color: var(--paper); }
.code { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-size: 14px; }
.code__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 4px 4px 16px; background: var(--espresso); color: var(--paper); }
.code__file { display: flex; gap: 10px; font-size: 12px; letter-spacing: .06em; }
.code__file span { color: var(--paper-soft); }
.copy { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--paper); font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.copy:hover { background: var(--ink); }
.copy .ok, .copy.copied .idle { display: none; }
.copy.copied .ok { display: inline; color: var(--ember); }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; background: var(--ink); color: var(--paper); font-family: var(--font-mono); line-height: 1.65; }
.code pre:focus-visible { outline-offset: -2px; }
.code .ln { display: block; min-height: 1.65em; white-space: pre; }
.code .k { color: var(--ember-text); }
.code .f { color: var(--copper-text); }
.code .s { color: var(--paper-soft); font-style: italic; }
.code .nu { color: var(--ember-text); }
.code .cm { color: var(--stone); }
.pq { margin: 2em 0; padding: 0 0 0 24px; border-left: 3px solid var(--ember); }
.pq__mark { display: block; font-size: 64px; line-height: .6; color: var(--ember); }
.pq p { font-size: clamp(24px, 2.08vw, 30px); line-height: 1.25; letter-spacing: -0.02em; font-weight: 500; color: var(--paper); }
.brk { display: flex; justify-content: center; gap: 14px; padding: 12px 0; }
.brk span { width: 6px; height: 6px; border-radius: 50%; background: var(--copper); }

/* blocks from Markdown posts (blog/posts/*.md, rendered by blog/tools/post-page.mjs) */
.pbody h3 { margin-top: 1.8em; font-size: clamp(21px, 1.6vw, 24px); line-height: 1.2; color: var(--paper); letter-spacing: -0.015em; }
.pbody h2 + *, .pbody h3 + * { margin-top: .7em; }
.pbody ul.plist { padding-left: 1.3em; list-style: disc; border-top: 0; }
.pbody ul.plist li { display: list-item; padding: 0; border: 0; }
.pbody ul.plist li + li { margin-top: .5em; }
.pbody ul.plist li::marker { color: var(--copper-text); }
.pq__cite { display: block; margin-top: 12px; font-family: var(--font-mono); font-size: 12px; font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }
.pbody figure.img { margin-block: 2em 0; display: flex; flex-direction: column; gap: 10px; }
.pbody figure.img + * { margin-top: 2em; }
.pbody figure.img img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.pbody figure.img figcaption { font-size: 15px; color: var(--paper-soft); text-align: center; }
/* wide: out of the 680px column to 960px; full: edge to edge */
.pbody figure.img--wide { --w: min(960px, 100vw - 2 * var(--gutter)); width: var(--w); margin-inline: calc((100% - var(--w)) / 2); }
.pbody figure.img--full { width: 100vw; margin-inline: calc(50% - 50vw); }
.pbody figure.img--full img { border-radius: 0; }
.pbody figure.img--full figcaption { padding-inline: var(--gutter); }
.post { overflow-x: clip; }
.where { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--copper-text); }
.pbody h2 + .where { margin-top: .6em; }
.info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 16px; line-height: 1.45; }
.info dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--stone); }
.info dd { margin: 4px 0 0; color: var(--paper); }
.info .must dt { color: var(--ember-text); }
.info .muted { opacity: .55; }
.gallery { width: min(100% - 2 * var(--gutter), 1040px); margin: clamp(40px, 4.4vw, 64px) auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gallery figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.gallery .ph { aspect-ratio: 4 / 3; }
.gallery .cap { font-size: 15px; color: var(--paper-soft); }

/* tech posts: the table of contents sits beside the column on wide screens, above it otherwise */
.ptech .toc {
  width: min(100% - 2 * var(--gutter), var(--col)); margin: clamp(40px, 4.4vw, 64px) auto 0;
  padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; flex-direction: column;
}
.toc__title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--stone); margin-bottom: 4px; }
.toc a { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; color: var(--paper-soft); }
.toc a i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); flex: none; }
.toc a[aria-current="true"] { color: var(--paper); }
.toc a[aria-current="true"] i { background: var(--ember); }
.toc__foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }
@media (min-width: 1200px) {
  .ptech { display: grid; grid-template-columns: minmax(0, 1fr) var(--col) minmax(0, 1fr); column-gap: 48px; padding-inline: var(--gutter); }
  .ptech .pbody { grid-column: 2; grid-row: 1; width: auto; }
  .ptech .toc { grid-column: 3; grid-row: 1; width: auto; max-width: 260px; align-self: start; position: sticky; top: 104px; margin-top: clamp(40px, 4.4vw, 64px); }
}

.pend { margin-top: clamp(48px, 5.6vw, 80px); display: flex; flex-direction: column; gap: 40px; }
.also-substack { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }
.also-substack a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: .2em; }
.pend__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.bio { flex-direction: row; gap: 24px; align-items: flex-start; background: var(--espresso); border: 0; }
.bio:hover { transform: none; background: var(--espresso); }
.bio .ph { width: 88px; flex: none; aspect-ratio: 1; border-radius: 50%; }
.bio__name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.bio__role { margin-top: 2px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-soft); }
.bio p { margin-top: 12px; color: var(--paper-soft); font-size: 16px; }
.bio .links-row { margin-top: 16px; }
.btn--sm { padding: 10px 18px; font-size: 15px; }
.more { display: flex; flex-direction: column; }
.more h2 { font-size: 28px; letter-spacing: -0.02em; margin-bottom: 12px; }
.more h2 em { font-style: normal; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); margin-left: 8px; font-weight: 400; }
.more > a { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.more > a:last-of-type { border-bottom: 1px solid var(--line); }
.more .ph { width: 10px; height: 44px; aspect-ratio: auto; border: 0; border-radius: var(--radius-pill); background: var(--nb); flex: none; }
.more__s { display: flex; flex-direction: column; gap: 2px; }
.more__m { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }
.more__t { font-size: 18px; font-weight: 600; }
.more__none { color: var(--paper-soft); }
.nl { background: var(--espresso); border: 0; }
.nl:hover { transform: none; background: var(--espresso); }
.nl__kick { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--paper); }
.nl__kick i { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); }
.nl__title { font-size: clamp(26px, 2.22vw, 32px); letter-spacing: -0.02em; }
.nl p { color: var(--paper-soft); font-size: 16px; }
.nlform { display: flex; flex-wrap: wrap; gap: 10px; }
.nlform .search { flex: 1 1 220px; background: var(--ink); }
.nl__small { font-size: 12px; letter-spacing: .08em; color: var(--paper-soft); }

/* ---------- Search dialog (blog pages) ---------- */
.search-dialog { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: 12vh 16px 16px; }
.search-dialog[hidden] { display: none; }
.search-dialog__scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 80%, transparent); backdrop-filter: blur(6px); }
.search-dialog__panel {
  position: relative; width: min(100%, 640px); max-height: 76vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--espresso); color: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5);
}
.search-dialog__bar { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.search-dialog__bar .search { flex: 1; min-width: 0; background: var(--ink); }
.search-dialog__close { min-height: 44px; padding: 0 12px; }
.search-dialog__cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.schip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--copper); background: transparent; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
}
.schip i { width: 8px; height: 8px; border-radius: 50%; background: var(--nb); }
.schip[aria-pressed="true"] { background: var(--nb-fill); border-color: var(--nb-fill); color: var(--ink); }
.schip[aria-pressed="true"] i { background: var(--ink); }
.search-dialog__body { overflow-y: auto; padding: 8px 8px 12px; }
.search-dialog__count { padding: 8px 10px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-soft); }
.res { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 10px; border-radius: 12px; }
.res[aria-selected="true"], .res:hover { background: var(--ink); color: var(--paper); }
.res__s { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.res .clab { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-soft); display: flex; align-items: center; gap: 8px; }
.res .clab i { width: 6px; height: 6px; border-radius: 50%; background: var(--nb); }
.res__t { font-size: 17px; font-weight: 600; }
.res__m { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-soft); white-space: nowrap; }
.search-dialog__empty { padding: 16px 10px; color: var(--paper-soft); }
.search-dialog__foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-soft); }
.search-dialog__foot > span { display: flex; gap: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 120; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: var(--radius-pill); background: var(--espresso); color: var(--paper); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 13px; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Contact and 404
   ========================================================================== */
.contact-hero { position: relative; padding-top: clamp(48px, 5.6vw, 80px); overflow: hidden; }
.contact-hero .container { position: relative; display: flex; flex-direction: column; gap: 40px; }
.contact-orbits { position: absolute; right: 60px; top: 20px; width: 420px; height: 420px; pointer-events: none; }
.contact-hero h1 { font-size: clamp(76px, 12.5vw, 180px); line-height: .84; letter-spacing: -0.06em; font-weight: 800; position: relative; }
.contact-hero__intro { max-width: 640px; font-size: clamp(19px, 1.67vw, 24px); line-height: 1.45; color: var(--paper-soft); position: relative; }
.email-link--xl { align-self: flex-start; gap: 20px; font-size: clamp(26px, 4.45vw, 64px); font-weight: 600; letter-spacing: -0.035em; border-bottom-width: 3px; padding-bottom: 8px; position: relative; }
.social-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 48px 0 0; padding: 0; list-style: none; }
.social-tiles > li { display: flex; }
.social-tile { width: 100%; padding: 28px; gap: 40px; min-height: 180px; }
.social-tile__label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--paper); }
.social-tile__label--copper { color: var(--copper-text); }
.social-tile__handle { margin-top: auto; font-size: clamp(20px, 1.67vw, 24px); font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; }

.notfound { padding-top: clamp(56px, 8vw, 120px); }
.notfound .container { display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.notfound h1 { font-size: clamp(64px, 10.83vw, 156px); line-height: .84; letter-spacing: -0.055em; font-weight: 800; }
.notfound p { max-width: 560px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (hover: none) {
  /* a tap leaves :hover stuck on touch screens; don't leave cards tilted or scaled */
  .card:hover, .tilt:hover { transform: none; }
}

@media (max-width: 1200px) {
  .blog-orbits { width: 260px; height: 260px; right: 24px; opacity: .6; }
  .contact-orbits { width: 320px; height: 320px; right: 24px; opacity: .7; }
}

@media (max-width: 1024px) {
  .home-hero__text, .moon,
  .about-teaser__side, .about-teaser__main,
  .about-hero__text, .about-art,
  .story__label, .story__body,
  .projects-hero__text, .tally { grid-column: 1 / -1; }
  .moon { max-width: 460px; }
  .about-art { max-width: 360px; }
  .tally { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .bento, .post-row, .proj-grid, .post-grid, .nb-grid, .nb-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento__lx1 { grid-column: 1 / -1; }
  .post-row > :last-child:nth-child(odd), .nb-grid > :last-child:nth-child(odd), .nb-links > :last-child:nth-child(odd) { grid-column: 1 / -1; }

  .timeline { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-left: 48px; }
  .timeline::before { left: 11px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; background: linear-gradient(180deg, var(--copper), var(--paper), var(--copper), var(--ember)); }
  .timeline__dot { position: absolute; left: -48px; top: 0; }
  .timeline__step { gap: 12px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .browse__bar { flex-direction: column; align-items: stretch; }
  .searchbox .search { flex: 1; width: auto; }
  .social-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-orbits { right: -80px; top: -40px; width: 280px; height: 280px; opacity: .5; }
}

@media (max-width: 640px) {
  .grid12 { grid-template-columns: minmax(0, 1fr); }
  .grid12 > * { grid-column: 1 / -1 !important; }

  /* the nav collapses to a Menu button + theme toggle, still a centered pill (without JS the links stay visible) */
  .js .nav-menu {
    display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 20px; border: 0;
    border-radius: var(--radius-pill); background: transparent; color: var(--paper); font-size: 15px; font-weight: 600;
  }
  .js .nav-menu:hover { background: var(--ink); }
  .js .nav-menu svg { transition: transform .2s; }
  .js .site-nav.is-open .nav-menu svg { transform: rotate(180deg); }
  .js .nav-links {
    display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    min-width: 240px; flex-direction: column; gap: 4px; padding: 8px;
    background: var(--espresso); border: 1px solid var(--line); border-radius: var(--radius-md);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .45);
  }
  .js .site-nav.is-open .nav-links { display: flex; }
  .js .nav-links a { justify-content: center; padding: 12px 20px; }
  html:not(.js) .site-nav { overflow-x: auto; }

  .home-hero h1 { margin-top: 20px; }
  .hero-actions > * { flex: 1 1 auto; justify-content: center; }
  .moon { max-width: 400px; }
  .bento, .post-row, .proj-grid, .post-grid, .nb-grid, .nb-links, .facts, .social-tiles { grid-template-columns: minmax(0, 1fr); }
  .bento > *, .post-row > *, .nb-grid > *, .nb-links > * { grid-column: auto !important; }
  .bento__lx1 { grid-template-columns: minmax(0, 1fr); padding: 28px; }
  .bento > .card { padding: 28px; min-height: 240px; }
  .post-card { min-height: 360px; }
  .post-card__body { padding: 28px; }
  .post-card--compact { min-height: 0; }
  .proj-card { padding: 24px; min-height: 0; }
  .nb-card { min-height: 0; padding: 28px; }
  .social-tile { min-height: 132px; }
  .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; padding: 28px 0; }
  .row__kind { grid-column: 1 / -1; }
  .row__title { grid-column: 1; }
  .row .arrow { grid-column: 2; width: 28px; height: 28px; }
  .rss-cta .btn { width: 100%; justify-content: center; }
  .blog-orbits { width: 160px; height: 160px; right: -24px; top: -24px; opacity: .45; }
  .contact-orbits { width: 200px; height: 200px; right: -70px; top: -30px; opacity: .45; }
  .info { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .pbody ul li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .bio { flex-direction: column; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; }
  .social { gap: 0 20px; }
  .searchbox { flex-wrap: wrap; }
  .searchbox label { flex-basis: 100%; }
  .blogbar { gap: 0 16px; }
  .blogbar__tools { gap: 0 14px; letter-spacing: .06em; }
  .search-btn { padding: 0 12px; }
  .search-dialog { padding-top: 16px; }
  .search-dialog__hint { display: none !important; }
  .phero figcaption { flex-direction: column; gap: 4px; }
}
