/* ==========================================================================
   PALETTE "Ink & Paper", modern edition
   To swap palettes, change only the colour values in these three blocks.
   ========================================================================== */
:root {
  --paper: #FAF7F2;
  --ink: #1B1F23;
  --ink-soft: #4A525A;
  --rule: #E3DCCF;
  --accent: #A94A22;
  --accent-ink: #FFFFFF;       /* text on accent buttons */
  --accent-tint: #F1E3D8;
  --teal: #0F6B66;
  --teal-tint: #DCEBE8;
  --card: #FFFFFF;
  --band: #1B1F23;             /* dark colour blocks */
  --band-ink: #F4EFE7;
  --band-soft: #B9C0C6;
  --shadow: 0 1px 2px rgba(27, 31, 35, .06), 0 8px 24px rgba(27, 31, 35, .08);
  --shadow-lift: 0 2px 4px rgba(27, 31, 35, .08), 0 16px 40px rgba(27, 31, 35, .14);
  color-scheme: light;
}

/* Dark: chosen with the toggle */
:root[data-theme="dark"] {
  --paper: #15181B;
  --ink: #ECE7DF;
  --ink-soft: #A9B0B7;
  --rule: #2A2F34;
  --accent: #E48A5C;
  --accent-ink: #15181B;
  --accent-tint: #2E2219;
  --teal: #5CC2B6;
  --teal-tint: #15302D;
  --card: #1D2125;
  --band: #0E1012;
  --band-ink: #ECE7DF;
  --band-soft: #A9B0B7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* Dark: from the visitor's system setting (keep identical to the block above) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15181B;
    --ink: #ECE7DF;
    --ink-soft: #A9B0B7;
    --rule: #2A2F34;
    --accent: #E48A5C;
    --accent-ink: #15181B;
    --accent-tint: #2E2219;
    --teal: #5CC2B6;
    --teal-tint: #15302D;
    --card: #1D2125;
    --band: #0E1012;
    --band-ink: #ECE7DF;
    --band-soft: #A9B0B7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ==========================================================================
   Fonts (self-hosted, SIL Open Font License; see /fonts/LICENSE-*.txt)
   ========================================================================== */
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-latin-wght-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --serif: "Newsreader", Charter, "Sitka Text", Cambria, Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --text: 1.0625rem;
  --small: 0.9rem;
  --tiny: 0.8125rem;
  --h3: 1.1875rem;
  --h2: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem);
  --h1: clamp(2.6rem, 1.6rem + 4.2vw, 4.75rem);

  --page: 74rem;
  --measure: 40rem;
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text);
  line-height: 1.7;
  font-kerning: normal;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-family: var(--sans); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0 0 1em; }
p, li { text-wrap: pretty; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

[hidden] { display: none !important; }
.js .no-js-only { display: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -10rem; z-index: 100;
  padding: 0.6rem 1rem; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.page { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 48rem) { .page { padding-inline: 2rem; } }

/* ==========================================================================
   Buttons and chips
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.55rem 1.25rem;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600; line-height: 1.2; color: var(--ink);
  text-decoration: none; background: var(--card);
  border: 1.5px solid var(--ink-soft); border-radius: 999px; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s, border-color .2s;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--ink-soft); }
.btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.chips > li {
  padding: 0.3rem 0.85rem; border-radius: 999px;
  background: var(--accent-tint); color: var(--ink); font-size: var(--small); font-weight: 500; line-height: 1.4;
}
.chips--teal > li { background: var(--teal-tint); }

.kicker {
  margin: 0 0 0.5rem; color: var(--accent); font-size: var(--small); font-weight: 600; letter-spacing: 0.01em;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-header .page {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-block: 0.75rem;
}
.site-name {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 700; font-size: 1.125rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.site-name::before {
  content: ""; width: 2rem; height: 2rem; border-radius: 9px; flex: none;
  background: url("/images/brand/icon.svg") center / cover no-repeat;
}
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; font-size: 0.95rem; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: inline-block; padding: 0.4rem 0.85rem; border-radius: 999px;
  color: var(--ink); font-weight: 500; text-decoration: none;
  transition: background-color .2s;
}
.site-nav a:hover { background: var(--accent-tint); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.theme-toggle {
  min-height: 2.25rem; padding: 0.35rem 0.85rem; border-radius: 999px;
  border: 1.5px solid var(--ink-soft); background: transparent; cursor: pointer;
  font: inherit; font-size: var(--small); font-weight: 500; color: var(--ink-soft);
}
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }
@media (max-width: 47.99rem) {
  .site-header { position: static; }
  .site-header .page { padding-block: 0.6rem; }
  .site-nav { gap: 0.25rem 0.5rem; }
  .site-nav a { padding: 0.35rem 0.7rem; }
  .theme-toggle { min-height: 2rem; padding: 0.2rem 0.7rem; }
}

/* ==========================================================================
   Home: hero
   ========================================================================== */
.hero {
  display: grid; gap: 2.5rem; align-items: center;
  padding-top: 3rem; padding-bottom: 3rem;
}
@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 4rem; padding-top: 5rem; padding-bottom: 4.5rem; }
}
.hero h1 { font-size: var(--h1); letter-spacing: -0.035em; line-height: 1; margin: 1.1rem 0 0.9rem; }
.oneliner {
  margin: 0 0 1.25rem; font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); line-height: 1.3; color: var(--accent);
}
.hero-lede { max-width: 36rem; font-size: 1.125rem; color: var(--ink-soft); }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 1.5rem; }
.status { margin: 0; font-size: var(--small); line-height: 1.6; color: var(--ink-soft); }

