/* Expert Experiments - design system
   Brand: ink black + signal orange (#FF6600). Flat surfaces, sharp corners, heavy Inter display type.
   Light + dark. No framework. */

@font-face { font-family: "InterVar"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; 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: "InterVar"; src: url("../fonts/inter-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "SerifVar"; src: url("../fonts/serif.woff2") format("woff2"); font-weight: 200 900; font-display: swap; 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: "SerifVar"; src: url("../fonts/serif-ext.woff2") format("woff2"); font-weight: 200 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "SerifVar"; src: url("../fonts/serif-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "SerifVar"; src: url("../fonts/serif-ext-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1EFF; }

:root {
  --font-sans: "InterVar", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "InterVar", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif: "SerifVar", "Iowan Old Style", Charter, "Palatino Linotype", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --bg: #ffffff;
  --bg-sunken: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #f6f6f4;
  --hover: rgba(17, 17, 17, .05);
  --ink: #111111;
  --ink-2: #4a4a4a;
  --ink-3: #8a8a8a;
  --line: #e5e5e2;
  --line-strong: #cdcdc8;

  --accent: #ff6600;          /* brand orange: fills, bars, focus */
  --accent-hover: #e65c00;
  --accent-ink: #ffffff;
  --accent-soft: #fff1e7;
  --accent-line: #ffd0ad;
  --accent-text: #c24e00;     /* orange that passes contrast as text */
  --primary: #111111;         /* primary buttons are ink, like the wordmark */
  --primary-ink: #ffffff;

  --blue: #2346d0;    --blue-soft: #edf1fe;
  --red: #d13b30;     --red-soft: #fdeeec;
  --rec: #e0302a;
  --green: #13804f;   --green-soft: #e9f6ef;
  --amber: #a5650b;   --amber-soft: #fdf5e6;
  --purple: #6e46c2;  --purple-soft: #f3effc;
  --teal: #0f7b80;    --teal-soft: #e8f6f6;

  --radius: 2px;
  --radius-sm: 2px;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .14);  /* only for floating layers: menus, dialogs, toasts */
  --grid: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 20px 20px,
          linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 20px 20px;
  --sidebar-w: 248px;
  --page-w: 760px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e0e0e; --bg-sunken: #0a0a0a; --surface: #161616; --surface-2: #1c1c1c; --hover: rgba(255,255,255,.06);
  --ink: #f2f2f0; --ink-2: #b8b8b4; --ink-3: #7e7e7a; --line: #2a2a2a; --line-strong: #3d3d3d;
  --accent: #ff6a10; --accent-hover: #ff8236; --accent-ink: #ffffff; --accent-soft: #2a160a; --accent-line: #5a2c0e;
  --accent-text: #ff8a42; --primary: #f2f2f0; --primary-ink: #111111;
  --blue: #8aa2ff; --blue-soft: #1a2040;
  --red: #ff8a80; --red-soft: #3a1d1b; --green: #5fd39a; --green-soft: #13261c; --amber: #f0b45a; --amber-soft: #2d2213;
  --purple: #b9a0ff; --purple-soft: #241c3a; --teal: #5fd0d4; --teal-soft: #122627;
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15.5px/1.6 var(--font-sans); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, video, canvas { max-width: 100%; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 1.6em 0 .5em; font-family: var(--font-display); font-weight: 750; letter-spacing: -.02em; }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: .5em 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.6rem 0; }
code { font: .88em var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); padding: .1em .35em; border-radius: var(--radius-sm); }
mark { background: var(--accent-soft); color: inherit; padding: 0 .15em; box-shadow: inset 0 -2px 0 var(--accent); }
small, .small { font-size: .85rem; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.display, .serif { font-family: var(--font-display); font-weight: 800; letter-spacing: -.025em; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }

/* ---------- layout primitives ---------- */
.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; gap: var(--gap, .75rem); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: var(--gap, 1rem); }
.grid.c2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 440px; margin: 0 auto; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }

/* ---------- app shell: sidebar ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg-sunken);
  border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 1px;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 10px 18px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.wordmark { display: block; height: 24px; width: auto; color: var(--ink); flex: none; }
.sidebar .wordmark { height: 21px; }
.brand small { display: block; font-weight: 600; color: var(--ink-3); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.nav-section { margin: 16px 10px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 550; font-size: .92rem; border-left: 3px solid transparent;
}
.nav-link:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--surface); color: var(--ink); border-left-color: var(--accent); }
.nav-link .ico { width: 18px; text-align: center; opacity: .85; }
.nav-link .count { margin-left: auto; font-size: .72rem; font-weight: 700; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-sm); padding: 0 6px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); }
.user-chip:hover { background: var(--hover); text-decoration: none; }
.avatar { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: .72rem; font-weight: 750;
  background: var(--ink); color: var(--bg); flex: none; letter-spacing: .02em; }
.user-chip .who { line-height: 1.2; min-width: 0; }
.user-chip .who b { display: block; font-size: .88rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: .75rem; color: var(--ink-3); }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--ink-3); font-size: .9rem; min-width: 0; }
.crumbs a { color: var(--ink-2); }
.crumbs span.sep { opacity: .5; }
.crumbs .here { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .menu-btn { display: none; }
.content { padding: 8px 40px 80px; max-width: 1180px; }
.page-head { margin: 22px 0 26px; }
.page-head h1 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--ink-2); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 40; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 8px 18px 80px; }
  .topbar { padding: 0 12px; }
}

/* ---------- public header ---------- */
.pub-nav { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.pub-nav .container { display: flex; align-items: center; height: 64px; gap: 28px; }
.pub-nav .wordmark { height: 26px; }
.pub-nav nav { display: flex; gap: 24px; margin-left: 8px; }
.pub-nav nav a { color: var(--ink-2); font-weight: 600; font-size: .9rem; padding: 6px 0; white-space: nowrap; }
@media (max-width: 1240px) { .pub-nav .container { gap: 16px; } .pub-nav nav { gap: 14px; margin-left: 0; } .pub-nav nav a { font-size: .85rem; } }
.pub-nav nav a:hover { color: var(--ink); text-decoration: none; box-shadow: inset 0 -2px 0 var(--accent); }
.pub-nav .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 960px) { .pub-nav nav { display: none; } }

/* ---------- buttons & forms ---------- */
.btn {
  --b: var(--line-strong); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--b);
  background: var(--surface); color: var(--ink); font: 600 .9rem/1 var(--font-sans); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s; white-space: nowrap; text-decoration: none !important;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; color: var(--ink); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: .84rem; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 1rem; }
.btn-icon { width: 34px; padding: 0; }
.btn-rec { background: var(--red); border-color: var(--red); color: #fff; }
.btn-rec .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.btn-rec.on .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

label { font-weight: 600; font-size: .86rem; color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field .hint { font-size: .8rem; color: var(--ink-3); }
.input, .select, .textarea, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: 400 .95rem/1.4 var(--font-sans); transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; min-height: 90px; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--accent); vertical-align: -3px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 450; color: var(--ink); cursor: pointer; }
.inline-form { display: inline; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 8px 16px; cursor: pointer; color: var(--ink-2); font-weight: 600; }
.seg label + input + label { border-left: 1px solid var(--line-strong); }
.seg input:checked + label { background: var(--ink); color: var(--bg); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.flat { box-shadow: none; }
.card.pad-0 { padding: 0; }
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1rem; font-weight: 750; letter-spacing: -.01em; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin: 32px 0 12px; }
.section-title::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex: none; }

.stat { padding: 16px 18px; }
.stat .n { font: 800 2rem/1.05 var(--font-display); letter-spacing: -.04em; }
.stat .l { font-size: .8rem; color: var(--ink-3); margin-top: 6px; font-weight: 500; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border-radius: var(--radius-sm); font-size: .74rem; font-weight: 650;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.badge.orange { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.purple { background: var(--purple-soft); color: var(--purple); border-color: transparent; }
.badge.teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.dot-status { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: none; }
.dot-status.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot-status.busy { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); animation: pulse 1s infinite; }

.progress { height: 6px; background: var(--bg-sunken); overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; background: var(--accent); }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--grid); }
.empty .big { font-size: 2rem; margin-bottom: 6px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 700; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-2); }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--hover); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* flashes */
.flashes { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.flash { padding: 12px 40px 12px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--ink); box-shadow: var(--shadow-lg); position: relative; font-size: .93rem; animation: slidein .2s ease; }
.flash::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; background: var(--accent); }
.flash.success::before { background: var(--green); } .flash.error::before { background: var(--red); } .flash.warning::before { background: var(--amber); }
.flash button { position: absolute; right: 8px; top: 8px; border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 1.1rem; }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }
.alert { padding: 12px 14px; border-radius: var(--radius); border-left: 4px solid currentColor; background: var(--red-soft); color: var(--red); font-size: .93rem; margin-bottom: 14px; }
.alert.info { background: var(--accent-soft); color: var(--accent-text); }
.alert.ok { background: var(--green-soft); color: var(--green); }
.alert.warn { background: var(--amber-soft); color: var(--amber); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--ink-2); font-weight: 600; border: 0; background: none; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; font-size: .92rem; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .active { color: var(--ink); border-bottom-color: var(--accent); }

dialog { border: 1px solid var(--ink); border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 10, 10, .45); }
dialog .dlg-body { padding: 22px; }
dialog .dlg-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

.code-chip { font: 700 1.05rem var(--font-mono); letter-spacing: .14em; background: var(--surface-2); border: 1px solid var(--ink); padding: 4px 10px; border-radius: var(--radius-sm); }
.kbd { font: .78rem var(--font-mono); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--radius-sm); padding: 0 5px; color: var(--ink-2); }

