/*
 * THEME TOKENS — tweakcn "Vintage Paper" (https://tweakcn.com/editor/theme?theme=vintage-paper)
 *
 * This is the ONLY file that defines raw colors, font stacks, radius, and shadows.
 * It follows the shadcn/tweakcn variable contract, so to change the theme:
 *   1. Export a theme from tweakcn (Code → CSS, any color format).
 *   2. Replace the `:root { … }` and `.dark { … }` blocks below with the export.
 *      Drop the `@theme inline { … }` block — this site doesn't use Tailwind.
 *   3. If the fonts changed, update `fonts_url` in web/site.json.
 * Components never use raw values; they only read these variables (see base.css
 * for the derived site-level roles). Full procedure: .claude/skills/site-design/SKILL.md
 */

:root {
  --background: #f5f1e6;
  --foreground: #4a3f35;
  --card: #fffcf5;
  --card-foreground: #4a3f35;
  --popover: #fffcf5;
  --popover-foreground: #4a3f35;
  --primary: #a67c52;
  --primary-foreground: #ffffff;
  --secondary: #e2d8c3;
  --secondary-foreground: #5c4d3f;
  --muted: #ece5d8;
  --muted-foreground: #7d6b56;
  --accent: #d4c8aa;
  --accent-foreground: #4a3f35;
  --destructive: #b54a35;
  --destructive-foreground: #ffffff;
  --border: #dbd0ba;
  --input: #dbd0ba;
  --ring: #a67c52;
  --chart-1: #a67c52;
  --chart-2: #8d6e4c;
  --chart-3: #735a3a;
  --chart-4: #b3906f;
  --chart-5: #c0a080;
  --sidebar: #ece5d8;
  --sidebar-foreground: #4a3f35;
  --sidebar-primary: #a67c52;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #d4c8aa;
  --sidebar-accent-foreground: #4a3f35;
  --sidebar-border: #dbd0ba;
  --sidebar-ring: #a67c52;
  --font-sans: Libre Baskerville, serif;
  --font-serif: Lora, serif;
  --font-mono: IBM Plex Mono, monospace;
  --radius: 0.25rem;
  --shadow-2xs: 2px 3px 5px 0px hsl(28 13% 20% / 0.06);
  --shadow-xs: 2px 3px 5px 0px hsl(28 13% 20% / 0.06);
  --shadow-sm: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 1px 2px -1px hsl(28 13% 20% / 0.12);
  --shadow: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 1px 2px -1px hsl(28 13% 20% / 0.12);
  --shadow-md: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 2px 4px -1px hsl(28 13% 20% / 0.12);
  --shadow-lg: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 4px 6px -1px hsl(28 13% 20% / 0.12);
  --shadow-xl: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 8px 10px -1px hsl(28 13% 20% / 0.12);
  --shadow-2xl: 2px 3px 5px 0px hsl(28 13% 20% / 0.30);
  --tracking-normal: 0em;
  --spacing: 0.25rem;
}

.dark {
  --background: #2d2621;
  --foreground: #ece5d8;
  --card: #3a322c;
  --card-foreground: #ece5d8;
  --popover: #3a322c;
  --popover-foreground: #ece5d8;
  --primary: #c0a080;
  --primary-foreground: #2d2621;
  --secondary: #4a4039;
  --secondary-foreground: #ece5d8;
  --muted: #312b26;
  --muted-foreground: #c5bcac;
  --accent: #59493e;
  --accent-foreground: #ece5d8;
  --destructive: #b54a35;
  --destructive-foreground: #ffffff;
  --border: #4a4039;
  --input: #4a4039;
  --ring: #c0a080;
  --chart-1: #c0a080;
  --chart-2: #b3906f;
  --chart-3: #a67c52;
  --chart-4: #8d6e4c;
  --chart-5: #735a3a;
  --sidebar: #2d2621;
  --sidebar-foreground: #ece5d8;
  --sidebar-primary: #c0a080;
  --sidebar-primary-foreground: #2d2621;
  --sidebar-accent: #59493e;
  --sidebar-accent-foreground: #ece5d8;
  --sidebar-border: #4a4039;
  --sidebar-ring: #c0a080;
}