.hero-photo { position: relative; margin: 0 auto; width: min(100%, 24rem); }
.photo-frame { position: relative; }
.photo-frame::before {
  content: ""; position: absolute; inset: 1.25rem -1.25rem -1.25rem 1.25rem; z-index: 0;
  border-radius: 32px; background: var(--teal-tint);
  transform: rotate(3deg);
}
.photo-frame img {
  position: relative; z-index: 1; width: 100%;
  border-radius: 28px; box-shadow: var(--shadow-lift);
}
.badge {
  position: absolute; z-index: 2; left: -1rem; bottom: 3.5rem; margin: 0;
  display: flex; flex-direction: column; padding: 0.7rem 1rem; border-radius: 16px;
  background: var(--card); box-shadow: var(--shadow-lift); font-size: var(--tiny); line-height: 1.35; color: var(--ink-soft);
}
.badge strong { color: var(--ink); font-size: 0.95rem; }
.hero-photo figcaption { margin-top: 1.75rem; font-size: var(--tiny); color: var(--ink-soft); text-align: center; }

/* Entrance: a single, gentle sequence on load */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-text > * { animation: rise .7s var(--ease) both; }
.hero-text > :nth-child(2) { animation-delay: .06s; }
.hero-text > :nth-child(3) { animation-delay: .12s; }
.hero-text > :nth-child(4) { animation-delay: .18s; }
.hero-text > :nth-child(5) { animation-delay: .24s; }
.hero-text > :nth-child(6) { animation-delay: .3s; }
.hero-photo { animation: rise .9s .15s var(--ease) both; }

/* Numbers strip */
.stats ul {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem;
  margin: 0; padding: 0; list-style: none;
}
.stats li {
  display: flex; flex-direction: column; gap: 0.2rem; padding: 1.25rem 1.4rem;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stats strong { font-size: 2.25rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--teal); }
.stats span { font-size: var(--small); color: var(--ink-soft); line-height: 1.4; }

/* ==========================================================================
   Sections
   ========================================================================== */
.sec { margin-top: 5rem; }
.sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: 1.75rem; }
.sec-head h2, .sec h2 { font-size: var(--h2); }
.sec-head .kicker { width: 100%; }
.more { font-weight: 600; font-size: 0.95rem; }

/* Inner pages: each section is a card */
main.page { padding-bottom: 2rem; }
main.page > .sec {
  margin-top: 1.5rem; padding: 1.75rem 1.4rem;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
@media (min-width: 48rem) { main.page > .sec { padding: 2.5rem 3rem; } }
main.page > .sec .sec-body { max-width: 46rem; }
main.page > .sec h2 { margin-bottom: 1.25rem; }
.sec-mark { margin: 0 0 0.35rem; color: var(--accent); font-size: var(--small); font-weight: 600; }
.sec h3 { margin: 2rem 0 0.6rem; font-size: var(--h3); }
.sec h3:first-of-type { margin-top: 0.5rem; }

/* Inner page hero */
.page-head {
  position: relative; overflow: hidden;
  margin-top: 1.75rem; padding: 2.5rem 1.5rem 2.25rem;
  border-radius: 28px; background: var(--accent-tint);
}
.page-head::after {
  content: ""; position: absolute; right: -4rem; top: -4rem; width: 16rem; height: 16rem;
  border-radius: 50%; background: var(--teal-tint); opacity: .9; z-index: 0;
}
.page-head > * { position: relative; z-index: 1; max-width: 46rem; }
.page-head h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 3.75rem); letter-spacing: -0.03em; margin-bottom: 0.9rem; }
.page-head .lede, .page-head p { font-size: 1.125rem; color: var(--ink-soft); }
.page-head .status { font-size: var(--small); }
@media (min-width: 48rem) { .page-head { padding: 3.75rem 3rem 3.25rem; } }

