/* ==========================================================================
   MJS-OM-2026  |  Operator's Manual  |  marksalisburyai.com
   Two spot inks on warm paper. Dark mode is the blueprint of the same page.
   Hand-authored. No framework. View source is part of the pitch.
   ========================================================================== */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(fonts/Archivo-400_900-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/IBMPlexSans-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/IBMPlexSans-400-italic.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/IBMPlexMono-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/IBMPlexMono-500-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/IBMPlexMono-600-normal.woff2) format('woff2');
}

/* ---------- Tokens: PRINT (default) ---------- */
:root {
  --paper: #F3EEE3;
  --paper-2: #EAE3D2;
  --paper-3: #E0D7C2;
  --ink: #1B1A17;
  --ink-2: #4B473F;
  --ink-3: #7A7468;
  --rule: rgba(27, 26, 23, .24);
  --rule-soft: rgba(27, 26, 23, .12);
  --teal: #0A8A90;
  --teal-deep: #07666B;
  --teal-tint: rgba(10, 138, 144, .14);
  --magenta: #DB1268;
  --magenta-deep: #B40D54;
  --magenta-tint: rgba(219, 18, 104, .12);
  --overprint: #4A2C6B;
  --blend: multiply;
  --grid-line: rgba(10, 138, 144, .16);
  --plate: #D9D2C0;
  --plate-edge: #B9B19C;
  --shadow: rgba(27, 26, 23, .16);
  --grain-opacity: .55;

  --display: 'Archivo', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --body: 'IBM Plex Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

/* ---------- Tokens: BLUEPRINT ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="print"]) {
    --paper: #0C2742;
    --paper-2: #103152;
    --paper-3: #153B61;
    --ink: #EAF2FB;
    --ink-2: #B7CBE0;
    --ink-3: #86A2BF;
    --rule: rgba(234, 242, 251, .30);
    --rule-soft: rgba(234, 242, 251, .14);
    --teal: #7FE7EA;
    --teal-deep: #A9F1F3;
    --teal-tint: rgba(127, 231, 234, .13);
    --magenta: #FF86BA;
    --magenta-deep: #FFA5CB;
    --magenta-tint: rgba(255, 134, 186, .14);
    --overprint: #C9B6FF;
    --blend: screen;
    --grid-line: rgba(234, 242, 251, .10);
    --plate: #143A5F;
    --plate-edge: #2B5A8A;
    --shadow: rgba(0, 0, 0, .35);
    --grain-opacity: .35;
    color-scheme: dark;
  }
}
:root[data-theme="blueprint"] {
  --paper: #0C2742;
  --paper-2: #103152;
  --paper-3: #153B61;
  --ink: #EAF2FB;
  --ink-2: #B7CBE0;
  --ink-3: #86A2BF;
  --rule: rgba(234, 242, 251, .30);
  --rule-soft: rgba(234, 242, 251, .14);
  --teal: #7FE7EA;
  --teal-deep: #A9F1F3;
  --teal-tint: rgba(127, 231, 234, .13);
  --magenta: #FF86BA;
  --magenta-deep: #FFA5CB;
  --magenta-tint: rgba(255, 134, 186, .14);
  --overprint: #C9B6FF;
  --blend: screen;
  --grid-line: rgba(234, 242, 251, .10);
  --plate: #143A5F;
  --plate-edge: #2B5A8A;
  --shadow: rgba(0, 0, 0, .35);
  --grain-opacity: .35;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
/* paper tooth: a tiny pre-rendered tile. No filters, no blend modes, no repaint cost. */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grain-opacity);
  background: url(img/grain.png) 0 0 / 160px 160px;
}
img, svg { max-width: 100%; display: block; }
.project-preview { width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--teal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--magenta); }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--magenta); color: #fff; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 300; font-family: var(--mono); font-size: 13px; }
.skip:focus { left: 8px; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--display); margin: 0; line-height: 1; letter-spacing: -.015em; }
.h-hero {
  font-weight: 900; font-stretch: 112%;
  font-size: clamp(2.6rem, 5.7vw, 4.9rem);
  line-height: .93; letter-spacing: -.035em;
}
.h-sec {
  font-weight: 850; font-stretch: 108%;
  font-size: clamp(2rem, 4.6vw, 3.7rem);
  line-height: .98; letter-spacing: -.03em;
  text-wrap: balance;
}
.h-card { font-weight: 800; font-stretch: 105%; font-size: clamp(1.35rem, 2.2vw, 1.8rem); line-height: 1.05; letter-spacing: -.02em; }
.lede { font-size: clamp(1.1rem, 1.55vw, 1.32rem); line-height: 1.5; color: var(--ink-2); max-width: 38em; text-wrap: pretty; }
p { margin: 0 0 1em; text-wrap: pretty; }
.mono, .label, .fig-cap, .callout-no, .tape, .spec dt, .spec dd { font-family: var(--mono); }
.label {
  font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 10px;
}
.label::before { content: ""; width: 22px; height: 2px; background: var(--magenta); }
.label.teal::before { background: var(--teal); }
.label.plain::before { display: none; }

