* { box-sizing: border-box }
:root {
  color-scheme: dark; --ink:#edf7f7; --sub:#a9c3cc; --faint:#71929e; --bg:#0b2029;
  --panel:#102a35; --line:#2a4853; --warm:#ffd08c; --selection:#8de0d5;
  font-family: Inter, system-ui, sans-serif; background:var(--bg); color:var(--ink);
}
body { margin:0; min-width:280px; }
button,a { -webkit-tap-highlight-color: transparent; }
button { font:inherit; color:inherit; cursor:pointer; min-height:42px; }
:focus-visible { outline:2px solid var(--warm); outline-offset:3px; }
[hidden] { display:none !important; }
.hero { position:relative; min-height:clamp(260px,29vw,390px); display:flex; align-items:end; overflow:hidden; border-bottom:1px solid #447282; }
.hero img,.hero::after { position:absolute; inset:0; width:100%; height:100%; }
.hero img { object-fit:cover; object-position:center 60%; }
.hero::after { content:""; background:linear-gradient(90deg,#071b25ef 0%,#071b25c7 26%,transparent 75%),linear-gradient(0deg,#0b2029 0%,transparent 36%); }
.hero-copy,main,footer { width:min(1220px,calc(100% - 64px)); margin-inline:auto; }
.hero-copy { position:relative; z-index:1; padding-bottom:clamp(24px,4vw,54px); }
.eyebrow { margin:0; text-transform:uppercase; font-size:.72rem; letter-spacing:.19em; font-weight:750; color:var(--selection); }
.eyebrow span { display:inline-block; width:8px; height:8px; background:var(--selection); border-radius:50%; margin-right:5px; box-shadow:0 0 18px #8de0d5; }
h1,h2,h3,p { margin:0; }
h1,.subtitle,.board h2 { font-family:Georgia,serif; font-weight:400; }
h1 { font-size:clamp(4rem,9vw,7.5rem); line-height:.96; letter-spacing:-.075em; margin-left:-.06em; margin-top:7px; }
.subtitle { color:#e2ecf3; font-size:clamp(1.3rem,3.2vw,2rem); margin-top:7px; }
.intro { color:var(--sub); margin-top:12px; max-width:32ch; line-height:1.45; }
.campaign { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:18px 0; }
.level-list { display:flex; gap:7px; flex-wrap:wrap; }
.level-list button,.segmented button,.secondary button { background:#0c232d; border:1px solid var(--line); border-radius:6px; }
.level-list button { width:42px; font-size:.85rem; font-variant-numeric:tabular-nums; color:var(--sub); }
.level-list button.done { color:var(--selection); }
.level-list button[aria-current="step"],.segmented button[aria-pressed="true"] { background:#224956; color:var(--ink); border-color:#76c9bf; }
.progress,.row-head span,.preview-head span,.meter span,small { color:var(--sub); font-size:.74rem; }
.workbench { display:grid; grid-template-columns:minmax(0,1fr) minmax(265px,330px); align-items:start; gap:16px; }
.board,.controls { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:clamp(14px,2.2vw,28px); min-width:0; }
.board-header,.row-head,.preview-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.board h2 { font-size:clamp(1.8rem,4vw,3rem); margin-top:4px; }
.meter { text-align:center; min-width:76px; padding:6px 8px; border:1px solid var(--line); border-radius:7px; }
.meter strong { display:block; color:var(--warm); line-height:1; font:400 1.75rem Georgia,serif; }
#note,.instructions { color:var(--sub); font-size:.9rem; line-height:1.5; }
#note { margin:12px 0 21px; }
h3 { font-size:.79rem; letter-spacing:.045em; font-weight:720; }
small { font-weight:400; margin-left:4px; letter-spacing:0; }
.ribbon { display:grid; width:100%; grid-template-columns:repeat(var(--columns),minmax(0,1fr)); gap:3px; margin:7px 0 13px; min-height:25px; }
.band { display:grid; place-items:center; height:clamp(30px,4vw,47px); color:#f0fbfc; border:1px solid #ffffff48; border-radius:5px; font-weight:800; font-size:clamp(.73rem,2vw,1.24rem); box-shadow:inset 0 0 11px #12232b50; background-position:center; background-size:cover; }
.band.F { color:#102d3e; background-color:#c8e4ec; background-image:linear-gradient(115deg,#e7f9f9d4,#c1dfe9d9),url("./research-hut.webp"); }
.band.D { background-color:#124d6e; background-image:linear-gradient(115deg,#1f6993cc,#114162df),url("./research-hut.webp"); }
.band.C { color:#172b35; background-color:#80c4c3; background-image:linear-gradient(115deg,#97d8d5e6,#5fb3b4cb),url("./research-hut.webp"); }
.band.A { background-color:#554d66; background-image:linear-gradient(115deg,#766681e5,#3d364fe3),url("./research-hut.webp"); }
.band.S { color:#38281b; background-color:#dcaf72; background-image:linear-gradient(115deg,#f2d1a1ed,#d3a05cdf),url("./research-hut.webp"); }
.band.tear,.band.empty { background:#0d2530; border:1px dashed #49717e; box-shadow:none; color:var(--sub); }
.band.chosen { outline:2px solid var(--warm); outline-offset:-2px; }
.band.spent { opacity:.28; }
.band.conflict { outline:2px solid #ffa091; outline-offset:-2px; }
.trays { border-top:1px solid var(--line); margin-top:18px; padding-top:15px; }
.tray { width:min(100%,calc(var(--columns) * 49px)); }
#legend { display:flex; flex-wrap:wrap; gap:6px 12px; padding-top:4px; }
.key { display:flex; align-items:center; gap:5px; color:var(--sub); font-size:.74rem; }
.key .band { width:21px; height:21px; font-size:.73rem; }
.controls h2 { font:400 1.6rem Georgia,serif; }
.instructions { margin:8px 0 15px; }
.choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.segmented { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; margin:6px 0 13px; }
.segmented button { padding:0; font-size:.89rem; }
.segmented.lead { grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:16px; }
button:disabled { opacity:.42; cursor:default; }
button:hover:enabled { border-color:var(--selection); }
.preview { width:min(100%,calc(var(--columns)*48px)); margin-bottom:8px; }
.feedback { min-height:3.1em; font-size:.84rem; line-height:1.45; color:var(--sub); margin:3px 0 10px; }
.feedback.good { color:var(--selection); }
.feedback.warn { color:#ffd096; }
.primary { width:100%; background:#f2ca8a; color:#182b30; border:1px solid transparent; border-radius:7px; font-weight:760; padding:0 13px; min-height:44px; display:flex; justify-content:space-between; align-items:center; }
.secondary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin-top:9px; }
.secondary button { padding:0; font-size:.81rem; }
footer { color:var(--sub); font-size:.74rem; padding-block:22px; }
a { color:var(--selection); text-underline-offset:3px; }
@media (max-width:820px) { .hero-copy,main,footer { width:calc(100% - 36px); } }
@media (max-width:685px) {
  .workbench { grid-template-columns:minmax(0,1fr); }
  .hero { min-height:238px; }
  .hero img { object-position:58% 58%; }
  .hero::after { background:linear-gradient(90deg,#071b25ed,#071b2547 95%),linear-gradient(0deg,#0b2029 0%,transparent 35%); }
  .campaign { gap:7px; }
  .level-list { gap:3px; }
  .level-list button { width:35px; }
  .ribbon { gap:2px; }
  .band { border-radius:3px; }
}
@media (max-width:365px) {
  .hero-copy,main,footer { width:calc(100% - 22px); }
  .campaign { flex-wrap:wrap; }
  .ribbon { gap:1px; }
  small,.row-head span { font-size:.68rem; }
}