/*
 * BASE — site-level roles derived from theme.css, reset, typography, layout primitives.
 *
 * Rules for editing:
 *  - Never write a raw color here or in components.css. Derive from theme tokens
 *    (var(--primary), color-mix(...)) so any tweakcn theme drops in unchanged.
 *  - Typography roles live in the "Typography roles" block: remap them to change
 *    which theme font is used for headings, body copy, and UI labels.
 */

/* ---------- Site roles (derived; safe to tune) ---------- */
:root {
  /* Typography roles → theme fonts. Swap these to re-assign fonts site-wide. */
  --font-heading: var(--font-sans);
  --font-body: var(--font-serif);
  --font-ui: var(--font-mono);

  /* Fluid type scale (min @ 360px → max @ 1280px). */
  --step--2: clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.45vw, 1.45rem);
  --step-2: clamp(1.44rem, 1.25rem + 0.9vw, 1.9rem);
  --step-3: clamp(1.73rem, 1.4rem + 1.6vw, 2.6rem);
  --step-4: clamp(2.07rem, 1.5rem + 2.8vw, 3.6rem);
  --step-5: clamp(2.4rem, 1.5rem + 4.2vw, 4.6rem);
  --leading-tight: 1.15;
  --leading-body: 1.7;
  --tracking-ui: 0.08em;

  /* Spacing is a multiple of the theme's --spacing unit. */
  --space-1: calc(var(--spacing) * 1);
  --space-2: calc(var(--spacing) * 2);
  --space-3: calc(var(--spacing) * 3);
  --space-4: calc(var(--spacing) * 4);
  --space-6: calc(var(--spacing) * 6);
  --space-8: calc(var(--spacing) * 8);
  --space-12: calc(var(--spacing) * 12);
  --space-16: calc(var(--spacing) * 16);
  --space-24: calc(var(--spacing) * 24);
  --section-gap: clamp(3.5rem, 2.5rem + 5vw, 7rem);

  /* Layout */
  --container: 72rem;
  --prose: 42rem;
  --gutter: clamp(1rem, 0.6rem + 2.4vw, 2.5rem);
  --header-height: 4rem;
  --radius-sm: calc(var(--radius) * 0.5);
  --radius-lg: calc(var(--radius) * 2);
  --radius-pill: 999px;

  /* Accessible derived colors. Primary text/links are mixed toward foreground so
     they keep ≥ 4.5:1 contrast on light paper backgrounds. */
  --link: color-mix(in oklab, var(--primary) 60%, var(--foreground));
  --primary-strong: color-mix(in oklab, var(--primary) 60%, var(--foreground));
  --primary-strong-foreground: var(--primary-foreground);
  --rule: color-mix(in oklab, var(--border) 70%, transparent);
  --selection: color-mix(in oklab, var(--primary) 30%, transparent);
  --header-bg: color-mix(in oklab, var(--background) 82%, transparent);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 150ms;
  --duration: 250ms;
  --duration-theme: 600ms;

  /* Paper grain overlay (set to 0 to disable). */
  --grain-opacity: 0.5;

  color-scheme: light;
}

.dark {
  --link: var(--primary);
  --primary-strong: var(--primary);
  --grain-opacity: 0.25;
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-height) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-normal);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
body > main { flex: 1; }
img, picture, video, svg, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--selection); }

/* Paper grain: an SVG noise texture laid over the page, tinted by blend mode. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.28 0 0 0 0 0.2 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.dark body::before { mix-blend-mode: soft-light; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  font-weight: 700;
  text-wrap: balance;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-4); font-weight: 400; letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); font-weight: 400; }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); }
p { text-wrap: pretty; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
strong, b { font-weight: 700; }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.9em; }
small { font-size: var(--step--1); }
.lede { font-size: var(--step-1); line-height: 1.55; color: var(--muted-foreground); max-width: 38em; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Layout primitives ---------- */
.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.container--prose { width: min(var(--prose), 100% - 2 * var(--gutter)); }
.stack > * + * { margin-block-start: var(--stack-gap, var(--space-4)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--space-2)); }
.grid {
  display: grid;
  gap: var(--grid-gap, clamp(1rem, 0.5rem + 2vw, 2rem));
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-min, 18rem)), 1fr));
}
.section { padding-block: var(--section-gap); }
.section + .section, .hero + .section { padding-block-start: 0; }
main > .section:last-child { padding-block-end: 0; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Theme change animation ----------
 * site.js uses the View Transitions API to reveal the new theme in a circle
 * expanding from the toggle. Browsers without it get a short cross-fade via
 * the .theme-transition class. Reduced-motion users get an instant switch. */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 1; }