.note { font-size: var(--small); color: var(--ink-soft); }
.flag { font-style: italic; font-weight: 600; color: var(--accent); }
.me { font-weight: 700; }
.sec-body ul.plain { margin: 0 0 1em; padding-left: 1.2rem; }
.sec-body ul.plain li { margin-bottom: 0.35rem; }

/* ==========================================================================
   Home: cards and tiles
   ========================================================================== */
.cards { display: grid; gap: 1.25rem; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.5rem 1.5rem 1.4rem; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card-label { margin: 0; font-size: var(--tiny); font-weight: 600; color: var(--teal); }
.card-title { font-size: 1.1rem; line-height: 1.35; letter-spacing: -0.01em; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); } /* whole card is clickable */
.card-title a:hover { color: var(--accent); }
.card-text { margin: auto 0 0; font-size: var(--small); color: var(--ink-soft); }

.tiles { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.tile { padding: 1.4rem; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.tile h3 { margin: 0.9rem 0 0.35rem; font-size: 1.05rem; }
.tile p { margin: 0; font-size: var(--small); color: var(--ink-soft); }
.icon {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 14px;
  background: var(--accent-tint);
}
.icon::before {
  content: ""; width: 1.5rem; height: 1.5rem; background-color: var(--accent);
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.tile:nth-child(even) .icon { background: var(--teal-tint); }
.tile:nth-child(even) .icon::before { background-color: var(--teal); }
.icon-teach { --icon: url("/images/icons/teach.svg"); }
.icon-code { --icon: url("/images/icons/code.svg"); }
.icon-travel { --icon: url("/images/icons/travel.svg"); }
.icon-web { --icon: url("/images/icons/web.svg"); }
.icon-paw { --icon: url("/images/icons/paw.svg"); }

/* ==========================================================================
   Dark band: "Currently", drawn as a pavement section
   ========================================================================== */
.band { margin-top: 5rem; padding-block: 4rem; background: var(--band); color: var(--band-ink); }
.band .kicker { color: var(--accent); }
:root:not([data-theme="dark"]) .band .kicker { color: #F0A57E; }
.band-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 60rem) { .band-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 4rem; } }
.band h2 { font-size: var(--h2); color: var(--band-ink); margin-bottom: 1rem; }
.band-intro p { color: var(--band-soft); }

.layers { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255, 255, 255, .12); }
.layers ul { margin: 0; padding: 0; list-style: none; }
.layer { display: grid; grid-template-columns: 3rem minmax(0, 1fr); column-gap: 1.1rem; background: rgba(255, 255, 255, .03); }
.layer + .layer { border-top: 1px solid rgba(255, 255, 255, .12); }
.layer::before {
  content: ""; grid-row: 1 / span 2; background-color: var(--band-soft); opacity: .55;
  -webkit-mask: var(--hatch) repeat; mask: var(--hatch) repeat;
}
.layer--surface::before { background-color: #F0A57E; opacity: .9; }
.layer-name { padding-top: 1rem; font-size: var(--tiny); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--band-soft); }
.layer-text { margin: 0; padding: 0.15rem 1.25rem 1.1rem 0; color: var(--band-ink); }
@media (min-width: 40rem) {
  .layer { grid-template-columns: 4rem 7rem minmax(0, 1fr); }
  .layer::before { grid-row: 1; }
  .layer-name, .layer-text { padding-block: 1.15rem; }
}
.layer--surface  { --hatch: url("/images/hatch/surface.svg"); }
.layer--binder   { --hatch: url("/images/hatch/binder.svg"); }
.layer--base     { --hatch: url("/images/hatch/base.svg"); }
.layer--subgrade { --hatch: url("/images/hatch/subgrade.svg"); }

/* ==========================================================================
   Research: publications
   ========================================================================== */
.publist { margin: 0; padding: 0; list-style: none; counter-reset: pub; }
.publist > li { position: relative; counter-increment: pub; padding: 1.1rem 0 1.1rem 3rem; border-top: 1px solid var(--rule); }
.publist > li:first-child { border-top: 0; }
.publist > li::before {
  content: counter(pub);
  position: absolute; left: 0; top: 1.1rem; display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--teal-tint); color: var(--teal); font-size: var(--tiny); font-weight: 700;
}
.publist.nonum > li { padding-left: 0; }
.publist.nonum > li::before { content: none; }
.cite { margin: 0; line-height: 1.55; }
.cite-title { font-weight: 600; }
.cite-src { margin: 0.35rem 0 0; font-size: var(--small); color: var(--ink-soft); overflow-wrap: anywhere; }

