/* Camera Field Guide — styles
   Darkroom palette: warm near-black, paper-white ink, amber for light, teal for "in focus". */

:root {
  --bg: #0e0d0b;
  --bg-2: #151311;
  --panel: #1b1916;
  --panel-2: #23201c;
  --line: #322d27;
  --line-2: #453f37;
  --ink: #f3eddf;
  --ink-2: #c2b9a8;
  --ink-3: #8f8778;
  --amber: #ffb454;
  --amber-2: #ffcf8f;
  --amber-ink: #1c1304;
  --teal: #5fd4c4;
  --rose: #ff7d6e;
  --violet: #a99dff;
  --pink: #ff8fc0;

  --display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --r: 14px;
  --r-sm: 9px;
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; outline: none; }

h1, h2, h3 { font-family: var(--display); font-weight: 560; line-height: 1.12; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4.1rem); }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.22rem; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
a { color: var(--amber); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--amber-2); }
em { font-style: italic; }
strong { font-weight: 650; color: #fff8ea; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
@media (max-width: 520px) { .wrap { width: calc(100% - 28px); } }

.skip { position: absolute; left: 12px; top: -60px; background: var(--amber); color: var(--amber-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 600; }
.skip:focus { top: 12px; }

.mono { font-family: var(--mono); font-size: 0.86em; }
.kicker { font: 600 0.74rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); margin: 0 0 14px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header-in { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--ink); text-decoration: none; font: 600 1.18rem/1 var(--display); letter-spacing: -0.01em; }
.brand em { color: var(--amber); font-style: italic; font-weight: 400; }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: 0.95rem; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { color: var(--ink); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--amber); }
.nav .short { display: none; }
@media (max-width: 460px) { .nav .long { display: none; } .nav .short { display: inline; } }

.site-footer { border-top: 1px solid var(--line); margin-top: 90px; padding: 34px 0 44px; color: var(--ink-3); font-size: 0.88rem; }
.site-footer p { max-width: 70ch; margin: 0; }

