:root{color-scheme:dark;--bg:#080f1d;--panel:#101c2e;--line:#263a57;--text:#f4f7ff;--muted:#bac8df;--blue:#a3c5ff;--surface:#132440;font-family:"Avenir Next",system-ui,sans-serif;line-height:1.55;background:var(--bg);color:var(--text)}
*{box-sizing:border-box}body{margin:0}h1,h2,h3,p{margin:0}a{color:var(--blue);text-underline-offset:.22em}img{display:block;max-width:100%}[hidden]{display:none!important}
:focus-visible{outline:3px solid #a0c7ff;outline-offset:4px}#main:focus{outline:none}.skip{position:absolute;left:12px;top:8px;transform:translateY(-150%);padding:9px;background:var(--panel);z-index:5}.skip:focus{transform:none}
.shell{width:min(1160px,calc(100% - 56px));margin-inline:auto}.site-header{border-bottom:1px solid var(--line);background:#0b1628}.top,.foot{display:flex;justify-content:space-between;align-items:center;gap:10px 20px;min-height:68px}.top a,.foot a{text-decoration:none}.logo{display:flex;align-items:center;gap:9px;color:var(--text);letter-spacing:.015em}.logo img{border-radius:8px}.logo span{color:var(--blue)}.top-links{display:flex;gap:16px;align-items:center}.top-links a{padding:9px 0;color:var(--muted)}.top-links [aria-current]{color:var(--text);box-shadow:inset 0 -2px #689aff}
.hero{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:clamp(24px,5vw,72px);padding:clamp(35px,6vw,73px) 0 40px;background:radial-gradient(ellipse at 78% 45%,#17417e45,transparent 68%)}
.eyebrow{color:var(--blue);font-weight:750;font-size:.83rem;letter-spacing:.09em;text-transform:uppercase}.eyebrow span{color:var(--muted);letter-spacing:0;text-transform:none}
h1{font-size:clamp(2.45rem,6vw,5.1rem);letter-spacing:-.055em;line-height:1.03}.hero h1{margin:7px 0 14px}.hero p:not(.eyebrow),.article-header>p:last-child{color:var(--muted);font-size:clamp(1rem,2vw,1.2rem)}.hero-art img{width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;border:1px solid #335582;border-radius:20px;box-shadow:0 18px 50px #020b1866}.button,.categories button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;border-radius:8px;border:1px solid #38547a;padding:8px 13px;background:var(--surface);color:var(--text);font:inherit;cursor:pointer;text-decoration:none}.button:hover,.categories button:hover{border-color:var(--blue)}.primary{margin-top:20px;border-color:#6197ff;background:#244fa5;font-weight:700}
.library{scroll-margin-top:18px;border-top:1px solid var(--line);padding:26px 0 55px}.library-heading{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:14px}.library h2{font-size:clamp(1.65rem,4vw,2.25rem);letter-spacing:-.027em}.library-heading p{color:var(--muted);white-space:nowrap}.fields{display:grid;grid-template-columns:1fr minmax(145px,225px);gap:12px}.fields label{display:grid;gap:5px;font-size:.93rem;font-weight:650}.fields input,.fields select{width:100%;min-height:46px;padding:8px 11px;border:1px solid var(--line);border-radius:8px;background:#0c182a;color:var(--text);font:inherit}.fields input::placeholder{color:#9dadc8}.fields select{appearance:none;padding-right:30px;background:linear-gradient(45deg,transparent 50%,#b0c9ee 50%) right 16px center/5px 5px no-repeat,linear-gradient(135deg,#b0c9ee 50%,transparent 50%) right 11px center/5px 5px no-repeat #0c182a}.categories{display:flex;flex-wrap:wrap;gap:7px;margin:13px 0 18px}.categories button{font-size:.9rem}.categories button[aria-pressed="true"]{background:#213c67;border-color:#80a9ef}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}.tile,.empty,.rail-box{border:1px solid var(--line);border-radius:14px;background:var(--panel);padding:16px}.tile{position:relative;transition:border-color 140ms ease}.tile:hover,.tile:focus-within{border-color:#688dca}.tile-top{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px;color:var(--muted);font-size:.84rem}.topic-icon{display:inline-grid;place-items:center;width:43px;height:43px;border-radius:10px;background:#1b345b;color:var(--accent,var(--blue));font-size:1.42rem;font-weight:750;line-height:1}.tone-0{--accent:#a5caff}.tone-1{--accent:#bcd4ff}.tone-2{--accent:#a2dfef}.tone-3{--accent:#cec8ff}.category-label{color:var(--accent,var(--blue));font-size:.84rem;font-weight:650}.tile h3{font-size:1.16rem;line-height:1.23;margin:5px 0 6px}.tile h3 a{color:var(--text);text-decoration:none}.tile h3 a:hover{text-decoration:underline}.tile h3 a::after{content:"";position:absolute;inset:0;border-radius:14px}.summary,.empty p{color:var(--muted);font-size:.96rem}.empty .button{margin-top:12px}
.crumb{padding-top:24px}.article-header{padding:24px 0;border-bottom:1px solid var(--line);margin-bottom:25px}.article-header .topic-icon{margin-bottom:10px}.article-header h1{font-size:clamp(2.25rem,5.3vw,4.4rem);margin:8px 0 10px}.article-layout{display:grid;grid-template-columns:minmax(0,2.4fr) minmax(235px,1fr);gap:30px;align-items:start;padding-bottom:45px}.readable{max-width:71ch;line-height:1.7}.readable section,.practice{margin-bottom:24px;scroll-margin-top:16px}.readable h2{font-size:1.5rem;line-height:1.2;margin-bottom:8px}.readable p,.readable ol{color:#d8e3f6}.readable ol,.sources ul{padding-left:1.4em}.readable li+li{margin-top:7px}.example,.safety,.practice{padding:13px 16px;border:1px solid var(--line);border-radius:10px;background:#11213a}.example{margin-top:13px}.safety{border-left:3px solid #85adeb}.practice summary{cursor:pointer;font-weight:750}.practice p{margin-top:7px}.rail{display:grid;gap:12px}.rail-box h2{font-size:1.07rem;margin:0 0 8px}.rail ul{list-style:none;margin:0;padding:0}.rail li+li{margin-top:7px}.guide-list span,.guide-list a{display:block}.guide-list p,.sources p{color:var(--muted);font-size:.88rem}.guide-list li+li{border-top:1px solid var(--line);padding-top:8px}.foot{border-top:1px solid var(--line);color:var(--muted);font-size:.9rem}
@media(max-width:820px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.article-layout{gap:16px}.hero{gap:22px}}
@media(max-width:630px){.shell{width:calc(100% - 32px)}.top{min-height:60px;gap:8px}.logo{gap:5px}.logo img{width:30px;height:30px}.top-links{gap:8px}.top-links a{font-size:.86rem}.hero,.article-layout{grid-template-columns:1fr}.hero{padding:29px 0 24px}.hero-art img{border-radius:13px}.hero h1 br{display:none}.article-layout{padding-bottom:25px}.rail{grid-template-columns:1fr}.fields{grid-template-columns:minmax(0,1fr) minmax(100px,.6fr)}.library{padding-top:20px}}
@media(max-width:470px){.grid{grid-template-columns:1fr}.fields{grid-template-columns:1fr}.library-heading h2{font-size:1.53rem}.tile{padding:14px}.tile-top{margin-bottom:8px}}
@media(prefers-reduced-motion:reduce){.tile{transition:none}}

/* Topic artwork and article reading rhythm. */
.tile { padding:17px 18px 19px; }
.tile-top {
  position:relative; min-height:65px; margin:-6px -7px 13px; padding:7px 9px;
  border:1px solid #2c4466; border-radius:10px;
  background:radial-gradient(ellipse at 14% 48%,#294b794f,transparent 68%),#0d192b;
}
.tile-top>span:last-child { font-variant-numeric:tabular-nums; }
.topic-icon { width:45px; height:45px; background:#1c3558; border:1px solid #3d5a83; }
.topic-icon svg { display:block; }
.tile h3 { font-size:1.19rem; margin:6px 0 7px; }
.tile .summary { line-height:1.52; }
.categories { margin-bottom:12px; }
.discovery { margin-bottom:16px; }
.clear-selection { min-height:44px; padding:0 6px; border:0; border-radius:5px; color:var(--blue); background:transparent; font:inherit; text-decoration:underline; text-underline-offset:.2em; cursor:pointer; }
#troubleshoot p+p { margin-top:9px; }
#troubleshoot strong { display:block; color:var(--text); }
.decision { padding:14px 16px; border:1px solid #36537a; border-radius:11px; background:#102039; }
.next-step>p { margin-bottom:9px; color:var(--muted); }
@media(max-width:630px){
  .tile h3{font-size:1.18rem}
  .tile .summary,.readable p,.readable li{font-size:1rem}
  .article-header{padding-top:18px}
  .readable section,.practice{margin-bottom:21px}
}
.next-step .guide-list { list-style:none; margin:0; padding:0; }
.next-step .guide-list li+li { margin-top:8px; }

/* Article thumbnails and instructional sequences share the site palette. */
.tile-top {
  min-height:76px;
  background:
    radial-gradient(ellipse at 13% 30%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 68%),
    repeating-linear-gradient(120deg, transparent 0 19px, #adcbff0e 19px 20px),
    #10213a;
}
.tile-top .topic-icon { box-shadow:0 5px 16px #060c20aa; }
.tile-top>span:last-child { padding:4px 8px; border-radius:6px; background:#091729; }
.hero h1 { font-size:clamp(2.45rem,5.5vw,4.75rem); }
.flow { margin:16px 0 0; padding:14px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.flow figcaption { margin-bottom:8px; color:var(--blue); font-weight:750; }
.flow ol { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0; padding:0; list-style:none; counter-reset:steps; }
.flow ol li { margin:0; counter-increment:steps; padding:9px; background:#152b50; border-radius:7px; line-height:1.4; }
.flow ol li::before { content:counter(steps); display:block; margin-bottom:4px; color:#d5e3ff; font-weight:750; }
.rail-box li p { margin-top:3px; color:var(--muted); font-size:.92rem; }
@media(max-width:630px) {
  .top-links { flex-wrap:wrap; justify-content:flex-end; column-gap:9px; row-gap:0; }
  .top-links a { padding:5px 0; }
}
@media(max-width:470px) { .flow ol { grid-template-columns:1fr; } }

/* Article artwork, numbered directions, and readable examples. */
.article-header {
  display:grid; grid-template-columns:minmax(0,1.35fr) minmax(240px,1fr);
  align-items:center; gap:clamp(20px,4vw,52px);
}
.article-intro>p:last-child { color:var(--muted); font-size:clamp(1rem,2vw,1.2rem); }
.article-header h1 { font-size:clamp(2.15rem,4.9vw,4.1rem); }
.article-art {
  color:var(--accent); border:1px solid #34527b; border-radius:16px; overflow:hidden;
  background:radial-gradient(ellipse at 50% 65%,#254e88 0, #12284a 48%,#0d182b 100%);
}
.article-art svg { display:block; width:100%; height:auto; }
.art-grid { fill:none; stroke:#a8c8ff28; }
.art-scene { filter:drop-shadow(0 3px 4px #071121aa); }
.art-accent { stroke:#f0f5ff; stroke-width:3.2; }
.readable .example,.readable .decision {
  padding:5px 0 5px 15px; border:0; border-left:2px solid #547fbb; border-radius:0; background:none;
}
.readable .decision { padding-left:0; border:0; }
.readable .instructions { padding:0; margin:12px 0 0; list-style:none; }
.instructions li { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:baseline; gap:10px; }
.instructions li+li { margin-top:10px; }
.instruction-label {
  width:max-content; border-bottom:1px solid #547fbb; color:var(--blue); font-size:.85rem; font-weight:750;
}
.flow { border:0; background:none; padding:0; }
.flow figcaption,.worksheet figcaption { margin-bottom:8px; color:var(--blue); font-weight:750; }
.flow ol li { border-left:2px solid #6e9fe2; background:#132743; }
.worksheet { margin:18px 0 0; }
.sheet { border:1px solid #6886a9; border-radius:10px; overflow:hidden; background:#f5f8fc; color:#132744; }
.readable .formula-bar {
  display:grid; grid-template-columns:auto auto 1fr; align-items:center; gap:8px;
  padding:7px 10px; border-bottom:1px solid #a9bbd1; background:#e0eafa; color:#142846;
}
.formula-bar span:first-child { padding:0 8px; border:1px solid #899fbc; background:white; }
.sheet table { border-collapse:collapse; table-layout:fixed; width:100%; font-size:.94rem; }
.sheet td,.sheet th { padding:4px 9px; border:1px solid #b4c4d8; }
.sheet thead th,.sheet thead td,.sheet tbody th { background:#e8eff8; }
.sheet th:first-child,.sheet thead td:first-child { width:3rem; text-align:center; }
.sheet tbody td:last-child { text-align:right; font-variant-numeric:tabular-nums; }
.sheet tbody tr:first-child,.sheet tbody tr:last-child { font-weight:750; }
.sheet [data-cell="B2"],.sheet [data-cell="B3"],.sheet [data-cell="B4"] { background:#d9e8ff; }
.sheet [data-cell="B5"] { outline:2px solid #285db5; outline-offset:-2px; background:#eaf3ff; }
.worksheet>p { margin-top:8px; font-size:.92rem; }
@media(max-width:700px) {
  .article-header { grid-template-columns:minmax(0,1fr); gap:14px; padding-bottom:18px; }
  .article-art { width:min(100%,380px); border-radius:11px; }
  .article-art svg { max-height:148px; }
}
@media(max-width:470px) {
  .article-art svg { max-height:118px; }
  .flow ol { gap:5px; }
  .flow ol li { display:flex; align-items:baseline; gap:9px; padding:7px 9px; }
  .flow ol li::before { margin-bottom:0; }
  .sheet td,.sheet th { padding:3px 6px; }
}

/* Shared light reading surfaces. The existing diagrams retain their own contrast. */
:root {
  color-scheme: light;
  --bg: var(--site-paper);
  --panel: var(--site-paper);
  --line: var(--site-line);
  --text: var(--site-ink);
  --muted: var(--site-muted);
  --blue: var(--site-accent);
  --surface: var(--site-tint);
}
.site-header { background: var(--site-paper); }
.hero { background: none; }
.tile-top, .decision { background: var(--site-tint); border-color: var(--site-line); }
.topic-icon, .tile-top > span:last-child { background: #eaf2ff; border-color: var(--site-line); color: var(--site-accent); }
.flow ol li { background: var(--site-tint); }
.flow ol li::before { color: var(--site-accent); }
:focus-visible { outline-color: var(--site-accent); }
.primary { background: var(--site-accent); color: #fff; }
.fields input, .fields select { background: var(--site-paper); }
.fields input::placeholder { color: var(--site-muted); }
.fields select { appearance: auto; }
.categories button[aria-pressed="true"] { background: #dce9ff; border-color: #6386ba; }
.category-label { color: var(--site-accent); }
.readable p, .readable ol { color: var(--site-muted); }
.example, .safety, .practice { background: var(--site-tint); }