.theme-transition, .theme-transition *, .theme-transition *::before, .theme-transition *::after {
  transition: background-color var(--duration-theme) var(--ease-out),
              color var(--duration-theme) var(--ease-out),
              border-color var(--duration-theme) var(--ease-out),
              fill var(--duration-theme) var(--ease-out) !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/*
 * COMPONENTS — one block per component, in the order listed below.
 * Markup for each lives in web/templates/components.html (Jinja macros) and the
 * live catalog is at http://127.0.0.1:8000/styleguide while the CMS runs.
 *
 * Naming: BEM-ish. `.block`, `.block__part`, `.block--variant`. State via ARIA
 * attributes (aria-pressed, aria-current) or data-* attributes, never extra classes.
 * Colors/fonts/radii/shadows must come from tokens (theme.css / base.css).
 *
 *  1. Skip link            8. Chip / chip list / filter chip
 *  2. Site header + nav    9. Card (project card)
 *  3. Theme toggle        10. Index card (catalog summary)
 *  4. Icon                11. Principles (numbered list)
 *  5. Button              12. Breadcrumbs
 *  6. Eyebrow + meta      13. Article (head, media frame, prose, foot)
 *  7. Section + page head 14. Empty state, 15. Site footer, 16. Reveal motion
 *                         17. Notice bar, 18. Model card (extends 10)
 *                         19. Resume (page + PDF print layout)
 */

/* 1. Skip link ------------------------------------------------------------ */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--foreground);
  color: var(--background);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-3); }

/* 2. Site header + nav ---------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.3) blur(12px);
  backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}
.site-header[data-scrolled] { border-bottom-color: var(--rule); box-shadow: var(--shadow-xs); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--header-height);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  color: var(--foreground);
  font-family: var(--font-heading);
  font-size: var(--step-0);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.brand__mark {
  display: grid;
  place-items: center;
  inline-size: 2.1rem;
  block-size: 2.1rem;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: transform var(--duration) var(--ease-out), background-color var(--duration);
}
.brand:hover .brand__mark { transform: rotate(-6deg); background: var(--muted); }
.nav { display: flex; align-items: center; gap: var(--space-1); }
.nav__list { display: flex; gap: var(--space-1); list-style: none; padding: 0; }
.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius);
  color: var(--foreground);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-ui);
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--duration-fast), box-shadow var(--duration-fast);
}
.nav__link:hover { background: var(--muted); }
.nav__link[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--primary); border-radius: 0; }
@media (max-width: 27.5rem) {
  .brand__mark { display: none; }
  .nav__link { padding: 0 var(--space-2); }
}
/* Smallest phones: the monogram replaces the full name so the nav fits. */
@media (max-width: 22.5rem) {
  .brand__mark { display: grid; }
  .brand__name { display: none; }
}

/* 3. Theme toggle --------------------------------------------------------- */
.theme-toggle {
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  margin-inline-start: var(--space-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-2xs);
  transition: border-color var(--duration-fast), transform var(--duration) var(--ease-out);
}
.theme-toggle:hover { border-color: var(--primary); transform: rotate(12deg); }
.theme-toggle .icon { grid-area: 1 / 1; transition: transform 500ms var(--ease-out), opacity 300ms var(--ease-out); }
.theme-toggle .icon--sun { opacity: 0; transform: rotate(-90deg) scale(0.4); }
.dark .theme-toggle .icon--sun { opacity: 1; transform: none; }
.dark .theme-toggle .icon--moon { opacity: 0; transform: rotate(90deg) scale(0.4); }

/* 4. Icon ----------------------------------------------------------------- */
.icon { flex: none; inline-size: 1.15em; block-size: 1.15em; }