/* About: timeline */
.timeline { position: relative; margin: 0; padding: 0 0 0 1.75rem; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 0.45rem; top: 0.5rem; bottom: 0.5rem; width: 2px; background: var(--rule); }
.timeline > li { position: relative; padding: 0 0 2rem; }
.timeline > li::before {
  content: ""; position: absolute; left: -1.75rem; top: 0.3rem; width: 1rem; height: 1rem; border-radius: 50%;
  background: var(--card); border: 3px solid var(--accent);
}
.timeline > li:nth-child(even)::before { border-color: var(--teal); }
.when { margin: 0 0 0.2rem; font-size: var(--tiny); font-weight: 600; color: var(--teal); }
.what h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.what p, .what ul { margin: 0.35rem 0 0; }
.what ul { padding-left: 1.1rem; }
.what li { margin-bottom: 0.3rem; }

/* Label and value pairs */
.pairs { display: grid; gap: 0.75rem; margin: 0; }
.pairs > div { padding: 1rem 1.2rem; border-radius: var(--radius-sm); background: var(--paper); }
.pairs dt { font-size: var(--tiny); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.pairs dd { margin: 0.2rem 0 0; }
@media (min-width: 40rem) { .pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ==========================================================================
   Writing
   ========================================================================== */
.tag-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; padding: 0; border: 0; }
.tag-filter legend { width: 100%; margin-bottom: 0.5rem; padding: 0; font-size: var(--small); color: var(--ink-soft); }
.post-list { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.post-list > li { padding: 1.25rem 1.4rem; border-radius: var(--radius-sm); background: var(--paper); }
.post-list h3 { margin: 0; font-size: 1.2rem; }
.post-list h3 a { color: var(--ink); text-decoration: none; }
.post-list h3 a:hover { color: var(--accent); }
.post-list p { margin: 0.35rem 0 0; }
.post-meta { font-size: var(--small); color: var(--ink-soft); }
.post-meta a { color: var(--ink-soft); }
.empty {
  display: flex; align-items: center; gap: 1rem; margin: 0; padding: 1.25rem 1.4rem; border-radius: var(--radius-sm);
  background: var(--teal-tint); font-weight: 500;
}
.post-list:has(li) ~ .empty { display: none; }

.post-body { max-width: var(--measure); font-size: 1.125rem; }
.post-body h2 { font-size: 1.5rem; margin: 2.25rem 0 0.75rem; }
.post-body h3 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; }
.post-body ul, .post-body ol { padding-left: 1.25rem; margin: 0 0 1em; }
.post-body li { margin-bottom: 0.35rem; }
.post-body blockquote { margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.1rem; border-left: 4px solid var(--accent); font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--ink-soft); }
.post-body figure { margin: 1.75rem 0; }
.post-body img { border-radius: var(--radius-sm); }
.post-body code { font-family: Consolas, "Cascadia Mono", Menlo, monospace; font-size: 0.875em; background: var(--accent-tint); padding: 0.1em 0.35em; border-radius: 6px; }
.post-body pre { overflow-x: auto; padding: 1rem 1.25rem; background: var(--band); color: var(--band-ink); border-radius: var(--radius-sm); font-size: 0.9375rem; line-height: 1.55; }
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-nav { display: grid; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: var(--small); }
@media (min-width: 40rem) { .post-nav { grid-template-columns: 1fr 1fr; } .post-nav .next { text-align: right; } }
.fig-caption { margin-top: 0.6rem; font-size: var(--tiny); color: var(--ink-soft); }