/* ---------- Buttons / chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font: 600 0.98rem/1 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s; }
.btn-primary { background: var(--amber); color: var(--amber-ink); }
.btn-primary:hover { background: var(--amber-2); color: var(--amber-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--panel); color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips-label { font: 600 0.7rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.chip { font: 550 0.86rem/1 var(--sans); color: var(--ink); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--amber); background: #2b2620; }
.chip.is-on { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }

/* ---------- Home ---------- */
.hero { padding: clamp(36px, 6vw, 76px) 0 30px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(28px, 4vw, 60px); align-items: center; }
.hero h1 em { color: var(--amber); font-weight: 400; }
.hero-lede { font-size: 1.16rem; color: var(--ink-2); max-width: 46ch; margin: 22px 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-demo figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink-3); font-size: 0.88rem; margin-top: 12px; }
.hero-demo figure { margin: 0; }
.icon-btn { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: none; }
.icon-btn:hover { border-color: var(--amber); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

.section { padding: 54px 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head p { color: var(--ink-3); margin: 0; max-width: 52ch; }

.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.lab-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); transition: border-color .18s, transform .18s, background .18s; overflow: hidden; }
.lab-card:hover { border-color: var(--amber); transform: translateY(-2px); color: var(--ink); background: #1f1c18; }
.lab-card .num { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.14em; color: var(--amber); }
.lab-card h3 { font-size: 1.32rem; }
.lab-card p { color: var(--ink-2); font-size: 0.95rem; margin: 0; }
.lab-card .glyph { position: absolute; right: 16px; top: 16px; width: 52px; height: 52px; color: var(--line-2); transition: color .18s; }
.lab-card:hover .glyph { color: var(--amber); }
.lab-card .go { margin-top: auto; padding-top: 8px; font: 600 0.84rem/1 var(--sans); color: var(--ink-3); }
.lab-card:hover .go { color: var(--amber); }

.q-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.q-list a { display: block; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-family: var(--display); font-size: 1.08rem; line-height: 1.3; background: var(--bg-2); }
.q-list a:hover { border-color: var(--teal); }
.q-list a span { display: block; font: 500 0.82rem/1.4 var(--sans); color: var(--ink-3); margin-top: 8px; }

.ideas { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ideas a { display: block; padding: 18px 20px 16px; border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: var(--r-sm); background: var(--panel); color: var(--ink); text-decoration: none; }
.ideas a:nth-child(2) { border-top-color: var(--teal); }
.ideas a:nth-child(3) { border-top-color: var(--violet); }
.ideas a:hover { border-color: var(--line-2); background: var(--panel-2); }
.ideas h3 { margin-bottom: 8px; }
.ideas p { color: var(--ink-2); font-size: 0.95rem; margin: 0 0 10px; }
.ideas span { font: 600 0.74rem/1 var(--mono); letter-spacing: 0.06em; color: var(--ink-3); }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.how > div { border-top: 2px solid var(--line-2); padding-top: 14px; }
.how h3 { margin-bottom: 6px; }
.how p { color: var(--ink-2); font-size: 0.95rem; margin: 0; }

/* ---------- Lab page ---------- */
.lab-strip { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.lab-strip-in { display: flex; gap: 4px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.lab-strip-in::-webkit-scrollbar { display: none; }
.lab-strip a { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; color: var(--ink-3); text-decoration: none; font-size: 0.86rem; font-weight: 550; white-space: nowrap; }
.lab-strip a b { font: 600 0.7rem/1 var(--mono); color: var(--ink-3); }
.lab-strip a:hover { color: var(--ink); background: var(--panel); }
.lab-strip a[aria-current="page"] { color: var(--amber-ink); background: var(--amber); }
.lab-strip a[aria-current="page"] b { color: var(--amber-ink); }

.lab-head { padding: 40px 0 26px; max-width: 820px; }
.lab-head h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
.lab-head .lede { font-size: 1.14rem; color: var(--ink-2); margin: 16px 0 0; max-width: 62ch; }

.stage { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, 1fr); gap: 18px; align-items: start; }
.stage-main { min-width: 0; display: grid; gap: 14px; }
.side { min-width: 0; display: grid; gap: 14px; }
.stage-main > *, .side > * { min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 20px; display: grid; gap: 16px; }
.panel h2, .card h2 { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 940px) {
  .stage { grid-template-columns: 1fr; }
  /* Flatten the left column so the picture can stay pinned while the controls scroll beneath it. */
  .stage-main { display: contents; }
  .stage > .panel, .stage > .side, .stage > .card { order: 1; }
  .stage-main > * { order: 2; }
  .stage-main > .stage-sticky { order: 0; }
}
@media (max-width: 700px) and (min-height: 620px) {
  .stage-sticky { position: sticky; top: 58px; z-index: 20; background: var(--bg); padding: 8px 0; margin: -8px 0; }
}

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 18px; min-width: 0; }
.card > h2 { margin-bottom: 12px; }
.card-note { color: var(--ink-3); font-size: 0.86rem; margin: 10px 0 0; }
.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; margin-top: 14px; }
.diagram svg { display: block; width: 100%; height: auto; }
/* On narrow screens, wide diagrams keep a readable size and scroll sideways instead of shrinking to nothing. */
.diagram-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
@media (max-width: 700px) { .diagram-scroll svg { min-width: 660px; } }
.diagram text { font-family: var(--mono); }

/* Controls */
.ctrl { display: grid; gap: 8px; }
.ctrl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ctrl-head label, .ctrl-head > span { font-weight: 600; font-size: 0.93rem; }
.ctrl-head output { font: 600 0.92rem/1 var(--mono); color: var(--amber); white-space: nowrap; }
.ctrl-hint { margin: 0; font-size: 0.8rem; color: var(--ink-3); line-height: 1.4; }
.ctrl.is-disabled { opacity: .45; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; margin: 0; cursor: pointer; --p: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--amber) var(--p), var(--line-2) var(--p)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--amber) var(--p), var(--line-2) var(--p)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); border: 4px solid var(--amber); margin-top: -8px; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 4px solid var(--amber); box-shadow: 0 2px 8px rgba(0,0,0,.5); }
input[type="range"]:disabled { cursor: not-allowed; }

