/* ==========================================================================
   Green Duck Labs — design system "Technical ledger" (October 2026)
   Light, ruled and dense, like well-kept engineering documentation.
   Dark console panels hold the technical examples.
   Type: IBM Plex Sans + IBM Plex Mono (SIL OFL 1.1), self-hosted in /media/fonts/.
   Every top-level class here is shown in /design/moodboard.html.
   ========================================================================== */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/media/fonts/plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/media/fonts/plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url("/media/fonts/plex-sans-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url("/media/fonts/plex-sans-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/media/fonts/plex-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/media/fonts/plex-mono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/media/fonts/plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/media/fonts/plex-mono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Colours — light ground */
  --color-bg: #F5F6F8;            /* Paper: the page, a cool light grey */
  --color-surface: #FFFFFF;       /* Sheet: panels, tables, forms */
  --color-text: #0F1216;          /* Ink: text and primary buttons */
  --color-text-muted: #484F5C;    /* Graphite: secondary text */
  --color-text-soft: #636B78;     /* Pencil: captions, dates, hints */
  --color-border: #D3D8E0;        /* Rule: lines that divide sections */
  --color-border-soft: #E5E8EE;   /* Faint rule: lines inside a section */
  --color-mark: #F1A33A;          /* Beak amber: the one accent, as in the logo; fills, bars, bullets, underlines, focus, cursor */
  --color-accent: #8A5700;        /* Deep amber: accent for small text, readable on paper */
  --color-accent-deep: #6B4300;   /* Darker amber: hover, text on the amber tint */
  --color-accent-soft: #FBEFD9;   /* Amber tint: highlights, added lines in a diff */
  --color-warn: #B7791F;          /* Status only: needs a person */
  --color-fail: #B8341F;          /* Status only: failed, removed */
  /* Colours — dark ground (console) */
  --color-console: #0B0D12;       /* Console: dark panels and the footer */
  --color-console-2: #12161D;     /* Console raised: rows inside a panel */
  --color-console-line: #252B36;  /* Console rule */
  --color-console-text: #E5E8EE;  /* Console text */
  --color-console-muted: #959CAA; /* Console muted */
  --color-signal: #F1A33A;        /* Beak amber: links and marks on dark ground */
  --color-pass: #4CD48F;          /* Status only: pass, current */
  --color-signal-fail: #FF7D6B;   /* Status only: fail, on dark ground */
  --color-signal-warn: #F2C14E;   /* Status only: needs a person, on dark ground */

  /* Type */
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif; /* no serif in this design */
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-display: clamp(2.75rem, 1.55rem + 4.4vw, 5rem);
  --fs-h1: clamp(2.25rem, 1.6rem + 2.5vw, 3.625rem);
  --fs-h2: clamp(1.5rem, 1.2rem + 1.05vw, 2.125rem);
  --fs-h3: 1.125rem;
  --fs-lead: clamp(1.1875rem, 1.05rem + 0.55vw, 1.4375rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-label: 0.75rem;
  --lh-tight: 1.04;
  --lh-snug: 1.25;
  --lh-body: 1.6;

  /* Layout and spacing */
  --maxw-page: 1320px;
  --maxw-prose: 68ch;
  --gutter: clamp(20px, 3vw, 40px);
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 28px;
  --s-7: 40px;
  --s-8: 56px;
  --s-9: 80px;
  --s-10: 112px;

  /* Shape and depth: square-ish corners, almost no shadow */
  --r-1: 3px;
  --r-2: 6px;
  --r-3: 10px;
  --r-4: 14px;
  --r-pill: 999px;
  --shadow-1: 0 1px 0 rgba(15, 18, 22, 0.05);
  --shadow-2: 0 1px 2px rgba(15, 18, 22, 0.06), 0 10px 28px -14px rgba(15, 18, 22, 0.22);
  --shadow-3: 0 30px 70px -30px rgba(5, 7, 12, 0.55);
  --transition: 160ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ==========================================================================
   STABLE CORE — base elements and layout slots
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -0.028em; }
h2 { font-size: var(--fs-h2); line-height: 1.12; letter-spacing: -0.022em; }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 var(--s-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; }
a { color: var(--color-text); text-decoration-color: var(--color-mark); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--color-accent-deep); text-decoration-thickness: 3px; }
b, strong { font-weight: 600; }
img, video { display: block; max-width: 100%; height: auto; }
code, kbd { font-family: var(--font-mono); font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--color-mark); outline-offset: 2px; }
::selection { background: var(--color-mark); color: var(--color-text); }

[data-aicms="page"] { flex: 1; width: 100%; }
[data-aicms="hero"] { position: relative; }
[data-aicms="hero"] h1 { max-width: 18ch; }

.container { width: 100%; max-width: var(--maxw-page); margin-inline: auto; padding-inline: var(--gutter); }