/* 5. Button --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--duration-fast), border-color var(--duration-fast),
              box-shadow var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .icon { transition: transform var(--duration) var(--ease-out); }
.btn:hover .icon--arrow-right { transform: translateX(3px); }
.btn:hover .icon--download { transform: translateY(2px); }
.btn:hover .icon--arrow-left { transform: translateX(-3px); }
.btn--primary { background: var(--primary-strong); color: var(--primary-strong-foreground); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: color-mix(in oklab, var(--primary-strong) 88%, var(--foreground)); box-shadow: var(--shadow-md); }
.btn--secondary { background: var(--card); color: var(--card-foreground); border-color: var(--border); box-shadow: var(--shadow-2xs); }
.btn--secondary:hover { border-color: var(--primary); background: var(--muted); }
.btn--ghost { background: transparent; color: var(--link); padding-inline: var(--space-1); }
.btn--ghost:hover { transform: none; text-decoration: underline; text-underline-offset: 0.3em; }
.btn--danger { background: transparent; color: var(--destructive); border-color: color-mix(in oklab, var(--destructive) 45%, var(--border)); }
.btn--danger:hover { background: var(--destructive); border-color: var(--destructive); color: var(--destructive-foreground); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
@media (max-width: 30rem) { .btn--block-mobile { flex: 1 1 100%; } }

/* 6. Eyebrow + meta ------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  color: var(--muted-foreground);
}

/* 7. Section + page head -------------------------------------------------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-block-end: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  padding-block-end: var(--space-4);
  border-bottom: 1px solid var(--rule);
}
.section-head__title { font-size: var(--step-3); }
.page-head { padding-block: clamp(2.5rem, 1.5rem + 5vw, 5rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.page-head__title { font-size: var(--step-5); margin-block: var(--space-2) var(--space-4); }

/* 8. Chip / chip list / filter chip --------------------------------------- */
.chip-list { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-family: var(--font-ui);
  font-size: var(--step--2);
  letter-spacing: 0.03em;
  line-height: 1.6;
  white-space: nowrap;
  text-decoration: none;
}
a.chip:hover { border-color: var(--primary); }
.filter-bar {
  display: flex;
  gap: var(--space-2);
  margin-block-start: var(--space-6);
  padding: var(--space-1) var(--gutter) var(--space-2);
  margin-inline: calc(var(--gutter) * -1);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--gutter), #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--gutter), #000 calc(100% - 2.5rem), transparent);
}
.filter-bar::-webkit-scrollbar { display: none; }
@media (min-width: 48rem) {
  .filter-bar { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; -webkit-mask-image: none; mask-image: none; }
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  min-height: 40px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--card-foreground);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  scroll-snap-align: start;
  transition: background-color var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}
.filter-chip:hover { border-color: var(--primary); }
.filter-chip[aria-pressed="true"] { background: var(--foreground); border-color: var(--foreground); color: var(--background); }
.filter-chip__count { font-size: var(--step--2); opacity: 0.7; }
.filter-status { margin-block-start: var(--space-4); font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted-foreground); }