/* Misregistered two-ink word.
   Done with text-shadow on purpose: generated ::before/::after copies get read aloud
   by screen readers ("show show show"). Shadows are paint only, so the word exists once. */
.misreg {
  color: var(--ink);
  text-shadow: -.045em .035em 0 var(--teal), .05em -.03em 0 var(--magenta);
  transition: text-shadow .6s var(--ease);
}
.misreg:hover { text-shadow: -.09em .06em 0 var(--teal), .1em -.055em 0 var(--magenta); }

/* ---------- Running header / nav ---------- */
.runhead {
  position: sticky; top: 0; z-index: 200;
  background: var(--paper);
  border-bottom: 1.5px solid var(--ink);
}
.runhead .wrap { display: flex; align-items: stretch; justify-content: space-between; gap: 16px; min-height: 60px; }
.docid { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.docid .mark { width: 34px; height: 34px; flex: none; }
.docid b { font-family: var(--display); font-weight: 900; font-stretch: 110%; font-size: 16px; letter-spacing: -.01em; text-transform: none; display: block; line-height: 1; }
.docid span { color: var(--ink-3); font-size: 10.5px; display: block; margin-top: 3px; }
.runhead nav { display: flex; }
.tabs { display: flex; align-items: stretch; gap: 0; margin: 0; padding: 0; list-style: none; }
.tabs li { display: flex; }
.tabs a {
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  border-left: 1px solid var(--rule-soft); position: relative;
}
.tabs a i { font-style: normal; color: var(--ink-3); font-size: 10.5px; }
.tabs a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1.5px; height: 4px; background: var(--magenta); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.tabs a:hover::after, .tabs a[aria-current="page"]::after { transform: scaleX(1); }
.tabs a[aria-current="page"] { background: var(--paper-2); }
.theme-btn {
  align-self: center; margin-left: 12px; flex: none;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  background: none; color: var(--ink); border: 1.5px solid var(--ink); padding: 8px 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.theme-btn:hover { background: var(--ink); color: var(--paper); }
.theme-btn .sw { width: 12px; height: 12px; border: 1.5px solid currentColor; background: linear-gradient(135deg, #F3EEE3 50%, #0C2742 50%); }
.navtoggle { display: none; }

@media (max-width: 520px) { .docid span { display: none; } .docid b { white-space: nowrap; font-size: 15px; } .docid .mark { width: 28px; height: 28px; } .theme-btn span:last-child { display: none; } }
@media (max-width: 900px) {
  .navtoggle { display: inline-flex; align-self: center; background: none; border: 1.5px solid var(--ink); color: var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: .1em; padding: 8px 12px; cursor: pointer; }
  .runhead nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1.5px solid var(--ink); display: none; }
  .runhead nav.open { display: block; }
  .tabs { flex-direction: column; }
  .tabs a { padding: 16px var(--gutter); border-left: 0; border-top: 1px solid var(--rule-soft); }
  .theme-btn { margin-left: auto; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-weight: 600; font-size: 13.5px; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  padding: 16px 22px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer;
  box-shadow: 5px 5px 0 var(--magenta); transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--magenta); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--magenta); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: 5px 5px 0 var(--teal); }
.btn.ghost:hover { box-shadow: 7px 7px 0 var(--teal); }
.btn .arr { transition: transform .2s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn[disabled] { opacity: .55; cursor: wait; }
.textlink { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; display: inline-flex; gap: 8px; align-items: center; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(36px, 6vw, 84px) clamp(40px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.hero h1 { margin: 22px 0 26px; }
.hero .lede b { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 18px 22px; margin-top: 34px; align-items: center; }
.hero-meta { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 8px 26px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--ink-2); text-transform: uppercase; }
.hero-meta span::before { content: "■ "; color: var(--teal); }
.hero .fig { width: 100%; max-width: 500px; justify-self: end; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } .hero .fig { justify-self: start; max-width: 560px; } }

/* crop + registration marks */
.cropped { position: relative; }
.cropped::before, .cropped::after {
  content: ""; position: absolute; width: 26px; height: 26px; pointer-events: none;
  border: 0 solid var(--ink); opacity: .7;
}
.cropped::before { left: calc(var(--gutter) * .35); top: 14px; border-left-width: 1.5px; border-top-width: 1.5px; }
.cropped::after { right: calc(var(--gutter) * .35); bottom: 14px; border-right-width: 1.5px; border-bottom-width: 1.5px; }

/* ---------- Figures ---------- */
.fig { position: relative; margin: 0; border: 1.5px solid var(--ink); background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper-2);
}
.fig-cap { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 10px 14px; border-top: 1.5px solid var(--ink); background: var(--paper); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.fig-cap b { font-weight: 600; }
.fig-cap span { color: var(--ink-3); text-align: right; }
.fig svg { width: 100%; height: auto; }
.fig .reg { position: absolute; width: 18px; height: 18px; top: 10px; right: 10px; opacity: .8; }

/* parts list under Fig. 1: real text, real size */
.parts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1.5px solid var(--ink); background: var(--paper); }
.parts li { display: flex; gap: 12px; align-items: baseline; padding: 11px 14px; border-bottom: 1px solid var(--rule); font-size: 14.5px; line-height: 1.35; color: var(--ink-2); }
.parts li:nth-child(odd) { border-right: 1px solid var(--rule); }
.parts li:nth-last-child(-n+2) { border-bottom: 0; }
.parts b { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 50%; width: 26px; height: 26px; display: inline-grid; place-items: center; flex: none; }
.parts strong { color: var(--ink); font-weight: 600; }
@media (max-width: 460px) { .parts { grid-template-columns: 1fr; } .parts li:nth-child(odd) { border-right: 0; } .parts li:nth-last-child(2) { border-bottom: 1px solid var(--rule); } }

/* SVG ink classes */
.s-ink { stroke: var(--ink); fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.s-thin { stroke: var(--ink); fill: none; stroke-width: 1; stroke-linejoin: round; }
.s-dash { stroke: var(--ink-3); fill: none; stroke-width: 1; stroke-dasharray: 5 5; }
.s-teal { stroke: var(--teal); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.s-mag { stroke: var(--magenta); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.f-paper { fill: var(--paper); }
.f-paper2 { fill: var(--paper-3); }
.f-teal { fill: var(--teal); opacity: .88; }
.f-mag { fill: var(--magenta); opacity: .9; }
.f-ink { fill: var(--ink); }
.t-mono { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; fill: var(--ink); text-transform: uppercase; }
.t-mono.sm { font-size: 9.5px; fill: var(--ink-2); }
.t-part { font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: .1em; fill: var(--ink); text-transform: uppercase; dominant-baseline: central; }
.t-no { font-family: var(--mono); font-size: 14px; font-weight: 600; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }

/* draw-on */
.draw path, .draw line, .draw polyline, .draw polygon, .draw circle, .draw rect { stroke-dasharray: var(--len, 900); stroke-dashoffset: var(--len, 900); }
.draw .s-dash { stroke-dasharray: 5 5; stroke-dashoffset: 0; opacity: 0; }
.draw .fillin, .draw text, .draw .balloon { opacity: 0; }
.draw.on path, .draw.on line, .draw.on polyline, .draw.on polygon, .draw.on circle, .draw.on rect { animation: draw 1.5s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 140ms); }
.draw.on .s-dash { animation: fade .8s ease forwards; animation-delay: 1.2s; }
.draw.on .fillin, .draw.on text, .draw.on .balloon { animation: fade .7s ease forwards; animation-delay: calc(var(--i, 0) * 140ms + 700ms); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
.float { animation: bob 7s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -900ms); }
.still .float { animation-play-state: paused; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ---------- Sections ---------- */
.sec { padding-block: clamp(56px, 8vw, 116px); border-top: 1.5px solid var(--ink); position: relative; }
.sec.alt { background: var(--paper-2); }
.sec-head { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px 28px; margin-bottom: clamp(30px, 4.5vw, 60px); align-items: start; }
.sec-no { font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 64px; line-height: .8; color: transparent; -webkit-text-stroke: 1.5px var(--ink); letter-spacing: -.04em; }
.sec-head .lede { margin-top: 20px; }
@media (max-width: 720px) { .sec-head { grid-template-columns: 1fr; } .sec-no { font-size: 46px; } }

/* ---------- ID plate ---------- */
.plate {
  position: relative; background: linear-gradient(160deg, var(--plate), var(--paper-3)); border: 1.5px solid var(--ink);
  padding: 30px clamp(20px, 3vw, 40px); box-shadow: 8px 8px 0 var(--shadow);
}
.plate::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--plate-edge); pointer-events: none; }
.rivet { position: absolute; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--ink); background: radial-gradient(circle at 35% 35%, var(--paper), var(--plate-edge)); }
.rivet.tl { left: 13px; top: 13px; } .rivet.tr { right: 13px; top: 13px; } .rivet.bl { left: 13px; bottom: 13px; } .rivet.br { right: 13px; bottom: 13px; }
.spec { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; margin: 0; }
.spec > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.spec dt { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.spec dd { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: .01em; }
.spec dd small { display: block; font-weight: 400; color: var(--ink-2); font-size: 12px; margin-top: 2px; }
@media (max-width: 820px) { .spec { grid-template-columns: 1fr; } .spec > div { grid-template-columns: 104px minmax(0, 1fr); } }

/* ---------- Principle steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1.5px solid var(--ink); background: var(--paper); }
.step { padding: clamp(22px, 2.6vw, 36px); border-right: 1.5px solid var(--ink); position: relative; }
.step:last-child { border-right: 0; }
.step .n { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; display: flex; justify-content: space-between; color: var(--ink-2); }
.step svg { width: 100%; max-width: 230px; height: auto; margin: 18px 0 14px; }
.step h3 { margin-bottom: 12px; }
.step p { color: var(--ink-2); font-size: 16px; margin: 0; }
.steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .steps.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps.four .step:nth-child(2) { border-right: 0; } .steps.four .step:nth-child(-n+2) { border-bottom: 1.5px solid var(--ink); } }
@media (max-width: 860px) { .steps, .steps.four { grid-template-columns: 1fr; } .step { border-right: 0; border-bottom: 1.5px solid var(--ink); } .step:last-child { border-bottom: 0; } }

/* ---------- Loop simulator ---------- */
.sim { border: 1.5px solid var(--ink); background: var(--paper); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); box-shadow: 10px 10px 0 var(--shadow); }
.sim-stage { border-right: 1.5px solid var(--ink); display: flex; flex-direction: column; min-width: 0; }
.sim-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1.5px solid var(--ink); background: var(--paper-2); }
.sim-bar label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.sim-bar select { font-family: var(--mono); font-size: 13px; padding: 10px 12px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); min-width: 0; flex: 1 1 200px; }
.sim-bar .btn { padding: 11px 16px; font-size: 12.5px; box-shadow: 4px 4px 0 var(--magenta); }
.sim-canvas { flex: 1; min-height: 300px; background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px; padding: 8px; }
.node rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; transition: fill .3s, stroke .3s; }
.node text { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; fill: var(--ink); text-anchor: middle; text-transform: uppercase; }
.node .sub { font-size: 8.5px; letter-spacing: .04em; fill: var(--ink-3); }
.node.live rect { fill: var(--teal-tint); stroke: var(--teal); stroke-width: 2.4; }
.node.done rect { fill: var(--paper-3); }
.node.skip { opacity: .32; }
.node.skip rect { stroke-dasharray: 4 4; }
.node.flag rect { fill: var(--magenta-tint); stroke: var(--magenta); stroke-width: 2.4; }
.wire { stroke: var(--ink-3); stroke-width: 1.2; fill: none; stroke-dasharray: 4 4; }
.wire.hot { stroke: var(--teal); stroke-dasharray: none; stroke-width: 2; }
.packet { fill: var(--magenta); opacity: 0; }
.packet.go { opacity: 1; }
.sim-tape { display: flex; flex-direction: column; min-width: 0; min-height: 420px; }
.tape-head { padding: 14px 16px; border-bottom: 1.5px solid var(--ink); display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; background: var(--paper-2); }
.tape-head .led { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); display: inline-block; margin-right: 8px; }
.tape-head .led.on { background: var(--magenta); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.tape { flex: 1; margin: 0; padding: 16px; font-size: 12.5px; line-height: 1.55; overflow-y: auto; max-height: 470px; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.tape .ln { display: block; padding: 2px 0; animation: fade .25s ease both; }
.tape .t { color: var(--ink-3); }
.tape .k { color: var(--teal-deep); font-weight: 600; }
.tape .w { color: var(--magenta-deep); font-weight: 600; }
.tape .ok { font-weight: 600; }
.tape .idle { color: var(--ink-3); }
.verdict { border-top: 1.5px solid var(--ink); padding: 16px; font-size: 15px; background: var(--paper-2); min-height: 92px; }
.verdict b { font-family: var(--display); font-weight: 800; font-size: 17px; display: block; margin-bottom: 4px; }
.sim-foot { grid-column: 1 / -1; border-top: 1.5px solid var(--ink); padding: 12px 16px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
@media (max-width: 940px) { .sim { grid-template-columns: 1fr; } .sim-stage { border-right: 0; border-bottom: 1.5px solid var(--ink); } .sim-tape { min-height: 320px; } }

/* ---------- Equipment sheets (work cards) ---------- */
.sheets { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.sheet { grid-column: span 6; border: 1.5px solid var(--ink); background: var(--paper); display: flex; flex-direction: column; position: relative; transition: transform .25s var(--ease), box-shadow .25s var(--ease); text-decoration: none; }
.sheet.wide { grid-column: span 12; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.sheet.third { grid-column: span 4; }
a.sheet:hover, .sheet:has(a.cover:hover) { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--teal); }
.sheet-top { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1.5px solid var(--ink); font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; background: var(--paper-2); }
.sheet-top .status { display: inline-flex; align-items: center; gap: 7px; }
.sheet-top .status::before { content: ""; width: 8px; height: 8px; background: var(--teal); border-radius: 50%; }
.sheet-top .status.mag::before { background: var(--magenta); }
.sheet-art { border-bottom: 1.5px solid var(--ink); background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 20px 20px, var(--paper-2);
  aspect-ratio: 16 / 9; overflow: hidden; position: relative; }
.sheet.wide .sheet-art { border-bottom: 0; border-right: 1.5px solid var(--ink); aspect-ratio: auto; min-height: 320px; }
.sheet-art img { width: 100%; height: 100%; object-fit: cover; object-position: left top; filter: saturate(.92); transition: transform .6s var(--ease); }
.sheet:hover .sheet-art img { transform: scale(1.03); }
.sheet-art svg { width: 100%; height: 100%; }
.sheet-body { padding: clamp(18px, 2.2vw, 30px); display: flex; flex-direction: column; gap: 14px; flex: 1; }
.sheet-body p { color: var(--ink-2); margin: 0; font-size: 16px; }
.sheet-specs { margin: auto 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 12px; }
.sheet-specs li { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.sheet-specs li span:first-child { color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; font-size: 10.5px; padding-top: 2px; flex: none; }
.sheet-specs li span:last-child { text-align: right; }
.sheet-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
@media (max-width: 980px) { .sheet, .sheet.third { grid-column: span 12; } .sheet.wide { grid-template-columns: 1fr; } .sheet.wide .sheet-art { border-right: 0; border-bottom: 1.5px solid var(--ink); min-height: 0; aspect-ratio: 16 / 9; } }
@media (min-width: 981px) and (max-width: 1180px) { .sheet.third { grid-column: span 6; } }

/* big number readout */
.readout { display: flex; align-items: flex-end; gap: 16px; }
.readout .num { font-family: var(--display); font-weight: 900; font-stretch: 120%; font-size: clamp(4rem, 9vw, 7.5rem); line-height: .8; letter-spacing: -.05em; }
.readout .unit { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 6px; max-width: 16em; }

/* ---------- Teaching rows ---------- */
.rows { border-top: 1.5px solid var(--ink); }
.row { display: grid; grid-template-columns: 90px minmax(0, 1.1fr) minmax(0, 1.4fr) auto; gap: 14px 28px; padding: 24px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.row .no { font-family: var(--mono); font-size: 12px; color: var(--ink-3); letter-spacing: .1em; }
.row h3 { font-size: 1.3rem; font-weight: 800; line-height: 1.1; margin-bottom: 8px; }
.row p { margin: 0; color: var(--ink-2); font-size: 16px; }
.row .tag { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; border: 1.5px solid var(--ink); padding: 5px 9px; white-space: nowrap; }
@media (max-width: 860px) { .row { grid-template-columns: 1fr; gap: 8px; } .row .tag { justify-self: start; } }

/* ---------- Service record (timeline) ---------- */
.record { list-style: none; margin: 0; padding: 0; border-left: 1.5px solid var(--ink); margin-left: 8px; }
.record li { position: relative; padding: 0 0 34px 34px; }
.record li::before { content: ""; position: absolute; left: -8px; top: 5px; width: 14px; height: 14px; border: 1.5px solid var(--ink); background: var(--paper); transform: rotate(45deg); }
.record li.now::before { background: var(--magenta); }
.record .when { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.record h3 { font-size: 1.35rem; font-weight: 800; margin: 6px 0 8px; line-height: 1.1; }
.record p { color: var(--ink-2); margin: 0; max-width: 46em; }

/* ---------- Prose (about, notes) ---------- */
.prose { max-width: 44em; font-size: 1.12rem; line-height: 1.68; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 850; margin: 1.8em 0 .6em; line-height: 1.05; }
.prose h3 { font-size: 1.3rem; font-weight: 800; margin: 1.6em 0 .5em; }
.prose p.big { font-size: 1.35rem; line-height: 1.45; color: var(--ink); font-weight: 500; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--magenta); font-size: 1.2rem; }
.prose ul { padding-left: 1.2em; } .prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--magenta); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
@media (max-width: 940px) { .two-col { grid-template-columns: 1fr; } }
.sidecard { border: 1.5px solid var(--ink); background: var(--paper); position: sticky; top: 92px; }
.sidecard h3 { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; padding: 11px 16px; border-bottom: 1.5px solid var(--ink); background: var(--paper-2); }
.sidecard ul { list-style: none; margin: 0; padding: 0; }
.sidecard li { padding: 13px 16px; border-bottom: 1px solid var(--rule); font-size: 15px; display: flex; justify-content: space-between; gap: 12px; }
.sidecard li:last-child { border-bottom: 0; }
.sidecard li span { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; flex: none; }
.portrait { border: 1.5px solid var(--ink); background: var(--paper-2); position: relative; aspect-ratio: 4 / 5; overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08); mix-blend-mode: var(--blend); }
.portrait::after { content: ""; position: absolute; inset: 0; background: var(--teal); mix-blend-mode: screen; opacity: .55; pointer-events: none; }
:root[data-theme="blueprint"] .portrait::after { mix-blend-mode: multiply; opacity: .4; }

/* notice / caution boxes */
.notice { border: 1.5px solid var(--ink); display: grid; grid-template-columns: auto minmax(0, 1fr); background: var(--paper); }
.notice .hd { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--mono); font-weight: 600; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; padding: 14px 9px; background: var(--ink); color: var(--paper); text-align: center; }
.notice.mag .hd { background: var(--magenta); color: #fff; }
.notice .bd { padding: 18px 22px; font-size: 15.5px; color: var(--ink-2); }
.notice .bd p:last-child { margin: 0; }
.notice .bd b { color: var(--ink); }

/* ---------- Colophon ---------- */
.colophon { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1.5px solid var(--ink); background: var(--paper); }
.colophon > div { padding: 22px; border-right: 1px solid var(--rule); }
.colophon > div:last-child { border-right: 0; }
.colophon .v { font-family: var(--display); font-weight: 900; font-stretch: 115%; font-size: 2.4rem; line-height: 1; letter-spacing: -.03em; }
.colophon .k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-top: 8px; }
@media (max-width: 820px) { .colophon { grid-template-columns: repeat(2, minmax(0, 1fr)); } .colophon > div { border-bottom: 1px solid var(--rule); } }

/* ---------- Footer ---------- */
.foot { border-top: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); padding-block: 56px 28px; position: relative; }
:root[data-theme="blueprint"] .foot { background: #081B2F; color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="print"]) .foot { background: #081B2F; color: var(--ink); } }
.foot a { text-decoration-color: var(--teal); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 36px; }
.foot h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; opacity: .6; margin-bottom: 14px; font-weight: 500; }
.foot ul { list-style: none; margin: 0; padding: 0; } .foot li { margin-bottom: 9px; font-size: 15px; }
.foot .big { font-family: var(--display); font-weight: 900; font-stretch: 112%; font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1; letter-spacing: -.03em; margin-bottom: 18px; }
.disclaimer { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .22); font-size: 13.5px; line-height: 1.55; opacity: .78; max-width: 70em; }
.strip { display: flex; height: 14px; margin-top: 30px; }
.strip i { flex: 1; } .strip i:nth-child(1) { background: #0A8A90; } .strip i:nth-child(2) { background: #57B3B6; } .strip i:nth-child(3) { background: #A9D8D8; }
.strip i:nth-child(4) { background: #DB1268; } .strip i:nth-child(5) { background: #E966A0; } .strip i:nth-child(6) { background: #F4B5D1; }
.strip i:nth-child(7) { background: #4A2C6B; } .strip i:nth-child(8) { background: #F3EEE3; } .strip i:nth-child(9) { background: #8A8577; } .strip i:nth-child(10) { background: #1B1A17; outline: 1px solid rgba(255,255,255,.3); outline-offset: -1px; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .6; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- Shortcut for people who do not want to read ----------
   Default: a slim strip under the header that scrolls away with the page. It covers nothing.
   1500px and up: there is empty margin beside the 1240px column, so it becomes an edge tab that lives there. */
.coolbtn {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  padding: 9px var(--gutter);
  font-family: var(--mono); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  background: var(--magenta-deep); color: var(--paper); border-bottom: 1.5px solid var(--ink);
}
.coolbtn .arr { transition: transform .2s var(--ease); }
.coolbtn:hover .arr { transform: translateX(5px); }
.is-cool .coolbtn { display: none; }
@media (min-width: 1500px) {
  .coolbtn {
    position: fixed; right: 0; top: 50%; z-index: 150;
    writing-mode: vertical-rl; transform: translateY(-50%);
    padding: 20px 11px; border: 2px solid var(--ink); border-right: 0;
    box-shadow: -4px 4px 0 var(--ink);
    transition: padding .2s var(--ease);
  }
  .coolbtn:hover { padding-right: 17px; }
  .coolbtn .arr { display: none; }
}
@media print { .coolbtn { display: none; } }
button.sheet { font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 0; }
button.sheet:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--magenta); }

/* shelf index on the cool page */
.jump { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 30px; }
.jump a {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  border: 1.5px solid var(--ink); background: var(--paper); box-shadow: 3px 3px 0 var(--teal); transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.jump a i { font-style: normal; font-weight: 500; color: var(--ink-3); font-size: 11px; }
.jump a:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--magenta); }
/* a logo instead of a screenshot in a sheet */
.sheet-art.sheet-logo { background: #0C2742; display: grid; place-items: center; }
.sheet-art.sheet-logo img { width: 72%; height: auto; object-fit: contain; filter: none; }

/* ---------- Page header (inner pages) ---------- */
.pagehead { padding-block: clamp(44px, 7vw, 96px) clamp(36px, 5vw, 64px); }
.pagehead h1 { margin: 20px 0 22px; font-size: clamp(2.5rem, 6.4vw, 5.2rem); }
.crumbs { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }

/* reveal */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.rv.in { opacity: 1; transform: none; }
.no-js .rv { opacity: 1; transform: none; }
.no-js .draw path, .no-js .draw line, .no-js .draw polyline, .no-js .draw polygon, .no-js .draw circle, .no-js .draw rect { stroke-dashoffset: 0; }
.no-js .draw .fillin, .no-js .draw text, .no-js .draw .balloon, .no-js .draw .s-dash { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
  .rv { opacity: 1; transform: none; }
  .float { animation: none; }
}

@media print {
  .runhead, .theme-btn, .sim, .foot .strip { display: none; }
  body::before { display: none; }
}

/* ---------- Repo label: one look for every project with public code (list in src/repos.json) ---------- */
.repo-tag { display: inline-flex; align-items: stretch; max-width: 100%; border: 1.5px solid var(--teal); background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 12px; line-height: 1; text-decoration: none; vertical-align: middle; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.repo-tag > span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; white-space: nowrap; }
.repo-tag .rt-k { background: var(--teal); color: var(--paper); font-weight: 600; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.repo-tag svg { width: 13px; height: 13px; flex: none; }
.repo-tag svg circle { fill: currentColor; }
.repo-tag svg path { fill: none; stroke: currentColor; stroke-width: 1.5; }
.repo-tag > .rt-v { display: block; align-self: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.repo-tag .rt-v b { color: var(--teal-deep); font-weight: 700; }
.repo-tag .rt-l { border-left: 1.5px solid var(--teal); color: var(--ink-3); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
a.repo-tag:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--teal); }
a.repo-tag:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
/* Narrow spots drop the license first, then the owner (the same on every repo), so the repo name always shows. */
.sheet-body { container-type: inline-size; }
@container (max-width: 400px) { .repo-tag .rt-l { display: none; } }
@container (max-width: 340px) { .repo-tag .rt-o { display: none; } }
@media (max-width: 420px) { .repo-tag .rt-l { display: none; } }

/* ---------- Range sheet (/work/#range): skills down the side, builds across the top ---------- */
.range-wrap { border: 1.5px solid var(--ink); background: var(--paper); }
.range { width: 100%; border-collapse: collapse; font-size: 15px; }
.range th, .range td { padding: 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.range tr > * + * { border-left: 1px solid var(--rule); }
.range tbody tr:last-child > * { border-bottom: 0; }
.range thead th { background: var(--paper-2); border-bottom: 1.5px solid var(--ink); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.range thead a { color: var(--ink); text-underline-offset: 4px; }
.range tbody th { width: 18%; font-family: var(--display); font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.range td { color: var(--ink-2); line-height: 1.45; }
.range td:not(.no)::before { content: ""; display: block; width: 9px; height: 9px; margin-bottom: 9px; background: var(--teal); }
.range td.no { background: repeating-linear-gradient(135deg, transparent 0 8px, var(--rule) 8px 9px); }
.range .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.range-key { margin: 14px 0 0; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
@media (max-width: 900px) {
  .range thead { display: none; }
  .range, .range tbody, .range tr, .range th, .range td { display: block; width: auto; }
  .range tr { padding: 16px 18px 10px; border-bottom: 1.5px solid var(--ink); }
  .range tbody tr:last-child { border-bottom: 0; }
  .range tr > * + * { border-left: 0; }
  .range tbody th { width: auto; padding: 0 0 8px; border: 0; font-size: 18px; }
  .range td { padding: 7px 0; border-bottom: 0; display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; }
  .range td:not(th + td) { border-top: 1px dashed var(--rule); }
  .range td::before, .range td:not(.no)::before { content: attr(data-col); display: block; width: auto; height: auto; margin: 0; background: none; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-deep); padding-top: 3px; }
  .range td.no { display: none; }
}
@media (max-width: 420px) { .range td { grid-template-columns: 1fr; gap: 2px; } }