/* Navbar: the fragment's parts sit directly in <nav>, so the engine's phone menu can fold them. */
[data-aicms="navbar"] {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--s-6);
  min-height: 60px;
  padding-block: var(--s-2);
  padding-inline: max(var(--gutter), calc((100% - var(--maxw-page)) / 2 + var(--gutter)));
  background: rgba(245, 246, 248, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--fs-small);
}
[data-aicms="navbar"] a { color: var(--color-text); text-decoration: none; }
[data-aicms="navbar"] a:hover { color: var(--color-text); text-decoration: underline; text-decoration-color: var(--color-mark); }
.nav-brand { display: inline-flex; align-items: center; margin-right: auto; padding-block: var(--s-2); }
.nav-brand img { width: 168px; height: auto; }
.nav-links { display: flex; gap: var(--s-1); list-style: none; padding: 0; margin: 0; }
.nav-links a { display: block; padding: 6px 10px; border-radius: var(--r-1); color: var(--color-text-muted) !important; }
.nav-links a:hover { color: var(--color-text) !important; background: rgba(15, 18, 22, 0.05); }
.nav-links a[aria-current="page"] { color: var(--color-text) !important; box-shadow: inset 0 -2px 0 var(--color-mark); border-radius: 0; }
[data-aicms="navbar"] .nav-cta { color: var(--color-bg); }
[data-aicms="navbar"] .nav-cta:hover { color: var(--color-bg); }
@media (max-width: 759.98px) {
  [data-aicms="navbar"] { gap: var(--s-2) var(--s-4); padding-block: var(--s-1); }
  .nav-links { flex-direction: column; gap: 0; padding-block: var(--s-2); border-top: 1px solid var(--color-border-soft); }
  .nav-links a { padding: 12px 0; font-size: 1.0625rem; border-bottom: 1px solid var(--color-border-soft); border-radius: 0; }
  .nav-links a:hover { background: none; }
  [data-aicms="navbar"] .nav-cta { margin-bottom: var(--s-4); justify-content: center; }
}

[data-aicms="footer"] { background: var(--color-console); color: var(--color-console-text); }

/* ==========================================================================
   STABLE CORE — components the engine and its agents expect
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-text); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-mark); color: var(--color-text); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { border-color: var(--color-text); color: var(--color-text); }
.btn-ghost { background: transparent; color: var(--color-text); padding-inline: 4px; }
.btn-ghost:hover { color: var(--color-accent); }
.btn-paper { background: var(--color-text); color: #fff; }
.band-dark .btn-paper { background: #fff; color: var(--color-text); }
.btn-paper:hover { background: #fff; color: var(--color-text); }
.band-dark .btn-paper:hover { background: var(--color-mark); color: var(--color-text); }
.btn-small { min-height: 32px; padding: 6px 12px; font-size: var(--fs-small); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-2);
  padding: var(--s-5);
}
.card-feature .icon-circle {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; margin-bottom: var(--s-3);
  border: 1px solid var(--color-border); border-radius: var(--r-1);
  font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-accent);
}
.card-feature h4 { font-size: var(--fs-h3); margin-bottom: var(--s-2); }
.card-feature p { color: var(--color-text-muted); font-size: var(--fs-small); }
.card-testimonial { border-left: 2px solid var(--color-mark); border-radius: 0 var(--r-2) var(--r-2) 0; }
.card-testimonial blockquote { margin: 0 0 var(--s-3); font-size: var(--fs-lead); line-height: 1.4; }
.card-testimonial .author { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-text-soft); }
.card-pricing { display: flex; flex-direction: column; gap: var(--s-3); }
.card-pricing.popular { border-color: var(--color-text); box-shadow: inset 0 3px 0 var(--color-mark); }
.card-pricing .badge { align-self: start; font-family: var(--font-mono); font-size: var(--fs-label); padding: 2px 8px; border-radius: var(--r-1); background: var(--color-accent-soft); color: var(--color-accent-deep); }
.card-pricing .price { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.02em; }
.card-pricing .price span { font-size: var(--fs-small); font-weight: 400; color: var(--color-text-muted); }
.card-pricing ul { list-style: none; padding: 0; }
.card-pricing li { padding: 6px 0; border-top: 1px solid var(--color-border-soft); font-size: var(--fs-small); color: var(--color-text-muted); }
.card-pricing li::before { content: "+ "; font-family: var(--font-mono); color: var(--color-mark); }
.card-blog { padding: 0; overflow: hidden; }
.card-blog .blog-img { aspect-ratio: 16 / 7; background: var(--color-console); background-image: radial-gradient(var(--color-console-line) 1px, transparent 1px); background-size: 14px 14px; }
.card-blog .blog-body { padding: var(--s-5); }
.card-blog .blog-tag { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-accent); margin-bottom: var(--s-2); }
.card-blog h4 { font-size: var(--fs-h3); margin-bottom: var(--s-2); }
.card-blog p { font-size: var(--fs-small); color: var(--color-text-muted); }

.label { display: block; font-size: var(--fs-small); font-weight: 500; margin-bottom: var(--s-2); color: var(--color-text); }
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-2);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input::placeholder { color: var(--color-text-soft); }
.input:focus { outline: none; border-color: var(--color-mark); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-pill);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  background: var(--color-surface);
}
.pill-active { background: var(--color-text); border-color: var(--color-text); color: var(--color-bg); }
.tag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  line-height: 1.6;
  color: var(--color-text-muted);
  background: var(--color-surface);
  white-space: nowrap;
}

/* ==========================================================================
   EXTENSIONS — the Green Duck Labs vocabulary
   ========================================================================== */

