/* Publishing on Nintendo Switch 2 — course stylesheet.
   Editorial handbook look. No stock "AI" palette, no Inter, no hero gradients. */
:root {
  --paper: #f3ead6;
  --paper-2: #fffaf0;
  --ink: #1a1714;
  --ink-soft: #3c372f;
  --rule: #c9b89a;
  --rule-strong: #8a7a62;
  --rust: #8f2d14;
  --rust-deep: #6a1f0d;
  --forest: #2c4a32;
  --forest-soft: #dce8d8;
  --navy: #1d3a4d;
  --amber: #8a5a12;
  --amber-soft: #f3e2b8;
  --nda: #3b2a4a;
  --nda-soft: #ece4f1;
  --warn: #7a2e12;
  --warn-soft: #f3d5c6;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Source Serif 4", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "Source Code Pro", ui-monospace, Menlo, Consolas, monospace;
  --measure: 42rem;
  --radius: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 400px at 10% -10%, #efe4c9 0%, transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.55;
  letter-spacing: 0.01em;
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.8rem;
  z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.frame { max-width: 76rem; margin: 0 auto; padding: 1.25rem 1.25rem 4rem; }

.mast {
  border-bottom: 3px solid var(--ink);
  padding: 0.75rem 0 1.25rem;
  margin-bottom: 1.5rem;
}
.kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 0 0 0.4rem;
}
.wordmark {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  max-width: 18ch;
}
.wordmark:hover, .wordmark:focus { color: var(--rust); }
.deck {
  margin: 0.75rem 0 0;
  max-width: 40rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.layout {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.rail {
  position: sticky;
  top: 0.75rem;
  border-right: 1px solid var(--rule);
  padding: 0 1.1rem 1rem 0;
  font-family: var(--sans);
  font-size: 0.86rem;
}
.progress-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 0.85rem 0.9rem 1rem;
  margin-bottom: 1rem;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.bar {
  height: 0.45rem;
  background: #e6d9bc;
  border: 1px solid var(--ink);
}
.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--rust);
  transition: width 0.3s ease;
}
.rail h2 {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  color: var(--ink-soft);
  font-weight: 600;
}
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail li { margin: 0 0 0.15rem; }
.rail a {
  color: var(--ink);
  text-decoration: none;
  display: grid;
  grid-template-columns: 1.1rem 1.4rem 1fr;
  gap: 0.25rem;
  padding: 0.28rem 0.2rem;
  line-height: 1.25;
  border-left: 2px solid transparent;
}
.rail a:hover, .rail a:focus { background: #efe4c8; }
.rail a[aria-current="page"] {
  border-left-color: var(--rust);
  background: var(--paper-2);
  font-weight: 600;
}
.tick { color: var(--forest); font-weight: 700; }
.tick.empty { color: var(--rule-strong); font-weight: 400; }
.num { color: var(--rust); font-variant-numeric: tabular-nums; }
.rail .kit-link, .rail .src-link {
  display: block;
  margin-top: 0.85rem;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rail button.reset {
  margin-top: 1rem;
  font: inherit;
  font-size: 0.75rem;
  background: none;
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}
.rail button.reset:hover { border-color: var(--ink); color: var(--ink); }

main { min-width: 0; max-width: 46rem; }
main h1 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.module-tag {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 0 0 0.35rem;
}
.lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
  max-width: var(--measure);
}
main p, main li { max-width: var(--measure); }
main h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.6rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--rule);
}
main h3 { font-size: 1.08rem; margin: 1.4rem 0 0.4rem; }
main a { color: var(--navy); text-underline-offset: 2px; }
main a:hover { color: var(--rust); }
main ul, main ol { padding-left: 1.2rem; }
main li { margin: 0.3rem 0; }
main strong { font-weight: 700; }