/* 9. Card ----------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out),
              border-color var(--duration) var(--ease-out);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in oklab, var(--primary) 45%, var(--border)); }
.card:has(.card__link:focus-visible) { outline: 2px solid var(--ring); outline-offset: 3px; }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--muted); border-bottom: 1px solid var(--border); }
.card__media img { inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.card:hover .card__media img { transform: scale(1.035); }
.card__placeholder {
  display: grid;
  place-items: center;
  block-size: 100%;
  color: var(--muted-foreground);
  font-family: var(--font-heading);
  font-size: var(--step-5);
  background: repeating-linear-gradient(to bottom, transparent 0 1.4rem, var(--rule) 1.4rem calc(1.4rem + 1px));
}
.card__body { display: flex; flex: 1; flex-direction: column; gap: var(--space-2); padding: clamp(1rem, 0.8rem + 1vw, 1.5rem); }
.card__title { font-size: var(--step-1); }
.card__link { color: inherit; text-decoration: none; }
.card__link:focus-visible { outline: none; }
.card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: var(--step--1);
  line-height: 1.6;
}
.card__body .chip-list { margin-block-start: auto; padding-block-start: var(--space-2); }

/* 10. Index card ---------------------------------------------------------- */
.index-card {
  position: relative;
  padding: var(--space-6);
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  transform: rotate(-1.25deg);
  transition: transform 500ms var(--ease-out);
}
.index-card:hover { transform: rotate(0deg); }
.index-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-block-end: var(--space-3);
  border-bottom: 2px solid color-mix(in oklab, var(--destructive) 55%, transparent);
}
.index-card__rows { margin-block: var(--space-2) var(--space-4); }
.index-card__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-2);
  border-bottom: 1px solid var(--rule);
}
.index-card__row dt { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted-foreground); }
.index-card__row dd { text-align: end; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Phones: keep only the topic links so the work itself stays near the top. */
@media (max-width: 55.99rem) {
  .index-card { transform: none; padding: var(--space-4); box-shadow: var(--shadow-sm); }
  .index-card__rows { display: none; }
  .index-card__head { margin-block-end: var(--space-3); }
}

/* 11. Principles ---------------------------------------------------------- */
.principles { display: grid; gap: clamp(1.5rem, 1rem + 2vw, 3rem); list-style: none; padding: 0; counter-reset: principle; }
@media (min-width: 48rem) { .principles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.principle { padding-block-start: var(--space-4); border-top: 2px solid var(--foreground); }
.principle::before {
  counter-increment: principle;
  content: "No. " counter(principle, decimal-leading-zero);
  display: block;
  margin-block-end: var(--space-3);
  font-family: var(--font-ui);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  color: var(--muted-foreground);
}
.principle__title { font-size: var(--step-2); font-weight: 400; margin-block-end: var(--space-2); }
.principle__text { color: var(--muted-foreground); }

/* 12. Breadcrumbs --------------------------------------------------------- */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  font-family: var(--font-ui);
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.breadcrumbs li { display: inline-flex; gap: var(--space-2); min-width: 0; }
.breadcrumbs li + li::before { content: "/"; color: var(--muted-foreground); }
.breadcrumbs a { color: var(--muted-foreground); text-decoration: none; }
.breadcrumbs a:hover { color: var(--foreground); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 13. Article ------------------------------------------------------------- */
.article-head { padding-block: clamp(2rem, 1.25rem + 3vw, 4rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.article-head__kicker { margin-block-start: var(--space-8); }
.article-head__title { font-size: var(--step-4); margin-block: var(--space-4) var(--space-4); }
.article-head .lede { margin-block-end: var(--space-6); }
.container--wide { width: min(60rem, 100% - 2 * var(--gutter)); margin-inline: auto; }
.media-frame {
  overflow: hidden;
  margin-block-end: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.media-frame img { inline-size: 100%; max-block-size: 75vh; object-fit: cover; }
.media-frame--video { aspect-ratio: 16 / 9; }
.media-frame--video video, .media-frame--video iframe { inline-size: 100%; block-size: 100%; border: 0; background: #000; }
.prose { font-size: var(--step-0); line-height: var(--leading-body); }
.prose > * + * { margin-block-start: 1.25em; }
.prose > p:first-child::first-letter {
  float: left;
  padding: 0.08em 0.12em 0 0;
  font-family: var(--font-heading);
  font-size: 3.3em;
  line-height: 0.8;
  color: var(--primary-strong);
}
.prose h2 { font-size: var(--step-2); margin-block-start: 2em; }
.prose h3 { font-size: var(--step-1); margin-block-start: 1.75em; }
.prose h4 { font-size: var(--step-0); margin-block-start: 1.5em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-block-start: 0.6em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li + li { margin-block-start: 0.4em; }
.prose li::marker { color: var(--primary-strong); }
.prose img, .prose video { border-radius: var(--radius); margin-inline: auto; }
.prose figure { margin-inline: 0; }
.prose figcaption { margin-block-start: var(--space-2); color: var(--muted-foreground); font-size: var(--step--1); text-align: center; }
.prose audio, .prose video { inline-size: 100%; max-inline-size: 100%; }
.prose iframe { display: block; inline-size: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }
.prose iframe[src*="spotify.com"], .prose iframe[src*="soundcloud.com"] { aspect-ratio: auto; min-block-size: 160px; }
.prose [id] { scroll-margin-block-start: var(--space-8); }
.prose blockquote {
  padding-inline-start: 1.25em;
  border-inline-start: 3px solid var(--primary);
  color: var(--muted-foreground);
  font-style: italic;
  font-size: var(--step-1);
}
.prose mark { padding: 0 0.15em; background: color-mix(in oklab, var(--primary) 30%, transparent); color: inherit; }
.prose hr { border: 0; text-align: center; color: var(--muted-foreground); }
.prose hr::before { content: "❦"; font-size: 1.4em; }
.prose code { padding: 0.1em 0.35em; border-radius: var(--radius-sm); background: var(--muted); }
.prose pre { overflow-x: auto; padding: var(--space-4); border-radius: var(--radius); background: var(--muted); line-height: 1.5; }
.prose pre code { padding: 0; background: none; }
.prose table { display: block; overflow-x: auto; max-inline-size: 100%; border-collapse: collapse; font-size: var(--step--1); }
.prose th, .prose td { padding: var(--space-2) var(--space-3); border: 1px solid var(--border); text-align: start; vertical-align: top; }
.prose th { background: var(--muted); font-family: var(--font-ui); font-weight: 500; }
.article-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-block-start: clamp(2.5rem, 2rem + 2vw, 4rem);
  padding-block-start: var(--space-6);
  border-top: 1px solid var(--rule);
}

/* 14. Empty state --------------------------------------------------------- */
.empty-state {
  padding: var(--space-12) var(--space-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--muted-foreground);
}

/* 15. Site footer --------------------------------------------------------- */
.site-footer {
  margin-block-start: var(--section-gap);
  padding-block: clamp(2.5rem, 2rem + 2vw, 3.5rem) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--card);
  color: var(--card-foreground);
  font-size: var(--step--1);
}
.site-footer__grid { display: grid; gap: var(--space-8); }
@media (min-width: 48rem) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer__name { font-family: var(--font-heading); font-size: var(--step-1); font-weight: 700; margin-block-end: var(--space-2); }
.site-footer__blurb { max-width: 36ch; color: var(--muted-foreground); }
.site-footer__list { list-style: none; padding: 0; margin-block-start: var(--space-3); }
.site-footer__list a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; color: var(--card-foreground); text-decoration: none; }
.site-footer__list a:hover { color: var(--link); text-decoration: underline; }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  margin-block-start: var(--space-8);
  padding-block-start: var(--space-4);
  border-top: 1px solid var(--rule);
  font-family: var(--font-ui);
  font-size: var(--step--2);
  color: var(--muted-foreground);
}
.site-footer__bottom a { color: inherit; }

/* 16. Reveal motion ------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: reveal 700ms var(--ease-out) both; animation-delay: var(--reveal-delay, 0ms); }
  @keyframes reveal { from { opacity: 0; transform: translateY(14px); } }
}

/* 17. Notice bar -------------------------------------------------------- */
.notice-bar {
  border-bottom: 1px solid color-mix(in oklab, var(--primary) 40%, var(--border));
  background: color-mix(in oklab, var(--primary) 14%, var(--background));
  color: var(--foreground);
  font-size: var(--step--1);
}
.notice-bar__inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); padding-block: var(--space-3); }
.notice-bar .eyebrow { color: var(--foreground); }

/* 18. Model card (extends 10. Index card) -------------------------------- */
.model-card__name { margin-block: var(--space-4) var(--space-2); font-family: var(--font-heading); font-size: var(--step-2); line-height: var(--leading-tight); }
.model-card__status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.2rem 0.7rem;
  border: 1px solid color-mix(in oklab, var(--primary) 45%, var(--border));
  border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--primary) 12%, var(--card));
  font-family: var(--font-ui);
  font-size: var(--step--1);
}
.model-card__dot {
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-radius: 50%;
  background: var(--primary-strong);
  animation: model-card-pulse 2.4s var(--ease-out) infinite;
}
@keyframes model-card-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--primary) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 0.45rem transparent; }
}
.model-card .index-card__rows { margin-block-start: var(--space-4); }
.model-card [data-since-format="version"] { text-transform: none; }
.model-card dd small { font-family: var(--font-ui); font-size: var(--step--2); color: var(--muted-foreground); }
.model-card dd a { color: inherit; text-decoration-color: var(--primary); }
.model-card__label { margin-block-end: var(--space-2); }
.model-card__label--spaced { margin-block-start: var(--space-6); }
.model-card__best-for { font-size: var(--step--1); line-height: 1.55; text-wrap: pretty; }
.skill-list { display: grid; gap: var(--space-3); list-style: none; padding: 0; }
.skill { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3); align-items: baseline; font-family: var(--font-ui); font-size: var(--step--1); }
.skill__value { font-size: var(--step--2); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.skill__track { grid-column: 1 / -1; block-size: 0.5rem; overflow: hidden; border-radius: var(--radius-pill); background: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.skill__fill { display: block; block-size: 100%; inline-size: calc(var(--level) * 1%); border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-strong)); }
@media (prefers-reduced-motion: no-preference) {
  .skill__fill { transform-origin: left; animation: skill-fill 900ms var(--ease-out) 400ms both; }
  @keyframes skill-fill { from { transform: scaleX(0); } }
}
@media (max-width: 55.99rem) {
  .model-card .index-card__rows { display: block; }
  .model-card__latest { display: none; }
}