/* --- Type helpers --------------------------------------------------------- */
.display { font-size: var(--fs-display); line-height: 0.98; letter-spacing: -0.035em; font-weight: 600; }
.lead { font-size: var(--fs-lead); line-height: 1.45; letter-spacing: -0.008em; color: var(--color-text); }
/* The home hero name is the logo itself, so its letters match the logo exactly. */
.display.wordmark { line-height: 1; }
.display.wordmark img { display: block; width: min(100%, 36rem); height: auto; }
.mono { font-family: var(--font-mono); font-size: 0.875em; letter-spacing: 0; }
.muted { color: var(--color-text-muted); }
.small { font-size: var(--fs-small); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.link { font-weight: 500; color: var(--color-text); text-decoration: underline; text-decoration-color: var(--color-mark); text-decoration-thickness: 2px; }
.link:hover { text-decoration-color: currentColor; }
.path { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s-5); font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-text-soft); }
.path a { color: var(--color-text-muted); text-decoration: none; }
.path a:hover { color: var(--color-accent); text-decoration: underline; }
.path span[aria-hidden] { color: var(--color-border); }

/* --- Bands: every section is a full-width band with a rule below it -------- */
.band { border-bottom: 1px solid var(--color-border); }
.band-white { background: var(--color-surface); }
.band-dark { background: var(--color-console); color: var(--color-console-text); border-bottom-color: var(--color-console-line); }
.band-dark a:not(.btn) { color: var(--color-signal); }
.band-dark .muted, .band-dark .lead { color: var(--color-console-text); }
.band-dark .muted { color: var(--color-console-muted); }
.band-accent { background: var(--color-mark); color: var(--color-text); border-bottom-color: var(--color-mark); }
.band-accent a:not(.btn) { color: var(--color-text); text-decoration-color: currentColor; }
@media (min-width: 1400px) {
  .band > .container { border-inline: 1px solid var(--color-border-soft); }
  .band-dark > .container { border-inline-color: var(--color-console-line); }
  .band-accent > .container { border-inline-color: rgba(15, 18, 22, 0.14); }
}

/* A faint engineering grid behind the opening of the home page. */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(15, 18, 22, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 18, 22, 0.055) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}

/* --- Section row: heading in a left column, text on the right -------------- */
.sect {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--s-6);
  row-gap: var(--s-6);
  padding-block: var(--s-9);
}
.sect-tight { padding-block: var(--s-8); }
.sect-head { grid-column: 1 / span 4; align-self: start; }
.sect-head > * + * { margin-top: var(--s-4); }
.sect-head p { color: var(--color-text-muted); max-width: 40ch; }
.band-dark .sect-head p { color: var(--color-console-muted); }
.sect-body { grid-column: 5 / -1; min-width: 0; }
.sect-wide { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 980px) { .sect-head.stick { position: sticky; top: 92px; } }
@media (max-width: 979.98px) {
  .sect { padding-block: var(--s-8); row-gap: var(--s-6); }
  .sect-head, .sect-body { grid-column: 1 / -1; }
}

/* --- Home opening ---------------------------------------------------------- */
.hero { border-bottom: 1px solid var(--color-border); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--s-7);
  padding-block: var(--s-9) var(--s-8);
  align-items: end;
}
.hero-text .display { margin-bottom: var(--s-6); }
.hero-text .lead { max-width: 30ch; font-size: clamp(1.3125rem, 1.1rem + 0.8vw, 1.75rem); line-height: 1.32; margin-bottom: var(--s-6); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.facts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--color-border); margin-top: var(--s-8); }
.facts p { margin: 0; padding: var(--s-4) var(--s-5) 0 0; font-size: var(--fs-small); color: var(--color-text-muted); max-width: 34ch; }
.facts p + p { padding-left: var(--s-5); border-left: 1px solid var(--color-border); }
.facts b { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500; color: var(--color-text); }
@media (max-width: 979.98px) {
  .hero-grid { grid-template-columns: 1fr; padding-block: var(--s-8) var(--s-7); }
}
@media (max-width: 559.98px) {
  .facts { grid-template-columns: 1fr; }
  .facts p + p { padding-left: 0; border-left: 0; border-top: 1px solid var(--color-border-soft); margin-top: var(--s-4); }
}

/* The duck on the waterline: the logo mark drawn as a plate. */
.duck-plate {
  position: relative;
  aspect-ratio: 5 / 4;
  border: 1px solid var(--color-border);
  border-radius: var(--r-2);
  background: var(--color-surface);
  overflow: hidden;
}
.duck-plate img { position: absolute; left: 50%; bottom: calc(46% + 1px); width: 30%; transform: translateX(-50%); }
.duck-plate::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  background: var(--color-console);
  background-image: repeating-linear-gradient(to bottom, transparent 0 13px, rgba(155, 179, 255, 0.10) 13px 14px);
}
.duck-plate::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 46%; height: 0;
  border-top: 1px dashed var(--color-mark);
}
.duck-plate .under {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  list-style: none; margin: 0; padding: var(--s-4) var(--s-5);
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-console-text);
}
.duck-plate .under li { display: flex; gap: var(--s-3); align-items: baseline; padding: 3px 0; border-bottom: 1px solid var(--color-console-line); }
.duck-plate .under li:last-child { border-bottom: 0; }
.duck-plate .under li::after { content: "ok"; margin-left: auto; color: var(--color-pass); }
.duck-plate .above { position: absolute; top: var(--s-4); left: var(--s-5); right: var(--s-5); font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-text-soft); }

@media (max-width: 559.98px) { .duck-plate { aspect-ratio: 1 / 1.08; } }

