/* ---- tokens.css ---- */
/*
  Design tokens: P1 "Cyanotype".
  Light is the default. Dark applies when the system prefers dark and the visitor
  hasn't picked light, or when the visitor picks dark (html[data-theme="dark"]).
  Those are two separate blocks below, and they must be kept identical: scripts/contrast.py
  fails if they drift.
  Contrast is checked by scripts/contrast.py; rerun it after changing a colour.

  --bg            page / paper
  --ink           body text, headings
  --ink-2         secondary text (captions, labels)
  --rule          hairlines between rows
  --rule-2        inner sheet border, title-block cell lines, zone ticks
  --frame         outer sheet border, heavy rules, title-block border
  --accent        hover / active fills (legend numbers)
  --accent-text   accent used as text (links on hover)
  --focus         focus outline
  --on-accent     text on --accent
  --fill          subtle panel fill
  --btn-*         primary button
  --hl-ink/bg     headline emphasis
  --ring-1..4     callout rings on the Detail A render
  --plate         dark mount behind product renders
  --plate-edge    border around the plate
  --desk          drafting-table surface around the sheet (wide screens)
  --grid-minor/major  CAD grid dots on the desk (small every cell, larger every 6th)
*/
:root {
  color-scheme: light;
  --bg: #EEF2F4;
  --ink: #11304A;
  --ink-2: #46596B;
  --rule: #C6D2DB;
  --rule-2: #8EA3B5;
  --frame: #11304A;
  --accent: #8A5300;
  --accent-text: #8A5300;
  --focus: #8A5300;
  --on-accent: #FFFFFF;
  --fill: #E3EAEE;
  --btn-bg: #11304A;
  --btn-fg: #EEF2F4;
  --btn-hover-bg: #8A5300;
  --btn-hover-fg: #FFFFFF;
  --hl-ink: #8A5300;
  --hl-bg: transparent;
  --ring-1: #F2CF72;
  --ring-2: #F2CF72;
  --ring-3: #F2CF72;
  --ring-4: #F2CF72;
  --plate: #0B0C0E;
  --portrait: url("/assets/img/portrait.svg");
  --plate-edge: #11304A;
  --desk: #E3EAEE;
  --grid-minor: #B9C7D2;
  --grid-major: #8EA3B5;

  /* terminal easter egg (same in both themes: it is a dark plate) */
  --term-bg: #0B0C0E;
  --term-ink: #E4EDF4;
  --term-ink-2: #9FB4C8;
  --term-accent: #F4D27A;
  --term-edge: #F4D27A;

  /* type + layout */
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sheet-margin: 20px;
  --sheet-max: 297mm;   /* widest the sheet gets: A3 portrait / A4 landscape (1123 CSS px) */
  --grid: calc(var(--sheet-max) / 60);   /* dot pitch: 60 cells, 10 major cells across the sheet */
  --sheet-pad: 34px 48px 48px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1A4670;
    --ink: #F2F6F9;
    --ink-2: #BCD0E2;
    --rule: #2F5A82;
    --rule-2: #5A82A8;
    --frame: #E4EDF4;
    --accent: #F4D27A;
    --accent-text: #F4D27A;
    --focus: #F4D27A;
    --on-accent: #14385A;
    --fill: #1F4E7A;
    --btn-bg: #F2F6F9;
    --btn-fg: #14385A;
    --btn-hover-bg: #F4D27A;
    --btn-hover-fg: #14385A;
    --hl-ink: #F4D27A;
    --hl-bg: transparent;
    --ring-1: #F4D27A;
    --ring-2: #F4D27A;
    --ring-3: #F4D27A;
    --ring-4: #F4D27A;
    --plate: #0B0C0E;
    --portrait: url("/assets/img/portrait-dark.svg");
    --plate-edge: #E4EDF4;
    --desk: #153B5F;
    --grid-minor: #2A5781;
    --grid-major: #4A76A0;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1A4670;
  --ink: #F2F6F9;
  --ink-2: #BCD0E2;
  --rule: #2F5A82;
  --rule-2: #5A82A8;
  --frame: #E4EDF4;
  --accent: #F4D27A;
  --accent-text: #F4D27A;
  --focus: #F4D27A;
  --on-accent: #14385A;
  --fill: #1F4E7A;
  --btn-bg: #F2F6F9;
  --btn-fg: #14385A;
  --btn-hover-bg: #F4D27A;
  --btn-hover-fg: #14385A;
  --hl-ink: #F4D27A;
  --hl-bg: transparent;
  --ring-1: #F4D27A;
  --ring-2: #F4D27A;
  --ring-3: #F4D27A;
  --ring-4: #F4D27A;
  --plate: #0B0C0E;
  --portrait: url("/assets/img/portrait-dark.svg");
  --plate-edge: #E4EDF4;
  --desk: #153B5F;
  --grid-minor: #2A5781;
  --grid-major: #4A76A0;
}