/* Page: home hero (composition of components) ----------------------------- */
.hero { padding-block: clamp(3rem, 1.5rem + 7vw, 7.5rem) var(--section-gap); }
.hero__grid { display: grid; gap: clamp(2.5rem, 1rem + 5vw, 5rem); align-items: center; }
@media (min-width: 56rem) { .hero__grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }
/* Sized from the hero column (container units) so each headline line — split with
   "\n" in site.json — stays on one line on desktop: ~8cqi fits ~12em of text. */
.hero__copy { container-type: inline-size; }
.hero__title { font-size: clamp(2rem, 8cqi, 4.6rem); max-width: none; margin-block: var(--space-4) var(--space-6); }
.hero__actions { margin-block-start: var(--space-8); --cluster-gap: var(--space-3); }

/* 19. Resume (page + PDF) -------------------------------------------------
 * One markup (components.html: resume_*) serves the web page and the PDF that
 * publishing/resume_pdf.py prints from web/templates/resume-print.html. The PDF
 * uses `.resume--print` (fixed point sizes, no chrome); the same rules apply when
 * a visitor prints the web page from their browser (@media print at the end). */
.resume-page { padding-block-end: var(--space-8); }
.resume-layout { display: grid; gap: var(--space-8); }
@media (min-width: 64rem) { .resume-layout { grid-template-columns: 11.5rem minmax(0, 1fr); gap: var(--space-12); } }
.resume-toc { display: none; }
@media (min-width: 64rem) {
  .resume-toc { display: block; position: sticky; top: calc(var(--header-height) + var(--space-8)); align-self: start; padding-block-start: clamp(2.5rem, 1.5rem + 5vw, 5rem); }
}
.resume-toc ul { display: grid; gap: var(--space-1); margin-block-start: var(--space-3); padding: 0; list-style: none; }
.resume-toc a {
  display: block;
  padding: var(--space-1) 0 var(--space-1) var(--space-3);
  border-inline-start: 2px solid var(--rule);
  color: var(--muted-foreground);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: 1.4;
  text-decoration: none;
}
.resume-toc a { transition: color var(--duration-fast), border-color var(--duration-fast), background-color var(--duration-fast); }
.resume-toc a:hover { border-color: var(--primary); color: var(--foreground); }
.resume-toc a[aria-current] { border-color: var(--primary-strong); background: color-mix(in oklab, var(--primary) 14%, transparent); color: var(--foreground); font-weight: 500; }
.resume { max-inline-size: 48rem; }
.resume-head { padding-block: clamp(1.5rem, 1rem + 2vw, 2.5rem) var(--space-4); }
.resume-head__name { margin-block: var(--space-2) var(--space-3); font-size: var(--step-5); }
.resume-head__headline { font-family: var(--font-ui); font-size: var(--step-0); line-height: 1.5; color: var(--muted-foreground); text-wrap: balance; }
.resume-head__contact { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); margin-block-start: var(--space-4); padding: 0; list-style: none; font-family: var(--font-ui); font-size: var(--step--1); }
.resume-head__actions { margin-block-start: var(--space-6); }
.resume-head__updated { margin-block-start: var(--space-4); font-family: var(--font-ui); font-size: var(--step--2); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.resume-section { margin-block-start: clamp(2rem, 1.5rem + 2vw, 3.25rem); scroll-margin-block-start: calc(var(--header-height) + var(--space-4)); }
.resume-section__title { margin-block-end: var(--space-6); padding-block-end: var(--space-3); border-bottom: 1px solid var(--rule); font-size: var(--step-2); }
.resume-entries { display: grid; gap: clamp(1.5rem, 1rem + 2vw, 2.25rem); margin: 0; padding: 0; list-style: none; }
.resume-entry__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-4); row-gap: var(--space-1); align-items: baseline; margin-block-end: var(--space-3); }
.resume-entry__org { font-size: var(--step-1); }
.resume-entry__dates, .resume-entry__place { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted-foreground); text-align: end; }
.resume-entry__dates { grid-column: 2; grid-row: 1; white-space: nowrap; }
.resume-entry__role { grid-column: 1; font-style: italic; }
.resume-entry__place { grid-column: 2; }
@media (max-width: 35.99rem) {
  .resume-entry__head { grid-template-columns: minmax(0, 1fr); }
  .resume-entry__dates, .resume-entry__place { grid-column: 1; grid-row: auto; text-align: start; }
  .resume-entry__dates { order: 2; }
}
.resume-prose > * + * { margin-block-start: 0.85em; }
.resume-prose ul, .resume-prose ol { padding-inline-start: 1.3em; }
.resume-prose ul { list-style: disc; }
.resume-prose ol { list-style: decimal; }
.resume-prose li + li { margin-block-start: 0.5em; }
.resume-prose li::marker { color: var(--primary-strong); }
.resume-prose li > p + p { margin-block-start: 0.4em; }
.resume-prose code { padding: 0.1em 0.35em; border-radius: var(--radius-sm); background: var(--muted); }
.resume-section .chip-list { gap: var(--space-2); }

