/* siniaev.dev field notes, "control room": one dark system, one accent per project.
   Guide: docs/project-pages.md. Each page sets --accent (brand) and --accent-dark (readable on the dark ground). */
:root {
  color-scheme: dark;
  --bg: #0a0b0f;
  --panel: #12141c;
  --ink: #f4f5f7;
  --ink-2: #c9cdd4;
  --muted: #9aa0ab;
  --rule: #262a35;
  --paper: var(--bg);  /* old names, still used by the source previews */
  --paper-2: var(--panel);
  --accent: #e4570f;  /* each page overrides this and --accent-dark */
  --hl: var(--accent-dark, var(--accent));
  --met: #6fbf73;
  --missed: #ef7a6f;
  --sans: "Instrument Sans", -apple-system, system-ui, sans-serif;  /* self-hosted, assets/fonts (OFL) */
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --serif: var(--sans);
  --inset: 20px;
  --col: 680px;
}
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-400-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: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-ext-400-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: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-500-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: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-ext-500-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: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-600-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: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-ext-600-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: "Instrument Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-700-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: "Instrument Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-ext-700-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: "Instrument Sans"; font-style: italic; font-weight: 600; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-600-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; }
@font-face { font-family: "Instrument Sans"; font-style: italic; font-weight: 600; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-ext-600-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: "Instrument Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-400-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; }
@font-face { font-family: "Instrument Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-ext-400-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: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/jetbrains-mono-latin-500-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: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/jetbrains-mono-latin-ext-500-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: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/jetbrains-mono-latin-700-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: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/jetbrains-mono-latin-ext-700-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; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--hl); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { color: var(--hl); }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; text-wrap: balance; margin: 0; }
p, li { text-wrap: pretty; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--panel); padding: 0 4px; border-radius: 2px; }

.page { max-width: 1120px; margin: 0 auto; padding: 0 40px 80px; }

/* Top bar: breadcrumb left, date right. */
.strip { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid var(--rule); max-width: var(--col); margin: 0 auto;
         font: 12px/1.4 var(--mono); color: var(--muted); }
/* The top bar stays on screen so home is always one click away; its ground runs edge to edge. */
.strip { position: sticky; top: 0; z-index: 10; background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax); }
html { scroll-padding-top: 64px; }
.strip a { text-decoration: none; }
.strip a[href="/"] { text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; }  /* the way home */ .strip a:hover { color: var(--ink); }

/* Masthead: name, lead, links; the definition note follows the links. */
.masthead { display: flex; flex-direction: column; padding: 64px 0 48px; max-width: var(--col); margin: 0 auto; border-bottom: 1px solid var(--rule); }
.masthead + .spec-strip { margin-top: 48px; }
.masthead > div:not(.tag) { order: 1; }
.masthead .tag { order: 2; font: 12.5px/1.6 var(--mono); color: var(--muted); margin-top: 32px; }
.masthead .tag b { color: var(--hl); font-weight: 700; margin-right: 8px; }
h1 { font-size: 56px; line-height: 1.05; letter-spacing: -.02em; max-width: 17ch; }
h1 .dot { color: var(--hl); }
.lead { font-size: 20px; line-height: 1.5; margin: 24px 0 24px; color: var(--ink-2); }
.go { display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 600; }
.go a[href^="http"]::after, .strip a[href^="http"]::after { content: "\00a0↗"; }  /* only links that leave the site */

/* Sections: a numbered label with a heavy rule, then the reading column; figures go wider. */
section { display: block; padding: 64px 0 0; }
.masthead + section { margin-top: 0; }
section > .num { font: 500 12.5px/1.4 var(--mono); color: var(--hl); font-weight: 700; padding-bottom: 8px; margin-bottom: 24px;
                 border-bottom: 2px solid var(--ink); max-width: var(--col); margin-left: auto; margin-right: auto; }
section > .num span { color: var(--muted); font-weight: 500; margin-left: 12px; }
section > .num:empty { display: none; }
section > .body { min-width: 0; max-width: var(--col); margin-left: auto; margin-right: auto; }
section > .body + .body, section > figure + .body { margin-top: 32px; }
h2 { font-size: 30px; line-height: 1.18; letter-spacing: -.01em; margin-bottom: 16px; }
h3 { font-size: 20px; line-height: 1.3; margin: 32px 0 8px; }
.body p { margin: 0 0 16px; color: var(--ink-2); }
.body ul { margin: 0 0 16px; padding-left: 20px; color: var(--ink-2); }
.body li { margin: 4px 0; }
.body li::marker { color: var(--hl); }
.wide { margin: 24px 0 8px; min-width: 0; }
section > figure:not(.wide) { max-width: var(--col); margin-left: auto; margin-right: auto; }
.note { font: 13px/1.6 var(--mono); color: var(--muted); margin: 16px 0; }