/* --- Page opening (every page except home) -------------------------------- */
.page-head { border-bottom: 1px solid var(--color-border); }
.page-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: var(--s-6) var(--s-8);
  padding-block: var(--s-8) var(--s-8);
  align-items: end;
}
.page-head h1 { margin-bottom: var(--s-5); }
.page-head .lead { max-width: 52ch; color: var(--color-text-muted); }
.page-meta { border-top: 1px solid var(--color-text); }
.page-meta p { margin: 0; padding: var(--s-3) 0; border-bottom: 1px solid var(--color-border); font-size: var(--fs-small); color: var(--color-text-muted); }
.page-meta b { display: block; font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500; color: var(--color-text); }
.page-meta .btn { margin-top: var(--s-5); }
.page-meta p:has(> .btn) { border-bottom: 0; padding: 0; }
@media (max-width: 979.98px) { .page-head-grid { grid-template-columns: 1fr; padding-block: var(--s-7); } }

/* --- Run-in paragraphs in a grid ------------------------------------------ */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-7); }
.cols > * { margin: 0; padding: var(--s-5) 0; border-top: 1px solid var(--color-border); color: var(--color-text-muted); }
.cols b { color: var(--color-text); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 759.98px) { .cols, .cols-3 { grid-template-columns: 1fr; } }

.sect-body > .lead { max-width: 44ch; margin-bottom: var(--s-7); }
.sect-body > .note-block + * { margin-top: var(--s-7); }
.waterline + p { margin-top: var(--s-5); max-width: 64ch; color: var(--color-text-muted); }

/* A larger statement with a bar on its left: the text that stood beside the old pictures. */
.note-block { border-left: 2px solid var(--color-mark); padding-left: var(--s-6); max-width: 62ch; }
.note-block p { font-size: var(--fs-lead); line-height: 1.45; }
.note-block p + p { font-size: var(--fs-body); color: var(--color-text-muted); line-height: var(--lh-body); }
.band-dark .note-block p + p { color: var(--color-console-muted); }

/* --- The waterline diagram: what users see above, what we build below ------ */
.waterline { border: 1px solid var(--color-border); border-radius: var(--r-2); overflow: hidden; background: var(--color-surface); }
.wl-above, .wl-below { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s-5); padding: var(--s-6) var(--s-5); }
.wl-below { background: var(--color-console); color: var(--color-console-text); border-top: 1px dashed var(--color-mark); }
.wl-side { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-text-soft); }
.wl-below .wl-side { color: var(--color-signal); }
.wl-answer { padding: var(--s-4); border: 1px solid var(--color-border); border-radius: var(--r-2); font-size: var(--fs-small); max-width: 44ch; }
.wl-answer::before { content: "Answer"; display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-text-soft); }
.wl-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--color-console-line); border: 1px solid var(--color-console-line); border-radius: var(--r-1); list-style: none; padding: 0; }
.wl-parts li { background: var(--color-console-2); padding: var(--s-3) var(--s-4); font-family: var(--font-mono); font-size: var(--fs-label); line-height: 1.5; }
.wl-parts li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--color-pass); vertical-align: 1px; }
@media (max-width: 559.98px) {
  .wl-above, .wl-below { grid-template-columns: 1fr; gap: var(--s-3); }
  .wl-parts { grid-template-columns: 1fr; }
}

/* --- Console panels: drawn interface fragments, always "An example" -------- */
.console {
  background: var(--color-console);
  color: var(--color-console-text);
  border: 1px solid var(--color-console-line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  font-size: var(--fs-small);
}
.console-bar {
  display: flex; justify-content: space-between; gap: var(--s-4);
  padding: 10px var(--s-4);
  border-bottom: 1px solid var(--color-console-line);
  font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-console-muted);
}
.console-bar span:first-child::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: var(--color-pass); box-shadow: 0 0 0 3px rgba(76, 212, 143, 0.15); vertical-align: 1px; }
.console-body { padding: var(--s-5); }
.console-body + .console-body { border-top: 1px solid var(--color-console-line); }
.console h3 { font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500; letter-spacing: 0; color: var(--color-console-muted); margin-bottom: var(--s-3); }
.example-note { margin-top: var(--s-3); font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-text-soft); }
.band-dark .example-note { color: var(--color-console-muted); }
.example-note::before { content: "* "; color: var(--color-mark); }
.band-dark .example-note::before { color: var(--color-signal); }
.stack { display: grid; gap: var(--s-4); }

/* An answer with its sources */
.answer-q { margin-bottom: var(--s-4); font-size: var(--fs-body); font-weight: 500; color: #fff; }
.answer-q small { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 400; color: var(--color-console-muted); }
.answer-a { margin-bottom: var(--s-4); color: var(--color-console-text); line-height: 1.6; }
.answer-a sup { font-family: var(--font-mono); font-size: 0.7em; color: var(--color-signal); }
.answer-src { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.answer-src span { padding: 2px 8px; border: 1px solid var(--color-console-line); border-radius: var(--r-1); font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-console-muted); }

/* A trace: the steps that ran under one answer */
.trace summary { display: flex; justify-content: space-between; align-items: center; padding: 10px var(--s-5); cursor: pointer; list-style: none; border-top: 1px solid var(--color-console-line); background: var(--color-console-2); font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-console-text); }
.trace summary::-webkit-details-marker { display: none; }
.trace summary::after { content: "−"; color: var(--color-console-muted); }
.trace:not([open]) summary::after { content: "+"; }
.trace-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.trace-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  column-gap: var(--s-3);
  padding: 10px var(--s-5);
  border-top: 1px solid var(--color-console-line);
  line-height: 1.45;
}
.trace-steps li::before { content: counter(step, decimal-leading-zero); grid-row: 1 / span 2; font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-console-muted); padding-top: 2px; }
.trace-steps li span { grid-column: 2; font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-console-muted); }
.trace-steps li em { grid-column: 3; grid-row: 1 / span 2; align-self: center; font-style: normal; font-family: var(--font-mono); font-size: var(--fs-label); padding: 1px 8px; border-radius: var(--r-1); border: 1px solid var(--color-console-line); color: var(--color-console-text); white-space: nowrap; }
.trace-steps li.pass em { color: var(--color-pass); border-color: rgba(76, 212, 143, 0.35); background: rgba(76, 212, 143, 0.08); }
.trace-total { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); padding: 12px var(--s-5); border-top: 1px solid var(--color-console-line); background: var(--color-console-2); font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-console-text); }
.trace-total span:last-child { margin-left: auto; color: var(--color-signal); }
/* Motion: the steps fill in one by one when the trace scrolls into view (the script is in the footer). */
.js .trace-steps.is-waiting li { opacity: 0.25; }
.js .trace-steps.is-waiting li em { visibility: hidden; }
.js .trace-steps li { transition: opacity 260ms ease; }
.js .trace-steps li.is-run { opacity: 1; }
.js .trace-steps li.is-run em { visibility: visible; }