/* ==========================================================================
   404
   ========================================================================== */
.lost { display: grid; gap: 2rem; align-items: center; padding-block: 3rem 1rem; }
@media (min-width: 48rem) { .lost { grid-template-columns: minmax(0, 1fr) 18rem; } }
.lost-code { margin: 0; font-size: clamp(5rem, 3rem + 10vw, 9rem); font-weight: 700; line-height: .9; letter-spacing: -0.05em; color: var(--accent); }
.lost h1 { font-size: var(--h2); margin: 0.75rem 0 0.75rem; }
.lost img { width: 100%; max-width: 18rem; margin-inline: auto; }
.link-list { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }

/* ==========================================================================
   Footer (dark block)
   ========================================================================== */
.site-footer { margin-top: 6rem; background: var(--band); color: var(--band-soft); font-size: var(--small); line-height: 1.65; }
.footer-grid { display: grid; gap: 2rem; padding-block: 3.5rem 3rem; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem; } }
.foot-h { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 700; color: var(--band-ink); letter-spacing: 0; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { padding-block: 0.15rem; }
.site-footer a { color: var(--band-ink); text-decoration-color: rgba(255, 255, 255, .35); }
.site-footer a:hover { text-decoration-color: currentColor; }
.site-footer p { margin: 0 0 0.75rem; }
.site-footer .btn { background: transparent; color: var(--band-ink); border-color: rgba(255, 255, 255, .35); }
.site-footer .btn:hover { border-color: var(--band-ink); box-shadow: none; }
.email-result { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.email-result a { font-size: 1rem; font-weight: 600; }
.js .site-footer { padding-bottom: 250px; } /* room for Bruno and his kennel at the end of the page */
@media (max-width: 40rem) { .js .site-footer { padding-bottom: 160px; } }
@media (min-width: 64rem) { .js .site-footer { padding-bottom: 300px; } }

/* ==========================================================================
   Scroll reveal (only when main.js has started; skipped for reduced motion)
   ========================================================================== */
.reveal-ready .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-ready .reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Bruno, the dog (built by /js/bruno.js; absent when JavaScript is off)
   ========================================================================== */
.bruno {
  position: fixed; right: 0.25rem; bottom: 0; z-index: 60;
  width: 320px; height: 245px;
  pointer-events: none;                       /* only Bruno himself is clickable, not the empty space */
  visibility: hidden; opacity: 0; transition: opacity .6s var(--ease);
}
.bruno.is-here { visibility: visible; opacity: 1; }
@media (max-width: 40rem) { .bruno { width: 196px; height: 150px; right: 0; } }
@media (min-width: 64rem) { .bruno { width: 384px; height: 294px; } }
.bruno canvas, .bruno-poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.bruno-poster { object-fit: contain; }

/* An invisible button that follows Bruno around the canvas */
.bruno-dog {
  position: absolute; left: 58%; top: 12%; width: 36%; height: 80%;
  min-width: 44px; min-height: 44px;
  padding: 0; border: 0; border-radius: 28px; background: transparent; cursor: pointer;
  pointer-events: auto;
}
.bruno-dog:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Little comic words: "Woof!", "Achoo!" */
.bruno-sfx {
  position: absolute; left: 70%; top: 15%; z-index: 1;
  padding: 0.2rem 0.7rem; border-radius: 999px;
  background: var(--card); color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--shadow);
  font-family: var(--sans); font-size: 0.95rem; font-weight: 700; line-height: 1.2; white-space: nowrap;
  opacity: 0; transform: translate(-50%, -100%) scale(.5);
  transition: opacity .18s, transform .3s cubic-bezier(.3, 1.6, .5, 1);
  pointer-events: none;
}
.bruno-sfx.is-on { opacity: 1; transform: translate(-50%, -100%) scale(1); }

/* Speech bubble */
.bruno-bubble {
  position: fixed; right: 1rem; bottom: 212px; z-index: 61;
  width: min(22rem, calc(100vw - 2rem)); max-height: calc(100vh - 240px); overflow-y: auto;
  padding: 1rem 1.1rem 0.85rem; border-radius: 20px 20px 6px 20px;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-lift);
  border: 1px solid var(--rule);
  font-size: var(--small); line-height: 1.55;
  animation: pop .35s var(--ease) both;
}
@media (max-width: 40rem) { .bruno-bubble { bottom: 128px; max-height: calc(100vh - 150px); } }
@media (min-width: 64rem) { .bruno-bubble { bottom: 252px; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.bruno-name { margin: 0 0 0.25rem; font-size: var(--tiny); font-weight: 700; color: var(--teal); }
.bruno-say { margin: 0 0 0.5rem; font-size: 1rem; line-height: 1.5; color: var(--ink); }
.bruno-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0 0 0.6rem; font-size: var(--tiny); color: var(--ink-soft); }
.bruno-meta:empty { display: none; }
.bruno-meta a { color: var(--ink-soft); }
.bruno-note { font-style: italic; }
.bruno-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.25rem 0 0.5rem; }
.bruno-chips .btn { min-height: 2.25rem; padding: 0.35rem 0.85rem; font-size: var(--small); font-weight: 500; text-align: left; }
.bruno-foot { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.35rem; padding-top: 0.5rem; border-top: 1px solid var(--rule); }
.bruno-link {
  min-height: 1.75rem; padding: 0.15rem 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: var(--tiny); color: var(--ink-soft); text-decoration: underline; text-underline-offset: 0.2em;
}
.bruno-link:hover { color: var(--ink); }