/* ---- fonts.css ---- */
/* Archivo, self-hosted from @fontsource-variable/archivo (SIL OFL, /assets/fonts/OFL.txt).
   One variable file per style carries both axes: weight 100-900 and width 62-125%. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(/assets/fonts/archivo-latin-ext-wdth-normal.woff2) format("woff2-variations"), url(/assets/fonts/archivo-latin-ext-wdth-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(/assets/fonts/archivo-latin-wdth-normal.woff2) format("woff2-variations"), url(/assets/fonts/archivo-latin-wdth-normal.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: "Archivo";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(/assets/fonts/archivo-latin-ext-wdth-italic.woff2) format("woff2-variations"), url(/assets/fonts/archivo-latin-ext-wdth-italic.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(/assets/fonts/archivo-latin-wdth-italic.woff2) format("woff2-variations"), url(/assets/fonts/archivo-latin-wdth-italic.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;
}

/* ---- base.css ---- */
/* Base: reset, type, sheet frame, header, footer. Direction A "Drawing Sheet":
   the page is a general-arrangement drawing. All colour comes from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* The page is a drafting table: a CAD dot grid with the sheet laid on it. A small dot every
   cell, a larger one every 6th; the grid is centred so the sheet's edges fall on major dots. */
body {
  margin: 0;
  background-color: var(--desk);
  background-image:
    radial-gradient(circle, var(--grid-major) 1.5px, transparent 1.75px),
    radial-gradient(circle, var(--grid-minor) .9px, transparent 1.15px);
  background-size: calc(var(--grid) * 6) calc(var(--grid) * 6), var(--grid) var(--grid);
  background-position:
    calc(50% - var(--sheet-max) / 2 - var(--grid) * 3) calc(var(--grid) * -3),
    calc(50% - var(--sheet-max) / 2 - var(--grid) / 2) calc(var(--grid) / -2);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
img, video, svg { max-width: 100%; }
img, video { display: block; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.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;
}

/* Skip link */
.skip { position: absolute; left: -999px; top: 16px; z-index: 50; }
.skip:focus { left: 16px; background: var(--ink); color: var(--bg); padding: 8px 12px; }

/* Sheet frame: heavy outer border, light inner border, zone ticks along the top edge.
   The sheet is as tall as its content: no viewport min-height and no flex-grow on <main>,
   so a tall window never opens a gap above the footer.
   It is never wider than --sheet-max (an A3 sheet in portrait), centred on the desk. It is also the
   container every layout breakpoint inside it answers to (@container sheet), so the
   page lays out by the sheet's width, not the window's. */
.sheet {
  position: relative;
  container: sheet / inline-size;
  width: min(var(--sheet-max), 100% - 2 * var(--sheet-margin));
  margin: var(--sheet-margin) auto;
  background: var(--bg);
  border: 1.5px solid var(--frame);
}
@media (min-width: 901px) { .sheet { margin-block: 48px; } }
.sheet::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--rule-2); pointer-events: none; }
.zones { position: absolute; inset: 0; pointer-events: none; }
.zones span { position: absolute; top: -1px; width: 1px; height: 10px; background: var(--rule-2); }
.zones span:nth-child(1) { left: 16.6%; }
.zones span:nth-child(2) { left: 33.3%; }
.zones span:nth-child(3) { left: 50%; }
.zones span:nth-child(4) { left: 66.6%; }
.zones span:nth-child(5) { left: 83.3%; }
.inner { padding: var(--sheet-pad); }
main:focus { outline: none; }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.who { font-weight: 650; font-size: 15px; letter-spacing: .01em; text-decoration: none; margin-right: auto; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 28px; list-style: none; margin: 0; padding: 0; font-size: 15px; }
.site-nav a { display: inline-block; padding: 6px 0; text-decoration: none; }
.site-nav a[aria-current] { text-decoration: underline; }

/* Theme toggle: a small square key with a half-filled disc */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; padding: 0; margin: 0;
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule-2); border-radius: 0;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--frame); color: var(--accent-text); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }

/* Footer: a thin revision strip at the bottom of the sheet */
.site-footer {
  margin-top: 72px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 8px 24px;
  font-size: 13px; color: var(--ink-2);
}
.site-footer p { margin: 0; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.site-footer a { display: inline-block; padding: 4px 0; }
.site-footer a:not(:hover) { color: var(--ink); }

@media (max-width: 900px) {
  :root { --sheet-margin: 10px; --sheet-pad: 22px 18px 28px; }
  .sheet::before { inset: 6px; }
  .zones { display: none; }
  .site-nav { order: 3; flex-basis: 100%; }
  .site-nav ul { gap: 0 18px; font-size: 15px; }
  .site-footer { margin-top: 56px; flex-direction: column; }
  /* Touch: 44px targets for the name, nav, theme toggle and footer links */
  .who { display: inline-block; padding: 11px 0; }
  .site-nav a { padding: 11px 0; }
  .theme-toggle { width: 44px; height: 44px; }
  .site-footer ul { gap: 0 18px; }
  .site-footer a { padding: 12px 0; }
}

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

/* ---- components.css ---- */
/* Reusable components. Each block matches a macro in src/_includes/macros/ui.njk. */

/* ---------- Headings ---------- */
.display {
  font-size: clamp(40px, 5.4cqi, 80px);
  line-height: .98;
  font-weight: 700;
  font-variation-settings: "wdth" 70;
  letter-spacing: -.01em;
  margin: 0;
  max-width: 20ch;
}
.display em {
  white-space: nowrap;
  font-style: italic;
  font-weight: 650;
  font-variation-settings: "wdth" 80;
  color: var(--hl-ink);
  background: var(--hl-bg);
  padding: 0 .06em;
  margin: 0 -.06em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.h2 {
  font-size: clamp(28px, 3.4cqi, 44px);
  font-variation-settings: "wdth" 75;
  font-weight: 700;
  margin: 0;
  line-height: 1;
}
.lede { max-width: 54ch; font-size: 19px; color: var(--ink-2); margin: 28px 0 0; }
.lede strong { color: var(--ink); font-weight: 600; }

/* ---------- Dimension line: |<--- label --->| ---------- */
.dim { display: flex; align-items: center; gap: 10px; margin-top: 34px; color: var(--ink-2); font-size: 13px; max-width: 640px; }
.dim i { flex: 1; height: 1px; background: var(--ink-2); position: relative; }
.dim i::before, .dim i::after { content: ""; position: absolute; top: -4px; width: 0; height: 0; border: 4px solid transparent; }
.dim .l::before { left: 0; border-right: 7px solid var(--ink-2); border-left: 0; }
.dim .r::after { right: 0; border-left: 7px solid var(--ink-2); border-right: 0; }
.dim::before, .dim::after { content: ""; width: 1px; height: 16px; background: var(--ink-2); }

/* ---------- Title block (the 5-second summary box) ---------- */
/* Every cell draws a right and bottom line and overhangs by 1px; overflow clips the
   lines that would double the frame. Works for any mix of wide and paired cells. */
.tb { border: 1.5px solid var(--frame); font-size: 14px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.tb > div { padding: 9px 12px; border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); margin: 0 -1px -1px 0; min-width: 0; }
.tb > .w { grid-column: 1 / -1; }
.tb small { display: block; font-size: 11px; color: var(--ink-2); font-variation-settings: "wdth" 85; letter-spacing: .02em; }
.tb .big { font-size: 20px; font-weight: 650; font-variation-settings: "wdth" 80; }
.tb a { font-weight: 600; }

/* ---------- Section head: heavy rule, optional detail tag, title, kind ---------- */
.section-head { display: flex; align-items: baseline; gap: 18px; border-top: 1.5px solid var(--frame); padding-top: 16px; }
.detail-tag {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px;
  border: 1.5px solid var(--frame); border-radius: 50%;
  font-weight: 700; font-size: 18px;
}
.section-head .kind { color: var(--ink-2); font-size: 15px; margin-left: auto; }

/* ---------- Detail view: plate + numbered callouts + legend ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 48px; padding-top: 32px; }
.figure { margin: 0; }
.plate { position: relative; background: var(--plate); padding: 2.2%; border: 1px solid var(--plate-edge); }
.stage { position: relative; }
.stage img { display: block; width: 100%; height: auto; }
.mark {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: var(--mark-bg, var(--bg)); color: var(--mark-ink, var(--ink));
  border: 1.5px solid var(--mark-edge, var(--frame));
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  transition: transform .15s;
}
/* Callout names written beside their balloons, like drawing annotations. On narrow screens they
   drop out and the legend's numbers come back to carry the link. */
.mark-label {
  position: absolute; transform: translate(22px, -50%); white-space: nowrap; pointer-events: none;
  font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
  transition: color .15s;
}
.stage[data-on="1"] .ml1, .stage[data-on="2"] .ml2, .stage[data-on="3"] .ml3, .stage[data-on="4"] .ml4 { color: var(--accent); }
@container sheet (min-width: 681px) {
  .detail:has(.mark-label) .legend button { grid-template-columns: 1fr; }
  .detail:has(.mark-label) .legend .n { display: none; }
}
@container sheet (max-width: 680px) { .mark-label { display: none; } }
.ring { position: absolute; border: 2px solid var(--ring-1); border-radius: 10px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.ring.r2 { border-color: var(--ring-2); }
.ring.r3 { border-color: var(--ring-3); }
.ring.r4 { border-color: var(--ring-4); border-style: dashed; }
.stage[data-on="1"] .r1, .stage[data-on="2"] .r2, .stage[data-on="3"] .r3, .stage[data-on="4"] .r4 { opacity: 1; }
.stage[data-on="1"] .m1, .stage[data-on="2"] .m2, .stage[data-on="3"] .m3, .stage[data-on="4"] .m4 {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: scale(1.12);
}
.figure figcaption {
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 13px; color: var(--ink-2);
  padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.figure figcaption .scale { white-space: nowrap; }

.desc { font-size: 17px; margin: 0 0 22px; }

.legend { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.legend li { border-bottom: 1px solid var(--rule); }
.legend button {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start;
  padding: 12px 0; width: 100%;
}
.legend button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.legend .n {
  width: 26px; height: 26px; border: 1.5px solid var(--frame); border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.legend b { display: block; font-weight: 650; }
.legend .t { color: var(--ink-2); font-size: 15px; }
.legend button:hover .n, .legend button:focus-visible .n, .legend button[aria-pressed="true"] .n {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}

/* ---------- Buttons ----------
   .btn-row holds a primary action followed by quiet text actions. */
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 22px; font-weight: 600; }
.btn { display: inline-block; padding: 10px 0; }
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); padding: 10px 16px; text-decoration: none; }
.btn--primary:hover { background: var(--btn-hover-bg); color: var(--btn-hover-fg); }

/* ---------- Notes box (drawing notes) ---------- */
.notes { margin-top: 26px; font-size: 13px; color: var(--ink-2); border: 1px solid var(--rule-2); padding: 10px 12px; }
.notes b { color: var(--ink); }
.notes ol { margin: 4px 0 0; padding-left: 18px; }

/* ---------- Index of work (borrowed from mockup C) ---------- */
.work-index { width: 100%; border-collapse: collapse; font-size: 16px; margin-top: 8px; }
.work-index td, .work-index th {
  padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule);
  text-align: left; vertical-align: baseline; font-weight: 400;
}
.work-index .n { width: 56px; color: var(--ink-2); }
.work-index th { font-size: 24px; font-weight: 650; font-variation-settings: "wdth" 80; line-height: 1.15; width: 30%; }
.work-index th a { text-decoration: none; }
.work-index th a:hover, .work-index tr:hover th a { color: var(--accent-text); text-decoration: underline; }
.work-index .k { color: var(--ink-2); }
.work-index .y { text-align: right; color: var(--ink-2); white-space: nowrap; padding-right: 0; }

@container sheet (max-width: 880px) {
  .display { font-size: 40px; }
  .display em { white-space: normal; }
  .lede { font-size: 17px; }
  .detail { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .section-head .kind { display: none; }
  .mark { width: 24px; height: 24px; margin: -12px 0 0 -12px; font-size: 12px; }
}
@container sheet (max-width: 620px) {
  .work-index, .work-index tbody { display: block; }
  .work-index tr {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 12px;
    padding: 14px 0; border-bottom: 1px solid var(--rule);
  }
  .work-index td, .work-index th { padding: 0; border: 0; width: auto; }
  .work-index th { font-size: 21px; grid-column: 2; }
  .work-index th a { display: inline-block; padding: 11px 0; margin: -11px 0; }
  .work-index .n { grid-column: 1; grid-row: 1; align-self: baseline; padding-top: 4px; }
  .work-index .y { grid-column: 3; grid-row: 1; padding-top: 4px; }
  .work-index .k { grid-column: 2 / -1; margin-top: 4px; }
}

/* ---- drawing.css ---- */
/* Line drawings: the Stream Deck XL and its keys (svg/deck.njk).
   Drawn like the rest of the sheet: a heavy outline, medium key outlines, thin centre,
   dimension and hatch lines. Every colour is a theme token, so the drawing re-themes.
   Strokes don't scale (vector-effect), so line weights stay the same at any width. */

.plate--drawing { background: none; border-color: var(--rule); padding: 3% 2.5%; }

.dk { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.dk * { vector-effect: non-scaling-stroke; }
.dk path, .dk rect, .dk circle { fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Body: visible outline heavy, face edge thin; centre lines thin chain */
.dk-body { stroke: var(--ink); stroke-width: 2.25px; }
.dk-face { stroke: var(--ink-2); stroke-width: .75px; }
.dk path.dk-cl { stroke: var(--ink-2); stroke-width: .75px; stroke-dasharray: 22 5 3 5; stroke-linecap: butt; opacity: .8; }

/* Keys */
.dk .dk-kb { stroke: var(--ink); stroke-width: 1.4px; }
.dk-key--needs .dk-kb { stroke: var(--accent); stroke-width: 2.25px; }
.dk-key--failed .dk-kb { stroke-width: 2.25px; }
.dk-key--limit .dk-kb { stroke-dasharray: 5 4; stroke-linecap: butt; }
.dk-key--empty .dk-kb { stroke: var(--rule-2); stroke-width: 1px; }

.dk .dk-g circle, .dk .dk-g path { stroke: var(--ink); stroke-width: 1.4px; }
.dk .dk-g .dk-gdot { fill: var(--ink); stroke: none; }
.dk-key--needs .dk-g circle, .dk-key--needs .dk-g path, .dk-key--summary .dk-g circle, .dk-key--summary .dk-g path { stroke: var(--accent); }
.dk-key--needs .dk-g .dk-gdot, .dk-key--summary .dk-g .dk-gdot { fill: var(--accent); }

.dk .dk-spin0 { stroke: var(--rule-2); stroke-width: 1px; }
.dk .dk-spin { stroke: var(--ink); stroke-width: 2px; }
.dk-key--background .dk-spin { stroke: var(--ink-2); stroke-dasharray: 3 3; stroke-linecap: butt; }

.dk .dk-txt { stroke: var(--ink-2); stroke-width: 1px; }
.dk .dk-txt--sub { stroke: var(--rule-2); }
.dk .dk-num { stroke: var(--ink); stroke-width: 2.5px; }
.dk .dk-badge { stroke: var(--ink-2); stroke-width: 1px; }
.dk .dk-bar0 { stroke: var(--rule-2); stroke-width: 1px; }
.dk .dk-bar { stroke: var(--ink); stroke-width: 2px; }
.dk .dk-meter { stroke: var(--ink); stroke-width: 1px; }
.dk .dk-meter-fill { fill: var(--rule-2); stroke: none; }
.dk .dk-tick { stroke: var(--ink); stroke-width: 1.4px; }
.dk .dk-gauge0 { stroke: var(--rule-2); stroke-width: 2.5px; }
.dk .dk-gauge { stroke: var(--ink); stroke-width: 2.5px; stroke-linecap: butt; }

/* Text written out on the key sheet */
.dk-t { fill: var(--ink); font-size: 7.2px; font-weight: 600; }
.dk-ts { fill: var(--ink-2); font-size: 5.6px; font-weight: 500; }
.dk-ts--end { text-anchor: end; }
.dk-tb { fill: var(--ink-2); font-size: 4.6px; font-weight: 700; letter-spacing: .04em; text-anchor: middle; dominant-baseline: central; }
.dk-key--limit .dk-tb { fill: var(--accent-text); }

/* Dimensions and leaders */
.dk .dk-ext, .dk .dk-dim { stroke: var(--ink-2); stroke-width: .75px; stroke-linecap: butt; }
.dk .dk-ah { fill: context-stroke; stroke: none; }
/* The text sits on its dimension line; a halo in the paper colour breaks the line */
.dk .dk-dimtxt {
  fill: var(--ink-2); font-size: 18px; font-weight: 500; letter-spacing: .08em;
  text-anchor: middle; dominant-baseline: central;
  paint-order: stroke; stroke: var(--bg); stroke-width: 12px; stroke-linejoin: round;
  vector-effect: none;
}
.dk .dk-ldr { stroke: var(--ink); stroke-width: 1px; stroke-linecap: butt; transition: stroke .15s; }

/* Legend highlight: ring the key and colour its leader */
.dk .dk-hl { stroke: var(--accent); stroke-width: 2px; opacity: 0; transition: opacity .15s; }
.stage[data-on="1"] .c1 .dk-hl, .stage[data-on="2"] .c2 .dk-hl,
.stage[data-on="3"] .c3 .dk-hl, .stage[data-on="4"] .c4 .dk-hl { opacity: 1; }
.stage[data-on="1"] .dk-ldr.c1, .stage[data-on="2"] .dk-ldr.c2,
.stage[data-on="3"] .dk-ldr.c3, .stage[data-on="4"] .dk-ldr.c4 { stroke: var(--accent); stroke-width: 1.75px; }

/* Phone: hatch lines would blur into grey, so drop them; enlarge the dimension text */
@container sheet (max-width: 620px) {
  .plate--drawing { padding: 12px 6px; }
  .dk-xl .dk-txt, .dk-xl .dk-badge, .dk-xl .dk-bar0, .dk-xl .dk-bar { display: none; }
  .dk .dk-dimtxt { font-size: 32px; stroke-width: 20px; }
  .dk-xl .dk-face { display: none; }
}

/* ---- home.css ---- */
/* Home page layout. Components it uses live in components.css. */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; padding: 64px 0 56px; align-items: end; }

.home-section { margin-top: 88px; }

/* Closing "let's talk" block */
.talk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; padding-top: 28px; align-items: start; }
.talk p { margin: 0; max-width: 52ch; font-size: 19px; color: var(--ink-2); }
.talk .mail { font-size: clamp(22px, 2.6cqi, 34px); font-weight: 650; font-variation-settings: "wdth" 80; line-height: 1.1; overflow-wrap: anywhere; }
.talk .btn-row { margin-top: 18px; }

@container sheet (max-width: 880px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 40px 0; }
  .home-section { margin-top: 56px; }
  .talk { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
  .talk p { font-size: 17px; }
  /* 44px touch target without moving anything */
  .talk .mail { display: inline-block; padding: 10px 0; margin: -10px 0; }
}

/* ---- work.css ---- */
/* /work/ index and the Deck for T3 Code case study. Components come from components.css;
   this file only lays them out and adds the case-study pieces (key sheet, flow, spec
   table, stats). Colours come from tokens.css; the drawn keys are styled in drawing.css. */

/* ---------- Page heads (index + case study): text left, title block right ---------- */
.work-head, .cs-head {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 56px;
  padding: 64px 0 56px; align-items: end;
}
.cs-head .notes { margin-top: 14px; }
.cs-kicker { margin: 0 0 18px; font-size: 14px; color: var(--ink-2); letter-spacing: .02em; }
.cs-kicker a { color: var(--ink); }

/* ---------- /work/: detailed index rows ---------- */
.work-list { margin-top: 8px; }
.work-index--detailed th { vertical-align: top; }
.work-index--detailed td { vertical-align: top; }
.work-index--detailed .n, .work-index--detailed .y { padding-top: 21px; }
.work-index--detailed .k { color: var(--ink); }
.work-index--detailed .sum { display: block; font-weight: 600; margin-bottom: 6px; }
.work-index--detailed .about { display: block; color: var(--ink-2); max-width: 62ch; }
.work-index--detailed .more { display: inline-block; margin-top: 10px; padding: 4px 0; font-weight: 600; }
.work-talk { margin-top: 88px; }

/* ---------- Case study sections ---------- */
.cs-section { margin-top: 88px; }
.cs-body { padding-top: 28px; }
.cs-body--split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; }
.case-study .prose { max-width: 64ch; }
.case-study .prose p { margin: 0 0 16px; font-size: 18px; }
.case-study .prose p:last-child { margin-bottom: 0; }
.detail .prose { margin-bottom: 22px; }
.detail .prose p { font-size: 17px; }
.case-study code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--fill); padding: 1px 5px; border-radius: 3px;
}
.cs-more { margin: 14px 0 0; font-size: 15px; font-weight: 600; }