/* A data table inside a console panel or on paper */
.data-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: var(--fs-label); }
.data-table th { text-align: left; font-weight: 400; color: var(--color-console-muted); padding: 8px 10px; border-bottom: 1px solid var(--color-console-line); }
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--color-console-line); color: var(--color-console-text); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .ok { color: var(--color-pass); }
.data-table .bad { color: var(--color-signal-fail); }
.data-table .ok::before, .data-table .bad::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.table-scroll { overflow-x: auto; }

/* A timestamped log, for agents */
.log { list-style: none; padding: 0; margin: 0; font-family: var(--font-mono); font-size: var(--fs-label); }
.log li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s-3); padding: 8px 0; border-top: 1px solid var(--color-console-line); line-height: 1.55; color: var(--color-console-muted); }
.log li:first-child { border-top: 0; }
.log .t { color: var(--color-console-muted); opacity: 0.8; }
.log b { font-weight: 500; color: var(--color-console-text); }
.log li.hand { color: var(--color-console-text); }
.log li.hand b { color: var(--color-signal-warn); }

/* --- Ledger: a ruled list of named rows (services, risks) ---------------- */
.ledger { border-top: 1px solid var(--color-text); }
.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 3.4fr);
  gap: var(--s-2) var(--s-6);
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--color-border);
}
.ledger-row h3 { font-size: var(--fs-h3); }
.ledger-row h3 a { color: var(--color-text); text-decoration: none; }
.ledger-row h3 a:hover { color: var(--color-accent); text-decoration: underline; }
.ledger-row p { color: var(--color-text-muted); margin: 0; }
.ledger-row ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-text-muted); }
.ledger-row li::before { content: "+ "; color: var(--color-mark); }
.band-dark .ledger { border-top-color: var(--color-console-text); }
.band-dark .ledger-row { border-bottom-color: var(--color-console-line); }
.band-dark .ledger-row h3 a { color: var(--color-console-text); }
.band-dark .ledger-row p, .band-dark .ledger-row ul { color: var(--color-console-muted); }
@media (max-width: 759.98px) {
  .ledger-row { grid-template-columns: 1fr; }
  .ledger-row ul { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
}

/* --- Sheet: a schedule or a list of measures with dotted leaders ---------- */
.sheet { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--r-2); padding: var(--s-2) var(--s-5) 0; box-shadow: var(--shadow-1); }
.sheet h3 { padding: var(--s-4) 0 var(--s-2); font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500; letter-spacing: 0; color: var(--color-accent); }
.sheet-row { display: flex; align-items: baseline; gap: var(--s-3); margin: 0; padding: 7px 0; border-top: 1px solid var(--color-border-soft); font-size: var(--fs-small); }
.sheet-row .what { color: var(--color-text); }
.sheet-row .dots { flex: 1; min-width: var(--s-5); border-bottom: 1px dotted var(--color-border); transform: translateY(-4px); }
.sheet-row .when { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-text-muted); white-space: nowrap; }
.sheet-total { display: flex; justify-content: space-between; gap: var(--s-4); margin: var(--s-3) calc(-1 * var(--s-5)) 0; padding: var(--s-4) var(--s-5); background: var(--color-text); color: var(--color-bg); border-radius: 0 0 var(--r-2) var(--r-2); font-size: var(--fs-small); font-weight: 500; }
.sheet-total span:last-child { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-signal); white-space: nowrap; }
@media (max-width: 459.98px) { .sheet-row { flex-wrap: wrap; } .sheet-row .dots { display: none; } .sheet-row .when { width: 100%; } }

/* A two-by-two grid of small parts, with hairlines between them */
.parts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: var(--s-5); background: var(--color-border); border: 1px solid var(--color-border); border-radius: var(--r-2); overflow: hidden; }
.parts > div { background: var(--color-surface); padding: var(--s-5); }
.parts h3 { font-size: var(--fs-body); margin-bottom: var(--s-2); }
.parts p { font-size: var(--fs-small); color: var(--color-text-muted); }
@media (max-width: 559.98px) { .parts { grid-template-columns: 1fr; } }