/* PDF layout: point sizes, since fluid viewport units mean nothing on paper. */
.resume-doc { display: block; min-height: 0; background: none; color: var(--card-foreground); font-size: 9.5pt; line-height: 1.4; }
.resume-doc::before { display: none; }
.resume--print { max-inline-size: none; }
.resume--print .resume-head { padding-block: 0 4pt; }
.resume--print .resume-head__name { margin-block: 0 4pt; font-size: 26pt; letter-spacing: 0.02em; text-transform: uppercase; }
.resume--print .resume-head__headline { font-size: 9.5pt; letter-spacing: 0.04em; }
.resume--print .resume-head__contact { margin-block-start: 6pt; font-size: 9pt; }
.resume--print .resume-section { margin-block-start: 11pt; }
.resume--print .resume-section__title { margin-block-end: 7pt; padding-block-end: 3pt; font-family: var(--font-ui); font-size: 9.5pt; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; break-after: avoid; }
.resume--print .resume-entries { gap: 9pt; }
.resume--print .resume-entry__head { margin-block-end: 3pt; break-after: avoid; }
.resume--print .resume-entry__org { font-size: 11pt; }
.resume--print .resume-entry__dates, .resume--print .resume-entry__place { font-size: 8.5pt; }
.resume--print .resume-prose li { break-inside: avoid; }
.resume--print .resume-prose li + li { margin-block-start: 2.5pt; }
.resume--print .resume-prose > * + * { margin-block-start: 4pt; }
.resume--print .chip { padding: 0 6pt; font-size: 8pt; }
.resume--print .chip-list { gap: 4pt; }
.resume--print a { color: inherit; text-decoration: none; }

@media print {
  .site-header, .site-footer, .skip-link, .notice-bar, .breadcrumbs, .resume-toc, .resume-head__actions { display: none !important; }
  body { background: none; }
  body::before { display: none; }
  .reveal { animation: none; }
  .resume-entry__head { break-after: avoid; }
  .resume-prose li { break-inside: avoid; }
}