/* Demo video: full width, right under the head */
.cs-demo { margin: 8px 0 0; }

/* ---------- Key sheet: 4 x 2 keys on the plate, numbered callouts ---------- */
.keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(18px, 2.2cqi, 30px); padding: clamp(14px, 2cqi, 26px); }
.key { position: relative; aspect-ratio: 1; }
.keys .mark { left: 94%; top: 6%; }
/* Legend highlight: ring the drawn key (css/drawing.css draws the ring, .dk-hl) */
.stage[data-on="1"] .k1 .dk-hl, .stage[data-on="2"] .k2 .dk-hl, .stage[data-on="3"] .k3 .dk-hl, .stage[data-on="4"] .k4 .dk-hl,
.stage[data-on="5"] .k5 .dk-hl, .stage[data-on="6"] .k6 .dk-hl, .stage[data-on="7"] .k7 .dk-hl { opacity: 1; }
.stage[data-on="5"] .m5, .stage[data-on="6"] .m6, .stage[data-on="7"] .m7 {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: scale(1.12);
}
/* The two keys that blink on a real deck blink here too, for a few seconds only
   (WCAG 2.2.2), and again while their legend row is active. Reduced motion: base.css
   switches all animation off. */
.k1 .dk-key { animation: key-blink 1s steps(1, end) 4; }
.k2 .dk-key { animation: key-blink 1.25s steps(1, end) 3; }
.stage[data-on="1"] .k1 .dk-key { animation: key-blink-again 1s steps(1, end) 4; }
.stage[data-on="2"] .k2 .dk-key { animation: key-blink-again 1.25s steps(1, end) 3; }
@keyframes key-blink { 50% { opacity: .3; } }
@keyframes key-blink-again { 50% { opacity: .3; } }
.detail .legend { margin-top: 0; }
/* Keep the key sheet in view while reading its long legend */
@container sheet (min-width: 881px) { .case-study .detail > .figure { position: sticky; top: 24px; align-self: start; } }