.note, .official, .unverified, .nda, .do, .alert {
  border: 1px solid var(--rule);
  padding: 0.85rem 1rem 0.95rem;
  margin: 1.1rem 0;
  background: var(--paper-2);
  max-width: 44rem;
}
.note > :first-child, .official > :first-child, .unverified > :first-child,
.nda > :first-child, .do > :first-child, .alert > :first-child { margin-top: 0; }
.note > :last-child, .official > :last-child, .unverified > :last-child,
.nda > :last-child, .do > :last-child, .alert > :last-child { margin-bottom: 0; }
.official { border-left: 5px solid var(--forest); }
.unverified { border-left: 5px solid var(--amber); background: var(--amber-soft); }
.nda { border-left: 5px solid var(--nda); background: var(--nda-soft); }
.do { border-left: 5px solid var(--navy); }
.alert { border-left: 5px solid var(--rust); background: var(--warn-soft); }
.flag {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.official .flag { color: var(--forest); }
.unverified .flag { color: var(--amber); }
.nda .flag { color: var(--nda); }
.do .flag { color: var(--navy); }
.alert .flag { color: var(--rust); }

.module-grid, .hub-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
  display: grid;
  gap: 0.65rem;
}
.module-grid a, .hub-list a {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 0.85rem 1rem;
}
.module-grid a:hover, .hub-list a:hover { border-color: var(--ink); }
.module-grid .n, .hub-list .n {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
  display: block;
  margin-bottom: 0.15rem;
}
.module-grid h2, .hub-list h2 { border: 0; margin: 0; padding: 0; font-size: 1.2rem; }
.module-grid p, .hub-list p { margin: 0.25rem 0 0; color: var(--ink-soft); font-size: 1rem; }

.sources { font-size: 0.95rem; }
.sources li { margin: 0.45rem 0; }
cite, .cite { font-style: normal; font-family: var(--sans); font-size: 0.85rem; color: var(--ink-soft); }

.checklist { list-style: none; padding: 0; margin: 0.8rem 0 1.2rem; max-width: 44rem; }
.checklist li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 0.55rem 0.7rem;
  margin: 0.35rem 0;
}
.checklist input {
  margin-top: 0.35rem;
  accent-color: var(--forest);
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
}
.checklist label { cursor: pointer; }

.quiz {
  background: var(--paper-2);
  border: 1px solid var(--ink);
  padding: 1rem 1.1rem 1.2rem;
  margin: 1.2rem 0 1.6rem;
  max-width: 44rem;
}
.quiz h2 { border: 0; margin: 0 0 0.6rem; padding: 0; }
.q { margin: 1rem 0 0; padding-top: 0.8rem; border-top: 1px dashed var(--rule); }
.q p { margin: 0 0 0.45rem; font-weight: 700; }
.q label {
  display: block;
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.28rem 0.2rem;
  cursor: pointer;
}
.q input { margin-right: 0.4rem; accent-color: var(--navy); }
.quiz button, .actions button, a.btn {
  font-family: var(--sans);
  font-size: 0.95rem;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  margin: 0.8rem 0.4rem 0 0;
}
.quiz button:hover, .actions button:hover, a.btn:hover { background: var(--rust); border-color: var(--rust); }
a.btn.secondary, button.secondary {
  background: transparent;
  color: var(--ink);
}
a.btn.secondary:hover, button.secondary:hover { color: var(--paper); }
.feedback { margin-top: 0.5rem; font-size: 0.98rem; }
.feedback.ok { color: var(--forest); }
.feedback.bad { color: var(--rust-deep); }
.score {
  font-family: var(--sans);
  margin-top: 0.8rem;
  font-weight: 600;
}

.actions { margin: 1.6rem 0 0.5rem; }
.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  margin-top: 2rem;
  padding-top: 1rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.pager a { color: var(--navy); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  margin: 0.8rem 0 1.2rem;
  background: var(--paper-2);
}
th, td {
  border: 1px solid var(--rule);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}
th {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #efe4c8;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.2rem 0 1.6rem;
}

footer.colophon {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 3px solid var(--ink);
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-soft);
  max-width: 46rem;
}
footer.colophon p { margin: 0.3rem 0; }

.mobile-nav { display: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 1.2rem; }
  .rail {
    position: static;
    border-right: 0;
    padding: 0;
    display: none;
  }
  .rail.open { display: block; border-bottom: 1px solid var(--rule); padding-bottom: 1rem; }
  .mobile-nav { display: block; margin-bottom: 0.6rem; }
  .mobile-nav button {
    font-family: var(--sans);
    background: var(--paper-2);
    border: 1px solid var(--ink);
    color: var(--ink);
    padding: 0.4rem 0.7rem;
    cursor: pointer;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar > span { transition: none; }
}

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .rail, .mobile-nav, .quiz button, .reset, .hero-cta, .skip { display: none !important; }
  .layout { display: block; }
  a { color: inherit; }
  .frame { max-width: none; padding: 0; }
  .note, .official, .unverified, .nda, .do, .alert, .quiz { break-inside: avoid; }
}