/* ---------- experiment cards ---------- */
.exp-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); transition: border-color .15s; }
.exp-card:hover { text-decoration: none; border-color: var(--ink); }
.exp-card:hover h3 { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.exp-cover { height: 128px; background: var(--surface-2) center/cover no-repeat; position: relative; border-bottom: 1px solid var(--line); }
.exp-cover.gen { background: var(--grid), color-mix(in srgb, var(--hue, #ff6600) 9%, var(--surface)); }
.exp-cover.gen::after { content: ""; position: absolute; right: 0; top: 0; width: 34%; height: 100%; background: color-mix(in srgb, var(--hue, #ff6600) 16%, transparent); }
.exp-cover .ico { position: absolute; left: 16px; bottom: -18px; z-index: 1; font-size: 1.8rem; width: 50px; height: 50px; display: grid; place-items: center; background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--ink); }
.exp-body { padding: 26px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.exp-body h3 { margin: 0; font-size: 1.05rem; font-weight: 750; letter-spacing: -.015em; line-height: 1.3; }
.exp-kicker { margin-bottom: -4px; font: 700 .66rem var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.exp-body p { margin: 0; color: var(--ink-2); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.exp-meta { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-top: 6px; }
.exp-progress { margin-top: 6px; }

.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--hover); text-decoration: none; }
.list-row .ico { font-size: 1.25rem; width: 34px; height: 34px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); flex: none; }
.list-row .t { font-weight: 650; }
.list-row .s { font-size: .84rem; color: var(--ink-3); }

/* filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.filters .search { flex: 1 1 260px; position: relative; }
.filters .search input { padding-left: 34px; }
.filters .search::before { content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-52%); color: var(--ink-3); font-size: 1.15rem; }
.filters select { width: auto; min-width: 140px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 11px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: .84rem; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- experiment page (document) ---------- */
/* A book with instruments: prose in a narrow measure, widgets wider. Student-facing rules live in the
   handbook's experiment-structure article ("The student page"). */
.doc-layout { display: grid; grid-template-columns: minmax(0, 880px) 196px; gap: 48px; justify-content: center; }
.content:has(.doc-layout) { max-width: none; }
@media (max-width: 1180px) { .doc-layout { grid-template-columns: minmax(0, 880px); } .doc-layout .doc-toc { display: none; } }
.doc { min-width: 0; }
.doc-title { font: 800 2.6rem/1.08 var(--font-display); letter-spacing: -.04em; margin: 14px 0 10px; }
.doc-summary { color: var(--ink-2); font-size: 1.08rem; margin: 0 0 14px; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.doc-toc { position: sticky; top: 72px; align-self: start; font-size: .85rem; max-height: calc(100vh - 100px); overflow: auto; padding-top: 40px; }
.doc-toc .t { font-size: .7rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin-bottom: 8px; }
.doc-toc a { display: block; padding: 4px 0 4px 10px; color: var(--ink-3); border-left: 2px solid var(--line); }
.doc-toc a.l3 { padding-left: 22px; }
.doc-toc a:hover, .doc-toc a.on { color: var(--ink); border-left-color: var(--accent); text-decoration: none; }
.doc-progress { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }

/* blocks */
.blocks { font-size: 1.02rem; line-height: 1.7; }
.blk { margin: 4px 0; position: relative; }
.blk-text p { margin: .35em 0; }
.blk-heading { margin-top: 1.8em; }
.blk-heading h1, .blk-heading h2, .blk-heading h3 { margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em; }
.blk-heading h1 { font-size: 1.85rem; } .blk-heading h2 { font-size: 1.5rem; } .blk-heading h3 { font-size: 1.2rem; }
.blk-heading .anchor { position: absolute; left: -22px; top: .15em; opacity: 0; color: var(--ink-3); }
.blk-heading:hover .anchor { opacity: 1; }
.blk-quote { border-left: 4px solid var(--accent); padding: 2px 0 2px 16px; margin: 12px 0; font-size: 1.05rem; }
.blk-callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); margin: 12px 0; border-left: 4px solid var(--line-strong); }
.blk-callout .ci { font-size: 1.25rem; line-height: 1.5; flex: none; }
.blk-callout.info { background: var(--accent-soft); border-left-color: var(--accent); } .blk-callout.tip { background: var(--green-soft); border-left-color: var(--green); }
.blk-callout.warning { background: var(--amber-soft); border-left-color: var(--amber); } .blk-callout.danger { background: var(--red-soft); border-left-color: var(--red); }
.blk-callout.note { background: var(--surface-2); }
.blk-callout p:first-child { margin-top: 0; } .blk-callout p:last-child { margin-bottom: 0; }
.blk-list ul, .blk-list ol { margin: 6px 0; padding-left: 1.5em; }
.blk-list li { margin: 3px 0; padding-left: 2px; }
.blk-list ul.check { list-style: none; padding-left: .2em; display: block; }
.blk-list ul.check li { display: flex; gap: 10px; align-items: baseline; }
.blk-toggle details { margin: 6px 0; }
.blk-toggle summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.blk-toggle summary::-webkit-details-marker { display: none; }
.blk-toggle summary::before { content: "▸"; color: var(--accent); transition: transform .15s; display: inline-block; width: 1em; }
.blk-toggle details[open] summary::before { transform: rotate(90deg); }
.blk-toggle .tb { padding: 2px 0 6px 1.6em; color: var(--ink-2); }
.blk-equation { padding: 10px 0; overflow-x: auto; text-align: center; font-size: 1.12rem; }
.blk-image figure { margin: 14px 0; }
.blk-image img { border-radius: var(--radius); display: block; margin: 0 auto; }
.blk-image.small img { max-width: 50%; } .blk-image.wide figure { margin-left: -60px; margin-right: -60px; }
@media (max-width: 1000px) { .blk-image.wide figure { margin-left: 0; margin-right: 0; } }
@media (max-width: 600px) { .blk-image.small img { max-width: 80%; } }
.blk-image figcaption, .blk-video figcaption, .blk-embed figcaption { font-size: .85rem; color: var(--ink-3); margin-top: 6px; text-align: center; }
.ratio { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #000; }
.ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.blk-embed iframe { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.blk-code pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; font: .88rem/1.55 var(--font-mono); }
.blk-divider hr { margin: 22px 0; }

/* interactive blocks share a "widget" frame */
.widget { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); margin: 18px 0; overflow: hidden; }
.widget-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: .9rem; }
.widget-head .wt { font-weight: 700; }
.widget-head .wk { font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--bg); background: var(--ink); padding: 2px 6px; }
.widget-head .sp { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.plot-head { padding: 12px 18px; }
.plot-head .wt { font-size: 1rem; }
.plot-head .wk { background: var(--accent); color: #fff; }
.plot-brand { display: block; width: clamp(104px, 14vw, 148px); }
.plot-brand img { display: block; width: 100%; height: auto; }
.plot-brand img + img { display: none; }
html[data-theme="dark"] .plot-brand img:first-child { display: none; }
html[data-theme="dark"] .plot-brand img:last-child { display: block; }
.widget-body { padding: 14px; }
.widget[data-type="plot"] .widget-body { padding: 10px 18px 18px; }
.widget-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .88rem; color: var(--ink-3); }
.widget .instructions { color: var(--ink-2); font-size: .93rem; margin: 0 0 10px; }

/* question */
.q { border: 1px solid var(--line-strong); border-radius: var(--radius); margin: 18px 0; padding: 16px 18px; background: var(--surface); transition: border-color .2s; border-left: 4px solid var(--ink); }
.q.correct { border-color: var(--green); }
.q.wrong { border-color: var(--red); }
.q-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.q-num { font: 750 .74rem var(--font-sans); color: #fff; background: var(--accent); border-radius: var(--radius-sm); padding: 2px 7px; flex: none; }
.q-prompt { font-weight: 600; flex: 1; }
.q-pts { font-size: .78rem; color: var(--ink-3); white-space: nowrap; }
.q-input { display: flex; gap: 8px; align-items: center; }
.q-input .unit { color: var(--ink-3); font-size: .9rem; white-space: nowrap; }
.q-choices { display: grid; gap: 6px; }
.q-choice { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 450; color: var(--ink); transition: background .1s, border-color .1s; }
.q-choice:hover { border-color: var(--ink); }
.q-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.q-foot { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: .86rem; color: var(--ink-3); min-height: 30px; flex-wrap: wrap; }
.q-feedback { font-size: .9rem; padding: 10px 12px; border-radius: var(--radius); margin-top: 10px; border-left: 4px solid currentColor; }
.q-feedback.ok { background: var(--green-soft); color: var(--green); }
.q-feedback.no { background: var(--red-soft); color: var(--red); }
.q-feedback.info { background: var(--surface-2); color: var(--ink-2); }
.q-feedback.teacher { background: var(--purple-soft); color: var(--purple); }
.saved-ind { font-size: .8rem; color: var(--ink-3); }
.saved-ind.saving::before { content: "● "; color: var(--amber); }
.saved-ind.saved::before { content: "✓ "; color: var(--green); }

/* data table widget */
.dt-wrap { overflow-x: auto; }
table.dt { border-collapse: collapse; width: 100%; font-size: .93rem; font-variant-numeric: tabular-nums; }
.dt th { background: var(--surface-2); font-weight: 700; text-align: left; padding: 6px 10px; border: 1px solid var(--line-strong); white-space: nowrap; }
.dt th .u { font-weight: 400; color: var(--ink-3); font-size: .82rem; }
.dt th .f { display: block; font-weight: 400; color: var(--teal); font-size: .75rem; font-family: var(--font-mono); }
.dt td { border: 1px solid var(--line); padding: 0; }
.dt td input { border: 0; border-radius: 0; min-height: 34px; padding: 6px 10px; background: transparent; font-variant-numeric: tabular-nums; }
.dt td input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.dt td.calc { background: var(--teal-soft); color: var(--teal); padding: 6px 10px; }
.dt td.idx { width: 34px; text-align: center; color: var(--ink-3); font-size: .78rem; padding: 0 6px; background: var(--surface-2); }

/* charts */
.chart { width: 100%; min-height: 280px; position: relative; }
.widget[data-type="plot"] .chart, .widget[data-type="plot"] .chart-empty { min-height: 320px; }
.chart .u-legend { font-size: .82rem; }
.chart-empty { display: grid; place-items: center; min-height: 220px; color: var(--ink-3); font-size: .92rem; text-align: center; padding: 20px; background: var(--grid); border: 1px solid var(--line); }
.fit-result { font: .88rem var(--font-mono); background: var(--surface-2); border-left: 4px solid var(--accent); padding: 8px 10px; margin-top: 8px; color: var(--ink-2); }
.readout { display: flex; gap: 18px; flex-wrap: wrap; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.readout div { min-width: 90px; border-left: 2px solid var(--accent); padding-left: 10px; }
.readout b { display: block; font: 700 1.3rem var(--font-mono); color: var(--ink); }
.readout span { font-size: .74rem; color: var(--ink-3); letter-spacing: .02em; }
.readout b small { font: 500 .8rem var(--font-sans); color: var(--ink-3); }
.sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 18px; margin-top: 10px; }
.slider label { display: flex; justify-content: space-between; font-weight: 600; }
.slider output { font-family: var(--font-mono); color: var(--ink); }

.gate { text-align: center; padding: 24px; border: 1px dashed var(--ink-3); border-radius: var(--radius); color: var(--ink-2); margin: 24px 0; background: var(--grid); }
.gate .lock { font-size: 1.6rem; }
.gated { display: none !important; }
.submit-bar { margin: 40px 0 0; padding: 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-strong); border-top: 4px solid var(--accent); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.score-big { font: 800 2.2rem var(--font-display); letter-spacing: -.04em; }

/* ---------- landing ---------- */
.hero { position: relative; color: #fff; background: #0d0d0d; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0;
  background: linear-gradient(#1d1d1d 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, #1d1d1d 1px, transparent 1px) 0 0 / 32px 32px; }
.hero .container { position: relative; width: 100%; padding-top: 64px; padding-bottom: 32px; }
.hero-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; }
.hero-visual { position: relative; margin-right: 40px; }
.hero-visual::before { content: ""; position: absolute; inset: -20% -70%; background: radial-gradient(closest-side, rgba(255, 102, 0, .26), transparent); }
.hero-device { position: relative; display: block; width: auto; height: min(560px, 66vh); animation: hover-float 7s ease-in-out infinite; }
@keyframes hover-float { 50% { transform: translateY(-12px); } }
@media (max-width: 900px) { .hero-main { grid-template-columns: 1fr; gap: 40px; } .hero-visual { margin: 0 auto; } .hero-device { height: 280px; } }
@media (prefers-reduced-motion: reduce) { .hero-device { animation: none; } }
.kicker { display: inline-flex; gap: 12px; align-items: center; font-size: .76rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.kicker::before { content: ""; width: 28px; height: 4px; background: var(--accent); }
.hero h1 { font: 800 clamp(2.5rem, 5.2vw, 4.5rem)/.98 var(--font-display); letter-spacing: -.055em; margin: 20px 0 18px; color: #fff; }
.hero h1 .accent { color: var(--accent); }
.caret { display: inline-block; width: .07em; height: .82em; background: var(--accent); vertical-align: -.04em; margin-left: .05em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
.hero .lead { font-size: 1.2rem; line-height: 1.55; color: rgba(255, 255, 255, .86); max-width: 34em; margin: 0; }
.hero .ctas { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.btn-light { background: #fff; border-color: #fff; color: #111; }
.btn-light:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-outline-light:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-top: 48px; padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .22); font-size: .84rem; color: rgba(255, 255, 255, .72); }
.hero-foot .unis { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.hero-foot .unis img { height: 24px; filter: grayscale(1) invert(1); mix-blend-mode: screen; opacity: .85; }
.supported { display: flex; flex-direction: column; gap: 6px; }
.supported img { height: 34px; width: auto; background: #fff; padding: 6px 10px; }

.statbar { background: #111; color: #fff; border-bottom: 4px solid var(--accent); }
.statbar .container { display: grid; grid-template-columns: repeat(4, 1fr); }
.statbar .s { padding: 26px 20px; border-left: 1px solid #2a2a2a; }
.statbar .s:first-child { border-left: 0; padding-left: 0; }
.statbar .n { font: 800 2.4rem/1 var(--font-display); letter-spacing: -.05em; color: var(--accent); }
.statbar .l { font-size: .82rem; color: #bdbdbd; margin-top: 8px; }
@media (max-width: 760px) { .statbar .container { grid-template-columns: 1fr 1fr; } .statbar .s:nth-child(3) { border-left: 0; padding-left: 0; } }

.band { padding: 88px 0; }
.band.alt { background: var(--bg-sunken); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band.ink { background: #111; color: #fff; position: relative; overflow: hidden; }
.band.ink::before { content: ""; position: absolute; inset: 0; opacity: .5;
  background: linear-gradient(#262626 1px, transparent 1px) 0 0 / 28px 28px, linear-gradient(90deg, #262626 1px, transparent 1px) 0 0 / 28px 28px; }
.band.ink > * { position: relative; }
.band.ink .sub { color: #c8c8c8; }
.band h2 { font: 800 clamp(1.9rem, 3.6vw, 2.8rem)/1.05 var(--font-display); letter-spacing: -.045em; margin: 10px 0 12px; }
.band .sub { color: var(--ink-2); font-size: 1.1rem; max-width: 40em; margin: 0 0 40px; }
.curiosity-band { background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); }
.curiosity-lab { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.curiosity-prompt > p { max-width: 36em; color: var(--ink-2); }
.prediction { border: 0; padding: 0; margin: 22px 0 0; min-width: 0; }
.prediction legend { font-size: .82rem; font-weight: 700; margin-bottom: 10px; }
.prediction-options { display: flex; flex-wrap: wrap; gap: 8px; }
.prediction-options .btn { height: auto; min-height: 44px; padding: 10px 12px; white-space: normal; }
.prediction-options [aria-pressed="true"] { border-color: var(--ink); background: var(--primary); color: var(--primary-ink); }
.prediction-feedback { min-height: 3.2em; margin: 12px 0; }
.prediction-explanation summary { cursor: pointer; color: var(--accent-text); font-weight: 650; }
.prediction-explanation p { color: var(--ink-2); }
.pendulum-demo { padding: 24px; background: var(--surface); border: 1px solid var(--ink); box-shadow: 8px 8px 0 var(--accent); }
.pendulum-stage { background: var(--grid); }
.pendulum-stage svg { display: block; width: 100%; }
.pendulum-support { fill: none; stroke: var(--ink); stroke-width: 3; }
.pendulum-arm path { stroke: var(--ink); stroke-width: 2; }
.pendulum-arm circle { fill: var(--accent); stroke: var(--ink); stroke-width: 2; }
.pendulum-pivot { fill: var(--ink); }
.pendulum-traces { margin-top: 20px; color: var(--ink-2); }
.pendulum-traces svg { display: block; width: 100%; overflow: visible; }
.pendulum-traces text { fill: var(--ink-2); font: 11px var(--font-sans); }
.trace-axis { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.pendulum-trace { fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.trace-tip { fill: var(--blue); }
.pendulum-labels { display: grid; grid-template-columns: 1fr 1fr; text-align: center; gap: 16px; font-size: .82rem; color: var(--ink-2); }
.pendulum-labels b { display: block; color: var(--ink); font-size: 1.1rem; }
@media (max-width: 900px) { .curiosity-lab { grid-template-columns: 1fr; gap: 32px; } }
@media (prefers-reduced-motion: reduce) {
  .curiosity-lab [data-pendulum-motion] { display: none; }
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.wide-right { grid-template-columns: 5fr 7fr; }
@media (max-width: 900px) { .split, .split.wide-right { grid-template-columns: 1fr; gap: 32px; } }
.framed { position: relative; isolation: isolate; }
.framed img { display: block; width: 100%; height: auto; border: 1px solid var(--ink); background: var(--surface); }
.framed::after { content: ""; position: absolute; right: -14px; bottom: -14px; width: 42%; height: 42%; background: var(--accent); z-index: -1; }

.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.way { display: flex; flex-direction: column; color: inherit; background: var(--surface); border: 1px solid var(--line-strong); transition: border-color .15s, transform .15s; }
.way:hover { text-decoration: none; border-color: var(--ink); transform: translateY(-2px); }
.way img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-bottom: 1px solid var(--line-strong); }
.way-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 20px 22px 22px; }
.way h3 { margin: 0; font: 800 1.25rem/1.2 var(--font-display); letter-spacing: -.025em; }
.way p { margin: 0; color: var(--ink-2); font-size: .95rem; flex: 1; }
.way-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--accent-text); font-size: .88rem; font-weight: 700; }
@media (max-width: 900px) { .ways { grid-template-columns: 1fr; } }

/* Desktop: the copy is centred beside the stage. Mobile: heading, then device, then legend. */
.hepek-tour { display: grid; grid-template-columns: 5fr 6fr; grid-template-rows: 1fr auto auto 1fr; grid-template-areas: "stage ." "stage head" "stage body" "stage ."; column-gap: 64px; }
.hepek-head { grid-area: head; }
.hepek-body { grid-area: body; }
.hepek-stage { grid-area: stage; display: grid; align-content: center; justify-items: center; gap: 20px; padding: 36px 24px 24px; background: var(--grid), var(--bg-sunken); border: 1px solid var(--line-strong); perspective: 1800px; }
.hepek-flipper { position: relative; width: min(290px, 64vw); transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3, .7, .2, 1); }
.is-flipped .hepek-flipper { transform: rotateY(180deg); }
.hepek-face { position: relative; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.hepek-face[data-face="back"] { position: absolute; inset: 0; transform: rotateY(180deg); }
.hepek-face img { display: block; width: 100%; height: auto; }
.hotspot { position: absolute; left: var(--x); top: var(--y); width: 28px; height: 28px; margin: -14px 0 0 -14px; padding: 0; border: 2px solid #fff; border-radius: 50%;
  background: var(--accent); color: #fff; font: 800 .74rem/1 var(--font-display); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); transition: transform .15s, background-color .15s; }
.hotspot::after { content: ""; position: absolute; inset: -7px; border: 2px solid var(--accent); border-radius: 50%; opacity: 0; pointer-events: none; }
.is-seen .hotspot::after { animation: spot-ping 2.4s ease-out .4s 3; }
@keyframes spot-ping { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
.hotspot:hover, .hotspot.is-active { transform: scale(1.18); background: #111; }
.hotspot:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.hepek-legend { list-style: none; counter-reset: spot; padding: 0; margin: 0 0 24px; border-top: 1px solid var(--line); }
.hepek-legend li { counter-increment: spot; display: grid; grid-template-columns: 22px 1fr; column-gap: 14px; padding: 9px 10px; border-bottom: 1px solid var(--line); transition: background-color .15s; }
.hepek-legend li::before { content: counter(spot); grid-row: span 2; margin-top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font: 800 .7rem/22px var(--font-display); text-align: center; }
.hepek-legend b { font-weight: 750; }
.hepek-legend span { color: var(--ink-2); font-size: .93rem; }
.hepek-legend li.is-active { background: var(--accent-soft); }
.pods { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.pods li { display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px; border: 1px solid var(--line-strong); background: var(--surface); font-size: .8rem; font-weight: 650; }
.pods li::before { content: ""; width: 9px; height: 9px; background: var(--pod); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
@media (max-width: 900px) { .hepek-tour { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "head" "stage" "body"; row-gap: 28px; } .hepek-head .sub { margin-bottom: 0; } }
@media (prefers-reduced-motion: reduce) { .hepek-flipper { transition: none; } .is-seen .hotspot::after { animation: none; } }

/* ---------- Hepek page ---------- */
.hk-teaser { grid-template-columns: 5fr 6fr; }
.hk-teaser .framed { display: block; width: min(100%, 380px); justify-self: center; }
.hk-teaser .sq-list { margin-bottom: 22px; color: var(--ink-2); }

/* The hero keeps the photo's studio grey in both themes. */
.hk-hero { --ink: #111; --ink-2: #3b3b3b; --surface: transparent; --line-strong: rgba(0, 0, 0, .3); --primary: #111; --primary-ink: #fff;
  color-scheme: light; color: var(--ink); background: linear-gradient(90deg, #d4d4d5 45%, #bcbcbe); overflow: hidden; }
.hk-hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: center; padding-top: 48px; }
.hk-hero h1 { font: 800 clamp(2.4rem, 4.6vw, 4rem)/1 var(--font-display); letter-spacing: -.05em; margin: 18px 0 16px; }
.hk-hero .lead { font-size: 1.15rem; line-height: 1.55; color: var(--ink-2); max-width: 30em; margin: 0; }
.hk-hero .ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hk-hero-img { display: block; width: 116%; max-width: none; height: auto; margin: -24px -16% -8px 0;
  -webkit-mask-image: radial-gradient(60% 60%, #000 70%, transparent); mask-image: radial-gradient(60% 60%, #000 70%, transparent); }
.hk-facts { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 18px 0 32px; margin: 0; border-top: 1px solid rgba(0, 0, 0, .18); }
.hk-facts li { padding-left: 18px; border-left: 1px solid rgba(0, 0, 0, .14); font-size: .86rem; color: var(--ink-2); }
.hk-facts li:first-child { padding-left: 0; border-left: 0; }
.hk-facts b { display: block; font: 800 1.9rem/1.15 var(--font-display); letter-spacing: -.04em; color: var(--ink); }
@media (max-width: 900px) {
  .hk-hero-grid { grid-template-columns: 1fr; padding-top: 36px; }
  .hk-hero-img { width: 112%; margin: -8px -6% 0; }
  .hk-facts { grid-template-columns: 1fr 1fr; row-gap: 16px; }
  .hk-facts li:nth-child(3) { padding-left: 0; border-left: 0; }
}

/* Live demo: pods plug into the Hepek, which streams to a laptop and a phone. */
.hk-tray-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 24px; }
.hk-tray { display: flex; flex-wrap: wrap; gap: 8px; }
.hk-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px 6px 10px; border: 1px solid #3a3a3a; background: #181818;
  color: #ececec; font: 650 .9rem var(--font-sans); cursor: pointer; transition: border-color .15s, background-color .15s; }
.hk-chip i { width: 12px; height: 12px; border-radius: 50%; background: #2a2a2a; box-shadow: inset 0 0 0 2px var(--pod); transition: background-color .2s, box-shadow .2s; }
.hk-chip small { color: #8c8c8c; font: 500 .74rem var(--font-mono); }
.hk-chip:hover { border-color: var(--pod); }
.hk-chip:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hk-chip[aria-pressed="true"] { border-color: var(--pod); background: color-mix(in srgb, var(--pod) 14%, #141414); }
.hk-chip[aria-pressed="true"] i { background: var(--pod); box-shadow: 0 0 10px var(--pod); }
.hk-chip-port { padding: 1px 5px; background: var(--pod); color: #111; font: 700 .72rem var(--font-mono); }
.hk-chip-port:empty { display: none; }
.hk-chip.is-refused { animation: hk-shake .35s; }
@keyframes hk-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.hk-hint { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--accent); font-size: .86rem; font-weight: 650; }
.hk-hint::before { content: "←" / ""; animation: hk-nudge 1.2s ease-in-out infinite; }
@keyframes hk-nudge { 50% { transform: translateX(-5px); } }

.hk-rig { display: grid; grid-template-columns: minmax(200px, 270px) minmax(56px, 1fr) minmax(0, 6fr); gap: 0 14px; align-items: center; }
.hk-device { position: relative; aspect-ratio: 740 / 1160; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.hk-device img { position: absolute; top: 31.03%; left: 0; width: 100%; height: auto; }
.hk-cables { position: absolute; inset: 0; width: 100%; height: 100%; }
.hk-screen, .hk-screen-btn { position: absolute; left: 30.54%; top: 45.34%; width: 37.57%; height: 31.55%; }
.hk-screen { background: #0a0c0e; border-radius: 2px; }
.hk-screen-btn { padding: 0; border: 0; background: transparent; cursor: pointer; }
.hk-screen-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hk-cable { fill: none; stroke: #ececec; stroke-width: 14; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .25s; }
.hk-plug rect { fill: #f2f2f2; stroke: #bdbdbd; stroke-width: 2; }
.hk-plug { opacity: 0; transform: translateY(-30px); transition: transform .2s, opacity .2s; }
.hk-mod { opacity: 0; transform: translateY(-90px); transition: transform .3s, opacity .2s; }
.hk-mod-l { fill: var(--pod); font: 700 26px var(--font-mono); text-anchor: middle; }
.hk-pcb { fill: #151515; stroke: #3d3d3d; stroke-width: 2; }
.hk-chipic { fill: #2c2c2c; }
.hk-usb { fill: #d4d4d4; stroke: #8f8f8f; stroke-width: 2; }
.hk-led { fill: var(--pod, #444); filter: drop-shadow(0 0 6px var(--pod)); }
.hk-glow { fill: var(--pod, transparent); opacity: 0; filter: drop-shadow(0 0 10px var(--pod)); transition: opacity .2s; }
.hk-port.is-on .hk-mod { opacity: 1; transform: none; transition: transform .5s cubic-bezier(.2, .9, .3, 1.15), opacity .3s; }
.hk-port.is-on .hk-cable { stroke-dashoffset: 0; transition: stroke-dashoffset .55s .3s ease-out; }
.hk-port.is-on .hk-plug { opacity: 1; transform: none; transition: transform .3s .75s cubic-bezier(.3, 1.4, .5, 1), opacity .2s .75s; }
.hk-port.is-on .hk-glow { opacity: .9; transition: opacity .3s 1s; }

.hk-flow { position: relative; display: grid; place-items: center; height: 40px; }
.hk-flow-line { position: absolute; top: 50%; right: 0; left: 0; height: 6px; margin-top: -3px;
  background: radial-gradient(circle, #4a4a4a 2px, transparent 2.5px) 0 50% / 14px 6px repeat-x; }
.hk-demo.is-live .hk-flow-line { background-image: radial-gradient(circle, var(--accent) 2.5px, transparent 3px); animation: hk-flow .5s linear infinite; }
@keyframes hk-flow { to { background-position-x: 14px; } }
@keyframes hk-flow-y { to { background-position-y: 14px; } }
.hk-flow-label { position: relative; top: -18px; display: inline-flex; align-items: center; gap: 5px; padding: 0 6px; background: #111; white-space: nowrap;
  color: #9a9a9a; font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.hk-screens { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 18px; align-items: end; }
.hk-lid { padding: 2.2% 2.2% 1.6%; background: #1c1c1c; border: 1px solid #4a4a4a; border-bottom: 0; border-radius: 12px 12px 0 0; }
.hk-base { position: relative; height: 12px; margin: 0 -6%; background: linear-gradient(#d2d2d2, #8a8a8a); border-radius: 0 0 10px 10px; }
.hk-base::before { content: ""; position: absolute; top: 0; left: 42%; width: 16%; height: 5px; background: #777; border-radius: 0 0 6px 6px; }
.hk-ui { container-type: inline-size; display: flex; flex-direction: column; overflow: hidden; background: #0c0e11; color: #e9edf2; }
.hk-lid .hk-ui { aspect-ratio: 16 / 10; }
.hk-ui-bar { display: flex; align-items: center; gap: 1.1cqi; padding: 1.2cqi 1.6cqi; background: #1a1d22; }
.hk-ui-bar i { width: 1.4cqi; height: 1.4cqi; border-radius: 50%; background: #3a3f47; }
.hk-ui-bar span { flex: 1; margin-left: 2cqi; padding: .4cqi 1.6cqi; border-radius: 99px; background: #0c0e11; color: #8a919c; font-size: max(8px, 1.7cqi); }
.hk-ui-head { display: flex; justify-content: space-between; gap: 8px; padding: 1.6cqi 2.4cqi .8cqi; color: #8a919c; font-size: max(9px, 1.9cqi); font-weight: 600; }
.hk-live-dot { display: inline-flex; align-items: center; gap: .7em; }
.hk-live-dot::before { content: ""; width: .7em; height: .7em; border-radius: 50%; background: #555; }
.hk-demo.is-live .hk-live-dot { color: #fff; }
.hk-demo.is-live .hk-live-dot::before { background: var(--rec); animation: hk-live 1.6s infinite; }
@keyframes hk-live { from { box-shadow: 0 0 0 0 rgba(224, 48, 42, .6); } 70%, to { box-shadow: 0 0 0 .5em rgba(224, 48, 42, 0); } }
.hk-lanes { flex: 1; display: flex; flex-direction: column; gap: 1cqi; min-height: 0; padding: .8cqi 2.4cqi 2.4cqi; }
.hk-lane { flex: 1; display: grid; grid-template-columns: max(76px, 22cqi) minmax(0, 1fr); gap: 1.6cqi; min-height: 0; padding-top: 1cqi; border-top: 1px solid #1f242b; animation: hk-in .4s ease-out; }
.hk-lane[hidden] { display: none; }
.hk-lane-l { display: flex; flex-direction: column; justify-content: center; min-width: 0; line-height: 1.25; }
.hk-lane-l b { color: var(--pod); font-size: max(8px, 1.8cqi); }
.hk-lane-l span { color: #8a919c; font-size: max(8px, 1.6cqi); }
.hk-lane-l .hk-lane-val { color: #fff; font: 700 max(10px, 2.9cqi)/1.2 var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
@container (max-width: 420px) { .hk-lane-l [data-lane-qty] { display: none; } }
.hk-plot { position: relative; min-height: 0; }
.hk-plot canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hk-ui-empty { margin: auto; color: #6c737d; font-size: max(10px, 2cqi); text-align: center; }
@keyframes hk-in { from { opacity: 0; transform: translateY(6px); } }
.hk-phone { padding: 6%; background: #1b1b1b; border: 1px solid #4a4a4a; border-radius: 18px; }
.hk-phone-ui { aspect-ratio: 9 / 18; padding-bottom: 10px; border-radius: 11px; }
.hk-phone-ui .hk-ui-head { padding: 7cqi 7cqi 3cqi; font-size: max(8px, 7cqi); }
.hk-phone-name { padding: 0 7cqi; color: var(--pod, #8a919c); font-size: max(9px, 8cqi); }
.hk-phone-val { padding: 0 7cqi 4cqi; color: #fff; font: 700 max(12px, 13cqi)/1.15 var(--font-mono); white-space: nowrap; }
.hk-phone-ui .hk-plot { flex: 1; margin: 0 4cqi; }
.hk-status { min-height: 1.6em; margin: 22px 0 0; color: #bdbdbd; font-size: .92rem; }
@media (max-width: 900px) {
  .hk-rig { grid-template-columns: 1fr; justify-items: center; }
  .hk-device { width: min(240px, 62vw); }
  .hk-flow { width: 40px; height: 64px; }
  .hk-flow-line { top: 0; right: auto; bottom: 0; left: 50%; width: 6px; height: auto; margin: 0 0 0 -3px; background-size: 6px 14px; background-repeat: repeat-y; background-position: 50% 0; }
  .hk-demo.is-live .hk-flow-line { animation-name: hk-flow-y; }
  .hk-flow-label { position: absolute; top: 50%; left: 30px; transform: translateY(-50%); }
  .hk-screens { width: 100%; }
  .hk-hint::before { content: "↑" / ""; animation-name: hk-nudge-y; }
}
@keyframes hk-nudge-y { 50% { transform: translateY(-4px); } }
@media (max-width: 560px) {
  .hk-chip small { display: none; }
  .hk-screens { grid-template-columns: 1fr; justify-items: center; gap: 28px; }
  .hk-laptop { width: 90%; }
  .hk-phone { width: min(170px, 48%); }
}

.hk-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 0; margin: 0; }
.hk-steps li { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line-strong); }
.hk-steps img { display: block; width: 100%; height: auto; }
.hk-steps p { flex: 1; margin: 0; padding: 14px 18px 18px; border-top: 1px solid var(--line); background: var(--surface); font-weight: 650; }
.hk-strip { margin: 56px 0; }
.hk-strip img { display: block; width: 100%; height: auto; border: 1px solid var(--ink); }
.hk-strip figcaption { margin-top: 10px; color: var(--ink-3); font-size: .9rem; }
.hk-four { grid-template-columns: 6fr 5fr; }
.hk-four img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line-strong); }
.hk-four h3 { margin: 0 0 10px; font: 800 clamp(1.5rem, 2.6vw, 2rem)/1.1 var(--font-display); letter-spacing: -.035em; }
.hk-four p { color: var(--ink-2); font-size: 1.05rem; }
@media (max-width: 900px) { .hk-teaser, .hk-four { grid-template-columns: 1fr; } .hk-teaser .framed { width: min(100%, 300px); } }
@media (max-width: 760px) {
  .hk-steps { grid-template-columns: 1fr; gap: 12px; }
  .hk-steps li { flex-direction: row; }
  .hk-steps img { width: 42%; flex: none; }
  .hk-steps p { display: flex; align-items: center; border-top: 0; border-left: 1px solid var(--line); }
}

.hk-pods { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0; margin: 0; }
@media (max-width: 900px) { .hk-pods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .hk-pods { grid-template-columns: 1fr; } }
.hk-pods li { display: flex; flex-direction: column; padding: 18px 20px 16px; background: var(--surface); border: 1px solid var(--line-strong); border-top: 4px solid var(--pod); }
.hk-pods h3 { margin: 0 0 4px; font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; }
.hk-pods p { margin: 0 0 14px; color: var(--ink-2); font-size: .93rem; }
.hk-pods dl { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.hk-pods dt { color: var(--ink-3); font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.hk-pods dd { margin: 0; font: 600 .84rem var(--font-mono); }
@media (prefers-reduced-motion: reduce) {
  .hk-port *, .hk-port.is-on * { transition: none !important; }
  .hk-demo.is-live .hk-flow-line, .hk-demo.is-live .hk-live-dot::before, .hk-hint::before, .hk-lane, .hk-chip.is-refused { animation: none; }
}

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--ink); }
.pillars > div { padding: 30px 28px; border-left: 1px solid var(--ink); background: var(--surface); }
.pillars > div:first-child { border-left: 0; }
.pillars .num { font: 800 3rem/1 var(--font-display); letter-spacing: -.06em; color: var(--accent); }
.pillars h3 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; margin: 14px 0 8px; }
.pillars p { color: var(--ink-2); margin: 0 0 10px; }
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } .pillars > div { border-left: 0; border-top: 1px solid var(--ink); } .pillars > div:first-child { border-top: 0; } }
.sq-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.sq-list li { display: flex; gap: 10px; align-items: baseline; }
.sq-list li::before { content: ""; width: 7px; height: 7px; background: var(--accent); flex: none; transform: translateY(-2px); }
.sq-list.two { grid-template-columns: 1fr 1fr; }

.feature { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-strong); transition: border-color .15s; }
.feature:hover { border-color: var(--ink); }
.feature .fi { width: 42px; height: 42px; display: grid; place-items: center; font-size: 1.25rem; background: var(--accent-soft); border: 1px solid var(--accent-line); margin-bottom: 14px; }
.feature h3 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 750; }
.feature p { margin: 0; color: var(--ink-2); font-size: .94rem; }
.band.ink .feature { background: #161616; border-color: #333; color: #fff; }
.band.ink .feature p { color: #bdbdbd; }
.band.ink .feature .fi { background: #2a160a; border-color: #5a2c0e; }
.steps { counter-reset: s; display: grid; gap: 0; grid-template-columns: repeat(4, 1fr); border-top: 4px solid var(--ink); }
.steps > div { counter-increment: s; position: relative; padding: 52px 22px 0 0; }
.steps > div::before { content: counter(s, decimal-leading-zero); position: absolute; top: 14px; left: 0; font: 800 1rem var(--font-display); color: var(--accent); letter-spacing: .02em; }
.steps h3 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 750; }
.steps p { margin: 0; color: var(--ink-2); font-size: .94rem; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; row-gap: 24px; } }
.quote-big { font: 750 clamp(1.4rem, 2.6vw, 2rem)/1.25 var(--font-display); letter-spacing: -.03em; max-width: 30em; margin: 0; }
.quote-big::before { content: "“"; display: block; font-size: 4rem; line-height: .6; color: var(--accent); margin-bottom: 8px; }

.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--ink); border: 1px solid var(--ink); }
.team .p { background: var(--surface); }
.team .p img.photo { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .25s; border-bottom: 1px solid var(--ink); }
.team .p:hover img.photo { filter: none; }
.team .p .info { padding: 16px 18px 18px; }
.team b { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; }
.team span { display: block; color: var(--accent-text); font-size: .85rem; font-weight: 650; margin-top: 2px; }
.team small { display: block; color: var(--ink-3); margin-top: 6px; }
.team img.uni { height: 26px; width: auto; margin-top: 12px; filter: grayscale(1); opacity: .75; mix-blend-mode: multiply; }
:root[data-theme="dark"] .team img.uni { filter: grayscale(1) invert(1); mix-blend-mode: screen; }

.work { display: grid; gap: 56px; }
.work-row { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: center; }
.work-row:nth-child(even) { grid-template-columns: 7fr 5fr; }
.work-row:nth-child(even) .work-text { order: 2; }
.work-row img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--ink); }
.work-text .tag { display: inline-block; font-size: .72rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; background: var(--ink); color: var(--bg); padding: 3px 8px; }
.work-text h3 { font: 800 1.7rem/1.1 var(--font-display); letter-spacing: -.035em; margin: 14px 0 10px; }
.work-text p { color: var(--ink-2); }
@media (max-width: 900px) { .work-row, .work-row:nth-child(even) { grid-template-columns: 1fr; gap: 18px; } .work-row:nth-child(even) .work-text { order: 0; } }

.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; font-size: 1.05rem; }
.contact-list li { display: flex; gap: 14px; align-items: center; }
.contact-list .ci { width: 40px; height: 40px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }

/* ---------- blog ---------- */
.blog-band { border-top: 1px solid var(--line); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.post-card, .post-lead { display: flex; flex-direction: column; color: inherit; background: var(--surface); border: 1px solid var(--line-strong); transition: border-color .15s, transform .15s; }
.post-card:hover, .post-lead:hover { text-decoration: none; border-color: var(--ink); transform: translateY(-2px); }
.post-card-img, .post-lead-img { overflow: hidden; border-bottom: 1px solid var(--line-strong); }
.post-card-img img, .post-lead-img img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .4s; }
.post-card:hover img, .post-lead:hover img { transform: scale(1.03); }
.post-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card h3 { margin: 0; font: 800 1.25rem/1.2 var(--font-display); letter-spacing: -.025em; }
.post-card p { margin: 0; color: var(--ink-2); font-size: .95rem; flex: 1; }
.post-card time, .post-lead time { color: var(--ink-3); font-size: .85rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--ink-3); font-size: .78rem; font-weight: 650; }
.post-tag { text-transform: uppercase; letter-spacing: .12em; font-weight: 750; color: var(--accent-text); }
.blog-head h1 { font: 800 clamp(2.2rem, 5vw, 3.6rem)/1.02 var(--font-display); letter-spacing: -.05em; margin: 12px 0 12px; }
.post-lead { display: grid; grid-template-columns: 7fr 5fr; }
.post-lead-img { border-bottom: 0; border-right: 1px solid var(--line-strong); }
.post-lead-img img { height: 100%; aspect-ratio: auto; min-height: 320px; }
.post-lead-body { padding: 32px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.post-lead h2 { font: 800 clamp(1.6rem, 2.8vw, 2.2rem)/1.08 var(--font-display); letter-spacing: -.04em; margin: 0; }
.post-lead p { color: var(--ink-2); margin: 0; font-size: 1.05rem; }
@media (max-width: 860px) { .post-lead { grid-template-columns: 1fr; } .post-lead-img { border-right: 0; border-bottom: 1px solid var(--line-strong); } .post-lead-img img { min-height: 0; aspect-ratio: 16 / 9; } }

.post-col { max-width: 760px; }
.post-hero { padding: 56px 0 0; }
.post-crumbs { display: flex; gap: 8px; font-size: .85rem; font-weight: 650; color: var(--ink-3); margin-bottom: 18px; }
.post-crumbs a { color: var(--accent-text); }
.post-hero h1 { font: 800 clamp(2rem, 4.6vw, 3.2rem)/1.05 var(--font-display); letter-spacing: -.045em; margin: 0 0 16px; }
.post-dek { font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.45; color: var(--ink-2); margin: 0 0 22px; }
.post-byline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; color: var(--ink-3); padding-bottom: 28px; }
.post-byline span:first-child { color: var(--ink); font-weight: 700; }
.post-cover { max-width: 1080px; margin: 0 auto; }
.post-cover img { display: block; width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border: 1px solid var(--ink); }
.post-body { padding-top: 44px; padding-bottom: 72px; font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.7; }
.post-body p { margin: 0 0 1.2em; }
.post-body .post-lede { font-size: 1.32rem; line-height: 1.6; color: var(--ink); }
.post-body .post-lede::first-letter { float: left; font: 800 3.6em/.82 var(--font-display); color: var(--accent); margin: .06em .1em 0 0; }
.post-body h2 { font: 800 1.65rem/1.15 var(--font-display); letter-spacing: -.035em; margin: 2em 0 .6em; }
.post-body cite { font-style: italic; }
.post-body sup.ref { font-family: var(--font-sans); font-size: .62em; font-weight: 750; line-height: 0; margin-left: 1px; }
.post-body sup.ref a { color: var(--accent-text); padding: 0 1px; }
.post-pull { margin: 1.8em 0; padding: 4px 0 4px 26px; border-left: 4px solid var(--accent); font: 750 clamp(1.35rem, 2.6vw, 1.75rem)/1.3 var(--font-display); letter-spacing: -.03em; color: var(--ink); }
.post-box { margin: 1.8em 0; padding: 20px 24px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-family: var(--font-sans); font-size: 1rem; line-height: 1.6; }
.post-box p { margin: 0; }
.post-box-k { font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px; }
.post-figure { margin: 2em 0; }
.post-figure.wide { margin-left: -60px; margin-right: -60px; }
.post-figure img { display: block; width: 100%; border: 1px solid var(--ink); }
.post-figure.narrow { max-width: 420px; margin-inline: auto; }
.post-figure figcaption { font-family: var(--font-sans); font-size: .88rem; line-height: 1.5; color: var(--ink-3); margin-top: 10px; }
@media (max-width: 900px) { .post-figure.wide { margin-left: 0; margin-right: 0; } }
.loop-diagram { display: block; width: 100%; height: auto; font-family: var(--font-display); }
.loop-step rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.loop-step text { text-anchor: middle; fill: var(--ink); font-size: 19px; font-weight: 750; }
.loop-step text.n { fill: var(--accent); font-size: 22px; font-weight: 800; }
.loop-arrow { fill: none; stroke: var(--ink-2); stroke-width: 2; }
.loop-arrow.back { stroke: var(--accent); stroke-dasharray: 6 5; }
.loop-head { fill: var(--ink-2); }
.loop-label { text-anchor: middle; fill: var(--accent-text); font-size: 15px; font-weight: 700; font-style: italic; }
.post-refs { margin-top: 3em; padding-top: 1.4em; border-top: 1px solid var(--line-strong); font-family: var(--font-sans); font-size: .92rem; line-height: 1.55; color: var(--ink-2); }
.post-refs h2 { font-size: 1.05rem; margin: 0 0 .8em; letter-spacing: -.01em; }
.post-refs ol { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.post-refs li:target { background: var(--accent-soft); outline: 6px solid var(--accent-soft); }
.post-cta { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 28px 30px; background: var(--surface); border: 1px solid var(--ink); border-top: 4px solid var(--accent); }
.post-cta h2 { margin: 0 0 4px; font-size: 1.6rem; }
.post-cta p { margin: 0; color: var(--ink-2); max-width: 32em; }
.band .post-col > h2 { font-size: 1.6rem; }
@media print { .post-cover, .post-cta { display: none; } }

/* ---------- studio handbook ---------- */
.st-hook { --st: var(--purple); --st-text: var(--purple); --st-soft: var(--purple-soft); }
.st-predict { --st: var(--blue); --st-text: var(--blue); --st-soft: var(--blue-soft); }
.st-measure { --st: var(--accent); --st-text: var(--accent-text); --st-soft: var(--accent-soft); }
.st-explore { --st: var(--teal); --st-text: var(--teal); --st-soft: var(--teal-soft); }
.st-explain { --st: var(--green); --st-text: var(--green); --st-soft: var(--green-soft); }
.st-extend { --st: var(--amber); --st-text: var(--amber); --st-soft: var(--amber-soft); }
.hb-kicker { font: 800 .7rem/1.2 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 0; }

.hb-rules { margin: 0 0 28px; padding: 20px 24px 22px; background: var(--surface); border: 1px solid var(--ink); border-top: 4px solid var(--accent); }
.hb-rules ol { list-style: none; counter-reset: rule; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.hb-rules li { counter-increment: rule; font-size: .88rem; line-height: 1.45; color: var(--ink-2); }
.hb-rules li::before { content: counter(rule, decimal-leading-zero); display: block; font: 800 1.45rem/1 var(--font-display); color: var(--accent); margin-bottom: 8px; }
.hb-rules li b { display: block; color: var(--ink); font-size: .98rem; margin-bottom: 2px; }
@media (max-width: 1180px) { .hb-rules ol { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .hb-rules ol { grid-template-columns: 1fr 1fr; } }

.hb-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; margin: 0 0 28px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--ink); }
.hb-progress p { margin: 6px 0 10px; color: var(--ink-2); font-size: .92rem; }
.hb-progress p b { color: var(--ink); }
.hb-progress progress, .hb-track-meter progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 0; accent-color: var(--accent); }
.hb-progress progress::-webkit-progress-bar, .hb-track-meter progress::-webkit-progress-bar { background: var(--bg-sunken); }
.hb-progress progress::-webkit-progress-value, .hb-track-meter progress::-webkit-progress-value { background: var(--accent); }
.hb-progress progress::-moz-progress-bar, .hb-track-meter progress::-moz-progress-bar { background: var(--accent); }
.hb-library-tools { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 20px; font-family: var(--font-sans); }
.hb-library-tools > label { font-size: .88rem; font-weight: 700; }
.hb-library-tools input[type="search"] { min-width: 0; padding: 10px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); font: inherit; }
.hb-library-tools input[type="search"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hb-filter { display: flex; flex-wrap: wrap; gap: 4px; }
.hb-filter [aria-pressed="true"] { color: var(--ink); background: var(--surface-2); border-color: var(--ink); }
.hb-empty { margin: 0 0 24px; padding: 14px 16px; background: var(--surface-2); color: var(--ink-2); border-left: 3px solid var(--accent); }
.hb-track { margin: 0 0 44px; }
.hb-track-head { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin: 0 0 20px; padding: 0 0 14px; border-bottom: 1px solid var(--line-strong); }
.hb-track-head h2 { margin: 6px 0; font: 800 clamp(1.35rem, 2.4vw, 1.8rem)/1.15 var(--font-display); letter-spacing: -.035em; }
.hb-track-head p { max-width: 680px; margin: 0; color: var(--ink-2); }
.hb-track-meter { flex: 0 0 120px; font: .8rem/1.4 var(--font-sans); color: var(--ink-3); }
.hb-track-meter b { margin-right: 5px; color: var(--ink); font-size: 1rem; }
.hb-track-meter progress { margin-top: 8px; }
.hb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.hb-card { display: flex; flex-direction: column; color: inherit; background: var(--surface); border: 1px solid var(--line-strong); transition: border-color .15s, transform .15s; }
.hb-card:hover { text-decoration: none; border-color: var(--ink); transform: translateY(-2px); }
.hb-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.hb-card-art { border-bottom: 1px solid var(--line-strong); overflow: hidden; }
.hb-card-art .cv, .hb-hero-art .cv { display: block; width: 100%; height: auto; }
.hb-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.hb-card .post-meta { flex-wrap: wrap; gap: 4px 10px; }
.hb-card-status { margin-left: auto; font-weight: 700; color: var(--ink-2); }
.hb-card.is-done .hb-card-status { color: var(--green); }
.hb-card h3 { margin: 0; font: 800 1.2rem/1.2 var(--font-display); letter-spacing: -.025em; }
.hb-card p { margin: 0; color: var(--ink-2); font-size: .93rem; flex: 1; }
.hb-card-more { font-size: .88rem; font-weight: 700; color: var(--accent-text); }
.hb-card.lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.hb-card.lead .hb-card-art { border-bottom: 0; border-right: 1px solid var(--line-strong); }
.hb-card.lead .hb-card-body { padding: 28px; justify-content: center; }
.hb-card.lead h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.04em; }
.hb-card.lead p { flex: 0; font-size: 1.02rem; }
@media (max-width: 860px) { .hb-card.lead { grid-template-columns: 1fr; } .hb-card.lead .hb-card-art { border-right: 0; border-bottom: 1px solid var(--line-strong); } }
@media (max-width: 700px) {
  .hb-progress { grid-template-columns: 1fr; gap: 14px; }
  .hb-progress > .btn { justify-self: start; }
  .hb-library-tools { grid-template-columns: 1fr; gap: 8px; }
  .hb-track-head { align-items: start; }
  .hb-track-meter { flex-basis: 84px; }
}
@media (max-width: 460px) {
  .hb-track-head { display: block; }
  .hb-track-meter { max-width: 180px; margin-top: 12px; }
  .hb-filter { display: grid; grid-template-columns: repeat(3, 1fr); }
}

/* cover art */
.cv text { font-family: var(--font-sans); }
.cv-bg { fill: var(--bg-sunken); }
.cv-grid { stroke: var(--line); stroke-width: 1; fill: none; }
.cv-arc { fill: none; stroke: var(--ink-2); stroke-width: 3; }
.cv-back { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 8 6; }
.cv-node circle { fill: var(--st-soft); stroke: var(--st); stroke-width: 3; }
.cv-num { text-anchor: middle; font-size: 20px; font-weight: 800; fill: var(--st-text); }
.cv-label { text-anchor: middle; font-size: 19px; font-weight: 750; fill: var(--ink); }
.cv-note { text-anchor: middle; font-size: 18px; font-weight: 700; font-style: italic; fill: var(--accent-text); }
.cv-body { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; }
.cv-pod { fill: var(--pod); stroke: var(--ink); stroke-width: 2; }
.cv-port { text-anchor: middle; font-size: 14px; font-weight: 800; fill: #111; }
.cv-wire { stroke: var(--ink); stroke-width: 3; fill: none; }
.cv-screen { fill: #111; stroke: var(--ink); stroke-width: 2; }
.cv-trace { fill: none; stroke: #ff9628; stroke-width: 3; stroke-linejoin: round; }
.cv-value { font-size: 20px; font-weight: 800; fill: #f2f2f0; }
.cv-rocker { fill: var(--ink-3); }
.cv-btn { fill: var(--surface-2); stroke: var(--ink); stroke-width: 2; }
.cv-rec { fill: var(--rec); stroke: var(--ink); stroke-width: 2; }
.cv-glass { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; }
.cv-notch { fill: var(--ink); }
.cv-axis { stroke-width: 5; fill: none; stroke-linecap: round; }
.cv-axis.ax-x, .cv-head.ax-x, .cv-axlabel.ax-x { stroke: var(--red); fill: var(--red); }
.cv-axis.ax-y, .cv-head.ax-y, .cv-axlabel.ax-y { stroke: var(--green); fill: var(--green); }
.cv-axis.ax-z, .cv-head.ax-z, .cv-axlabel.ax-z { stroke: var(--blue); fill: var(--blue); }
.cv-axis.ax-x, .cv-axis.ax-y, .cv-axis.ax-z { fill: none; }
.cv-axlabel { font-size: 28px; font-weight: 800; stroke: none !important; }
.cv-origin { fill: var(--ink); }
.cv-wave { fill: none; stroke: var(--purple); stroke-width: 4; stroke-linecap: round; }
.cv-sun circle { fill: var(--amber-soft); stroke: var(--amber); stroke-width: 3; }
.cv-sun path { stroke: var(--amber); stroke-width: 3.5; stroke-linecap: round; }
.cv-pin { fill: var(--accent); stroke: var(--ink); stroke-width: 2; }
.cv-pin-dot { fill: var(--surface); }
.cv-target { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.cv-dots circle { fill: var(--pod); stroke: var(--ink); stroke-width: 2; }
.cv-pendulum { fill: none; stroke: var(--ink-2); stroke-width: 4; stroke-linecap: round; }
.cv-bob { fill: var(--accent); stroke: var(--ink); stroke-width: 2; }
.cv-table { fill: var(--surface); stroke: var(--line-strong); stroke-width: 2; }
.cv-data-line { fill: none; stroke: var(--accent); stroke-width: 3; }
.cv-data-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; }
.cv-axis-line { fill: none; stroke: var(--ink-3); stroke-width: 2; }
.cv-model-line { fill: none; stroke: var(--accent); stroke-width: 3; }
.cv-model-line.dashed { stroke-dasharray: 7 6; }
.cv-gap { fill: none; stroke: var(--red); stroke-width: 4; stroke-dasharray: 3 4; }
.cv-cycle { fill: none; stroke: var(--line-strong); stroke-width: 3; stroke-dasharray: 5 6; }
.cv-center { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.cv-route { fill: none; stroke: var(--line-strong); stroke-width: 3; }
.cv-shield { fill: var(--blue-soft); stroke: var(--blue); stroke-width: 3; }
.cv-check { fill: none; stroke: var(--green); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.cv-check-box { fill: var(--surface); stroke: var(--ink-2); stroke-width: 2; }
.cv-check-small { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.cv-label.left { text-anchor: start; }

/* article page */
.hb-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 24px 0 30px; border-bottom: 1px solid var(--line-strong); }
.hb-hero h1 { font: 800 clamp(1.9rem, 3.6vw, 2.8rem)/1.06 var(--font-display); letter-spacing: -.045em; margin: 12px 0 14px; }
.hb-hero .post-dek { font-size: 1.15rem; margin-bottom: 16px; }
.hb-hero .post-byline { padding-bottom: 0; }
.hb-complete { margin-top: 20px; }
.hb-complete .btn { min-height: 42px; }
.hb-hero-art { border: 1px solid var(--ink); }
@media (max-width: 980px) { .hb-hero { grid-template-columns: 1fr; gap: 22px; } .hb-hero-art { max-width: 560px; } }
.hb-layout { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 44px; align-items: start; }
.hb-toc { position: sticky; top: 52px; padding-top: 40px; max-height: calc(100vh - 52px); overflow-y: auto; font-family: var(--font-sans); }
.hb-toc ol { list-style: none; margin: 12px 0 0; padding: 0; border-left: 1px solid var(--line-strong); }
.hb-toc a { display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 2px solid transparent; color: var(--ink-2); font-size: .86rem; font-weight: 600; line-height: 1.35; }
.hb-toc a:hover { color: var(--ink); border-left-color: var(--accent); text-decoration: none; }
.hb-body { max-width: 760px; min-width: 0; padding-top: 36px; padding-bottom: 40px; }
.hb-next-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 22px; }
.hb-step-link { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); }
.hb-step-link:hover { border-color: var(--ink); text-decoration: none; }
.hb-step-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.hb-step-link span { color: var(--ink-3); font: 700 .72rem/1.3 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.hb-step-link b { font: 750 1rem/1.3 var(--font-display); }
.hb-step-link.next { text-align: right; }
@media (max-width: 1120px) {
  .hb-layout { grid-template-columns: 1fr; gap: 0; }
  .hb-toc { position: static; max-height: none; overflow: visible; padding-top: 22px; }
  .hb-toc ol { display: flex; flex-wrap: wrap; gap: 6px; border-left: 0; }
  .hb-toc a { margin: 0; padding: 4px 10px; border: 1px solid var(--line-strong); font-size: .82rem; }
  .hb-toc a:hover { border-color: var(--ink); }
}
@media (max-width: 560px) { .hb-next-nav { grid-template-columns: 1fr; } .hb-step-link.next { text-align: left; } }
.hb-body h3 { font: 750 1.22rem/1.25 var(--font-display); letter-spacing: -.02em; margin: 1.8em 0 .5em; }
.hb-body code { font-size: .8em; }
.hb-more { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--line-strong); }
.post-box.warn { background: var(--amber-soft); border-color: var(--amber); }
.post-box.warn .post-box-k { color: var(--amber); }

.stage-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; margin: 2.8em 0 1.1em; padding: 16px 18px;
  background: var(--st-soft); border: 1px solid var(--st); border-left-width: 6px; font-family: var(--font-sans); }
.stage-n { display: grid; place-items: center; width: 44px; height: 44px; background: var(--st); color: var(--surface); font: 800 1.4rem/1 var(--font-display); }
.post-body .stage-head h2 { margin: 0; font-size: 1.5rem; }
.stage-head p { margin: 3px 0 0; color: var(--ink-2); font-size: .98rem; line-height: 1.45; }
.stage-time { font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--st-text); white-space: nowrap; }
@media (max-width: 560px) { .stage-head { grid-template-columns: auto minmax(0, 1fr); } .stage-time { grid-column: 2; } }

.hb-blocks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 1.3em 0; font-family: var(--font-sans); }
.hb-blocks .hb-kicker { margin-right: 6px; }
.hb-blk { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font: 650 .8rem/1.6 var(--font-sans); white-space: nowrap; }
.hb-how { margin: 1.6em 0; padding: 18px 22px; background: var(--surface); border: 1px solid var(--ink); font-family: var(--font-sans); font-size: .98rem; line-height: 1.55; }
.hb-how ol { margin: 10px 0 0; padding-left: 1.3em; display: grid; gap: 8px; }
.hb-how li::marker { font-weight: 800; color: var(--accent-text); }
.hb-dodont { display: grid; grid-template-columns: 1fr 1fr; margin: 1.6em 0; border: 1px solid var(--line-strong); background: var(--surface); font-family: var(--font-sans); font-size: .95rem; line-height: 1.5; }
.hb-dodont > div { padding: 16px 20px; }
.hb-dodont > div + div { border-left: 1px solid var(--line-strong); }
.post-body .hb-dodont h3 { margin: 0 0 8px; font: 800 .74rem/1.2 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; }
.hb-dodont .do h3 { color: var(--green); }
.hb-dodont .dont h3 { color: var(--red); }
.hb-dodont ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hb-dodont li { position: relative; padding-left: 22px; }
.hb-dodont li::before { position: absolute; left: 0; font-weight: 800; }
.hb-dodont .do li::before { content: "✓"; color: var(--green); }
.hb-dodont .dont li::before { content: "✕"; color: var(--red); }
@media (max-width: 640px) { .hb-dodont { grid-template-columns: 1fr; } .hb-dodont > div + div { border-left: 0; border-top: 1px solid var(--line-strong); } }

.table-scroll { overflow-x: auto; margin: 1.6em 0; background: var(--surface); border: 1px solid var(--line-strong); }
table.spec { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: .88rem; line-height: 1.45; }
.spec th { padding: 9px 12px; text-align: left; vertical-align: bottom; font-size: .7rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-2); border-bottom: 1px solid var(--line-strong); }
.spec td { padding: 9px 12px; vertical-align: top; border-bottom: 1px solid var(--line); }
.spec tr:last-child td { border-bottom: 0; }
.spec td:first-child { font-weight: 650; }
.spec .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spec .yes { color: var(--green); font-weight: 700; }
.spec .no { color: var(--red); font-weight: 700; }
.spec .part { color: var(--amber); font-weight: 700; }
.spec .swatch { display: inline-block; width: 10px; height: 10px; margin-right: 8px; background: var(--pod); border: 1px solid var(--ink); }
.pitfalls td:first-child { width: 28%; }

ol.wire { list-style: none; margin: 1.6em 0; padding: 14px; display: grid; gap: 5px; background: var(--grid), var(--bg-sunken); border: 1px solid var(--line-strong); font-family: var(--font-sans); font-size: .92rem; line-height: 1.45; }
ol.wire li { display: grid; grid-template-columns: 64px auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--st); }
ol.wire li.gate { background: var(--surface-2); border-style: dashed; border-left-style: solid; }
.wire-tag { font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--st-text); }
.wire-d { color: var(--ink-2); }
@media (max-width: 640px) { ol.wire li { grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; } .wire-tag { grid-column: 1 / -1; } }

ul.hb-check { list-style: none; margin: 1.4em 0; padding: 0; background: var(--surface); border: 1px solid var(--line-strong); font-family: var(--font-sans); font-size: .98rem; line-height: 1.5; }
ul.hb-check li { position: relative; padding: 11px 16px 11px 48px; border-bottom: 1px solid var(--line); }
ul.hb-check li:last-child { border-bottom: 0; }
ul.hb-check li::before { content: ""; position: absolute; left: 17px; top: 14px; width: 16px; height: 16px; border: 2px solid var(--ink); }

/* figures */
.hb-scroll-hint { font: .85rem/1.5 var(--font-sans); color: var(--ink-3); }
.hb-figure-scroll { max-width: 100%; overflow-x: auto; padding: 4px 0 10px; }
.hb-figure-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hb-fig { display: block; width: 100%; min-width: 720px; height: auto; font-family: var(--font-sans); }
.hb-fig text { fill: var(--ink-2); font-size: 13px; }
.hb-fig .cv-value { fill: #f2f2f0; }
.hb-fig .f-row { font-weight: 750; fill: var(--ink); }
.f-stage rect { fill: var(--st-soft); stroke: var(--st); stroke-width: 1.5; }
.hb-fig .f-stage text { text-anchor: middle; font-weight: 750; fill: var(--ink); }
.hb-fig .f-stage text.m { font-size: 11px; font-weight: 600; fill: var(--ink-2); }
.f-model rect { fill: var(--surface); stroke: var(--line-strong); }
.f-model.eval rect { fill: var(--surface-2); stroke-dasharray: 4 3; }
.hb-fig .f-model text { text-anchor: middle; font-size: 12px; font-weight: 650; }
.f-axis { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.hb-fig .f-tick { text-anchor: middle; font-size: 12px; fill: var(--ink-3); }
.hb-fig .f-tick.end { text-anchor: end; }
.hb-fig .f-tick.start { text-anchor: start; }
.f-panel { fill: var(--surface); stroke: var(--line); }
.f-truth { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 4 4; }
.f-data { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.f-data.bad, .f-dot.bad { stroke: var(--red); fill: none; }
.f-data.good { stroke: var(--green); }
.f-dot.bad { fill: var(--red); }
.f-dot.good { fill: var(--green); }
.hb-fig .f-cap { text-anchor: middle; font-weight: 700; }
.hb-fig .f-cap.bad { fill: var(--red); }
.hb-fig .f-cap.good { fill: var(--green); }
.hb-fig .f-lab { text-anchor: middle; font-size: 12px; font-weight: 700; }
.hb-fig .f-lab.start { text-anchor: start; }
.hb-fig .f-lab.end { text-anchor: end; }
.f-fit { fill: none; stroke: var(--accent); stroke-width: 2.2; }
.f-fit.curve { stroke: var(--ink-3); stroke-dasharray: 5 4; }
.f-dot.pt { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.f-dot.a { fill: var(--blue); fill-opacity: .7; }
.f-dot.b { fill: var(--purple); fill-opacity: .7; }
.hb-fig .f-note { text-anchor: middle; font-size: 12.5px; font-weight: 700; fill: var(--accent-text); }
.hb-fig .f-note.left { text-anchor: start; fill: var(--ink-2); }
.f-mean { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.f-range { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.f-bar { fill: var(--pod, var(--accent)); stroke: var(--ink); stroke-width: 1; }
.f-limit { stroke-width: 1.5; stroke-dasharray: 5 4; }
.f-limit.platform { stroke: var(--accent); }
.f-limit.preview { stroke: var(--blue); }
.hb-fig .f-limit-l { font-size: 11.5px; font-weight: 700; }
.hb-fig .f-limit-l.platform { fill: var(--accent-text); }
.hb-fig .f-limit-l.preview { fill: var(--blue); }
.f-port { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.f-port.on { fill: var(--pod); }
.hb-fig .f-port-l { text-anchor: middle; font-size: 13px; font-weight: 800; fill: var(--ink); }
.hb-fig .f-port-l.dark { fill: #111; }

/* sensor cards */
.pod { margin: 2.6em 0 1.4em; background: var(--surface); border: 1px solid var(--line-strong); border-top: 6px solid var(--pod, var(--accent)); font-family: var(--font-sans); font-size: .95rem; line-height: 1.5; }
.pod-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 16px 20px 6px; }
.post-body .pod-head h2 { margin: 0; font-size: 1.45rem; }
.pod-chip { padding: 1px 7px; border: 1px solid var(--line-strong); color: var(--ink-2); font: 700 .74rem/1.6 var(--font-mono); white-space: nowrap; }
.pod-chip.q { color: var(--ink); background: var(--surface-2); }
.pod-sub { margin: 0; padding: 0 20px 14px; color: var(--ink-2); }
.pod-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-top: 1px solid var(--line); }
.pod-stats > div { padding: 11px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.pod-stats b { display: block; font: 800 1.08rem/1.25 var(--font-display); letter-spacing: -.02em; color: var(--ink); }
.pod-stats span { font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.pod-cols { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.pod-cols > div { padding: 14px 20px 16px; }
.pod-cols > div + div { border-left: 1px solid var(--line); }
.post-body .pod-cols h3 { margin: 0 0 6px; font: 800 .72rem/1.2 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--green); }
.post-body .pod-cols .watch h3 { color: var(--amber); }
.pod-cols ul { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.pod-foot { padding: 10px 20px; background: var(--surface-2); border-top: 1px solid var(--line); color: var(--ink-2); font-size: .86rem; }
.pod-foot code, .pod code { font-size: .82em; }
.post-body .pod-head h3 { margin: 0; font-size: 1.2rem; }
.pod-cols p { margin: 0; }
@media (max-width: 640px) { .pod-cols { grid-template-columns: 1fr; } .pod-cols > div + div { border-left: 0; border-top: 1px solid var(--line); } }

@media print {
  .hb-toc, .hb-more, .hb-hero-art, .hb-scroll-hint { display: none; }
  .hb-layout, .hb-hero { display: block; }
  .hb-figure-scroll { overflow: visible; }
  .hb-fig { min-width: 0; }
  .pod, .stage-head, figure, .spec tr { break-inside: avoid; }
}

.footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--ink-3); font-size: .9rem; }
.footer .container { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.footer .wordmark { height: 20px; }
.footer a { color: var(--ink-2); font-weight: 600; }

/* auth */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 16px; background: var(--grid), var(--bg-sunken); }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--ink); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 32px; }
.auth-card h1 { font: 800 1.9rem var(--font-display); letter-spacing: -.04em; margin: 0 0 6px; }
.auth-card .sub { color: var(--ink-2); margin: 0 0 22px; }
.auth-alt { text-align: center; margin-top: 18px; color: var(--ink-2); font-size: .92rem; }

/* ---------- studio editor ---------- */
.editor-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; }
@media (max-width: 1100px) { .editor-shell { grid-template-columns: 1fr; } }
.editor-doc { max-width: var(--page-w); width: 100%; margin: 0 auto; }
.ed-title { width: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; font: 800 2.5rem/1.1 var(--font-display) !important; letter-spacing: -.04em; padding: 0 !important; resize: none; overflow: hidden; color: var(--ink); min-height: 0 !important; }
.ed-summary { width: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--ink-2); font-size: 1.05rem !important; padding: 0 !important; resize: none; overflow: hidden; min-height: 0 !important; }
.ed-icon { font-size: 3.2rem; background: none; border: 0; cursor: pointer; padding: 0; line-height: 1; }
.ed-icon:hover { background: var(--hover); }
.ed-block { position: relative; padding: 2px 0 2px 0; }
.ed-block:hover { background: color-mix(in srgb, var(--hover) 50%, transparent); }
.ed-block.selected { background: var(--accent-soft); }
.ed-handle { position: absolute; left: -58px; top: 4px; display: flex; gap: 2px; opacity: 0; transition: opacity .1s; }
.ed-block:hover .ed-handle, .ed-block:focus-within .ed-handle { opacity: 1; }
.ed-handle button { width: 26px; height: 26px; border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 15px; display: grid; place-items: center; }
.ed-handle button:hover { background: var(--hover); color: var(--ink); }
.ed-handle .drag { cursor: grab; }
@media (max-width: 900px) { .ed-handle { position: static; opacity: 1; margin-bottom: 2px; } }
.ed-block.dragging { opacity: .4; }
.ed-block.drop-before { box-shadow: 0 -2px 0 var(--accent); }
.ed-block.drop-after { box-shadow: 0 2px 0 var(--accent); }
.ed-text { width: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 4px 2px !important; resize: none; overflow: hidden; min-height: 0 !important; font: inherit; color: inherit; line-height: 1.7; }
.ed-text::placeholder { color: var(--ink-3); opacity: .7; }
.ed-text.h1 { font: 800 1.85rem/1.25 var(--font-display); letter-spacing: -.03em; } .ed-text.h2 { font: 800 1.5rem/1.25 var(--font-display); letter-spacing: -.03em; } .ed-text.h3 { font: 800 1.2rem/1.25 var(--font-display); letter-spacing: -.02em; }
.ed-block .blk-heading { margin-top: 1.2em; }
.ed-panel { border: 1px solid var(--line-strong); border-left: 4px solid var(--ink); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; margin: 8px 0; }
.ed-panel .ph { display: flex; gap: 8px; align-items: center; font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px; }
.ed-panel .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ed-panel .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ed-panel label { font-size: .78rem; display: block; margin-bottom: 3px; }
.ed-panel .field { margin-bottom: 10px; }
.ed-panel input, .ed-panel select, .ed-panel textarea { font-size: .9rem; min-height: 32px; padding: 5px 9px; }
.ed-panel textarea { min-height: 60px; }
.ed-mini-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ed-mini-row input { flex: 1; }
.ed-panel label.check { display: flex; align-items: center; gap: 7px; font-size: .86rem; margin: 6px 0; }
.ed-panel input.bad { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber-soft); }
.ed-chans { display: grid; gap: 8px; margin-bottom: 6px; }
.ed-chan { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface-2, var(--surface)); }
.ed-chan-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ed-chan-row .ed-q { flex: 2 1 150px; min-width: 0; }
.ed-chan-row select:not(.ed-q) { flex: 0 1 auto; width: auto; }
.ed-chan-row .ed-alias { flex: 1 1 70px; min-width: 60px; max-width: 140px; }
.ed-del { flex: none; margin-left: auto; }
.ed-chan-note { font-size: .76rem; color: var(--ink-3); margin-top: 4px; }
.ed-chan-note.bad { color: var(--amber); }
.ed-warn { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.ed-warn:empty { display: none; }
.ed-warn li { font-size: .82rem; padding: 6px 10px; border-radius: 6px; background: var(--hover); color: var(--ink-2); }
.ed-warn li::before { content: "ℹ "; }
.ed-warn li.warn { background: var(--amber-soft); color: var(--amber); }
.ed-warn li.warn::before { content: "⚠ "; }
.ed-warn li.bad { background: var(--red-soft); color: var(--red); }
.ed-warn li.bad::before { content: "✕ "; }
.ed-series-list { display: grid; gap: 8px; margin-bottom: 6px; }
.ed-series { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px 0; }
.ed-series-head { display: flex; align-items: center; gap: 8px; font-size: .82rem; margin-bottom: 6px; }
.ed-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.ed-colinput { display: block; }
.ed-colinput input { width: 100%; }
.ed-pin { min-width: 36px; padding: 0 6px; filter: grayscale(1); opacity: .55; }
.ed-pin.on { filter: none; opacity: 1; border-color: var(--accent); background: var(--accent-soft, var(--hover)); }
.ed-pin:disabled { cursor: not-allowed; opacity: .3; }
.ed-capture { border-left: 3px solid var(--accent); padding-left: 8px; margin-bottom: 8px; }
.ed-capture .ed-mini-row { margin-bottom: 4px; }
.ed-capture-src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ed-capture-src select { width: auto; max-width: 260px; }
@media (max-width: 640px) { .ed-panel .grid2, .ed-panel .grid3 { grid-template-columns: 1fr; } }
.ed-add { display: flex; justify-content: center; margin: 18px 0; }
.palette { position: absolute; z-index: 60; width: 320px; max-height: 380px; overflow: auto; background: var(--surface); border: 1px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; }
.palette .pg { font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px 4px; }
.palette button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; cursor: pointer; color: var(--ink); border-left: 3px solid transparent; }
.palette button:hover, .palette button.on { background: var(--hover); border-left-color: var(--accent); }
.palette button .pi { width: 32px; height: 32px; border: 1px solid var(--line-strong); display: grid; place-items: center; background: var(--surface); flex: none; font-size: .95rem; }
.palette button b { display: block; font-weight: 650; font-size: .9rem; }
.palette button small { color: var(--ink-3); font-size: .78rem; }
.ed-side { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 80px); overflow: auto; }
.ed-side .card { padding: 16px; margin-bottom: 14px; }
.ed-side h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink); margin: 0 0 12px; font-weight: 750; }
.ed-status { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--ink-3); }
.preview-pane { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; }

/* misc */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.matrix td.cell { text-align: center; }
.cell-pill { display: inline-block; min-width: 54px; padding: 3px 8px; border-radius: var(--radius-sm); font-size: .78rem; font-weight: 700; }
.cell-pill.none { color: var(--ink-3); }
.cell-pill.prog { background: var(--amber-soft); color: var(--amber); }
.cell-pill.sub { background: var(--accent-soft); color: var(--accent-text); }
.cell-pill.ret { background: var(--green-soft); color: var(--green); }
.token-box { font: .95rem var(--font-mono); padding: 12px; background: var(--surface-2); border: 1px solid var(--ink); border-left: 4px solid var(--accent); word-break: break-all; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); display: inline-block; }
.live-dot.on { background: var(--red); animation: pulse 1.2s infinite; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink-3); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--ink); }
.link-btn.small { font-size: .82rem; }

/* ---------- file drop zone ---------- */
.dropzone { display: flex; align-items: center; gap: 16px; padding: 18px 22px; margin-bottom: 12px; border: 1.5px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--ink-2); cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.dropzone svg { flex: none; }
.dropzone strong { display: block; color: var(--ink); }
.dropzone span { font-size: .86rem; overflow-wrap: anywhere; }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--ink-2); color: var(--ink); }
.dropzone.is-armed { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.dropzone.is-over { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-busy { cursor: progress; opacity: .7; }
.dropzone.is-error { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.dropzone.is-error strong { color: var(--red); }

/* Hepek workspace: one deck of readings, one record dock. */
.card.hepek-lab-card { padding: 0; border: 0; background: transparent; }
.hepek-connection { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; }
.hepek-connection strong, .hepek-connection .grow > span { display: block; }
.hepek-connection .grow { min-width: 180px; overflow-wrap: anywhere; }
.hepek-port-help { text-align: right; min-height: 28px; padding-top: 4px; }
.hepek-views { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--surface-2); max-width: 420px; }
.hepek-view { flex: 1; background: none; color: var(--ink-2); border: 1px solid transparent; border-radius: 5px; padding: 9px 8px; font: 650 .9rem var(--font-sans); cursor: pointer; }
.hepek-view.active { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.hepek-view:disabled { opacity: .5; cursor: not-allowed; }
.hepek-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 16px; flex-wrap: wrap; }
.hepek-section-head h2 { margin: 0; font-size: 1.65rem; }
.hepek-section-head p { font-size: .88rem; margin-bottom: 0; }
.observable-deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); grid-auto-flow: dense; align-items: start; gap: 14px; }
.observable-card { position: relative; min-width: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; transition: border-color .15s, opacity .15s; }
.observable-card:hover { border-color: var(--ink-2); }
.observable-card.selected { box-shadow: inset 0 3px var(--green); }
.observable-card.is-recording { border-color: var(--rec); box-shadow: inset 0 3px var(--rec); }
.observable-card.is-skipped { opacity: .6; }
.observable-card.expanded { grid-column: span 2; }
.observable-main { display: block; width: 100%; text-align: left; padding: 18px 18px 12px; color: inherit; background: none; border: 0; font: inherit; cursor: pointer; }
.observable-main:focus-visible, .observable-select:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.observable-top { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; padding-right: 44px; min-height: 24px; }
.observable-port { font: 700 .72rem var(--font-mono); border: 1px solid var(--line); padding: 2px 6px; border-radius: 3px; }
.observable-freshness { color: var(--ink-2); font-size: .72rem; display: inline-flex; align-items: center; gap: 5px; }
.observable-freshness::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.is-live .observable-freshness { color: var(--green); }
.is-recording .observable-freshness { color: var(--rec); }
.observable-select { position: absolute; top: 14px; right: 14px; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink-3); font: 700 .95rem/1 var(--font-sans); cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.observable-select:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.selected .observable-select { background: var(--green); border-color: var(--green); color: var(--bg); }
.selected .observable-select:hover:not(:disabled) { color: var(--bg); filter: brightness(1.1); }
.is-recording .observable-select { background: var(--rec); border-color: var(--rec); color: #fff; font-size: .8rem; }
.observable-select:disabled { cursor: default; }
.observable-name { display: block; font-weight: 700; font-size: 1.08rem; }
.observable-pod { display: block; color: var(--ink-3); font-size: .73rem; margin-top: 2px; }
.observable-values { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 10px; margin: 16px 0 10px; min-height: 52px; }
.observable-number { font: 650 2.45rem/1.15 var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
.observable-unit { color: var(--ink-2); font: 500 .9rem var(--font-mono); }
.observable-values.vector { gap: 4px 12px; align-items: end; }
.observable-tail { display: inline-flex; align-items: flex-end; gap: 6px; white-space: nowrap; }
.observable-values.vector small { display: block; color: var(--ink-3); font: .7rem var(--font-mono); }
.observable-values.vector .observable-number { font-size: 1.05rem; letter-spacing: -.01em; }
.observable-spark { display: block; width: 100%; height: 64px; color: var(--ink-3); background: repeating-linear-gradient(to top, transparent 0 20px, var(--line) 20px 21px); }
.is-live .observable-spark { color: var(--green); }
.is-recording .observable-spark { color: var(--rec); }
.expanded .observable-spark { display: none; }
.observable-card path { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.observable-card .trace-1 { stroke-dasharray: 6 3; opacity: .8; }
.observable-card .trace-2 { stroke-dasharray: 2 3; opacity: .65; }
.observable-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: .68rem; color: var(--ink-3); gap: 8px; }
.observable-more { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.observable-more::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.expanded .observable-more::after { transform: translateY(1px) rotate(-135deg); }
.observable-main:hover .observable-more { color: var(--ink); }
.observable-detail { padding: 4px 14px 14px; }
.observable-chart { min-height: 220px; }
.observable-chart .u-legend { font-size: .75rem; }
.observable-chart .u-legend .u-series:first-child { display: none; }
.observable-stats { width: 100%; margin: 10px 0 0; border-collapse: collapse; font-size: .8rem; }
.observable-stats th, .observable-stats td { padding: 4px 6px; text-align: right; font-variant-numeric: tabular-nums; }
.observable-stats thead th { color: var(--ink-3); font: 600 .68rem var(--font-sans); text-transform: uppercase; letter-spacing: .06em; }
.observable-stats tbody th { text-align: left; color: var(--ink-3); font: .75rem var(--font-mono); width: 1%; }
.observable-stats td { font: 600 .84rem var(--font-mono); }
.observable-note { margin: 8px 6px 0; font-size: .74rem; color: var(--ink-3); }
.observable-meta { margin: 4px 6px 0; font: .7rem var(--font-mono); color: var(--ink-3); }
.hepek-dock { position: sticky; bottom: 12px; z-index: 10; margin-top: 22px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.hepek-dock.is-recording { border-color: var(--rec); box-shadow: 0 0 0 1px var(--rec), var(--shadow-lg); }
.hepek-dock-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 14px 12px 20px; }
.hepek-dock-main { flex: 1; min-width: 200px; }
.hepek-dock-count { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.hepek-dock.is-recording .hepek-dock-count { color: var(--rec); font: 700 1.6rem/1.2 var(--font-mono); }
.hepek-dock-sub { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.hepek-dock-result { gap: 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); padding-top: 10px; padding-bottom: 10px; }
.hepek-result-text { flex: 1; min-width: 180px; font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.hepek-dock .hepek-result-name { flex: 0 1 260px; width: auto; min-width: 140px; height: 34px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--rec); animation: pulse 1.2s infinite; }
.rec-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 54px; min-width: 150px; padding: 0 28px 0 22px; border: 0; border-radius: 27px; background: var(--rec); color: #fff; font: 750 1.1rem var(--font-sans); letter-spacing: .01em; cursor: pointer; transition: filter .12s, transform .12s; }
.rec-btn:hover:not(:disabled) { filter: brightness(1.1); }
.rec-btn:active:not(:disabled) { transform: scale(.98); }
.rec-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.rec-btn:disabled { background: var(--line-strong); color: var(--ink-3); cursor: not-allowed; }
.rec-btn.is-recording { animation: rec-ring 1.6s infinite; }
.rec-icon { position: relative; width: 24px; height: 24px; flex: none; border: 2.5px solid currentColor; border-radius: 50%; transition: border-color .15s; }
.rec-icon::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: currentColor; transition: inset .15s, border-radius .15s; }
.rec-btn.is-recording .rec-icon { border-color: transparent; }
.rec-btn.is-recording .rec-icon::after { inset: 3px; border-radius: 3px; }
@keyframes rec-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rec) 55%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@media (prefers-reduced-motion: reduce) { .rec-btn.is-recording, .rec-dot { animation: none; } }
.hepek-empty { grid-column: 1 / -1; padding: 36px 22px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--ink-2); background: var(--surface-2); }
.hepek-empty strong { color: var(--ink); display: block; }
.hepek-empty p { max-width: 440px; margin: 8px auto 0; font-size: .9rem; }
.hepek-saved-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 10px 0; background: var(--surface); }
.hepek-saved-row .grow { overflow-wrap: anywhere; min-width: 0; }

/* Measurement block: sources, one lane per reading (own scale, shared time), record dock, runs. */
.meas { position: relative; display: grid; gap: 12px; }
.meas.is-drop::after { content: "Drop the CSV file to add it as a run"; position: absolute; inset: -6px; z-index: 5; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent-soft) 90%, transparent); color: var(--accent-text); font-weight: 700; }
.meas-head { display: grid; gap: 8px; }
.meas-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.meas-src { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--ink); font: 650 .86rem/1 var(--font-sans); cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
select.meas-src { width: auto; min-height: 36px; padding: 0 12px; }
.meas-src:hover:not(:disabled) { border-color: var(--ink-2); }
.meas-src.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.meas-src:disabled { opacity: .5; cursor: not-allowed; }
.meas-status { min-height: 1.3em; font-size: .84rem; color: var(--ink-2); overflow-wrap: anywhere; }
.meas-status.warn { color: var(--amber); }
.meas-viewbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.meas-view-note { font: 650 .7rem var(--font-sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.meas-view { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.meas-view button { padding: 4px 12px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font: 650 .8rem var(--font-sans); cursor: pointer; }
.meas-view button.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.meas-view button:disabled { cursor: default; }
.meas-lanes { display: grid; gap: 8px; }
.meas-lane { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); border: 0; border-top: 1px solid var(--line); border-radius: 0; overflow: hidden; background: transparent; transition: border-color .15s, opacity .15s; }
.meas-lane:first-child { border-top: 0; }
.meas-lane.is-live { border-color: color-mix(in srgb, var(--green) 45%, var(--line-strong)); }
.meas-lane.is-recording { border-color: var(--rec); }
.meas-lane.is-missing { opacity: .55; }
.ml-tile { position: relative; min-width: 0; padding: 10px 12px 12px 14px; border-right: 1px solid var(--line); box-shadow: inset 3px 0 var(--lane); }
.ml-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ml-alias { padding: 0; border: 0; background: none; color: var(--lane); font: 700 .76rem var(--font-mono); }
.ml-state { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; color: var(--ink-3); }
.is-live .ml-state { color: var(--green); }
.is-recording .ml-state { color: var(--rec); }
.is-live .ml-state::before, .is-recording .ml-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.is-recording .ml-state::before { animation: pulse 1.2s infinite; }
.ml-name { margin-top: 2px; font-size: .86rem; font-weight: 650; line-height: 1.3; }
.ml-reading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-top: 6px; }
.ml-value { font: 650 1.7rem/1.1 var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.ml-unit { font: 500 .8rem var(--font-mono); color: var(--ink-2); }
.ml-live { position: absolute; left: 14px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; background: var(--green); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.is-live .ml-live { transform: scaleX(1); animation: live-glow 1.6s ease-in-out infinite; }
.is-recording .ml-live { background: var(--rec); }
@keyframes live-glow { 50% { opacity: .35; } }
.ml-chart { min-width: 0; min-height: 240px; padding: 4px 10px 6px; }
.meas-dock { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-2); transition: border-color .15s, background .15s; }
.meas-dock.is-recording { border-color: var(--rec); background: color-mix(in srgb, var(--red-soft) 55%, var(--surface)); }
.md-main { flex: 1; min-width: 180px; }
.md-time { font: 700 1.35rem/1.2 var(--font-mono); font-variant-numeric: tabular-nums; }
.md-time.faint { color: var(--ink-3); font-weight: 600; }
.meas-dock.is-recording .md-time { color: var(--rec); }
.md-bar { height: 4px; margin: 6px 0 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.md-bar span { display: block; height: 100%; width: 0; background: var(--rec); transition: width .25s linear; }
.md-sub { font-size: .8rem; color: var(--ink-2); }
.meas-settings { flex-basis: 100%; }
.meas-settings summary { width: max-content; font-size: .82rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; margin-top: 8px; }
.ms-grid label { display: grid; gap: 3px; font-size: .76rem; color: var(--ink-3); }
.meas-runs { display: grid; gap: 6px; }
.mr-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mr-label { margin-right: 4px; font: 650 .7rem var(--font-sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.run-chip { display: inline-flex; align-items: stretch; border: 1.5px solid var(--line-strong); border-radius: 16px; background: var(--surface); overflow: hidden; }
.run-chip button { padding: 4px 4px 4px 12px; border: 0; background: none; color: var(--ink-2); font: 650 .82rem var(--font-sans); cursor: pointer; }
.run-chip .rc-x { padding: 4px 10px 4px 6px; color: var(--ink-3); font-size: .72rem; }
.run-chip.on { border-color: var(--ink); background: var(--ink); }
.run-chip.on button { color: var(--bg); }
.run-chip .rc-x:hover:not(:disabled) { color: var(--red); }
.run-chip.local { border-style: dashed; }
.run-chip button:disabled { cursor: default; }
.mr-info { font-size: .8rem; color: var(--ink-2); }
.mr-link { margin-left: 8px; }
.meas-note { font-size: .82rem; color: var(--ink-3); }

/* Graph and readout blocks */
.graph-controls { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.graph-controls label { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; }
.graph-controls select { width: auto; min-height: 32px; padding: 4px 10px; }
.graph-hint { margin-top: 6px; font-size: .78rem; color: var(--ink-3); }
.region-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; padding: 8px 10px; border-left: 4px solid var(--blue); background: var(--blue-soft); color: var(--ink-2); font: .82rem var(--font-mono); }
.region-stats b { color: var(--blue); font-family: var(--font-sans); }
.graph-problem { margin-top: 8px; font-size: .82rem; color: var(--amber); }
.readout-blk { display: grid; gap: 2px; margin: 14px 0; padding: 14px 18px; border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.readout-blk.is-live { border-left-color: var(--green); }
.readout-label { font-size: .82rem; font-weight: 650; color: var(--ink-2); }
.readout-value { display: flex; align-items: baseline; gap: 8px; }
.readout-value .rv { font: 650 2.1rem/1.15 var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.readout-value .ru { font: 500 .95rem var(--font-mono); color: var(--ink-2); }
.readout-note { display: flex; align-items: center; gap: 5px; min-height: 1.2em; font-size: .74rem; color: var(--ink-3); }
.readout-blk.is-live .readout-note { color: var(--green); }
.readout-blk.is-live .readout-note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: live-glow 1.6s infinite; }

/* Hand tools (widgets/tools.js): stopwatch, timer, counter. Big digits, round thumb-sized buttons, orange = go. */
.tool { margin: 22px 0; padding: 12px 16px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font: 400 .95rem/1.5 var(--font-sans); }
.tool-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-height: 22px; }
.tool-k { font: 750 .68rem var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.tool-t { min-width: 0; font-weight: 600; color: var(--ink-2); }
.tool-len { display: flex; align-items: baseline; gap: 6px; margin-left: auto; font-size: .85rem; color: var(--ink-3); }
.tool-len input { width: 5.5em; padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: 600 .9rem var(--font-sans); font-variant-numeric: tabular-nums; }
.tool-len input:disabled { opacity: .5; }
.tool-face { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 4px; }
.tool-time { font: 600 2.6rem/1.1 var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: -.03em; color: var(--ink); }
.tool.is-on .tool-time, .tool.is-done .tool-time { color: var(--accent-text); }
.tool.is-done { animation: tool-done 1s ease-out; }
@keyframes tool-done { from { border-color: var(--accent); background: var(--accent-soft); } }
.tool-ctrl { display: flex; align-items: center; gap: 8px; }
.tool-ctrl .btn { height: 44px; min-width: 88px; border-radius: 22px; font-size: .95rem; }
.tool-go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tool-go:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.tool.is-on .tool-go { background: var(--surface); border-color: color-mix(in srgb, var(--red) 55%, var(--line)); color: var(--red); }
.tool.is-on .tool-go:hover { background: var(--red-soft); border-color: var(--red); }
@media (max-width: 520px) {
  .tool-face { flex-direction: column; align-items: stretch; }
  .tool-ctrl .btn { flex: 1; min-width: 0; height: 50px; border-radius: 25px; }
}
@media (prefers-reduced-motion: reduce) { .tool.is-done { animation: none; } }
@media print { .tool { display: none !important; } }

/* Data table: 📍 capture columns */
.dt th.cap { background: color-mix(in srgb, var(--green-soft) 70%, var(--surface-2)); }
.cap-cell { display: flex; align-items: center; }
.cap-cell input { flex: 1; min-width: 60px; }
.cap-pin { flex: none; width: 30px; height: 30px; margin-right: 2px; padding: 0; border: 0; border-radius: 6px; background: none; font-size: .9rem; cursor: pointer; filter: grayscale(1); opacity: .45; transition: opacity .12s, filter .12s, background .12s; }
.cap-pin.is-live { filter: none; opacity: 1; }
.cap-pin:hover { background: var(--hover); opacity: 1; }
.cap-take .cap-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.cap-take.is-live { border-color: var(--green); color: var(--green); }
.cap-take.is-live .cap-dot { background: var(--green); animation: live-glow 1.6s infinite; }
.cap-hint { margin-top: 6px; font-size: .78rem; color: var(--ink-3); }
.dt tr.captured td { animation: captured 1.2s ease-out; }
@keyframes captured { from { background: var(--green-soft); } }
@media (prefers-reduced-motion: reduce) {
  .is-live .ml-live, .is-recording .ml-state::before, .readout-blk.is-live .readout-note::before, .cap-take.is-live .cap-dot, .dt tr.captured td { animation: none; }
}
@media (max-width: 560px) {
  .observable-card.expanded { grid-column: 1 / -1; }
  .meas-lane { grid-template-columns: 1fr; }
  .ml-tile { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ml-top { grid-column: 1 / -1; }
  .ml-reading { margin-top: 0; justify-content: flex-end; }
  .ml-value { font-size: 1.45rem; }
}
@media (max-width: 480px) {
  .hepek-connection { padding: 14px; gap: 12px; }
  .hepek-section-head h2 { font-size: 1.4rem; }
  .observable-deck { grid-template-columns: 1fr; }
  .observable-values { justify-content: flex-start; }
  .hepek-dock { bottom: 8px; border-radius: 14px; }
  .hepek-dock-row { padding: 10px 12px; gap: 8px 12px; }
  .hepek-dock-main { min-width: 0; }
  .hepek-dock-count { font-size: 1rem; }
  .hepek-dock.is-recording .hepek-dock-count { font-size: 1.35rem; }
  .rec-btn { height: 46px; min-width: 0; gap: 9px; padding: 0 20px 0 16px; border-radius: 23px; font-size: 1rem; }
  .rec-icon { width: 20px; height: 20px; }
  .hepek-result-text { order: 1; flex: 1 1 calc(100% - 56px); min-width: 0; }
  .hepek-dock-result .btn-ghost { order: 2; }
  .hepek-dock .hepek-result-name { order: 3; flex: 1 1 140px; min-width: 0; }
  .hepek-dock-result .btn:not(.btn-ghost) { order: 4; }
  .dropzone { padding: 14px; }
}
/* First Steps: the introductory path */
.fs-path { margin: 4px 0 28px; padding: 22px 24px 16px; background: var(--surface); border: 1px solid var(--ink); border-top: 4px solid var(--accent); }
.fs-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 28px; flex-wrap: wrap; }
.fs-head > div:first-child { flex: 1 1 340px; min-width: 0; }
.fs-kicker { font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.fs-head h2 { margin: 2px 0 6px; font: 800 1.7rem/1.1 var(--font-display); letter-spacing: -.035em; }
.fs-head p { margin: 0; max-width: 62ch; color: var(--ink-2); font-size: .95rem; }
.fs-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fs-count { font-size: .85rem; color: var(--ink-2); white-space: nowrap; }
.fs-count b { font: 800 1.25rem var(--font-display); color: var(--ink); }
.fs-steps { list-style: none; margin: 22px 0 0; padding: 0 0 6px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(136px, 1fr); overflow-x: auto; scroll-snap-type: x proximity; }
.fs-step { position: relative; scroll-snap-align: start; }
.fs-step:not(:last-child)::before { content: ""; position: absolute; top: 14px; left: 14px; right: 0; height: 2px; background: var(--line-strong); }
.fs-step.is-done::before { background: var(--accent); }
.fs-step a { position: relative; display: grid; align-content: start; gap: 3px; height: 100%; padding: 0 14px 4px 0; color: var(--ink); text-decoration: none; }
.fs-n { width: 30px; height: 30px; margin-bottom: 8px; display: grid; place-items: center; border: 2px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font: 750 .85rem var(--font-sans); color: var(--ink-2); transition: border-color .15s, color .15s; }
.fs-step.is-done .fs-n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fs-step.is-started .fs-n, .fs-step.is-next .fs-n { border-color: var(--accent); color: var(--accent-text); }
.fs-step.is-next .fs-n { box-shadow: 0 0 0 4px var(--accent-soft); }
.fs-step a:hover .fs-n { border-color: var(--ink); color: var(--ink); }
.fs-step.is-done a:hover .fs-n { border-color: var(--accent-hover); color: var(--accent-ink); }
.fs-t { font-weight: 700; font-size: .9rem; line-height: 1.25; }
.fs-step a:hover .fs-t { color: var(--accent-text); }
.fs-h { font-size: .8rem; line-height: 1.3; color: var(--ink-2); }
.fs-m { font-size: .72rem; color: var(--ink-3); }

.fs-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 18px 0 -4px; font-size: .78rem; }
.fs-nav-name { font-weight: 750; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); text-decoration: none; }
.fs-nav-name:hover { text-decoration: underline; }
.fs-nav-pos { color: var(--ink-3); }
.fs-dots { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.fs-dots a { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font: 700 .72rem var(--font-sans); color: var(--ink-2); text-decoration: none; }
.fs-dots a:hover { border-color: var(--ink); color: var(--ink); }
.fs-dots a.is-done { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.fs-dots a.is-current { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.fs-next { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 18px; align-items: center; margin: 24px 0 0; padding: 18px 22px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); text-decoration: none; transition: background .15s; }
.fs-next:hover { background: var(--accent-soft); }
.fs-next > span:not(.fs-next-go) { grid-column: 1; }
.fs-next-k { font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.fs-next-t { font: 800 1.35rem/1.2 var(--font-display); letter-spacing: -.03em; }
.fs-next-h { font-size: .88rem; color: var(--ink-2); }
.fs-next-go { grid-column: 2; grid-row: 1 / span 3; width: 46px; height: 46px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 1.4rem; font-weight: 700; transition: transform .15s; }
.fs-next:hover .fs-next-go { transform: translateX(3px); }
@media (max-width: 600px) {
  .fs-path { padding: 18px 16px 12px; }
  .fs-cta, .fs-cta .btn { width: 100%; }
  .fs-cta .btn { justify-content: center; white-space: normal; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .fs-next-go, .fs-n { transition: none; } }
@media print { .fs-nav, .fs-next { display: none !important; } }

/* ---------- the student page: a book with instruments ---------- */
/* Prose sits in a ~68-character column; instruments (tables, graphs, measurements) take the full width and keep
   their frames. Orange means "your turn": the next question, a tip, the cursor. Everything else is ink, rules
   and space. Rules for authors: handbook, "How to structure an experiment" > "The student page". */
.book { --read-w: 40rem; container-type: inline-size; }
.book > *, .book .blocks > .blk { max-width: var(--read-w); margin-inline: auto; }
.book .blocks > :is(.widget, .blk-video, .blk-embed, .blk-image.wide) { max-width: none; }
.book .blk-image.wide figure { margin-inline: 0; }
.book .blocks { font: 400 1.13rem/1.72 var(--font-serif); counter-reset: sec; }
.book .blk-text p { margin: .6em 0; text-wrap: pretty; }
.book .blocks > .blk-text:first-child > p:first-child::first-letter { float: left; margin: .07em .09em 0 0; font: 600 3.35em/.8 var(--font-serif); color: var(--ink); }
.book .blk-heading { margin-top: 2.3em; }
.book .blk-heading h2 { font-size: 1.6rem; counter-increment: sec; }
.book .blk-heading h2::before { content: counter(sec, decimal-leading-zero); display: block; margin-bottom: 8px; font: 700 .72rem/1 var(--font-sans); letter-spacing: .16em; color: var(--ink-3); }
.book .blk-heading h3 { font-size: 1.2rem; }
.book .blk-quote { border-left: 2px solid var(--ink); font-style: italic; color: var(--ink-2); }
.book .blk-callout { gap: 12px; margin: 22px auto; padding: 1px 0 1px 18px; background: none; border-left: 2px solid var(--line-strong); border-radius: 0; font-size: .96em; }
.book .blk-callout .ci { font-size: 1.05rem; line-height: 1.72; }
.book .blk-callout.info { border-left-color: var(--ink); }
.book .blk-callout.tip { border-left-color: var(--green); }
.book .blk-callout:is(.warning, .danger) { padding: 12px 16px; border-left-width: 3px; }
.book .blk-callout.warning { background: var(--amber-soft); }
.book .blk-callout.danger { background: var(--red-soft); }
.book .blk-toggle summary { font: 600 .98rem/1.5 var(--font-sans); color: var(--ink-2); }
.book .blk-toggle summary:hover { color: var(--ink); }
.book .blk-toggle summary::before { color: var(--ink-3); }
.book .blk-toggle .tb { padding-left: 1.55em; }
.book .blk-list li { margin: 5px 0; }

/* questions: no boxes. The number hangs in the margin and carries the state. */
.book .q { margin: 34px auto; padding: 0; border: 0; border-radius: 0; background: none; }
.book .q-head { margin-bottom: 12px; }
.book .q-num { position: absolute; left: -3.6rem; top: .3em; width: 2.6rem; padding: 3px 0; border: 1.5px solid var(--ink); border-radius: var(--radius-sm); background: none; color: var(--ink); font: 750 .72rem/1.2 var(--font-sans); text-align: center; transition: background .2s, border-color .2s, color .2s; }
.book .q.is-answered .q-num { border-color: var(--line-strong); color: var(--ink-3); }
.book .q.is-next .q-num { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.book .q.correct .q-num { border-color: var(--green); background: none; color: var(--green); }
.book .q.wrong .q-num { border-color: var(--red); background: none; color: var(--red); }
.book .q-prompt { font-weight: 600; }
.book .q-prompt p { margin: 0 0 .3em; }
.book .q-pts { font: 600 .7rem/1.9 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.book .q-input input { width: 100%; min-height: 0; padding: 6px 2px; border: 0; border-bottom: 1.5px solid var(--ink-3); border-radius: 0; background: none; font: 500 1.08rem/1.4 var(--font-sans); }
.book .q[data-kind="number"] .q-input input { width: 13rem; }
.book .q-input input:focus { border-bottom-color: var(--ink); }
.book .q-input .unit { font: 1rem var(--font-sans); }
.book .q textarea { --lh: 1.9em; min-height: calc(var(--lh) * 4); padding: 0 4px; border: 0; border-radius: 0;
  background: repeating-linear-gradient(transparent 0 calc(var(--lh) - 1px), var(--line-strong) calc(var(--lh) - 1px) var(--lh)) local;
  font: 400 1.05rem/1.9 var(--font-serif); line-height: var(--lh); }
.book .q textarea:focus { box-shadow: none; background-image: repeating-linear-gradient(transparent 0 calc(var(--lh) - 1px), var(--ink-3) calc(var(--lh) - 1px) var(--lh)); }
.book .q-choices { gap: 2px; }
.book .q-choice { margin-left: -10px; padding: 7px 10px; border: 0; font-weight: 400; }
.book .q-choice:hover { background: var(--hover); }
.book .q-choice:has(input:checked) { background: var(--hover); box-shadow: inset 2px 0 0 var(--ink); }
.book .q-foot { margin-top: 10px; font-family: var(--font-sans); }
.book .q-foot:empty { display: none; }
.book .q-feedback { margin-top: 12px; padding: 2px 0 2px 14px; border-left: 2px solid currentColor; border-radius: 0; background: none; font: .95rem/1.55 var(--font-sans); }
.book .q-feedback.info { color: var(--ink-2); border-left-color: var(--line-strong); }

/* the gate: a quiet rule across the page */
.book .gate { margin: 40px auto; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink-3); }
.book .gate-text { display: flex; align-items: center; gap: 12px; font: 600 .85rem/1.4 var(--font-sans); }
.book .gate-text::before, .book .gate-text::after { content: ""; flex: 1 1 24px; height: 1px; background: var(--line-strong); }
.book .gate-text svg { flex: none; }
.book .gate-text span { flex: 0 1 auto; max-width: 28em; text-align: center; }

/* instruments keep a frame, in plain sans */
.book .widget { margin: 32px auto; font: 400 1rem/1.6 var(--font-sans); }
.book .widget-head { background: none; }
.book .widget-head .wk, .book .plot-head .wk { padding: 0; background: none; color: var(--ink-3); letter-spacing: .14em; }
.book .widget .instructions { font: 400 1.02rem/1.6 var(--font-serif); }
.book .fit-result { border-left: 2px solid var(--ink); }
.book .readout-blk { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0 18px; margin: 22px auto; padding: 10px 0; border: 0; border-block: 1px solid var(--line-strong); border-radius: 0; background: none; }
.book .readout-blk + .readout-blk { margin-top: -22px; border-top: 0; }
.book .readout-label { font: 400 1.02rem/1.4 var(--font-serif); color: var(--ink-2); }
.book .readout-value .rv { font-size: 1.45rem; }
.book .readout-note { grid-column: 1 / -1; min-height: 0; }
.book .readout-blk.is-live .rv { color: var(--green); }
.book .tool { margin: 28px auto; font-size: 1rem; }

/* header: what it is, how long, what you need. Teachers get the rest behind one fold. */
.book .doc-head { margin-bottom: 30px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.book .doc-cover { margin: 8px 0 0; }
.book .doc-cover img { display: block; width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--radius); }
.book .doc-kicker { margin-top: 22px; font: 750 .72rem var(--font-sans); letter-spacing: .14em; text-transform: uppercase; }
.book .doc-kicker a { color: var(--ink-3); }
.book .doc-kicker a:hover { color: var(--ink); }
.book .doc-title { margin: 10px 0 12px; font-size: clamp(2rem, 4.6vw, 2.8rem); text-wrap: balance; }
.book .doc-lede { margin: 0 0 18px; font: 400 1.28rem/1.5 var(--font-serif); color: var(--ink-2); text-wrap: pretty; }
.book .doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin: 0; font-size: .86rem; color: var(--ink-3); }
.book .doc-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.book .doc-guest a { font-weight: 650; }
.book .doc-resume { margin-left: auto; font-weight: 700; color: var(--accent-text); }
.book .doc-assign { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 0; font-size: .86rem; color: var(--ink-2); }
.book .doc-assign svg { flex: none; align-self: center; color: var(--ink-3); }
.book .doc-assign b { font-weight: 650; color: var(--ink); }
.book .doc-assign q { font-style: italic; }
.book .doc-assign.is-late b { color: var(--red); }
.book .fs-nav { margin: 22px 0 0; }
.book .fs-nav-name { color: var(--ink-3); }
.book .fs-nav-name:hover { color: var(--ink); }
.book .fs-dots a { width: 22px; height: 22px; border-color: var(--line); color: var(--ink-3); }
.book .fs-dots a.is-done { border-color: var(--line-strong); background: none; color: var(--ink); }
.book .fs-dots a.is-current { border-color: var(--ink); background: var(--ink); color: var(--bg); }

.doc-teach { margin-bottom: 30px; border: 1px solid var(--line); font-size: .88rem; }
.doc-teach summary { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-weight: 650; color: var(--ink-2); cursor: pointer; list-style: none; }
.doc-teach summary::-webkit-details-marker { display: none; }
.doc-teach summary:hover { color: var(--ink); }
.doc-teach .sum { margin-left: auto; font-weight: 400; color: var(--ink-3); }
.doc-teach .sum::after { content: "▸"; display: inline-block; margin-left: 10px; transition: transform .15s; }
.doc-teach[open] .sum::after { transform: rotate(90deg); }
.doc-teach[open] summary { border-bottom: 1px solid var(--line); }
.doc-teach dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 18px; margin: 0; padding: 12px 14px 14px; }
.doc-teach dt { font-weight: 650; color: var(--ink-3); }
.doc-teach dd { margin: 0; color: var(--ink-2); }

.doc-result { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 28px; margin-bottom: 30px; padding: 14px 0 18px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.doc-result.is-graded { border-top-color: var(--green); }
.doc-result-k { font: 750 .72rem var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.doc-result.is-graded .doc-result-k { color: var(--green); }
.doc-result .score-big { font-size: 2rem; }
.doc-result-note { flex: 1 1 260px; font-size: .93rem; color: var(--ink-2); }
.doc-result-note p { margin: 0; }

/* end of the page: progress, hand in, what's next */
.book .doc-end { margin-top: 56px; }
.book .submit-bar { margin: 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--ink); border-radius: 0; background: none; }
.submit-note { margin-top: 6px; font-size: .82rem; color: var(--ink-3); }
.book .fs-next { margin-top: 30px; }
.doc-end-tools { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 24px; }
@media (min-width: 1181px) { .doc-end-tools { display: none; } }
.doc-toc a.is-done::after { content: " ✓"; color: var(--green); }
.doc-progress { display: grid; justify-items: start; gap: 8px; }

/* the hanging numbers need a margin; on narrow pages they sit inline */
@container (max-width: 47rem) {
  .book .q-num { position: static; flex: none; width: auto; padding: 2px 7px; }
}
@container (max-width: 34rem) {
  .book .q-head { flex-wrap: wrap; row-gap: 6px; }
  .book .q-prompt { order: 1; flex-basis: 100%; }
}
@media (max-width: 600px) {
  .book .blocks { font-size: 1.06rem; }
  .book .doc-lede { font-size: 1.15rem; }
  .book .doc-resume { margin-left: 0; }
  .doc-teach dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .doc-teach dd + dt { margin-top: 8px; }
  .doc-teach summary { flex-wrap: wrap; }
}

/* coach marks (static/js/coach.js): a pulsing ring on the tool and an ink bubble beside it */
.coach-ring { position: absolute; z-index: 16; pointer-events: none; border: 2px solid var(--accent); border-radius: 4px; animation: coach-pulse 1.8s ease-out infinite; }
.coach { position: absolute; z-index: 17; width: min(300px, calc(100vw - 24px)); padding: 12px 15px 11px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font: 400 .9rem/1.5 var(--font-sans); animation: coach-in .22s ease-out; }
.coach::before { content: ""; position: absolute; left: calc(var(--ax, 24px) - 7px); width: 14px; height: 14px; background: inherit; transform: rotate(45deg); }
.coach[data-side="below"]::before { top: -6px; }
.coach[data-side="above"]::before { bottom: -6px; }
.coach[data-side="right"]::before { left: -6px; top: calc(var(--ay, 26px) - 7px); }
.coach[data-side="inside"]::before { display: none; }
.coach-k { margin-bottom: 3px; font: 750 .68rem var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
:root[data-theme="dark"] .coach-k { color: var(--accent-hover); filter: brightness(.8); }
.coach-t { position: relative; margin: 0; }
.coach-t b { font-weight: 700; }
.coach-a { position: relative; display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.coach-ok { padding: 5px 13px; border: 0; border-radius: var(--radius-sm); background: var(--accent); color: #111; font: 700 .82rem var(--font-sans); cursor: pointer; }
.coach-ok:hover { background: var(--accent-hover); }
.coach-off { padding: 0; border: 0; background: none; color: inherit; opacity: .7; font: .8rem var(--font-sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.coach-off:hover { opacity: 1; }
@keyframes coach-pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } to { box-shadow: 0 0 0 12px transparent; } }
@keyframes coach-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  .coach-ring { animation: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
  .coach, .book .q-num { animation: none; transition: none; }
}
@media print {
  .coach, .coach-ring, .doc-teach, .doc-end-tools, .doc-resume, .doc-guest { display: none !important; }
  .book .q-num { position: static; }
  .book .q textarea { background: none; border-bottom: 1px solid #999; }
}

.error-page { text-align: center; padding: 100px 20px; }
.error-page .code { font: 800 7rem/1 var(--font-display); letter-spacing: -.06em; color: var(--accent); }
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .doc-toc, .doc-actions, .submit-bar, .flashes, .q-foot button, .btn { display: none !important; }
  .shell { display: block; } .content { padding: 0; } .print-only { display: block; }
}