/* ---------- Local only: data-flow strip ---------- */
.flow {
  list-style: none; margin: 0 0 28px; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr) 64px minmax(0, 1fr);
  align-items: center; text-align: center;
}
.flow li:not(.flow-link) { border: 1.5px solid var(--frame); padding: 12px 8px; min-width: 0; }
.flow b { display: block; font-weight: 650; font-variation-settings: "wdth" 85; line-height: 1.2; }
.flow li > span { display: block; font-size: 13px; color: var(--ink-2); }
.flow-link { position: relative; height: 1px; background: var(--ink-2); margin: 0 6px; }
.flow-link::before, .flow-link::after {
  content: ""; position: absolute; top: -4px; border: 4px solid transparent;
}
.flow-link::before { left: 0; border-right: 7px solid var(--ink-2); border-left: 0; }
.flow-link::after { right: 0; border-left: 7px solid var(--ink-2); border-right: 0; }
.flow-link span { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: 12px; color: var(--ink-2); white-space: nowrap; }

/* Spec table (tokens) */
.spec { width: 100%; border-collapse: collapse; font-size: 15px; border-top: 1.5px solid var(--frame); }
.spec caption { text-align: left; font-weight: 650; padding-bottom: 8px; }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); }
.spec thead th { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; padding-top: 8px; padding-bottom: 8px; }
.spec tbody th { font-weight: 650; width: 34%; }
.spec tbody th span { display: block; font-weight: 400; font-size: 13px; color: var(--ink-2); }
.spec td:last-child { padding-right: 0; }