/* Long-form rows: a heading on the left, prose on the right */
.doc-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s-6); padding-block: var(--s-7); border-top: 1px solid var(--color-border); }
.doc-row:first-child { border-top: 0; }
.doc-row > h2 { grid-column: 1 / span 4; font-size: var(--fs-h2); }
.doc-row > :not(h2) { grid-column: 5 / -1; }
.doc-row > .doc-body { max-width: 72ch; color: var(--color-text-muted); }
.doc-body > p:first-child { font-size: var(--fs-lead); line-height: 1.45; color: var(--color-text); }
.doc-body ul { padding-left: 0; list-style: none; margin: 0 0 var(--s-4); border-top: 1px solid var(--color-border-soft); }
.doc-body ul li { padding: 8px 0 8px 22px; border-bottom: 1px solid var(--color-border-soft); position: relative; }
.doc-body ul li::before { content: "+"; position: absolute; left: 2px; font-family: var(--font-mono); color: var(--color-mark); }
@media (max-width: 979.98px) { .doc-row > * { grid-column: 1 / -1 !important; } .doc-row > h2 { margin-bottom: var(--s-4); } }

/* --- The aicms editor fragment -------------------------------------------- */
.app { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--r-3); box-shadow: var(--shadow-2); overflow: hidden; font-size: var(--fs-small); }
.app-bar { display: flex; justify-content: space-between; gap: var(--s-4); padding: 9px var(--s-4); border-bottom: 1px solid var(--color-border); background: var(--color-bg); font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-text-muted); }
.app-bar span:last-child { color: var(--color-accent-deep); background: var(--color-accent-soft); padding: 0 6px; border-radius: var(--r-1); }
.app-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.chat { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); border-right: 1px solid var(--color-border); }
.msg { margin: 0; padding: 10px 12px; border-radius: var(--r-2); line-height: 1.5; }
.msg-me { background: var(--color-text); color: var(--color-bg); margin-left: var(--s-5); }
.msg-agent { background: var(--color-bg); border: 1px solid var(--color-border-soft); margin-right: var(--s-5); }
.msg small { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-accent); }
.diff { padding: var(--s-4); font-family: var(--font-mono); font-size: var(--fs-label); line-height: 1.6; }
.diff .label { font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 400; color: var(--color-text-soft); }
.diff-was, .diff-now { margin: 0 0 6px; padding: 6px 10px 6px 24px; border-radius: var(--r-1); position: relative; }
.diff-was { background: #FBEBE8; color: #7A2414; text-decoration: line-through; text-decoration-color: rgba(122, 36, 20, 0.4); }
.diff-now { background: #E3F5EA; color: #145232; }
.diff-was::before, .diff-now::before { position: absolute; left: 9px; }
.diff-was::before { content: "−"; }
.diff-now::before { content: "+"; }
.app-actions { display: flex; justify-content: flex-end; gap: var(--s-2); padding: 10px var(--s-4); border-top: 1px solid var(--color-border); }
.app-actions span { padding: 4px 12px; border: 1px solid var(--color-border); border-radius: var(--r-2); font-size: var(--fs-small); }
.app-actions .ok { background: var(--color-text); border-color: var(--color-text); color: var(--color-bg); }
.app-prompt { margin: 0; padding: 12px var(--s-4); border-top: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text-soft); }
.app-prompt::after { content: ""; display: inline-block; width: 8px; height: 1.1em; margin-left: 4px; background: var(--color-mark); vertical-align: -3px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 759.98px) { .app-body { grid-template-columns: 1fr; } .chat { border-right: 0; border-bottom: 1px solid var(--color-border); } }

/* A list with a bold run-in head on each item */
.facts-list { list-style: none; padding: 0; margin: var(--s-5) 0; border-top: 1px solid var(--color-border); }
.facts-list li { padding: var(--s-3) 0; border-bottom: 1px solid var(--color-border); color: var(--color-text-muted); font-size: var(--fs-small); }
.facts-list b { display: block; color: var(--color-text); font-size: var(--fs-body); }

/* --- Comparison table (two ways to work) ---------------------------------- */
.compare { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.compare th, .compare td { text-align: left; vertical-align: top; padding: var(--s-4) var(--s-5) var(--s-4) 0; border-bottom: 1px solid var(--color-border); }
.compare thead th { border-bottom: 1px solid var(--color-text); padding-bottom: var(--s-5); font-weight: 400; }
.compare thead th:first-child { width: 28%; }
.compare .plan { display: block; font-size: var(--fs-h3); font-weight: 600; color: var(--color-text); }
.compare .for { display: block; color: var(--color-text-muted); margin-top: 2px; max-width: 36ch; }
.compare tbody th { font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 400; color: var(--color-text-soft); padding-top: calc(var(--s-4) + 2px); }
.compare tbody td { color: var(--color-text); }
.compare tfoot td { border-bottom: 0; padding-top: var(--s-5); }
@media (max-width: 759.98px) {
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr, .compare td, .compare th, .compare tfoot { display: block; width: 100%; }
  .compare tbody tr { padding: var(--s-3) 0; border-bottom: 1px solid var(--color-border); }
  .compare tbody th, .compare tbody td { border: 0; padding: 2px 0; }
  .compare td[data-plan]::before { content: attr(data-plan) ": "; font-weight: 600; }
  .compare tfoot tr { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
  .compare tfoot td { width: auto; padding: var(--s-4) 0 0; }
  .compare tfoot td:empty { display: none; }
}

/* --- Lists of notes ------------------------------------------------------- */
.post-rows { border-top: 1px solid var(--color-text); }
.band-dark .post-rows { border-top-color: var(--color-console-text); }
.post-row a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-5); align-items: baseline; padding: var(--s-4) 0; border-bottom: 1px solid var(--color-border); color: var(--color-text); text-decoration: none; }
.band-dark .post-row a { border-bottom-color: var(--color-console-line); color: var(--color-console-text) !important; }
.post-row .t { font-size: 1.125rem; font-weight: 500; letter-spacing: -0.01em; }
.post-row .d { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-text-soft); white-space: nowrap; }
.band-dark .post-row .d { color: var(--color-console-muted); }
.post-row a:hover .t { color: var(--color-accent); text-decoration: underline; text-underline-offset: 0.2em; }
.band-dark .post-row a:hover .t { color: var(--color-signal); }
.more { margin-top: var(--s-5); }
[data-aicms="post-list"] { display: block; }
[data-aicms="post-list"]:empty::before { content: attr(data-empty); color: var(--color-text-soft); }