figure { margin: 24px 0 8px; min-width: 0; }
figure img, figure svg { display: block; width: 100%; height: auto; }
figure .frame { background: var(--panel); border: 1px solid var(--rule); }
figcaption { font: 12.5px/1.6 var(--mono); color: var(--muted); margin-top: 8px; max-width: 760px; }
figcaption b { color: var(--ink); font-weight: 700; }
.pair { display: grid; grid-template-columns: 1.55fr 1fr; gap: 24px; align-items: start; }
.pair > * { min-width: 0; }
.pair.even { grid-template-columns: 1fr 1fr; }
.phone { max-width: 328px; justify-self: center; }
/* The charger panel and the phone side by side at the same height; the panel is cropped from the top. */
.pair.same { grid-template-columns: minmax(0, 1fr) 328px; }
.pair.same .frame { height: 560px; overflow: hidden; }
.pair.same .frame img { height: 100%; width: 100%; object-fit: cover; object-position: top; }
@media (max-width: 900px) { .pair.same { grid-template-columns: 1fr; } .pair.same .frame { height: auto; } .pair.same .frame img { height: auto; } }
.scroll-x { overflow-x: auto; }

/* Spec sheet: key and value rows. */
dl.spec { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 16px 0 8px; border-top: 2px solid var(--ink); font-size: 15px; }
dl.spec dt, dl.spec dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--rule); }
dl.spec dt { font: 700 13px/1.6 var(--mono); padding-right: 24px; color: var(--ink); }
dl.spec dd { color: var(--ink-2); }

/* Spec strip: four numbers in a panel, one inset outside the text column so its text lines up. */
.spec-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 auto 0; max-width: calc(var(--col) + 2 * var(--inset));
              background: var(--panel); border: 1px solid var(--rule); border-top: 2px solid var(--ink); }
.spec-strip > div { padding: 16px var(--inset); border-right: 1px solid var(--rule); }
.spec-strip > div:last-child { border-right: 0; }
.spec-strip .n { font: 700 36px/1 var(--mono); letter-spacing: -.02em; color: var(--ink); }
.spec-strip .n small { font-size: 14px; color: var(--muted); margin-left: 4px; }
.spec-strip .l { font: 500 12.5px/1.4 var(--mono); color: var(--muted); margin-top: 12px; }
.spec-strip .hot .n { color: var(--hl); }

/* Decision box: only with a real decision in the author's words. */
.decision { display: grid; grid-template-columns: repeat(3, 1fr); margin: 24px calc(-1 * var(--inset)) 16px; background: var(--panel); border: 1px solid var(--rule); }
.decision > div { padding: 16px var(--inset); border-right: 1px solid var(--rule); }
.decision > div:last-child { border-right: 0; }
.decision h3 { font: 700 12.5px/1.4 var(--mono); color: var(--muted); margin: 0 0 8px; }
.decision > div:first-child h3 { color: var(--hl); }
.decision p { margin: 0; color: var(--ink); font-size: 16px; line-height: 1.5; font-weight: 500; }

/* Timestamped log: only with real data. */
.tlog { margin: 32px 0 16px calc(-1 * var(--inset)); padding-left: calc(var(--inset) - 1px); border-left: 1px solid var(--rule);
        font: 500 13.5px/1.9 var(--mono); color: var(--ink-2); }
.tlog > div { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; }
.tlog b { color: var(--muted); font-weight: 500; } .tlog .a { color: var(--hl); }