/* ---------- Numbers: a title-block style grid of big figures ---------- */
.stats {
  margin: 28px 0 0; border: 1.5px solid var(--frame);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stats > div { padding: 14px 16px 16px; border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); min-width: 0; }
.stats > div:nth-child(3n) { border-right: 0; }
.stats > div:nth-last-child(-n + 3) { border-bottom: 0; }
.stats dt { font-size: 12px; color: var(--ink-2); letter-spacing: .02em; font-variation-settings: "wdth" 85; }
.stats dd { margin: 4px 0 2px; font-size: clamp(32px, 3.6cqi, 48px); line-height: 1.05; font-weight: 700; font-variation-settings: "wdth" 72; }
.stats dd.sub { margin: 0; font-size: 13px; line-height: 1.55; font-weight: 400; font-variation-settings: "wdth" 100; color: var(--ink-2); }
.cs-footnote { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); max-width: 90ch; }

/* Closing blocks reuse .talk from home.css */
.case-study .talk { padding-top: 28px; }

@container sheet (max-width: 880px) {
  .work-head, .cs-head { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 40px 0; }
  .cs-section, .work-talk { margin-top: 56px; }
  .cs-body { padding-top: 20px; }
  .cs-body--split { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .case-study .prose p { font-size: 17px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3n) { border-right: 1px solid var(--rule-2); }
  .stats > div:nth-child(2n) { border-right: 0; }
  .stats > div:nth-last-child(-n + 3) { border-bottom: 1px solid var(--rule-2); }
  .stats > div:nth-last-child(-n + 2) { border-bottom: 0; }
}
@container sheet (max-width: 620px) {
  .work-index--detailed .n, .work-index--detailed .y { padding-top: 4px; }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .flow-link { width: 1px; height: 34px; margin: 0 auto; }
  .flow-link::before { left: -4px; top: 0; border: 4px solid transparent; border-bottom: 7px solid var(--ink-2); border-top: 0; }
  .flow-link::after { left: -4px; right: auto; top: auto; bottom: 0; border: 4px solid transparent; border-top: 7px solid var(--ink-2); border-bottom: 0; }
  .flow-link span { left: 12px; bottom: auto; top: 50%; transform: translateY(-50%); }
  .spec thead { display: none; }
  .spec, .spec tbody, .spec tr, .spec th, .spec td, .spec tbody th { display: block; width: auto; }
  .spec tr { padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .spec th, .spec td { border: 0; padding: 2px 0; }
  .spec td:nth-of-type(1)::before { content: "Scope: "; color: var(--ink-2); }
  .spec td:nth-of-type(2)::before { content: "Lifetime: "; color: var(--ink-2); }
  .spec caption { display: block; }
  .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; padding: 16px 20px; }
}

/* ---- pages.css ---- */
/* Inner pages: /about/, /now/, /support/, 404. Components live in components.css. */
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; padding: 64px 0 24px; align-items: start; }
.page-head--single { grid-template-columns: minmax(0, 1fr); padding-bottom: 8px; }
.page-aside { min-width: 0; }
.portrait { margin: 0; border: 1.5px solid var(--frame); border-bottom: 0; padding: 22px 22px 0; }
.portrait-art {
  aspect-ratio: 1; width: min(100%, 300px); margin: 0 auto; background: var(--ink);
  -webkit-mask: var(--portrait) center / contain no-repeat; mask: var(--portrait) center / contain no-repeat;
}
.portrait figcaption { font-size: 12px; color: var(--ink-2); text-align: right; padding: 10px 0 8px; letter-spacing: .02em; }
.page-head .display { max-width: 14ch; }
.page-head--single .display { max-width: 20ch; }
.page-section { margin-top: 72px; }

