/* Warm editorial theme: off-white canvas, near-black ink, heavy Inter headings,
   a cyan accent and a mustard highlighter. Dark follows the system setting.
   The site-wide rule still holds: a dashed outline means planned, a solid one means it exists.
   check.py reads the colour names in the first two :root blocks; keep those names. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --paper: #faf6f3;
  --wash: #f3ede8;
  --ink: #1c1c18;
  --muted: #6b645e;
  --rule: #e7e1dc;
  --line: #8f8780;
  --accent: #0b6e8e;
  --ok: #15803d;
  --warn: #8a5a00;

  --card-bg: #ffffff;
  --cyan: #38c5f3;
  --highlight: #eab91f;
  --nav-bg: rgba(250, 246, 243, 0.86);
  --shadow-card: 0 1px 2px rgba(28, 28, 24, 0.05), 0 8px 24px -12px rgba(28, 28, 24, 0.12);
  --shadow-lift: 0 2px 4px rgba(28, 28, 24, 0.06), 0 20px 40px -16px rgba(28, 28, 24, 0.22);

  /* The dark band (projects) uses the dark palette in both themes. */
  --night-paper: #1c1c18;
  --night-wash: #262622;
  --night-ink: #f5f3f0;
  --night-muted: #a8a29e;
  --night-rule: #34342f;
  --night-line: #77716b;
  --night-accent: #38c5f3;
  --night-ok: #4ade80;
  --night-warn: #eab91f;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-hero: clamp(2.75rem, 1.9rem + 3.6vw, 4.75rem);
  --text-3xl: clamp(2rem, 1.5rem + 2vw, 3.1rem);
  --radius: 16px;
  --radius-lg: 24px;
  --nav-h: 68px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1c18;
    --wash: #262622;
    --ink: #f5f3f0;
    --muted: #a8a29e;
    --rule: #34342f;
    --line: #77716b;
    --accent: #38c5f3;
    --ok: #4ade80;
    --warn: #eab91f;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --card-bg: #262622;
    --nav-bg: rgba(28, 28, 24, 0.86);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.45), 0 20px 40px -16px rgba(0, 0, 0, 0.7);
  }
}

/* ------------------------------------------------------------------ base */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3, h4 { line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; }