/* --- Questions and answers ------------------------------------------------- */
.qa { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-7); }
.qa > p { margin: 0; padding: var(--s-5) 0; border-top: 1px solid var(--color-border); color: var(--color-text-muted); font-size: 0.9688rem; }
.qa b { display: block; margin-bottom: var(--s-1); color: var(--color-text); font-size: var(--fs-body); }
.qa-one { grid-template-columns: 1fr; }
@media (max-width: 759.98px) { .qa { grid-template-columns: 1fr; } }

/* --- Closing call to action ---------------------------------------------- */
.close { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-6) var(--s-8); padding-block: var(--s-9); align-items: end; }
.close h2 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -0.03em; max-width: 16ch; }
.band-accent .close p { color: rgba(15, 18, 22, 0.82); }
.band-dark .close p { color: var(--color-console-muted); }
.close .btn { margin-top: var(--s-3); }
@media (max-width: 759.98px) { .close { grid-template-columns: 1fr; padding-block: var(--s-8); } }

/* --- Footer ---------------------------------------------------------------- */
.foot { padding-block: var(--s-8) var(--s-6); }
.foot-top { display: grid; grid-template-columns: minmax(0, 6fr) repeat(2, minmax(0, 2fr)); gap: var(--s-6); padding-bottom: var(--s-7); border-bottom: 1px solid var(--color-console-line); }
.foot-brand img { width: 176px; margin-bottom: var(--s-4); }
.foot-brand p { color: var(--color-console-muted); font-size: var(--fs-small); max-width: 34ch; }
.foot h2 { margin-bottom: var(--s-3); font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 400; letter-spacing: 0; color: var(--color-console-muted); }
.foot ul { list-style: none; padding: 0; display: grid; gap: 6px; font-size: var(--fs-small); }
.foot a { color: var(--color-console-text); text-decoration: none; }
.foot a:hover { color: var(--color-signal); text-decoration: underline; }
.foot-base { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); padding-top: var(--s-5); font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-console-muted); }
.foot-base a { color: var(--color-console-muted); text-decoration: underline; }
.foot-base span:last-child { margin-left: auto; }
@media (max-width: 979.98px) { .foot-top { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 559.98px) { .foot-base span:last-child { margin-left: 0; } }


/* --- Articles (notes and the privacy policy) ------------------------------ */
[data-aicms="post"] { display: block; }
[data-aicms="blog-header"] { display: block; }
.article { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s-6); padding-block: var(--s-8) var(--s-9); }
.article-side { grid-column: 1 / span 3; align-self: start; font-size: var(--fs-small); color: var(--color-text-muted); }
.article-side > * + * { margin-top: var(--s-5); }
.article-side b { display: block; font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500; color: var(--color-text); margin-bottom: 2px; }
@media (min-width: 980px) { .article-side { position: sticky; top: 92px; } }
.toc { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--color-border); }
.toc li { padding: 3px 0 3px var(--s-3); line-height: 1.4; }
.toc a { color: var(--color-text-muted); text-decoration: none; }
.toc a:hover { color: var(--color-accent); text-decoration: underline; }
.prose { grid-column: 5 / span 7; min-width: 0; max-width: var(--maxw-prose); font-size: 1.0625rem; line-height: 1.7; }
.prose > p:first-child { font-size: var(--fs-lead); line-height: 1.5; }
.prose h2 { margin: var(--s-8) 0 var(--s-4); padding-top: var(--s-5); border-top: 1px solid var(--color-border); font-size: 1.5rem; scroll-margin-top: 90px; }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin: var(--s-6) 0 var(--s-3); font-size: 1.125rem; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 var(--s-5); }
.prose li { margin-bottom: var(--s-2); }
.prose li::marker { color: var(--color-mark); font-family: var(--font-mono); }
.prose blockquote { margin: var(--s-6) 0; padding-left: var(--s-5); border-left: 2px solid var(--color-mark); font-size: var(--fs-lead); line-height: 1.45; }
.prose pre { overflow-x: auto; padding: var(--s-4) var(--s-5); background: var(--color-console); color: var(--color-console-text); border-radius: var(--r-2); font-size: var(--fs-small); line-height: 1.6; }
.prose code { padding: 1px 5px; background: var(--color-accent-soft); color: var(--color-accent-deep); border-radius: var(--r-1); }
.prose pre code { padding: 0; background: none; color: inherit; }
.prose .console, .prose .figure { margin: var(--s-6) 0; font-size: var(--fs-small); line-height: 1.5; }
@media (max-width: 979.98px) {
  .article { padding-block: var(--s-7) var(--s-8); row-gap: var(--s-6); }
  .article-side, .prose { grid-column: 1 / -1; }
}