.page .prose { max-width: 60ch; font-size: 17px; }
.page .prose .lede { margin-top: 28px; }
.page .prose p { margin: 16px 0 0; }
.prose--wide { padding-top: 24px; }
.prose--wide p:first-child { margin-top: 0; }
.page .prose .btn-row { margin: 0 0 18px; }
.page .prose .aside { color: var(--ink-2); font-size: 15px; margin-top: 28px; }
.stamp { margin: 20px 0 0; color: var(--ink-2); font-size: 14px; font-variation-settings: "wdth" 85; letter-spacing: .02em; }

/* Revision table */
.rev-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.rev-table th, .rev-table td { text-align: left; vertical-align: baseline; padding: 14px 18px 14px 0; border-bottom: 1px solid var(--rule); font-weight: 400; }
.rev-table thead th { font-size: 12px; color: var(--ink-2); font-variation-settings: "wdth" 85; letter-spacing: .04em; text-transform: uppercase; border-bottom: 1.5px solid var(--frame); padding-top: 18px; }
.rev-table tbody th { font-weight: 650; font-size: 19px; font-variation-settings: "wdth" 85; width: 24%; }
.rev-table .rev { width: 56px; font-weight: 700; font-size: 20px; }
.rev-table .per { width: 15%; color: var(--ink-2); white-space: nowrap; }
.rev-table td:last-child { padding-right: 0; }

.certs { padding-top: 24px; }
/* Certification badges: drawn hexagons in the sheet's ink, linked to Credly */
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1.5px solid var(--frame); border-left: 1px solid var(--rule-2); }
.badges li { border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); }
.badge { display: grid; place-items: center; padding: 24px 12px; color: var(--ink); text-decoration: none; height: 100%; box-sizing: border-box; }
.badge svg { width: 100%; max-width: 184px; height: auto; overflow: visible; }
.badge .b-out, .badge .b-in { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; transition: stroke .15s; }
.badge .b-in { stroke-width: 1.2; }
.badge--specialty .b-in { stroke-dasharray: 4 3; }
.badge--foundational .b-out { stroke-width: 1.2; }
.badge .b-band { fill: currentColor; transition: fill .15s; }
.badge text { fill: currentColor; text-anchor: middle; font-family: inherit; transition: fill .15s; }
.badge .b-aws { font-size: 26px; font-weight: 750; letter-spacing: .02em; }
.badge .b-cert { font-size: 12px; font-weight: 600; letter-spacing: .22em; }
.badge .b-name { font-size: 19px; font-weight: 700; font-variation-settings: "wdth" 82; }
.badge .b-tier { fill: var(--bg); font-size: 12.5px; font-weight: 700; letter-spacing: .16em; }
.badge:hover, .badge:focus-visible { color: var(--accent); }
.badge:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
.cert-more { color: var(--ink-2); font-size: 15px; margin: 14px 0 0; max-width: 70ch; }

.page .talk p { max-width: 46ch; }