table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0 8px; }
th, td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
th { font: 500 12.5px/1.4 var(--mono); color: var(--muted); border-bottom: 2px solid var(--ink); }
td.n { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.met { color: var(--met); font-weight: 700; } .missed { color: var(--missed); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; padding: 0; list-style: none; }
.chips li { font: 12.5px/1.2 var(--mono); border: 1px solid var(--rule); padding: 4px 8px; margin: 0; background: var(--panel); color: var(--ink-2); }
.chips li.expected { border-style: dashed; color: var(--muted); background: transparent; }

ol.log { list-style: none; padding: 0; margin: 8px 0; counter-reset: log; }
ol.log li { counter-increment: log; display: grid; grid-template-columns: 40px 1fr; padding: 12px 0; border-bottom: 1px solid var(--rule); margin: 0; }
ol.log li::before { content: counter(log, decimal-leading-zero); font: 700 13px/1.6 var(--mono); color: var(--hl); }
ol.log b { display: block; color: var(--ink); }
ol.log li > b, ol.log li > p { grid-column: 2; } ol.log li > p { margin: 4px 0 0; }

/* Drawings: ink lines, muted guides, the path that matters in the accent. Sources use the old paper colours; repaint them. */
svg text { font-family: var(--mono); fill: var(--ink); }
svg [fill="#1b1a17"] { fill: var(--ink); } svg [stroke="#1b1a17"] { stroke: var(--ink); }
svg [fill="#fbf9f4"] { fill: var(--panel); }
svg [fill="#e4570f"], svg [fill="#1f4f9e"], svg [fill="#8f5320"] { fill: var(--hl); }
svg .box { fill: var(--panel); stroke: var(--muted); stroke-width: 1.3; }
svg .box.hot { stroke: var(--hl); stroke-width: 2; }
svg .box.next { stroke-dasharray: 5 4; fill: none; }
svg .zone { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 4; }
svg .wire { fill: none; stroke: var(--muted); stroke-width: 1.3; }
svg .wire.hot { stroke: var(--hl); stroke-width: 2; }
svg .wire.next { stroke-dasharray: 5 4; }
svg .t { font-size: 13px; font-weight: 700; }
svg .s { font-size: 11px; fill: var(--muted); }
svg .lab { font-size: 10.5px; fill: var(--ink-2); }
svg .hv { fill: var(--hl); }

/* Hand annotations on one key figure per page: an ink layer over the screenshot, positions in %. */
.annotated { position: relative; container-type: inline-size; }
.annotated .shot { position: relative; }
.annotated .ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ink path { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ink path.halo { stroke: #f3efe6; stroke-width: 7; opacity: .85; }  /* light: the ink always sits on a screenshot */
.annotated .scrawl { position: absolute; left: var(--x); top: var(--y); max-width: var(--w, 30%); min-width: min-content; margin: 0; padding: .25em .5em .3em; background: #f3efe6; color: var(--accent);
  font: italic 600 clamp(10px, 1.8cqw, 18px)/1.25 var(--sans); transform: rotate(-2deg); box-shadow: 0 1px 0 #d6cebd; text-wrap: balance; }  /* paper note and brand accent: it sits on a light screenshot */
.annotated .scrawl i { font-style: normal; }
@container (max-width: 560px) {
  .annotated .scrawl { position: static; max-width: none; transform: none; box-shadow: none; padding: 8px 12px 10px; font-size: 14px; border-top: 1px solid var(--rule); }
}

/* An index card for one small fact a page is built around. */
.index-card { max-width: 440px; margin: 24px calc(-1 * var(--inset)) 16px; padding: 16px var(--inset); background: var(--panel); border: 1px solid var(--rule); border-top: 2px solid var(--ink); }
.index-card .k { font: 700 12.5px/1.4 var(--mono); color: var(--hl); margin: 0 0 8px; }
.index-card dl { display: grid; grid-template-columns: max-content max-content 1fr; gap: 0; margin: 0; font: 15px/1.5 var(--mono); }
.index-card dt, .index-card dd { margin: 0; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); } .index-card dd.arrow { color: var(--muted); }
.index-card dd b { color: var(--hl); font-weight: 600; }
.index-card p { margin: 12px 0 0; font: 13px/1.5 var(--mono); color: var(--muted); }

/* A sketch: a line drawing that explains, unnumbered so the Fig. sequence stays put. */
figure.sketch { max-width: 680px; }
.sketch .row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 40px; }
.sketch .row svg { width: 280px; max-width: 100%; flex: none; }
.sketch dl { flex: 1 1 240px; margin: 0; font: 13px/1.5 var(--mono); }
.sketch dt { font-weight: 600; } .sketch dd { margin: 0 0 12px; color: var(--muted); }
figure.sketch figcaption::before { content: "Sketch. "; font-weight: 700; color: var(--ink); }

/* More field notes, added by the publish script before the footer. */
section.more-notes > h2.num { letter-spacing: 0; }
.more-notes ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.more-notes li { color: var(--ink-2); }
.more-notes a { font-weight: 600; color: var(--ink); margin-right: 4px; }

footer { max-width: var(--col); margin-left: auto; margin-right: auto; border-top: 1px solid var(--rule); margin-top: 64px; padding-top: 16px; display: flex; justify-content: space-between;
         flex-wrap: wrap; gap: 8px; font: 12.5px/1.6 var(--mono); color: var(--muted); }

@media (max-width: 720px) {
  :root { --inset: 16px; }
  .strip > span:last-child { display: none; }  /* one-line sticky bar; the site link is also in the masthead */
  .page { padding: 0 24px 64px; }
  .masthead { padding: 48px 0 40px; }
  h1 { font-size: 36px; }
  .lead { font-size: 18px; }
  h2 { font-size: 26px; }
  section { padding-top: 48px; }
  .pair, .pair.even { grid-template-columns: 1fr; }
  dl.spec { grid-template-columns: 1fr; }
  dl.spec dt { border-bottom: 0; padding-bottom: 0; }
  .scroll-x svg { min-width: 760px; }
  .body > table { display: block; overflow-x: auto; }  /* wide tables scroll inside themselves */
  .spec-strip { grid-template-columns: 1fr 1fr; }
  .spec-strip > div:nth-child(2) { border-right: 0; }
  .spec-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .decision { grid-template-columns: 1fr; }
  .decision > div { border-right: 0; border-bottom: 1px solid var(--rule); }
  .decision > div:last-child { border-bottom: 0; }
}
@media (min-width: 721px) and (max-width: 900px) { .pair, .pair.even { grid-template-columns: 1fr; } .scroll-x svg { min-width: 760px; } }