/* ==========================================================================
   Holding site (until 2027): a headline and Bruno's construction stage
   ========================================================================== */
.hold-hero { max-width: 48rem; padding-top: 2.75rem; }
@media (min-width: 60rem) { .hold-hero { padding-top: 4rem; } }
.hold-hero h1 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4.2rem); line-height: 1.02; letter-spacing: -0.035em; margin: 0.5rem 0 1rem; }
.hold-lede { max-width: 40rem; font-size: 1.15rem; color: var(--ink-soft); }
.hold-hero .cta { margin-top: 1.25rem; }

.stage {
  position: relative; margin-top: 1.25rem;
  width: 100%; aspect-ratio: 2 / 1; min-height: 300px; max-height: 560px;
  border-radius: 28px; overflow: hidden;
  background: linear-gradient(to bottom, var(--teal-tint) 0 62%, var(--accent-tint) 62% 100%);
}
@media (max-width: 40rem) { .stage { aspect-ratio: 16 / 10.5; min-height: 220px; border-radius: 20px; } }
.stage canvas, .stage .bruno-poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.stage .bruno-poster { object-fit: contain; }
.stage canvas { opacity: 0; transition: opacity .6s var(--ease); }   /* invisible until Bruno is fully ready */
.stage.is-here canvas { opacity: 1; }
.stage .bruno-bubble {
  position: absolute; top: 0.9rem; right: 0.9rem; bottom: auto; z-index: 2;
  width: min(22rem, calc(100% - 1.8rem)); max-height: calc(100% - 1.8rem);
}
.bruno-bubble.is-below {
  position: relative; top: auto; right: auto; bottom: auto;
  width: 100%; max-height: none; margin-top: 0.75rem;
}
.stage-nojs { position: absolute; left: 0; right: 0; bottom: 1rem; margin: 0; text-align: center; color: var(--ink-soft); }

.holding-page .site-footer { margin-top: 3rem; }
.js .holding-page .site-footer { padding-bottom: 0; }
.hold-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 2rem 2.5rem; }
.hold-foot p { margin: 0; }
/* ==========================================================================
   Reduced motion: everything still works, nothing moves
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal-ready .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  :root { --paper: #fff; --ink: #000; --ink-soft: #333; --rule: #bbb; --accent: #000; --card: #fff; --shadow: none; }
  .site-header { position: static; }
  .site-nav, .theme-toggle, .skip-link, .site-footer, .no-js-only, .tag-filter, .bruno, .bruno-bubble, .hero-photo, .cta { display: none !important; }
  body { font-size: 11pt; line-height: 1.45; }
  a { color: inherit; text-decoration: none; }
  main.page > .sec { box-shadow: none; padding: 0.5rem 0; }
  .page-head { background: none; padding: 0; }
  .page-head::after { content: none; }
  .publist > li, .timeline > li, .pairs > div { break-inside: avoid; }
  .reveal-ready .reveal { opacity: 1; transform: none; }
}