@container sheet (max-width: 880px) {
  .page-head { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 40px 0 8px; }
  .page-section { margin-top: 48px; }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .badge { padding: 18px 8px; }
}
@container sheet (max-width: 620px) {
  .rev-table, .rev-table tbody, .rev-table tr { display: block; }
  .rev-table thead { display: none; }
  .rev-table tr { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .rev-table th, .rev-table td, .rev-table tbody th, .rev-table .rev, .rev-table .per { display: block; padding: 0; border: 0; width: auto; }
  .rev-table .rev { grid-row: 1 / span 3; }
  .rev-table .per { font-size: 14px; }
  .rev-table td:last-child { margin-top: 6px; }
}

/* ---- notes.css ---- */
/* Notes (index, note layout, prose) and the email signup block. */

/* ---------- Notes index ---------- */
/* Same top spacing as the other page heads (pages.css .page-head) */
.notes-index, .note { padding-top: 64px; }
.note-list { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1.5px solid var(--frame); }
.note-list li {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 4px 0;
  padding: 18px 0; border-bottom: 1px solid var(--rule); align-items: baseline;
}
.note-list__n { color: var(--ink-2); grid-column: 1; grid-row: 1; }
.note-list__title { grid-column: 2; margin: 0; font-size: 24px; font-weight: 650; font-variation-settings: "wdth" 80; line-height: 1.15; }
.note-list__title a { text-decoration: none; }
.note-list__title a:hover { color: var(--accent-text); text-decoration: underline; }
.note-list__desc { grid-column: 2; margin: 0; color: var(--ink-2); max-width: 62ch; }
.note-list__date { grid-column: 3; grid-row: 1; color: var(--ink-2); white-space: nowrap; }

/* ---------- Note page ---------- */
.note__crumb { margin: 0 0 18px; font-size: 14px; color: var(--ink-2); }
.note__title { max-width: 24ch; }
.note__meta { margin: 18px 0 0; color: var(--ink-2); font-size: 14px; }
.note__head { padding-bottom: 28px; border-bottom: 1.5px solid var(--frame); }
.note__foot { margin-top: 56px; }
.note__foot > p { margin-top: 28px; color: var(--ink-2); }

.note .prose { max-width: 66ch; margin-top: 32px; font-size: 18px; line-height: 1.65; }
.note .prose h2 { font-size: 30px; font-variation-settings: "wdth" 75; font-weight: 700; line-height: 1.1; margin: 2.2em 0 .6em; }
.note .prose h3 { font-size: 21px; font-weight: 650; margin: 1.8em 0 .5em; }
.note .prose p, .note .prose ul, .note .prose ol { margin: 0 0 1.1em; }
.note .prose li { margin-bottom: .35em; }
.note .prose a { text-decoration: underline; }
.note .prose blockquote { margin: 1.4em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--rule-2); color: var(--ink-2); }
.note .prose code { font-family: var(--font-mono); font-size: .9em; background: var(--fill); padding: .1em .35em; }
.note .prose pre { background: var(--fill); border: 1px solid var(--rule); padding: 14px 16px; overflow-x: auto; font-size: 15px; line-height: 1.5; }
.note .prose pre code { background: none; padding: 0; }
.note .prose img { margin: 1.4em 0; border: 1px solid var(--rule); }
.note .prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }

/* ---------- Email signup (partials/signup.njk) ---------- */
.signup { border: 1.5px solid var(--frame); background: var(--fill); padding: 20px 22px; max-width: 640px; }
.signup__label { display: block; font-size: 22px; font-weight: 650; font-variation-settings: "wdth" 80; line-height: 1.2; margin-bottom: 12px; }
.signup__row { display: flex; flex-wrap: wrap; gap: 10px; }
.signup__input {
  flex: 1 1 240px; min-width: 0; font: inherit; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--frame); border-radius: 0; padding: 10px 12px;
}
.signup__input::placeholder { color: var(--ink-2); opacity: 1; }
.signup__button { font: inherit; font-weight: 600; border: 0; border-radius: 0; cursor: pointer; }
.signup__note { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }

@container sheet (max-width: 880px) {
  .notes-index, .note { padding-top: 40px; }
}
@container sheet (max-width: 620px) {
  .note-list li { grid-template-columns: 40px minmax(0, 1fr); }
  .note-list__date { grid-column: 2; grid-row: auto; }
  .note-list__title { font-size: 21px; }
  .note .prose { font-size: 17px; }
}

/* ---- terminal.css ---- */
/* Hidden terminal easter egg (assets/js/terminal.js). Press ` or the Konami code.
   A dark plate in both themes, like the product renders, with the amber callout colour. */
.term {
  position: fixed; inset: auto 0 0 0; height: 60vh; z-index: 100;
  display: flex; flex-direction: column;
  background: var(--term-bg); color: var(--term-ink);
  font: 14px/1.5 var(--font-mono);
  border-top: 1.5px solid var(--term-edge);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .45);
  transform: translateY(100%); visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s;
}
.term.open { transform: translateY(0); visibility: visible; transition: transform .25s ease; }
.term-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 18px; border-bottom: 1px solid #22303D;
  font: 600 12px/1.4 var(--font); letter-spacing: .04em; color: var(--term-ink-2);
}
.term-close {
  background: none; border: 1px solid #3A4B5C; color: var(--term-ink);
  font: inherit; padding: 2px 8px; cursor: pointer;
}
.term-close:hover { border-color: var(--term-accent); color: var(--term-accent); }
.term-out { flex: 1; overflow-y: auto; padding: 14px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.term-line { display: flex; gap: 8px; padding: 8px 18px; border-top: 1px solid #22303D; }
.term-prompt { color: var(--term-accent); white-space: nowrap; }
.term-input {
  flex: 1; min-width: 0; background: none; border: none; color: var(--term-ink);
  font: inherit; outline: none; caret-color: var(--term-accent);
}
.term a, .term-link { color: var(--term-accent); text-underline-offset: 3px; }
.term :focus-visible { outline: 2px solid var(--term-accent); outline-offset: 2px; }
.term .term-input:focus-visible { outline: none; } /* the caret marks focus; the dialog holds only this field and the close button */