.seg { display: flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { flex: 1 1 auto; background: transparent; border: 0; color: var(--ink-2); font: 550 0.84rem/1.1 var(--sans); padding: 8px 8px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 600; font-size: 0.93rem; }
.switch small { display: block; font-weight: 400; color: var(--ink-3); font-size: 0.8rem; line-height: 1.35; margin-top: 2px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { flex: none; width: 42px; height: 24px; border-radius: 24px; background: var(--line-2); position: relative; transition: background .15s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.switch input:checked + i { background: var(--amber); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--teal); outline-offset: 3px; }

.lens-classes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin-top: -2px; }
.lens-classes span { font: 500 0.62rem/1.2 var(--mono); text-align: center; color: var(--ink-3); padding: 5px 2px; border-radius: 5px; background: var(--bg-2); letter-spacing: 0.02em; }
.lens-classes span.is-on { background: var(--amber); color: var(--amber-ink); font-weight: 600; }

/* Readouts */
.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 0; }
.readouts > div { padding: 13px 16px 14px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.readouts dt { font: 500 0.68rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.readouts dd { margin: 0; font: 600 1.12rem/1.2 var(--mono); color: var(--ink); }
.readouts dd small { display: block; font: 400 0.76rem/1.35 var(--sans); color: var(--ink-3); margin-top: 4px; }
.readouts dd.good { color: var(--teal); }
.readouts dd.warn { color: var(--rose); }

/* ---------- Viewfinder ---------- */
.vf { position: relative; width: 100%; aspect-ratio: 3 / 2; background: #000; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); isolation: isolate; }
.vf-scene { position: absolute; inset: 0; overflow: hidden; }
.vf-layer, .vf-lights { position: absolute; left: 0; top: 0; overflow: hidden; pointer-events: none; }
.vf-lights { width: 100%; height: 100%; }
.vf-grain { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: 0; background-size: 200px 200px; }
.vf-grain.b { mix-blend-mode: screen; }
.vf-overlay { position: absolute; inset: 0; pointer-events: none; }
.vf-hud { position: absolute; inset: 0; pointer-events: none; }
.vf-hud .c { position: absolute; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.75); }
.vf-hud .tl { left: 12px; top: 12px; border-right: 0; border-bottom: 0; }
.vf-hud .tr { right: 12px; top: 12px; border-left: 0; border-bottom: 0; }
.vf-hud .bl { left: 12px; bottom: 44px; border-right: 0; border-top: 0; }
.vf-hud .br { right: 12px; bottom: 44px; border-left: 0; border-top: 0; }
.vf-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: clamp(10px, 3vw, 28px); padding: 9px 12px; background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,.45)); font: 600 clamp(0.72rem, 1.6vw, 0.9rem)/1 var(--mono); color: #fff; letter-spacing: 0.02em; flex-wrap: wrap; }
.vf-bar span b { color: var(--amber); font-weight: 600; }
.vf-badge { position: absolute; left: 44px; top: 14px; font: 600 0.7rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.5); padding: 6px 9px; border-radius: 6px; }
.vf-badge.warn { background: var(--rose); color: #1c0603; }

.vf-tag { position: absolute; transform: translate(-50%, -100%); font: 600 0.66rem/1 var(--mono); padding: 5px 7px; border-radius: 6px; background: rgba(10,10,10,.72); color: #d8d2c4; white-space: nowrap; border: 1px solid rgba(255,255,255,.18); transition: background .15s, color .15s; }
.vf-tag::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 8px; background: rgba(255,255,255,.4); }
.vf-tag.sharp { background: var(--teal); color: #04201c; border-color: var(--teal); }
.vf-frameline { position: absolute; border: 1.5px solid rgba(255,255,255,.85); box-shadow: 0 0 0 1px rgba(0,0,0,.35); border-radius: 2px; }
.vf-frameline span { position: absolute; left: 4px; top: 3px; font: 600 0.62rem/1 var(--mono); color: #fff; text-shadow: 0 1px 2px #000; }

/* scene palette */
.vf-scene .sh { fill: #000; opacity: .3; }
.vf-scene[data-time="dusk"] { --t1: #17302f; --t2: #1f413c; --t3: #2b5a4f; --trunk: #241b1f; --metal: #14161c; --glass: #ffd9a0; --wood: #5a4033; --b1: #1b2045; --b2: #222950; --b3: #2a305d; --win: #ffd28a; --m1: #51457a; --m2: #383361; --leaf1: #1c4636; --leaf2: #2d6c4c; --moon: 1; --glow: .22; }
.vf-scene[data-time="day"] { --t1: #2f7d4f; --t2: #3d9960; --t3: #62bb7c; --trunk: #6a4a3a; --metal: #2c3038; --glass: #eef2f5; --wood: #a06e4a; --b1: #8ea2bf; --b2: #9db0ca; --b3: #abbad3; --win: #dbe6f2; --m1: #b9c8e2; --m2: #98accf; --leaf1: #3d8f55; --leaf2: #62b673; --moon: 0; --glow: 0; }
.vf-scene .t1 { fill: var(--t1); } .vf-scene .t2 { fill: var(--t2); } .vf-scene .t3 { fill: var(--t3); }
.vf-scene .trunk { fill: var(--trunk); } .vf-scene .metal { fill: var(--metal); } .vf-scene .metal-s { stroke: var(--metal); fill: none; }
.vf-scene .glass { fill: var(--glass); } .vf-scene .glow { fill: #ffbf6b; opacity: var(--glow); }
.vf-scene .wood { fill: var(--wood); }
.vf-scene .b1 { fill: var(--b1); } .vf-scene .b2 { fill: var(--b2); } .vf-scene .b3 { fill: var(--b3); }
.vf-scene .win { fill: var(--win); opacity: .85; }
.vf-scene .m1 { fill: var(--m1); } .vf-scene .m2 { fill: var(--m2); }
.vf-scene .leaf1 { fill: var(--leaf1); } .vf-scene .leaf2 { fill: var(--leaf2); }
.vf-scene .moon { opacity: var(--moon); }

/* Exposure meter */
.meter { position: relative; height: 46px; }
.meter-scale { position: absolute; left: 0; right: 0; top: 14px; height: 6px; border-radius: 6px; background: linear-gradient(to right, #1d1b19, #4a443c 35%, var(--teal) 50%, #c9bfae 65%, #fff); opacity: .8; }
.meter-ticks { position: absolute; left: 0; right: 0; top: 26px; display: flex; justify-content: space-between; font: 500 0.66rem/1 var(--mono); color: var(--ink-3); }
.meter-needle { position: absolute; top: 4px; width: 4px; height: 26px; margin-left: -2px; background: var(--amber); border-radius: 3px; box-shadow: 0 0 0 2px var(--panel); transition: left .12s; }
.meter-label { font: 600 0.92rem/1.3 var(--mono); }
.meter-label.good { color: var(--teal); } .meter-label.warn { color: var(--rose); }

.fx { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.fx .card h3 { font: 600 1.02rem/1.2 var(--sans); margin-bottom: 4px; }
.fx .card .big { font: 600 1.5rem/1.1 var(--mono); color: var(--amber); margin: 6px 0 8px; }
.fx .card p { font-size: 0.9rem; color: var(--ink-2); margin: 0 0 6px; }
.fx .card p b { color: var(--ink); font-family: var(--mono); font-size: 0.92em; }
.fx .iris { float: right; width: 56px; height: 56px; margin-left: 10px; }

/* ---------- Prose ---------- */
.prose { max-width: 760px; margin-top: 50px; }
.prose h2 { margin: 46px 0 14px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 28px 0 8px; font-family: var(--sans); font-weight: 650; font-size: 1.06rem; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--amber); }

.callout { border-left: 3px solid var(--amber); background: var(--panel); padding: 16px 20px; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin: 22px 0; }
.callout p:last-child { margin: 0; }
.callout.teal { border-color: var(--teal); }
.callout .callout-title { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); margin-bottom: 9px; }
.callout.teal .callout-title { color: var(--teal); }

details.deeper { border: 1px solid var(--line); border-radius: var(--r-sm); margin: 22px 0; background: var(--bg-2); }
details.deeper summary { cursor: pointer; padding: 14px 18px; font-weight: 650; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 10px; }
details.deeper summary::-webkit-details-marker { display: none; }
details.deeper summary::before { content: '+'; font: 600 1.1rem/1 var(--mono); color: var(--violet); width: 14px; }
details.deeper[open] summary::before { content: '−'; }
details.deeper summary span { font: 600 0.68rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--violet); margin-right: 2px; }
details.deeper .deeper-body { padding: 0 18px 16px 42px; }
@media (max-width: 520px) { details.deeper .deeper-body { padding-left: 18px; } }

.formula { font-family: var(--mono); font-size: 0.92rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 12px 0; overflow-x: auto; white-space: nowrap; }
.formula var { font-style: normal; color: var(--amber-2); }

table.data { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 14px 0; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
table.data th { font: 600 0.68rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
table.data td { color: var(--ink-2); }
table.data td.num { font-family: var(--mono); color: var(--ink); white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.term { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help; border-bottom: 1px dashed var(--teal); }
.term:hover { color: var(--teal); }
.popover { position: absolute; z-index: 60; width: min(340px, calc(100vw - 24px)); background: #26221d; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; box-shadow: 0 18px 50px rgba(0,0,0,.6); font-size: 0.9rem; line-height: 1.5; color: var(--ink-2); }
.popover b { display: block; font: 600 1.05rem/1.2 var(--display); color: var(--ink); margin-bottom: 6px; }
.popover a { display: inline-block; margin-top: 8px; font-weight: 600; font-size: 0.84rem; }

.lab-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 60px; flex-wrap: wrap; }
.lab-nav a { flex: 1 1 260px; display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); background: var(--panel); }
.lab-nav a:hover { border-color: var(--amber); }
.lab-nav a small { display: block; font: 600 0.68rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.lab-nav a span { font: 560 1.2rem/1.2 var(--display); }
.lab-nav a.next { text-align: right; }

/* ---------- ISO lab ---------- */
.iso-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .iso-panels { grid-template-columns: 1fr; } }
.iso-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.iso-panel canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; background: #000; }
.iso-panel .cap { padding: 13px 15px 15px; display: grid; gap: 6px; }
.iso-panel .cap b { font: 600 0.7rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.iso-panel .cap h3 { font: 650 1rem/1.25 var(--sans); }
.iso-panel .cap p { margin: 0; font-size: 0.84rem; color: var(--ink-3); line-height: 1.4; }
.iso-panel .cap .snr { font: 600 0.86rem/1 var(--mono); color: var(--ink); margin-top: 4px; }
.iso-panel.a .cap b { color: var(--teal); } .iso-panel.b .cap b { color: var(--amber); } .iso-panel.c .cap b { color: var(--rose); }

.chain { display: grid; gap: 10px; }
.chain-row { display: grid; grid-template-columns: 110px repeat(5, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.chain-row > * { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 8px; font: 500 0.74rem/1.35 var(--mono); color: var(--ink-2); text-align: center; min-width: 0; }
.chain-row > .lbl { background: transparent; border: 0; text-align: left; font: 650 0.84rem/1.25 var(--sans); color: var(--ink); display: flex; align-items: center; padding-left: 0; }
.chain-row.head > * { background: transparent; border: 0; font: 600 0.64rem/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding-block: 0; }
.chain-row b { display: block; color: var(--ink); font-weight: 600; font-size: 0.86rem; }
.chain-row .hot { border-color: var(--amber); background: #2a2114; }
.chain-row .bad { border-color: var(--rose); background: #2a1512; }
.chain-scroll { overflow-x: auto; }
.chain-scroll .chain { min-width: 640px; }

/* ---------- Macro ---------- */
.sensor-view { position: relative; aspect-ratio: 3 / 2; background: #1a2a1c; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); }
.sensor-view svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Guess first ---------- */
.predict { border: 1px solid var(--line-2); border-left: 3px solid var(--violet); background: var(--panel); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 16px 20px 18px; margin: 0 0 18px; }
.predict-kicker { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--violet); margin: 0 0 9px; }
.predict-q { font-size: 1.08rem; color: var(--ink); margin: 0 0 12px; max-width: 74ch; }
.predict-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.predict-opts button { text-align: left; font: 550 0.92rem/1.25 var(--sans); color: var(--ink); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; cursor: pointer; transition: border-color .15s; }
.predict-opts button:hover:not(:disabled) { border-color: var(--violet); }
.predict-opts button:disabled { cursor: default; color: var(--ink-3); }
.predict-opts button small { display: block; font: 600 0.62rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 5px; }
.predict-opts button.is-right { border-color: var(--teal); color: var(--teal); }
.predict-opts button.is-picked:not(.is-right) { border-color: var(--rose); color: var(--rose); }
.predict-why { color: var(--ink-3); font-size: 0.84rem; margin: 10px 0 0; }
.predict-result { margin-top: 14px; max-width: 74ch; }
.predict-result p { margin: 0 0 10px; color: var(--ink-2); }
.predict-result .predict-verdict { font-weight: 650; color: var(--ink); }
@media (max-width: 700px) { .predict { padding: 14px 14px 16px; } .predict-opts button { flex: 1 1 100%; } }
.stage, .lens-card, .iso-panels { scroll-margin-top: 76px; }

/* ---------- Diagram legend ---------- */
.legend { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 14px 18px 16px; margin: 0 0 18px; }
.legend h2 { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 22px; }
.legend li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; line-height: 1.4; color: var(--ink-2); }
.legend li svg { flex: 0 0 34px; width: 34px; height: 22px; margin-top: 1px; }
.legend li b { color: var(--ink); font-weight: 600; }

/* ---------- Check yourself ---------- */
.recall { margin-top: 46px; }
.recall-note { color: var(--ink-3); font-size: 0.92rem; }
details.recall-item { border: 1px solid var(--line); border-radius: var(--r-sm); margin: 10px 0; background: var(--bg-2); }
details.recall-item summary { cursor: pointer; padding: 13px 16px 13px 44px; position: relative; list-style: none; }
details.recall-item summary::-webkit-details-marker { display: none; }
details.recall-item summary::before { content: 'Q'; position: absolute; left: 16px; top: 14px; font: 700 0.86rem/1.4 var(--mono); color: var(--teal); }
details.recall-item summary span { display: block; font-weight: 600; color: var(--ink); }
details.recall-item summary small { display: block; margin-top: 5px; font: 600 0.66rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
details.recall-item summary:hover small { color: var(--teal); }
details.recall-item[open] summary small { display: none; }
details.recall-item .recall-a { position: relative; padding: 0 16px 14px 44px; color: var(--ink-2); }
details.recall-item .recall-a::before { content: 'A'; position: absolute; left: 16px; top: 0; font: 700 0.86rem/1.6 var(--mono); color: var(--amber); }
details.recall-item .recall-a p { margin: 0; }

/* ---------- 3D model (depth of field lab) ---------- */
.view-seg { margin-bottom: 10px; }
.dio { position: relative; width: 100%; aspect-ratio: 3 / 2; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); background: radial-gradient(120% 95% at 50% 0%, #22303a 0%, #141a1f 52%, #0c0d0f 100%); isolation: isolate; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.dio.is-drag { cursor: grabbing; }
.dio:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.dio > svg, .dio-layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.dio-world { pointer-events: none; isolation: isolate; }
.dio-world .sh { display: none; }
.dio-sprite { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.dio-ground text { font: 600 11px/1 var(--mono); fill: var(--ink-3); }
.dio-tags { position: absolute; inset: 0; pointer-events: none; }
.dio-handle { position: absolute; transform: translate(-50%, -50%); font: 700 0.72rem/1 var(--mono); padding: 7px 9px; border-radius: 999px; background: #bff5ec; color: #04201c; white-space: nowrap; cursor: ew-resize; touch-action: none; box-shadow: 0 0 0 3px rgba(95,212,196,.28), 0 4px 12px rgba(0,0,0,.5); }
.dio-inset { position: absolute; left: 10px; top: 10px; width: 27%; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,.3); background: #000; box-shadow: 0 6px 18px rgba(0,0,0,.5); pointer-events: none; }
.dio-inset span { position: absolute; left: 6px; top: 6px; font: 600 0.58rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.55); padding: 4px 6px; border-radius: 4px; }
.dio-tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(12,13,15,.78); border: 1px solid var(--line-2); cursor: default; }
.dio-tools button { background: transparent; border: 0; color: var(--ink-2); font: 600 0.74rem/1 var(--sans); padding: 8px 9px; border-radius: 7px; cursor: pointer; min-width: 30px; }
.dio-tools button:hover { color: var(--ink); background: rgba(255,255,255,.08); }
.dio-status { position: absolute; left: 10px; bottom: 10px; margin: 0; max-width: calc(100% - 20px); font: 600 0.7rem/1.3 var(--mono); color: var(--ink-2); background: rgba(12,13,15,.74); padding: 6px 9px; border-radius: 7px; pointer-events: none; }
.dio-status b { color: var(--teal); font-weight: 600; }
.dio-hint { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); margin: 0; font: 600 0.7rem/1 var(--mono); color: var(--ink-2); background: rgba(12,13,15,.7); padding: 7px 9px; border-radius: 7px; pointer-events: none; transition: opacity .4s; }
.dio-hint.is-gone { opacity: 0; }
.dio-caption { margin: 0; }
@media (max-width: 700px) {
  .dio { aspect-ratio: 1 / 1.08; }
  .dio-inset { width: 34%; left: 6px; top: 6px; }
  .dio-hint { display: none; }
  .dio-tools { left: 6px; right: 6px; top: auto; bottom: 6px; justify-content: space-between; }
  .dio-tools button { padding: 9px 8px; }
  .dio-status { left: 6px; bottom: 50px; }
  .dio-tags .vf-tag { font-size: 0.58rem; padding: 4px 5px; }
}

/* ---------- Take-apart lens (focus lab) ---------- */
.lens-stage { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(250px, 1fr); gap: 16px; align-items: start; }
.lens-stage > * { min-width: 0; }
.lens-side { display: grid; gap: 14px; }
.lens3d { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: radial-gradient(120% 95% at 50% 0%, #22303a 0%, #141a1f 52%, #0c0d0f 100%); cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.lens3d.is-drag { cursor: grabbing; }
.lens3d:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.lens3d canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.lens3d-labels { position: absolute; inset: 0; pointer-events: none; }
.lens3d-label { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; font: 600 0.68rem/1 var(--mono); padding: 5px 7px; border-radius: 6px; background: rgba(10,10,10,.8); color: #d8d2c4; border: 1px solid rgba(255,255,255,.22); white-space: nowrap; cursor: pointer; }
.lens3d-label.is-on { background: var(--amber-2); color: var(--amber-ink); border-color: var(--amber-2); }
.lens-parts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lens-card .chip[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.lens-info { min-height: 3em; color: var(--ink-2); font-size: 0.95rem; margin: 12px 0 0; max-width: 78ch; }
.lens-info strong { color: var(--ink); }
@media (max-width: 940px) { .lens-stage { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .lens3d { aspect-ratio: 4 / 3.4; } }

/* ---------- Color lab ---------- */
.cs-vf { cursor: crosshair; }
.cs-vf.is-picking { cursor: cell; }
.cs-pic { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cs-mark { position: absolute; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.65); border-radius: 2px; pointer-events: none; }
.cs-loupe { position: absolute; left: 10px; top: 10px; width: 31%; margin: 0; border: 1.5px solid #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.55); background: #000; pointer-events: none; }
.cs-loupe canvas { display: block; width: 100%; aspect-ratio: 3 / 2; image-rendering: pixelated; }
.cs-grid { position: absolute; left: 0; top: 0; right: 0; aspect-ratio: 3 / 2; opacity: 0; background-image: linear-gradient(to right, rgba(0,0,0,.5) 1px, transparent 1px), linear-gradient(to bottom, rgba(0,0,0,.5) 1px, transparent 1px); background-size: calc(100% / 24) calc(100% / 16); }
.cs-vf[data-stage="1"] .cs-grid, .cs-vf[data-stage="2"] .cs-grid { opacity: 1; }
.cs-loupe figcaption { font: 600 0.6rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.8); padding: 5px 7px; white-space: nowrap; overflow: hidden; }
.cs-pickmsg { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); margin: 0; background: var(--amber); color: var(--amber-ink); font: 600 0.8rem/1.2 var(--sans); padding: 7px 12px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
.pipe { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.pipe button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; color: var(--ink-2); font: 550 0.76rem/1.1 var(--sans); cursor: pointer; min-width: 0; }
.pipe button b { font: 600 0.7rem/1 var(--mono); color: var(--ink-3); }
.pipe button:hover { border-color: var(--amber); color: var(--ink); }
.pipe button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.pipe button[aria-pressed="true"] b { color: var(--amber-ink); }
.pipe-cap { margin: 8px 2px 0; font-size: 0.92rem; line-height: 1.45; color: var(--ink-2); min-height: 4.35em; }
.pipe-cap b { color: var(--ink); }
.pipe-cap .n { font: 600 0.68rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); margin-right: 4px; }
.panel-rule { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-look { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cs-patches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.cs-patches i { display: block; aspect-ratio: 1; border-radius: 4px; }
.cs-curve { display: block; width: 100%; height: auto; }
@media (max-width: 700px) {
  .pipe button span { display: none; }
  .pipe button { padding: 9px 2px; }
  .pipe button b { font-size: 0.84rem; }
  .pipe-cap { font-size: 0.82rem; line-height: 1.35; min-height: 5.4em; }
  .cs-loupe figcaption { display: none; }
  .cs-loupe { left: 6px; top: 6px; }
}

/* ---------- Glossary & Questions ---------- */
.page-head { padding: 44px 0 28px; max-width: 760px; }
.page-head p { color: var(--ink-2); font-size: 1.12rem; margin: 16px 0 0; }
.search { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--line-2); color: var(--ink); font: 500 1rem/1 var(--sans); padding: 13px 16px; border-radius: 12px; }
.search::placeholder { color: var(--ink-3); }
.gloss-tools { display: grid; gap: 14px; margin-bottom: 26px; }
.gloss-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.gloss-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px 18px 17px; scroll-margin-top: 80px; }
.gloss-item.is-target { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(95,212,196,.18); }
.gloss-item h3 { font-size: 1.16rem; margin-bottom: 4px; }
.gloss-item .cat { font: 600 0.62rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.gloss-item p { margin: 8px 0 0; font-size: 0.93rem; color: var(--ink-2); line-height: 1.55; }
.gloss-item a { font-size: 0.84rem; font-weight: 600; display: inline-block; margin-top: 10px; }
.empty { color: var(--ink-3); padding: 30px 0; }

.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); scroll-margin-top: 80px; }
.faq details[open] { border-color: var(--line-2); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 20px; font: 560 1.16rem/1.3 var(--display); display: flex; gap: 14px; align-items: baseline; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '+'; font: 600 1.1rem/1 var(--mono); color: var(--amber); flex: none; }
.faq details[open] summary::before { content: '−'; }
.faq .a { padding: 0 20px 18px 46px; color: var(--ink-2); }
.faq .a .short { color: var(--ink); font-weight: 600; }
.faq .a .see { font-weight: 600; font-size: 0.9rem; }
.faq-group { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 26px 0 4px; }
.faq-intro { color: var(--ink-2); font-size: 0.95rem; margin: 4px 0 6px; max-width: 70ch; }
.view { display: inline-block; font: 600 0.64rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 7px; border-radius: 5px; margin-right: 6px; vertical-align: 2px; border: 1px solid currentColor; }
.view.one { color: var(--violet); }
.view.two { color: var(--teal); }
.view.ours { color: var(--amber); }
.faq .a .sources { font-size: 0.82rem; line-height: 1.6; color: var(--ink-3); border-top: 1px solid var(--line, rgba(255,255,255,0.1)); padding-top: 10px; margin-top: 14px; }
.faq .a .sources span { font: 600 0.64rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; margin-right: 6px; }
.faq .a .sources a { color: var(--ink-2); }
.callout.split { border-color: var(--violet); }
.callout.split .callout-title { color: var(--violet); }
@media (max-width: 520px) { .faq .a { padding-left: 20px; } }

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

/* Small-screen header (kept last so it overrides the base rules above) */
@media (max-width: 520px) {
  .nav { gap: 0; }
  .nav a { padding: 8px 8px; font-size: 0.9rem; }
  .site-header-in { gap: 6px; }
  .brand { font-size: 1.05rem; gap: 7px; }
  .brand svg { width: 22px; height: 22px; }
}

/* ---------- Metering lab ---------- */
.mt-vf { background: #000; }
.mt-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mt-vf.is-spot { cursor: crosshair; }
.mt-spot { position: absolute; width: 5.56%; min-width: 22px; aspect-ratio: 1; padding: 0; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #fff; background: transparent; box-shadow: 0 0 0 2px rgba(0,0,0,.65), inset 0 0 0 2px rgba(0,0,0,.45); cursor: grab; touch-action: none; z-index: 2; }
.mt-spot::before { content: ''; position: absolute; inset: -12px; border-radius: 50%; }
.mt-spot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.mt-spot:active { cursor: grabbing; }
.mt-spot[hidden] { display: none; }
.mt-hist { margin-top: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px 6px; }
.mt-hist svg { display: block; width: 100%; height: 76px; background: var(--bg-2); border-radius: 5px; }
.mt-axis { position: relative; display: flex; justify-content: space-between; font: 500 0.66rem/1 var(--mono); letter-spacing: 0.06em; color: var(--ink-3); padding-top: 6px; }
.mt-axis .mid { position: absolute; top: 6px; transform: translateX(-50%); }
.mt-counts { margin: 0; font-size: 0.88rem; color: var(--ink-3); }
.mt-counts b { font-family: var(--mono); font-weight: 600; color: var(--ink-2); }
.mt-counts b.w { color: #ff7d6e; }
.mt-counts b.k { color: #7fa2ff; }
.mt-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px 13px; }
.mt-box p { margin: 10px 0 0; font-size: 0.86rem; line-height: 1.45; color: var(--ink-2); }
.mt-box p b { color: var(--ink); font-weight: 600; }
.mt-sws { display: flex; align-items: center; gap: 10px; font: 500 0.66rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.mt-sws span { display: grid; gap: 6px; justify-items: center; }
.mt-sws i { display: block; width: 54px; height: 34px; border-radius: 6px; border: 1px solid var(--line-2); }
.mt-sws b { color: var(--ink-3); font-size: 1rem; margin-top: -14px; }
.ctrl[hidden] { display: none; }
@media (max-width: 700px) { .mt-hist svg { height: 52px; } .mt-hist { margin-top: 6px; padding: 6px 8px 5px; } }

/* ---------- shared: saved guesses, challenges, take-away tasks, lab decision ---------- */
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 0.86rem; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--amber); }
.predict-verdict small { font: 500 0.8rem/1 var(--sans); color: var(--ink-3); margin-left: 6px; }
.predict-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 12px 0 0; }

.lab-decision { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink); font-size: 1rem; max-width: 62ch; }
.lab-decision span { display: block; font: 600 0.7rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); margin-bottom: 7px; }
.lab-decision small { display: block; color: var(--ink-3); font-size: 0.84rem; margin-top: 6px; }

.lab-strip a.is-seen:not([aria-current="page"]) b { color: var(--teal); }
.lab-card .num small { font: 500 0.7rem/1 var(--mono); letter-spacing: 0.04em; color: var(--ink-3); margin-left: 10px; text-transform: none; }
.lab-card.is-seen .num small { color: var(--teal); }

.challenges { border: 1px solid var(--line-2); border-left: 3px solid var(--rose); background: var(--panel); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 16px 20px 14px; margin: 22px 0; }
.challenges-kicker { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--rose); margin: 0 0 9px; }
.challenges-intro { color: var(--ink-2); font-size: 0.94rem; margin: 0 0 12px; max-width: 74ch; }
.challenges-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.challenges-list li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.challenges-box { width: 20px; height: 20px; margin-top: 3px; border: 2px solid var(--line-2); border-radius: 6px; position: relative; }
.challenges-list li.is-done .challenges-box { border-color: var(--teal); background: var(--teal); }
.challenges-list li.is-done .challenges-box::after { content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--bg); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.challenges-label { margin: 0; color: var(--ink); max-width: 74ch; }
.challenges-state { color: var(--teal); font-weight: 600; }
.challenges-hint { margin-top: 4px; font-size: 0.9rem; color: var(--ink-2); }
.challenges-hint summary { cursor: pointer; color: var(--ink-3); font-size: 0.84rem; width: fit-content; }
.challenges-hint p { margin: 6px 0 0; max-width: 70ch; }
.challenges-done { margin: 6px 0 0; color: var(--ink-2); font-size: 0.94rem; max-width: 70ch; }
.challenges-foot { margin: 12px 0 0; color: var(--ink-3); font-size: 0.84rem; display: flex; gap: 14px; align-items: center; }

.takeaway { margin: 46px 0 0; padding-top: 30px; border-top: 1px solid var(--line); }
.takeaway h2 { margin-bottom: 8px; }
.takeaway-note { color: var(--ink-2); margin: 0 0 18px; }
.takeaway-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.takeaway-ways > div { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: var(--r-sm); padding: 16px 18px; }
.takeaway-ways > div:nth-child(2) { border-top-color: var(--teal); }
.takeaway-ways > div:nth-child(3) { border-top-color: var(--violet); }
.takeaway-ways h3 { font-size: 1.05rem; margin-bottom: 7px; }
.takeaway-ways p { color: var(--ink-2); font-size: 0.95rem; margin: 0; }
.takeaway-reflect { margin: 16px 0 0; padding: 14px 18px; border-left: 3px solid var(--violet); background: var(--panel); border-radius: 0 var(--r-sm) var(--r-sm) 0; max-width: 78ch; }
.takeaway-reflect span { display: block; font: 600 0.7rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--violet); margin-bottom: 7px; }

.hero-progress { flex-basis: 100%; margin: 2px 0 0; color: var(--ink-3); font-size: 0.88rem; }

@media (max-width: 420px) {
  .nav { gap: 0; }
  .nav a { padding: 8px 6px; font-size: 0.86rem; }
  .brand { font-size: 0.98rem; gap: 6px; }
  .site-header-in { gap: 4px; }
}

/* The name is three words: on a phone it stacks on two lines so the nav still fits. */
@media (max-width: 460px) {
  .brand { font-size: 0.92rem; line-height: 1.08; }
  .brand-rest { display: block; }
}
@media (max-width: 340px) { .brand svg { display: none; } }
