/* Pedro Balloni — an Olivetti office machine in black, greys, Divisumma yellow and white.
   Enamel body, black keyboard bands, paper sheets, adding-machine tape, keycaps. */

@font-face { font-family: "Bricolage"; src: url("assets/fonts/bricolagegrotesque-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("assets/fonts/worksans-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("assets/fonts/worksans-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Red Hat Mono"; src: url("assets/fonts/redhatmono-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Red Hat Mono"; src: url("assets/fonts/redhatmono-bold.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --black: #161617;
  --keyboard: #1c1c1e;
  --graphite: #2a2a2d;
  --steel: #3a3a3e;
  --ash: #5d5b56;
  --stone: #8a8780;
  --fog: #c9c7c1;
  --enamel: #dcdcda;
  --enamel-deep: #d0d0cd;
  --mist: #ececea;
  --paper: #fbfbf9;
  --white: #ffffff;
  --yellow: #f2c12e;
  --yellow-deep: #dba812;
  --yellow-pale: #fbe9a6;

  --ink: var(--black);
  --ink-2: #3f3e3a;
  --ink-3: #57554f;
  --legend: #f3f1eb;
  --legend-2: #c4c1b8;

  --display: "Bricolage", "Work Sans", system-ui, sans-serif;
  --text: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Red Hat Mono", ui-monospace, Menlo, monospace;

  --wrap: 1240px;
  --gutter: clamp(18px, 4vw, 48px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --deck-h: 66px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--deck-h) + 16px); scrollbar-color: var(--ash) var(--enamel); }
body { margin: 0; background: var(--enamel); color: var(--ink); font: 400 1.0625rem/1.6 var(--text); -webkit-font-smoothing: antialiased; caret-color: var(--yellow-deep); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
p, h1, h2, h3, h4, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--yellow); color: var(--black); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }
.field-yellow :focus-visible, .field-paper :focus-visible, .field-enamel :focus-visible { outline-color: var(--black); }
svg { width: 1.1em; height: 1.1em; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; background: var(--yellow); color: var(--black); padding: 10px 14px; font-weight: 700; border-radius: 6px; }
.skip:focus { top: 12px; }

/* ---------- Keys ---------- */
.key {
  --face: #efeee9; --skirt: rgba(0, 0, 0, .2);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 44px; padding: 0 1.05rem;
  background: var(--face); color: var(--ink);
  border: 1px solid rgba(0, 0, 0, .3); border-radius: 9px;
  font: 700 .95rem/1.1 var(--text); text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -4px 0 var(--skirt), 0 2px 3px rgba(0, 0, 0, .2), 0 8px 14px -8px rgba(0, 0, 0, .45);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background-color .2s, color .2s;
}
.key:hover { --face: #fbfaf6; }
.key:active, .key[aria-current="page"], .key[aria-selected="true"], .key.is-on {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 var(--skirt), 0 1px 1px rgba(0, 0, 0, .25), 0 3px 6px -4px rgba(0, 0, 0, .4);
}
.key-ink { --face: #232326; --skirt: rgba(0, 0, 0, .6); color: var(--legend); border-color: #000; }
.key-ink:hover { --face: #303034; }
.key-yellow { --face: var(--yellow); --skirt: rgba(110, 72, 0, .38); color: var(--black); border-color: rgba(80, 55, 0, .5); }
.key-yellow:hover { --face: #f6cd4d; }
.key-quiet { --face: #e6e5e0; }
.key-s { min-height: 34px; min-width: 40px; padding: 0 .5rem; font-size: .8rem; letter-spacing: .06em; border-radius: 7px; }
.key-l { min-height: 56px; padding: 0 1.35rem; font-size: 1.02rem; }
.key-m { min-height: 48px; }
.key[aria-current="page"] { --face: var(--yellow); --skirt: rgba(110, 72, 0, .38); color: var(--black); }

/* ---------- Header ---------- */
.deck { position: sticky; top: 0; z-index: 40; background: var(--black); color: var(--legend); }
.deck-row { display: flex; align-items: center; gap: 24px; min-height: var(--deck-h); }
.maker { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 700 1.12rem/1 var(--display); white-space: nowrap; }
.maker img { width: auto; height: 36px; }
.deck-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.deck-nav a { text-decoration: none; font-size: .95rem; color: #d4d1c8; padding: 6px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.deck-nav a:hover, .deck-nav a.is-here { color: #fff; border-color: var(--yellow); }
.deck-keys { display: flex; align-items: center; gap: 10px; }
.lang { display: flex; gap: 5px; padding: 5px; background: #0a0a0b; border-radius: 10px; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .8); }
.deck .key-s:not([aria-current="page"]) { --face: #2e2e32; --skirt: rgba(0, 0, 0, .6); color: #e8e5dc; border-color: #000; }
.menu-key { display: none; }
.progress { height: 3px; background: #2a2a2d; }
.progress i { display: block; height: 100%; width: 100%; background: var(--yellow); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- Fields ---------- */
.field { padding: clamp(72px, 9.5vw, 128px) 0; }
.field-enamel { background: var(--enamel); }
.field-paper { background: var(--paper); }
.field-key { background: var(--keyboard); color: var(--legend); }
.field-yellow { background: var(--yellow); color: var(--black); }
.h2 { font: 700 clamp(2.1rem, 4.3vw, 3.7rem)/1.04 var(--display); letter-spacing: -.022em; max-width: 18ch; text-wrap: balance; }
.h2-wide { max-width: 22ch; }
.h2-big { font-size: clamp(2.5rem, 5.6vw, 5rem); max-width: 13ch; }
.h3 { font: 700 clamp(1.25rem, 1.8vw, 1.55rem)/1.15 var(--display); letter-spacing: -.012em; }
.h4 { font: 700 1.05rem/1.3 var(--text); }
.intro { max-width: 60ch; font-size: clamp(1.06rem, 1.3vw, 1.2rem); line-height: 1.55; color: var(--ink-2); }
.field-key .intro, .field-key p { color: var(--legend-2); }
.field-yellow .intro { color: #3b3110; }
.head-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px clamp(24px, 4vw, 72px); align-items: end; margin-bottom: clamp(36px, 4.5vw, 60px); }

/* Guided reading: every chapter ends by pointing at the next */
.next { display: inline-flex; align-items: center; gap: 12px; margin-top: clamp(40px, 5vw, 64px); font-weight: 700; text-decoration: none; font-size: 1rem; }
.next svg { width: 40px; height: 40px; padding: 10px; border-radius: 9px; background: var(--black); color: var(--yellow); box-shadow: inset 0 -3px 0 #000, 0 6px 10px -6px rgba(0, 0, 0, .6); transition: transform .3s var(--ease); }
.field-key .next svg { background: var(--yellow); color: var(--black); box-shadow: inset 0 -3px 0 rgba(110, 72, 0, .4); }
.next:hover svg { transform: translateY(4px); }
.next:hover { text-decoration: underline; }

/* ---------- 1. Carriage ---------- */
.machine { padding-top: clamp(26px, 4vw, 52px); padding-bottom: clamp(56px, 7vw, 92px); }
.machine-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(250px, 24vw, 310px); gap: clamp(28px, 4vw, 56px); align-items: start; }
.platen { position: relative; z-index: 2; display: flex; align-items: center; height: 38px; margin: 0 -10px; }
.platen b { flex: 1; height: 28px; border-radius: 14px; background: var(--keyboard); box-shadow: inset 0 -7px 0 #000, inset 0 3px 0 #3a3a3e, 0 8px 14px -6px rgba(0, 0, 0, .45); }
.platen i { width: 38px; height: 38px; border-radius: 50%; background: var(--steel); box-shadow: inset 0 -5px 0 #111, inset 0 2px 0 #55555a, 0 4px 8px -2px rgba(0, 0, 0, .4); }
.sheet { position: relative; z-index: 1; margin: -16px 28px 0; padding: clamp(36px, 5vw, 64px) clamp(24px, 5vw, 64px) clamp(28px, 3.5vw, 42px); background: var(--paper); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 22px 40px -22px rgba(30, 28, 20, .45); }
.typed { position: relative; font: 700 clamp(2.2rem, 5vw, 4.4rem)/1.03 var(--display); letter-spacing: -.025em; max-width: 16ch; }
.typed-ink { position: absolute; inset: 0; pointer-events: none; }
.typing .typed-real { color: transparent; }
.typing .typed-ink::after { content: ""; display: inline-block; width: .07em; height: .8em; margin-left: .04em; vertical-align: -.04em; background: var(--yellow-deep); animation: blink .9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.sheet-lead { margin-top: 24px; max-width: 58ch; font-size: clamp(1.05rem, 1.35vw, 1.22rem); line-height: 1.55; color: var(--ink-2); }
.sheet-sign { margin-top: 30px; padding-top: 14px; border-top: 1px dashed #bdbab0; font: 400 .84rem/1.5 var(--mono); color: var(--ink-3); }
.keyrow { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 28px 0; }
.avail { display: flex; align-items: center; gap: 10px; margin: 16px 28px 0; font-size: .92rem; color: var(--ink-2); }
.lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); box-shadow: inset 0 -2px 0 var(--yellow-deep), 0 1px 2px rgba(0, 0, 0, .4); }
@keyframes lamp { 50% { opacity: .45; } }

.tape-unit { position: relative; }
.tape-unit > .tape, .tape-unit > .tape-slot { filter: drop-shadow(0 14px 18px rgba(30, 28, 20, .26)); }
.guide { margin: 26px 0 0; padding: 18px 18px 14px; background: var(--black); color: var(--legend); border-radius: 12px; box-shadow: inset 0 -4px 0 #000, 0 16px 26px -18px rgba(0, 0, 0, .6); }
.guide-t { font: 700 .78rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--yellow); margin-bottom: 8px; }
.guide li + li { border-top: 1px solid #333; }
.guide a { display: flex; align-items: center; gap: 12px; padding: 10px 0; text-decoration: none; font-weight: 700; font-size: .98rem; }
.guide a b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: #333337; font: 700 .85rem/1 var(--display); box-shadow: inset 0 -2px 0 #000; transition: background-color .2s, color .2s; }
.guide a:hover b { background: var(--yellow); color: var(--black); }
.tape-slot { height: 22px; border-radius: 6px; background: var(--keyboard); box-shadow: inset 0 -6px 0 #000, 0 2px 0 rgba(255, 255, 255, .3); }
.tape {
  margin: -8px 16px 0; padding: 24px 16px 38px; background: var(--paper);
  font: 400 .84rem/1.4 var(--mono); color: var(--ink);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 9px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 9px repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - 9px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 9px repeat-x;
}
.tape-head { font: 700 .78rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; padding-bottom: 10px; border-bottom: 1px dashed #b9b6ad; }
.tape-lines li { display: grid; grid-template-columns: 1fr auto 1.1em; gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px dotted #dad8d1; }
.tape-lines li span { color: var(--ink-2); }
.tape-lines li b { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tape-lines li i { font-style: normal; text-align: right; color: var(--ink-3); }
.tape-lines .t-hi b { background: linear-gradient(transparent 38%, var(--yellow) 38% 88%, transparent 88%); padding: 0 3px; margin-right: -3px; }
.tape-lines .t-total { border-bottom: 0; margin-top: 4px; border-top: 3px double var(--ink); }
.tape-foot { margin-top: 12px; padding-top: 12px; border-top: 3px double var(--ink); font-size: .8rem; line-height: 1.45; color: var(--ink-3); }
.js .machine .tape-lines li { opacity: 0; transform: translateY(-3px); }
.js .machine .tape-lines li.on { opacity: 1; transform: none; transition: opacity .18s linear, transform .3s var(--ease); }

/* ---------- 2. Skills keyboard ---------- */
.kbd-wrap { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(18px, 2.5vw, 32px); align-items: start; }
.kbd { display: grid; grid-auto-flow: row dense; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, 1vw, 12px); padding: clamp(14px, 2vw, 24px); border-radius: 16px; background: var(--graphite); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .06), inset 0 -4px 10px rgba(0, 0, 0, .5), 0 30px 50px -30px #000; }
.kkey { --face: #38383c; --skirt: rgba(0, 0, 0, .65); grid-column: span min(var(--span, 1), 6); min-height: 64px; padding: 0 12px; color: var(--legend); border-color: #000; border-radius: 10px; white-space: normal; text-align: center; line-height: 1.15; font-size: .98rem; }
.kkey:hover { --face: #45454a; }
.kkey.key-yellow { --face: var(--yellow); color: var(--black); border-color: rgba(80, 55, 0, .6); }
.kkey.key-yellow:hover { --face: #f6cd4d; }
.kkey-any { --face: transparent; border: 2px dashed #6c6a64; box-shadow: none; color: var(--yellow); }
.kkey-any:hover { --face: #232326; }
.kkey.is-on { --face: var(--white); color: var(--black); }
.kprint { position: sticky; top: calc(var(--deck-h) + 20px); min-height: 220px; padding: 28px 26px 32px; background: var(--paper); color: var(--ink); box-shadow: 0 -10px 0 -4px #000, 0 18px 30px -18px #000; }
.kprint::before { content: ""; position: absolute; left: -10px; right: -10px; top: -14px; height: 10px; border-radius: 5px; background: #050506; }
.kprint-t { font: 700 clamp(1.4rem, 2.2vw, 1.9rem)/1.1 var(--display); letter-spacing: -.015em; color: var(--ink) !important; }
.kprint-d { margin-top: 12px; font-size: 1.08rem; line-height: 1.55; color: var(--ink-2) !important; min-height: 4.6em; }
.kprint-d::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -.15em; background: var(--yellow-deep); animation: blink .9s steps(1) infinite; }

/* ---------- 3. Hospital risk score ---------- */
.counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.counters > div { display: flex; flex-direction: column-reverse; gap: 10px; padding: 18px 18px 16px; background: var(--keyboard); border-radius: 12px; color: var(--legend); box-shadow: inset 0 -4px 0 #000, 0 16px 24px -18px rgba(0, 0, 0, .6); }
.counters dt { font-size: .9rem; color: var(--legend-2); line-height: 1.3; }
.odo { display: flex; gap: 3px; }
.odo i { display: grid; place-items: center; min-width: .78em; padding: .08em .06em; border-radius: 4px; background: #0b0b0c; box-shadow: inset 0 6px 6px -4px #000, inset 0 -6px 6px -4px #000; font: 700 clamp(1.7rem, 3vw, 2.5rem)/1 var(--mono); font-style: normal; color: var(--white); font-variant-numeric: tabular-nums; }
.odo i.sep { min-width: auto; padding: 0 1px; background: none; box-shadow: none; color: var(--yellow); }
.hosp-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(18px, 2.5vw, 32px); margin-top: 18px; align-items: start; }
.tilemap-sheet { padding: clamp(18px, 2.5vw, 30px); background: var(--mist); border-radius: 14px; }
.tilemap-sheet figcaption { display: grid; gap: 2px; margin-bottom: 18px; }
.tilemap-sheet figcaption b { font: 700 1.15rem/1.2 var(--display); }
.tilemap-sheet figcaption span { font-size: .92rem; color: var(--ink-3); }
.tilemap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(9, auto); gap: clamp(3px, .5vw, 6px); }
.tile { aspect-ratio: 1; min-width: 0; padding: 0; border: 1px solid rgba(0, 0, 0, .25); border-radius: clamp(4px, .6vw, 7px); font: 700 clamp(.56rem, 1vw, .8rem)/1 var(--mono); cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22); transition: transform .12s var(--ease), background-color .2s; }
.tile:hover, .tile.on { transform: translateY(1px); background: var(--yellow) !important; color: var(--black) !important; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); }
.s1 { background: #f5f4f1; color: var(--ink-2); }
.s2 { background: #d6d4ce; color: var(--ink); }
.s3 { background: #a8a59d; color: var(--black); }
.s4 { background: #55534e; color: var(--white); }
.s5 { background: var(--black); color: var(--yellow); }
.tile-readout { margin-top: 16px; font: 400 1rem/1.3 var(--mono); }
.tile-readout { padding: 10px 12px; background: var(--paper); border-top: 1px dashed #b9b6ad; }
.tile-readout b { display: inline-block; min-width: 2.6em; padding: 2px 6px; margin-right: 6px; background: var(--yellow); border-radius: 4px; text-align: center; }
.tile-legend { display: flex; gap: 4px; margin-top: 10px; }
.tile-legend i { width: 26px; height: 10px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .2); }
.tile-legend .s1 { background: #f5f4f1; } .tile-legend .s2 { background: #d6d4ce; } .tile-legend .s3 { background: #a8a59d; } .tile-legend .s4 { background: #55534e; } .tile-legend .s5 { background: var(--black); }
.tape-flat { margin: 0; -webkit-mask: none; mask: none; border-radius: 0 0 6px 6px; box-shadow: 0 -8px 0 -2px var(--keyboard), 0 18px 30px -22px rgba(30, 28, 20, .5); }
.how-h { margin-top: clamp(48px, 6vw, 76px); margin-bottom: 20px; }
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 3px solid var(--black); counter-reset: p; }
.pipeline li { position: relative; padding: 22px 22px 6px 0; }
.pipeline li + li { padding-left: 22px; border-left: 1px dashed #bdbab0; }
.pnum { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--yellow); font: 700 1rem/1 var(--display); box-shadow: inset 0 -3px 0 rgba(110, 72, 0, .4); }
.pipeline h4 { margin: 14px 0 6px; font: 700 1.15rem/1.2 var(--display); }
.pipeline p { color: var(--ink-2); font-size: .98rem; }
.fine { margin-top: 26px; font-size: .9rem; color: var(--ink-3); max-width: 70ch; }

/* ---------- Growth Engine ---------- */
.programme { padding: clamp(16px, 2.4vw, 28px); border-radius: 16px; background: var(--keyboard); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .06), 0 34px 50px -30px rgba(60, 40, 0, .8); }
.pad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 1.2vw, 14px); }
.key-n { --face: #333337; --skirt: rgba(0, 0, 0, .65); flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 16px; min-height: clamp(100px, 11vw, 128px); padding: 14px 16px 16px; white-space: normal; text-align: left; color: var(--legend); border-color: #000; border-radius: 11px; }
.key-n:hover { --face: #3d3d42; }
.key-n b { font: 700 clamp(1.7rem, 2.6vw, 2.3rem)/1 var(--display); }
.key-n span { font-size: .92rem; line-height: 1.25; }
.key-n[aria-selected="true"], .key-n.is-lit { --face: var(--yellow); --skirt: rgba(110, 72, 0, .4); color: var(--black); }
.printout { position: relative; margin: 22px 6% 0; padding: 28px clamp(22px, 3vw, 40px) 30px; background: var(--paper); color: var(--ink); min-height: 190px; box-shadow: 0 -10px 0 -4px #0b0b0c, 0 14px 24px -14px rgba(0, 0, 0, .7); }
.printout::before { content: ""; position: absolute; left: -12px; right: -12px; top: -14px; height: 10px; border-radius: 5px; background: #050506; }
.po-title { font: 700 clamp(1.45rem, 2.4vw, 2.05rem)/1.1 var(--display); letter-spacing: -.015em; }
.po-body { margin-top: 12px; max-width: 64ch; font-size: 1.1rem; color: var(--ink-2); min-height: 3.2em; }
.po-out { margin-top: 16px; padding-top: 14px; border-top: 1px dashed #c4c1b8; font: 400 .9rem/1.5 var(--mono); color: var(--ink-3); }
.po-out b { color: var(--ink); }
.po-step { margin-right: 14px; font-weight: 700; color: var(--ink); background: var(--yellow-pale); padding: 1px 5px; }
.engine-foot { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px; margin-top: clamp(32px, 4vw, 48px); }
.readout { display: grid; gap: 6px; max-width: 34ch; }
.readout b { font: 700 clamp(2.6rem, 5vw, 4rem)/1 var(--display); letter-spacing: -.03em; }
.readout span { color: #3b3110; }
.engine-links { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Brand ---------- */
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(18px, 2.5vw, 32px); align-items: start; }
.ledger { width: 100%; border-collapse: collapse; background: var(--paper); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 22px 40px -26px rgba(30, 28, 20, .45); }
.ledger tr + tr { border-top: 1px dashed #c9c6bd; }
.ledger th { width: 1%; padding: 24px clamp(14px, 2vw, 28px); text-align: right; vertical-align: baseline; white-space: nowrap; font: 700 clamp(2rem, 3.4vw, 2.9rem)/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ledger td { padding: 24px clamp(14px, 2vw, 24px) 24px 0; vertical-align: baseline; }
.ledger td b { display: block; font-size: 1.08rem; }
.ledger td span { display: block; margin-top: 4px; color: var(--ink-2); font-size: .97rem; }
.evolution { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 12px; }
.ev { display: flex; flex-direction: column; background: var(--paper); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.ev-img { flex: 1; display: grid; place-items: center; padding: 14px; background: var(--mist); }
.ev-img img { filter: grayscale(1) contrast(1.08); }
.ev:first-child .ev-img img { max-height: 170px; width: auto; }
.ev figcaption { padding: 12px 14px; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 5px; background: var(--black); color: var(--legend); font: 700 .74rem/1.3 var(--text); letter-spacing: .04em; text-transform: uppercase; }
.tag-y { background: var(--yellow); color: var(--black); }

/* ---------- More projects: programme cards ---------- */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: clamp(32px, 4vw, 48px); }
.pcard { --stock: var(--black); --pad: clamp(18px, 2vw, 26px); display: flex; flex-direction: column; gap: 10px; padding: 0 var(--pad) 26px; background: var(--white); clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 0 100%); filter: drop-shadow(0 12px 16px rgba(30, 28, 20, .14)); }
.pcard-strip { height: 24px; margin: 0 calc(-1 * var(--pad)) 10px; background: radial-gradient(circle, var(--paper) 3.5px, transparent 4px) 12px 50% / 17px 17px repeat-x, var(--stock); }
.stock-yellow { --stock: var(--yellow); }
.stock-ink { --stock: var(--black); }
.stock-grey { --stock: var(--stone); }
.pcard-logo { height: 70px; display: flex; align-items: center; }
.pcard-logo img { max-height: 60px; max-width: min(200px, 100%); width: auto; object-fit: contain; filter: grayscale(1) contrast(1.15) brightness(.85); }
.pcard-logo-full img { max-height: 70px; border-radius: 4px; filter: grayscale(1) brightness(.55) contrast(1.4); }
.pcard-big { height: 70px; display: flex; align-items: center; font: 700 3.6rem/1 var(--display); letter-spacing: -.03em; }
.pcard-meta { font: 400 .8rem/1.4 var(--mono); color: var(--ink-3); }
.pcard p:not([class]) { color: var(--ink-2); font-size: .97rem; }
.models { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 20px clamp(24px, 4vw, 56px); margin-top: 22px; padding: clamp(24px, 3vw, 36px); background: var(--black); color: var(--legend); border-radius: 14px; }
.models p { margin-top: 8px; color: var(--legend-2); }
.model-list li + li { border-top: 1px solid #3a3a3e; }
.model-list a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 4px; font: 700 1.05rem/1.3 var(--text); text-decoration: none; transition: color .2s, padding .3s var(--ease); }
.model-list a:hover { color: var(--yellow); padding-left: 10px; }

/* ---------- How ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 32px); }
.steps li { display: grid; gap: 14px; align-content: start; }
.key-static { width: 64px; min-height: 64px; cursor: default; align-items: center; justify-content: center; }
.steps .h3 { color: var(--white); }
.steps p { font-size: 1rem; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.portrait { position: sticky; top: calc(var(--deck-h) + 24px); padding: 12px 12px 44px; background: var(--white); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 26px 44px -26px rgba(30, 28, 20, .5); }
.portrait img { filter: grayscale(1) contrast(1.05); transition: filter .6s var(--ease); }
.portrait:hover img { filter: none; }
.about-text .h2 { margin-bottom: 24px; }
.about-text > p + p { margin-top: 16px; max-width: 62ch; color: var(--ink-2); }
.langs { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.langs b { padding: 2px 8px; background: var(--yellow); font: 700 .82rem/1.5 var(--mono); }
.career { margin-top: 32px; border-top: 2px solid var(--ink); }
.career li { display: grid; grid-template-columns: 6.2em minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; padding: 13px 0; border-bottom: 1px solid #cfccc4; align-items: baseline; }
.career span { font: 400 .86rem/1.4 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.career em { font-style: normal; color: var(--ink-2); }
.h4 { margin-top: 36px; margin-bottom: 12px; }
.certs { display: grid; gap: 8px; }
.certs a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; background: var(--mist); border-radius: 10px; text-decoration: none; transition: background-color .2s; }
.certs a:hover { background: var(--yellow-pale); }
.certs em { grid-column: 1; font-style: normal; font-size: .9rem; color: var(--ink-3); }
.certs svg { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

/* ---------- FAQ ---------- */
.faq { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.faq-list { border-top: 2px solid var(--ink); }
.faq-list details { border-bottom: 1px solid #b9b6ae; }
.faq-list summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; font: 700 1.12rem/1.3 var(--display); cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary svg { width: 34px; height: 34px; padding: 8px; border-radius: 8px; background: var(--black); color: var(--yellow); transition: background-color .2s, color .2s; }
.faq-list summary svg use { transform-origin: 10px 10px; transition: transform .3s var(--ease); }
.faq-list details[open] summary svg { background: var(--yellow); color: var(--black); }
.faq-list details[open] summary svg use { transform: rotate(45deg); }
.faq-list details p { padding: 0 48px 22px 0; color: var(--ink-2); max-width: 64ch; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
.contact .h2 { margin-bottom: 20px; }
.direct { margin-top: 32px; display: grid; gap: 2px; }
.direct a { display: inline-flex; align-items: center; gap: 12px; padding: 9px 0; font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent; }
.direct a:hover { border-color: var(--black); }
.form-sheet { padding: clamp(24px, 3.4vw, 44px); background: var(--paper); box-shadow: 0 30px 50px -28px rgba(60, 40, 0, .7); }
.f-row { display: grid; gap: 6px; margin-bottom: 20px; }
.f-row label { font-weight: 700; font-size: .95rem; }
.f-row input, .f-row select, .f-row textarea { width: 100%; padding: 10px 2px; background: transparent; border: 0; border-bottom: 2px solid #b4b1a7; border-radius: 0; font-size: 1.05rem; transition: border-color .2s, background-color .2s; }
.f-row textarea { resize: vertical; min-height: 104px; line-height: 1.5; }
.f-row select { appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%23161617' stroke-width='1.8'/%3E%3C/svg%3E") right 2px center / 18px no-repeat; padding-right: 28px; }
.f-row input:focus, .f-row select:focus, .f-row textarea:focus { outline: none; border-color: var(--black); background-color: #fff6d6; }
.f-row [aria-invalid="true"] { border-color: var(--black); border-bottom-style: dashed; background-color: #fff6d6; }
.f-error { min-height: 1.4em; margin: -6px 0 10px; font-weight: 700; font-size: .95rem; }
.f-error:not(:empty)::before { content: "! "; display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; margin-right: 6px; border-radius: 50%; background: var(--black); color: var(--yellow); font-size: .8em; }
.f-keys { display: flex; flex-wrap: wrap; gap: 12px; }
.f-keys .key-ink svg { color: var(--yellow); }
.f-note { margin-top: 14px; font-size: .88rem; color: var(--ink-3); }

/* ---------- Footer & dock ---------- */
.foot { background: var(--black); color: #cfcbc0; padding: 34px 0 calc(34px + env(safe-area-inset-bottom)); }
.foot-row { display: flex; align-items: center; gap: 18px; }
.foot-row img { width: auto; height: 40px; }
.foot-row p { display: grid; gap: 2px; font-size: .92rem; }
.foot-row b { color: #fff; font: 700 1rem/1.2 var(--display); }
.foot-c { margin-left: auto; font-family: var(--mono); font-size: .82rem !important; display: block !important; }
.dock { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kbd { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kkey { grid-column: span min(var(--span, 1), 4); }
}
@media (max-width: 960px) {
  .menu-key { display: inline-flex; }
  .deck-keys { margin-left: auto; }
  .deck-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 6px var(--gutter) 18px; background: var(--black); box-shadow: 0 18px 24px -12px rgba(0, 0, 0, .6); }
  .deck-nav.open { display: flex; }
  .deck-nav a { padding: 14px 0; font-size: 1.12rem; border-bottom: 1px solid #333; }
  .machine-grid, .head-split, .kbd-wrap, .hosp-grid, .brand-grid, .models, .about, .faq, .contact { grid-template-columns: 1fr; }
  .head-split { align-items: start; }
  .tape-unit { max-width: 440px; }
  .guide { display: none; }
  .kprint { order: -1; top: calc(var(--deck-h) + 10px); z-index: 3; min-height: 0; padding: 20px 20px 22px; }
  .kprint-d { min-height: 3.1em; font-size: 1rem; }
  .counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .pipeline li:nth-child(3) { padding-left: 0; border-left: 0; }
  .key-n span { display: none; }
  .key-n { min-height: 72px; align-items: center; justify-content: center; }
  .printout { margin-inline: 0; }
  .portrait { position: static; max-width: 360px; }
  .dock { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; gap: 10px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: var(--black); box-shadow: 0 -10px 24px -10px rgba(0, 0, 0, .6); transform: translateY(110%); transition: transform .35s var(--ease); }
  .dock.show { transform: none; }
  .dock .key-yellow { flex: 1; }
  .dock-wa { width: 56px; padding: 0; }
  .foot { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  :root { --deck-h: 60px; }
  .maker span { font-size: .98rem; }
  .maker img { height: 30px; }
  .maker { gap: 8px; }
  .deck-row { gap: 10px; }
  .lang { gap: 3px; padding: 4px; }
  .key-s { min-width: 34px; padding: 0 .35rem; }
  .platen { margin: 0 -6px; }
  .sheet { margin: -16px 10px 0; }
  .keyrow, .avail { margin-inline: 10px; }
  .keyrow .key { flex: 1 1 100%; }
  .kbd { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 7px; }
  .kkey { grid-column: span 1; min-height: 52px; font-size: .92rem; }
  .kkey[data-k="n8n"], .kkey[data-k="any"], .kkey[data-k="data"] { grid-column: span 2; }
  .ev-img img { max-height: 150px; width: auto; }
  .cards { grid-template-columns: 1fr; }
  .counters > div { padding: 14px; }
  .odo i { font-size: 1.45rem; }
  .pipeline, .steps { grid-template-columns: 1fr; }
  .pipeline li + li { padding-left: 0; border-left: 0; border-top: 1px dashed #bdbab0; }
  .evolution { grid-template-columns: 1fr; }
  .ledger th { font-size: 1.8rem; }
  .career li { grid-template-columns: 5.4em minmax(0, 1fr); }
  .career em { grid-column: 2; }
  .engine-links .key, .f-keys .key { flex: 1 1 100%; }
  .foot-row { flex-wrap: wrap; }
  .foot-c { margin-left: 0; }
  .faq-list details p { padding-right: 0; }
}
@media (max-width: 380px) {
  .maker span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .js .machine .tape-lines li { opacity: 1; transform: none; }
}