a { color: var(--accent); text-decoration-thickness: 0.07em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

mark {
  background: var(--highlight);
  color: #1c1c18;
  padding: 0 0.12em;
  border-radius: 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

code { font-size: 0.9em; background: var(--wash); padding: 0.1em 0.35em; border-radius: 5px; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

.skip { position: absolute; left: -999px; top: 0; z-index: 200; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }

.icon { width: 1.05em; height: 1.05em; flex: none; }

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.35rem; border-radius: 999px;
  font-weight: 600; font-size: 0.975rem; text-decoration: none; line-height: 1;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-dark { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-card); }
.btn-dark:hover { box-shadow: var(--shadow-lift); }
.btn-accent { background: var(--cyan); color: #1c1c18; }
.btn-ghost { color: var(--ink); border: 1.5px solid var(--rule); background: var(--card-bg); }
.btn-ghost:hover { border-color: var(--ink); }

.text-link { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ nav */

.site-head {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav-bar { display: flex; align-items: center; gap: 1.5rem; min-height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark {
  display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 9px;
  background: var(--ink); color: var(--paper); font-weight: 900; font-size: 0.85rem; letter-spacing: -0.04em;
  position: relative;
}
.brand-mark::after { content: ""; position: absolute; right: 4px; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; gap: 0.25rem; }
.site-nav a { display: block; padding: 0.45rem 0.8rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: color 0.2s, background-color 0.2s; }
.site-nav a:hover { color: var(--ink); background: var(--wash); }
.nav-cta { padding: 0.65rem 1.1rem; font-size: 0.9rem; }

@media (max-width: 860px) {
  .nav-bar { flex-wrap: wrap; gap: 0.5rem 1rem; padding-block: 0.6rem; min-height: 0; }
  .nav-cta { margin-left: auto; }
  .site-nav { order: 3; width: 100%; margin: 0 -0.5rem; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 0.35rem 0.7rem; font-size: 0.9rem; white-space: nowrap; }
}

/* -------------------------------------------------------------- shared */

.section { padding-block: clamp(4rem, 8vw, 7rem); }
.section-alt { background: var(--card-bg); border-block: 1px solid var(--rule); }

.eyebrow { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.section-title { font-size: var(--text-3xl); font-weight: 900; letter-spacing: -0.035em; line-height: 1.12; max-width: 22ch; margin-bottom: 1.25rem; }
.section-lede { font-size: 1.15rem; color: var(--muted); max-width: var(--measure); }
.sub-title { font-size: 1.5rem; font-weight: 800; margin: 3.5rem 0 1.25rem; }
.prose { max-width: var(--measure); }
.note { font-size: 0.9rem; color: var(--muted); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips li {
  font-size: 0.82rem; font-weight: 600; padding: 0.3rem 0.7rem; border-radius: 999px;
  background: var(--wash); color: var(--ink); border: 1px solid var(--rule);
}
.chips--quiet li { font-weight: 500; color: var(--muted); background: transparent; }

/* ---------------------------------------------------------------- hero */

.hero { padding-top: clamp(3rem, 7vw, 6rem); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-bottom: clamp(3rem, 6vw, 5rem); }
.hero-title { font-size: var(--text-hero); font-weight: 900; letter-spacing: -0.045em; line-height: 1.12; margin-bottom: 1.5rem; }
.hero-title mark, .section-title mark, .page-top mark { padding-block: 0.02em; }
.hero-lede { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem); color: var(--muted); max-width: 34rem; line-height: 1.6; margin-bottom: 2rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }
.hero-meta { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.95rem; }

.hero-card {
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--card-bg); border: 1px solid var(--rule); box-shadow: var(--shadow-lift);
  transform: rotate(2.5deg); transition: transform 0.6s var(--ease);
}
.hero-card:hover { transform: rotate(0.75deg) scale(1.01); }
.hero-card-top {
  position: relative; min-height: 15rem; padding: 1.5rem; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(56, 197, 243, 0.38), transparent 60%),
    radial-gradient(90% 90% at 0% 100%, rgba(234, 185, 31, 0.42), transparent 60%),
    #1c1c18;
  color: #f5f3f0;
}
.pill { display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start; margin: 0; padding: 0.35rem 0.8rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-size: 0.8rem; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.2); }
.monogram { margin: 0; font-size: clamp(5rem, 4rem + 4vw, 7.5rem); font-weight: 900; letter-spacing: -0.07em; line-height: 0.9; }
.hero-card-rows { margin: 0; padding: 0.5rem 1.5rem 1rem; }
.hero-card-rows div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding-block: 0.8rem; border-bottom: 1px solid var(--rule); }
.hero-card-rows div:last-child { border-bottom: 0; }
.hero-card-rows dt { color: var(--muted); font-size: 0.875rem; }
.hero-card-rows dd { margin: 0; font-weight: 600; font-size: 0.95rem; line-height: 1.4; }

.strip { border-block: 1px solid var(--rule); padding-block: 1.6rem; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.strip-track { display: flex; width: max-content; animation: strip 70s linear infinite; }
.strip:hover .strip-track { animation-play-state: paused; }
.strip ul { list-style: none; display: flex; gap: 2.75rem; padding-right: 2.75rem; }
.strip li { font-size: 1.15rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.strip li::before { content: "/"; color: var(--cyan); margin-right: 0.6rem; font-weight: 800; }
@keyframes strip { to { transform: translateX(-50%); } }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card { transform: rotate(1.25deg); max-width: 28rem; }
}

/* --------------------------------------------------------------- about */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.prose-lg { font-size: 1.15rem; color: var(--muted); }
.prose-lg p:first-child { color: var(--ink); }
.stats { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 3.5rem; }
.stats li { background: var(--card-bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-card); }
.stats strong { display: block; font-size: clamp(2.25rem, 1.8rem + 1.5vw, 3rem); font-weight: 900; letter-spacing: -0.05em; line-height: 1; margin-bottom: 0.6rem; }
.stats span { color: var(--muted); font-size: 0.92rem; line-height: 1.45; display: block; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------- experience */

.timeline { list-style: none; position: relative; margin-top: 3rem; }
.timeline::before { content: ""; position: absolute; left: 1.25rem; top: 0.5rem; bottom: 0.5rem; width: 2px; background: var(--rule); }
.role { position: relative; display: grid; grid-template-columns: 2.5rem 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.role-mark {
  position: relative; z-index: 1; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 12px;
  background: var(--ink); color: var(--paper); font-weight: 800; font-size: 0.85rem; letter-spacing: -0.02em; margin-top: 1.25rem;
}
.role:first-child .role-mark { background: var(--cyan); color: #1c1c18; }
.role-card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.5rem 1.75rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
.role-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line); }
.role-when { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 0.4rem; }
.role-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.25rem; }
.role-org { color: var(--accent); font-weight: 600; margin-bottom: 1rem; }
.role-points { padding-left: 1.1rem; margin-bottom: 1.25rem; color: var(--muted); }
.role-points li { margin-bottom: 0.4rem; padding-left: 0.2rem; }
.role-points li::marker { color: var(--line); }

.edu-grid { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.edu-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.5rem; }
.edu-year { display: inline-block; font-size: 0.8rem; font-weight: 700; color: #1c1c18; background: var(--highlight); padding: 0.15rem 0.55rem; border-radius: 6px; margin-bottom: 0.9rem; }
.edu-card h4 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.4rem; line-height: 1.25; }
.edu-card p { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .edu-grid { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------- skills */

.skill-grid { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2.5rem; }
.skill-card { background: var(--card-bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow-card); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.skill-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.skill-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 1.1rem; }
@media (max-width: 760px) { .skill-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ projects */

.section-dark {
  --paper: var(--night-paper);
  --wash: var(--night-wash);
  --ink: var(--night-ink);
  --muted: var(--night-muted);
  --rule: var(--night-rule);
  --line: var(--night-line);
  --accent: var(--night-accent);
  --ok: var(--night-ok);
  --warn: var(--night-warn);
  --card-bg: var(--night-wash);
  background: var(--paper);
  color: var(--ink);
}

.standing { margin: 2.5rem 0 0; padding: 1.5rem 1.75rem; border: 1.5px dashed var(--line); border-radius: var(--radius); max-width: 52rem; }
.standing > p:first-child { margin-bottom: 1.25rem; }
.key { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 1rem; margin: 0 0 1rem; align-items: center; }
.key dd { margin: 0; color: var(--muted); font-size: 0.95rem; }
.standing .note { margin: 0; }

.status {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 0.22rem 0.65rem; border-radius: 999px; white-space: nowrap; border: 1.5px solid;
}
.status--design { color: var(--warn); border-style: dashed; background: transparent; }
.status--demo { color: var(--accent); border-style: solid; }
.status--runnable { color: var(--paper); background: var(--ok); border-color: var(--ok); }

.loop { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; margin: 1.5rem 0 0.75rem; counter-reset: step; }
.loop li { counter-increment: step; position: relative; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; }
.loop li::before { content: "0" counter(step); display: block; font-size: 0.78rem; font-weight: 700; color: var(--muted); margin-bottom: 0.35rem; }
.loop a { display: block; font-size: 1.2rem; font-weight: 800; color: var(--ink); text-decoration: none; }
.loop a:hover { color: var(--accent); }
.loop span { display: block; font-size: 0.88rem; color: var(--muted); margin-top: 0.2rem; }
.loop-note { font-size: 0.9rem; color: var(--muted); }
@media (max-width: 900px) { .loop { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .loop { grid-template-columns: 1fr; } }

.projects { list-style: none; }
.project { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding-block: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--rule); }
.project-num { font-size: 0.85rem; font-weight: 700; color: var(--accent); margin-bottom: 0.6rem; letter-spacing: 0.08em; }
.project-title { font-size: clamp(2rem, 1.5rem + 2.2vw, 3.25rem); font-weight: 900; letter-spacing: -0.04em; margin-bottom: 1rem; }
.project-title a { color: var(--ink); text-decoration: none; }
.project-title a:hover { text-decoration: underline; text-decoration-color: var(--highlight); text-decoration-thickness: 0.12em; }
.project-claim { color: var(--muted); font-size: 1.05rem; margin: 1rem 0 1.25rem; max-width: 36rem; }
.project .chips { margin-bottom: 1.5rem; }
.project .links { margin: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; }

.project-visual { border: 1.5px dashed var(--line); border-radius: var(--radius-lg); background: var(--wash); padding: 0 1.5rem 1.25rem; transition: transform 0.4s var(--ease); }
.project-visual.is-built { border-style: solid; }
.project:hover .project-visual { transform: translateY(-4px) rotate(-0.5deg); }
.window-bar { display: flex; align-items: center; gap: 0.4rem; padding-block: 1rem; margin: 0 0 0.5rem; border-bottom: 1px solid var(--rule); }
.window-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); }
.window-bar span:first-child { background: var(--highlight); }
.window-bar span:nth-child(2) { background: var(--cyan); }
.window-bar em { margin-left: auto; font-style: normal; font-size: 0.8rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mini-flow { list-style: none; counter-reset: flow; }
.mini-flow li { counter-increment: flow; display: flex; align-items: center; gap: 0.75rem; padding-block: 0.55rem; font-weight: 600; font-size: 0.98rem; }
.mini-flow li::before { content: counter(flow); display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px dashed var(--line); font-size: 0.75rem; color: var(--muted); flex: none; }
.window-caption { margin: 0.75rem 0 0; font-size: 0.82rem; color: var(--muted); }
@media (max-width: 900px) { .project { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- contact */

.contact { max-width: 52rem; }
.contact-list { list-style: none; margin-top: 2rem; border-top: 1px solid var(--rule); }
.contact-list li { border-bottom: 1px solid var(--rule); }
.contact-link { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 0.25rem; color: var(--ink); font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 800; letter-spacing: -0.02em; text-decoration: none; transition: padding 0.3s var(--ease), color 0.2s; }
.contact-link:hover { padding-left: 0.75rem; color: var(--accent); }

/* -------------------------------------------------------------- footer */

.site-foot { border-top: 1px solid var(--rule); background: var(--card-bg); padding-block: 3.5rem 2rem; font-size: 0.95rem; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.foot-name { font-weight: 900; font-size: 1.2rem; letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.foot-brand p:not(.foot-name) { color: var(--muted); margin-bottom: 0.3rem; max-width: 30rem; }
.foot-head { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.site-foot ul { list-style: none; }
.site-foot li { margin-bottom: 0.45rem; }
.site-foot a { color: var(--ink); text-decoration: none; }
.site-foot a:hover { color: var(--accent); text-decoration: underline; }
.foot-base { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.875rem; }
.foot-base p { margin-bottom: 0.3rem; }
.foot-base a { color: var(--accent); text-decoration: underline; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* --------------------------------------------------------- project pages */

.article { max-width: 52rem; padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 6rem); }
.page-top { margin-bottom: 2.5rem; }
.page-top h1 { font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem); font-weight: 900; letter-spacing: -0.045em; margin-bottom: 1.25rem; }
.lede { font-size: 1.25rem; color: var(--muted); max-width: var(--measure); }
.back { margin-bottom: 1.5rem; font-size: 0.95rem; }
.back a { font-weight: 600; text-decoration: none; }
.back a::before { content: "← "; }
.back a:hover { text-decoration: underline; }

.article h2 { font-size: 1.75rem; font-weight: 900; letter-spacing: -0.03em; margin: 3.5rem 0 1.25rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.article h3 { font-size: 1.15rem; font-weight: 800; margin: 2rem 0 0.75rem; }

.ledger { display: grid; grid-template-columns: 7rem 1fr; margin: 0; background: var(--card-bg); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; }
.ledger dt, .ledger dd { padding: 1rem 1.25rem; border-bottom: 1px solid var(--rule); margin: 0; }
.ledger dt { font-weight: 700; color: var(--muted); font-size: 0.9rem; background: var(--wash); }
.ledger dt:last-of-type, .ledger dd:last-of-type { border-bottom: 0; }
.ledger dd p:last-child { margin-bottom: 0; }
.when { margin-left: 0.75rem; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 560px) { .ledger { grid-template-columns: 1fr; } .ledger dt { border-bottom: 0; padding-bottom: 0.25rem; } }

figure { margin: 0 0 1.5rem; }
.flow { list-style: none; counter-reset: flow; display: grid; gap: 0.75rem; }
.flow > li { counter-increment: flow; position: relative; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 1rem 1.25rem 1rem 3.5rem; background: var(--card-bg); }
.flow.is-built > li { border-style: solid; }
.flow > li::before { content: counter(flow); position: absolute; left: 1rem; top: 1rem; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 0.8rem; font-weight: 800; }
.flow strong { display: block; font-size: 1.05rem; margin-bottom: 0.2rem; }
.flow p { margin: 0; color: var(--muted); }
.systems { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.systems li { font-size: 0.82rem; font-weight: 600; padding: 0.25rem 0.65rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--wash); }
figcaption { margin-top: 0.75rem; font-size: 0.9rem; color: var(--muted); }

.how p, .prose p { max-width: var(--measure); }
.refs { padding-left: 1.2rem; }
.refs li { margin-bottom: 0.65rem; color: var(--muted); }
.refs li a { font-weight: 600; }


/* --------------------------------------------------------------- motion */

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

@media print {
  .site-head, .strip, .skip { display: none; }
  .section-dark { --paper: #ffffff; --ink: #000000; --muted: #333333; }
  .hero-card { transform: none; box-shadow: none; }
}