/* --- Notes index ---------------------------------------------------------- */
.note-list { border-top: 1px solid var(--color-text); }
.note-item a { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--s-1) var(--s-6); padding: var(--s-5) 0; border-bottom: 1px solid var(--color-border); color: var(--color-text); text-decoration: none; }
.note-item .date { grid-row: 1 / span 2; font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-text-soft); padding-top: 5px; }
.note-item .t { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; }
.note-item .x { color: var(--color-text-muted); max-width: 70ch; }
.note-item a:hover .t { color: var(--color-accent); text-decoration: underline; text-underline-offset: 0.2em; }
@media (max-width: 559.98px) { .note-item a { grid-template-columns: 1fr; } .note-item .date { grid-row: auto; padding: 0; } }
[data-aicms="pagination"] { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-6); font-family: var(--font-mono); font-size: var(--fs-label); }
[data-aicms="pagination"]:empty { display: none; }
[data-aicms="pagination"] a { padding: 5px 10px; border: 1px solid var(--color-border); border-radius: var(--r-1); color: var(--color-text); text-decoration: none; background: var(--color-surface); }
[data-aicms="pagination"] a:hover { border-color: var(--color-text); }
[data-aicms="pagination"] a[aria-current="true"], [data-aicms="pagination"] a[aria-current="page"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }

/* --- Contact form ---------------------------------------------------------- */
.contact { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-8); padding-block: var(--s-8) var(--s-9); }
.contact-side > div { padding: var(--s-5) 0; border-top: 1px solid var(--color-border); }
.contact-side h2 { font-size: var(--fs-h3); margin-bottom: var(--s-2); }
.contact-side p { color: var(--color-text-muted); font-size: var(--fs-small); }
.form-title { font-size: var(--fs-h2); margin-bottom: var(--s-6); }
[data-aicms="contact-form-section"] { display: block; }
[data-aicms="contact-form"] { display: grid; gap: var(--s-5); padding: var(--s-6); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--r-3); box-shadow: var(--shadow-1); }
[data-aicms="contact-form"] label { display: grid; gap: 6px; font-size: var(--fs-small); font-weight: 500; }
[data-aicms="contact-form"] input:not([type="checkbox"]):not([type="radio"]), [data-aicms="contact-form"] textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--r-2);
  background: var(--color-bg); color: var(--color-text); font: inherit; font-weight: 400; font-size: var(--fs-body);
  transition: border-color var(--transition), box-shadow var(--transition);
}
[data-aicms="contact-form"] input:focus, [data-aicms="contact-form"] textarea:focus { outline: none; border-color: var(--color-mark); box-shadow: 0 0 0 3px var(--color-accent-soft); background: var(--color-surface); }
[data-aicms="contact-form"] textarea { resize: vertical; min-height: 9rem; }
[data-aicms="contact-form"] button { justify-self: start; }
.form-hint { font-weight: 400; font-size: var(--fs-label); font-family: var(--font-mono); color: var(--color-text-soft); }
@media (max-width: 979.98px) { .contact { grid-template-columns: 1fr; gap: var(--s-7); padding-block: var(--s-7) var(--s-8); } [data-aicms="contact-form"] { padding: var(--s-5); } }

/* --- Short pages: not found, message sent --------------------------------- */
.lost { border-bottom: 1px solid var(--color-border); }
.lost .container { padding-block: var(--s-10); }
.lost h1 { margin-bottom: var(--s-5); }
.lost .lead { max-width: 46ch; color: var(--color-text-muted); margin-bottom: var(--s-6); }
.lost .code { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-accent); margin-bottom: var(--s-4); }
.go { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-5); }

/* --- Motion preferences ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .trace-steps.is-waiting li { opacity: 1; }
  .js .trace-steps.is-waiting li em { visibility: visible; }
}

/* --- Page parts: example notes inside articles --- */
/* In a note, the "An example" line sits right under its console panel. */
.prose .console:has(+ .example-note) { margin-bottom: 0; }
.prose .console + .example-note { margin-bottom: var(--s-6); }

/* --- Page parts: row heads, long post rows, tag rows --- */
/* A doc-row head with a short line under the heading (how we work, about). */
.doc-row > .doc-head { grid-column: 1 / span 4; }
.doc-head h2 { font-size: var(--fs-h2); }
.doc-head p { margin-top: var(--s-3); max-width: 34ch; color: var(--color-text-muted); }
.sr-only + .doc-row { border-top: 0; }
@media (max-width: 979.98px) { .doc-row > .doc-head { margin-bottom: var(--s-4); } }
.doc-body .parts + p { margin-top: var(--s-5); }
/* A console panel placed after a grid of run-in paragraphs. */
.sect-body > .cols + .console { margin-top: var(--s-7); }
/* Note rows whose second part is a phrase, not a date: let it wrap. */
.post-rows-long .post-row a { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.post-rows-long .post-row .d { white-space: normal; font-size: var(--fs-small); }
@media (max-width: 559.98px) { .post-rows-long .post-row a { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); } }
/* A row of tags, on paper or inside a console panel. */
.tag-row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }
.console .tag { background: transparent; border-color: var(--color-console-line); color: var(--color-console-muted); }

/* --- Page parts: logs with weekdays --- */
/* A log whose times carry a weekday ("Mon 08:00"): a wider time column so it stays on one line. */
.log-days li { grid-template-columns: 80px minmax(0, 1fr); }
