:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  --bg: #dde2e1;
  --paper: #eef0ee;
  --ink: #172630;
  --muted: #4b5f69;
  --accent: #a3213f;
  --accent-ink: #ffffff;
  --teal: #1f6f73;
  --rule: #b3bebe;
  --note: #e3ebea;
  --type: "Special Elite", "Courier New", Courier, monospace;
  --body: "Spectral", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1a21;
    --paper: #15242d;
    --ink: #dfe4e0;
    --muted: #93a5ae;
    --accent: #f0668a;
    --accent-ink: #1a0b12;
    --teal: #5cc1bd;
    --rule: #2b3f4a;
    --note: #1b2f39;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1a21;
  --paper: #15242d;
  --ink: #dfe4e0;
  --muted: #93a5ae;
  --accent: #f0668a;
  --accent-ink: #1a0b12;
  --teal: #5cc1bd;
  --rule: #2b3f4a;
  --note: #1b2f39;
}
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
*, *::before, *::after { box-sizing: inherit; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--teal); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.wrap { max-width: 42rem; margin: 0 auto; padding: 0 1.1rem 7rem; }

/* masthead */
.mast {
  padding: 3.5rem 0 2.2rem;
  border-bottom: 2px solid var(--ink);
  background-image: repeating-linear-gradient(101deg, transparent 0 22px, color-mix(in srgb, var(--teal) 14%, transparent) 22px 23px);
}
.series { font-family: var(--type); color: var(--muted); font-size: .95rem; margin: 0 0 .8rem; }
.mast h1 {
  font-family: var(--type);
  font-weight: 400;
  font-size: clamp(2.3rem, 9vw, 3.9rem);
  line-height: 1.02;
  margin: 0 0 1rem;
  letter-spacing: -.01em;
}
.mast .sub { font-style: italic; color: var(--muted); margin: 0; max-width: 34rem; }
.intro h2, .recap h2 { font-family: var(--type); font-weight: 400; font-size: 1.6rem; margin: 2.2rem 0 .6rem; }
.intro p, .intro li { max-width: 38rem; }
.intro ul { padding-left: 1.2rem; }
.start {
  display: inline-block; margin: .6rem 0 0; padding: .7rem 1.2rem;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font-family: var(--type); font-size: 1.1rem; border-radius: 2px;
}
.start:hover { filter: brightness(1.08); }

/* sections */
.sec {
  position: relative;
  margin: 2.6rem 0 0;
  padding: 0 0 2rem;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 12px;
}
.sec header { display: flex; align-items: baseline; gap: .9rem; margin-bottom: .6rem; }
.num {
  font-family: var(--type);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent);
  min-width: 2.4ch;
}
.sec h2 { font-family: var(--type); font-weight: 400; font-size: 1.5rem; margin: 0; }
.sec:target-unused { background: color-mix(in srgb, var(--paper) 78%, transparent); box-shadow: -5px 0 0 var(--accent); padding-left: 1rem; margin-left: -1rem; padding-right: 1rem; margin-right: -1rem; }
.sec p { margin: 0 0 1rem; }

/* choices */
.choices { margin-top: 1.4rem; display: grid; gap: .6rem; }
.choice {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .8rem 1rem;
  background: var(--paper);
  border-left: 4px solid var(--teal);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.5;
}
.choice:hover { border-left-color: var(--accent); background: color-mix(in srgb, var(--paper) 86%, var(--accent)); }
.turn { font-family: var(--type); font-size: .95rem; color: var(--accent); white-space: nowrap; }
@media (max-width: 30rem) { .choice { flex-direction: column; gap: .2rem; } }

/* evidence notes */
.note {
  margin: 1.2rem 0;
  padding: .8rem 1rem;
  background: var(--note);
  border: 1px dashed var(--muted);
}
.note p { margin: .3rem 0 .7rem; font-size: 1rem; line-height: 1.55; }
.note-h { font-family: var(--type); color: var(--accent); }
.rec {
  font-family: var(--type); font-size: .95rem; cursor: pointer;
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--ink); padding: .35rem .8rem; border-radius: 2px;
}
.rec:hover { background: var(--ink); color: var(--bg); }
.rec[disabled] { cursor: default; border-color: var(--teal); color: var(--teal); background: transparent; }

/* endings */
.theend { margin-top: 1.6rem; padding: 1.2rem 1.2rem 1rem; background: var(--ink); color: var(--bg); }
.end-h { font-family: var(--type); font-size: 1.3rem; }
.theend .soc { font-style: italic; margin: .7rem 0 1rem; }
.end-actions { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; }
.end-actions a { color: var(--bg); }
.theend .rec { color: var(--bg); border-color: var(--bg); }
.theend .rec:hover { background: var(--bg); color: var(--ink); }
.theend .rec[disabled] { color: var(--bg); border-color: var(--bg); opacity: .8; }

/* recap */
.recap h3 { font-family: var(--type); font-weight: 400; font-size: 1.25rem; margin: 2rem 0 .4rem; }
.tw { overflow-x: auto; margin: .8rem 0 1.4rem; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 1rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: .55rem .7rem; border-bottom: 1px solid var(--rule); }
thead th { font-family: var(--type); font-weight: 400; border-bottom: 2px solid var(--ink); }
tbody th { font-family: var(--type); font-weight: 400; color: var(--accent); white-space: nowrap; }
.qs { padding-left: 1.4rem; }
.qs li { margin-bottom: 1rem; }
.q { margin: 0 0 .3rem; }
.marks { font-family: var(--type); color: var(--muted); font-size: .95rem; white-space: nowrap; }
details summary { cursor: pointer; font-family: var(--type); color: var(--teal); }
details ul { margin: .4rem 0 0; padding-left: 1.2rem; font-size: 1rem; line-height: 1.55; }
.endings-found { list-style: none; padding: 0; }
.endings-found li { padding: .2rem 0; }
.endings-found li.found::before { content: "Found: "; font-family: var(--type); color: var(--teal); }
.endings-found li:not(.found)::before { content: "Not yet: "; font-family: var(--type); color: var(--muted); }

/* notebook pill and panel */
#nbBtn {
  position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  font-family: var(--type); font-size: 1rem; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  border: 0; padding: .7rem 1.1rem; border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
#nb {
  position: fixed; right: 14px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  width: min(23rem, calc(100vw - 28px)); max-height: 70vh; overflow: auto;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); padding: 1rem 1rem .8rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
#nb[hidden] { display: none; }
#nb h2 { font-family: var(--type); font-weight: 400; font-size: 1.25rem; margin: 0 0 .3rem; }
#nb h3 { font-family: var(--type); font-weight: 400; font-size: 1rem; margin: .9rem 0 .2rem; color: var(--muted); }
#nb ul { list-style: none; margin: 0; padding: 0; }
#nb li { display: flex; gap: .55rem; align-items: baseline; padding: .18rem 0; font-size: 1rem; line-height: 1.4; }
#nb input[type="checkbox"] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; flex: none; }
#nb .code { font-family: var(--type); color: var(--accent); min-width: 3.6rem; flex: none; }
#nb .small { font-size: .9rem; color: var(--muted); margin: .3rem 0 0; line-height: 1.4; }
#nbReset { margin-top: .8rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media print {
  #nbBtn, #nb, .choice .turn + *, .rec, .start { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .wrap { max-width: none; padding-bottom: 0; }
  .sec { break-inside: avoid; }
  .choice { border-left: 3px solid #000; background: none; }
  .theend { background: none; color: #000; border: 2px solid #000; }
  .theend a { color: #000; }
}

.sec { border-bottom: 0; margin-top: 2.2rem; }
.sec header { margin-bottom: .9rem; }
.num { font-size: 3.2rem; }
.sec h2 { font-size: 1.7rem; }
.crumb { font-family: var(--type); color: var(--muted); font-size: .95rem; margin: 2rem 0 0; }
.foot { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--type); font-size: .9rem; color: var(--muted); }

/* ===== ShortCutstv brand chrome (site skin) ===== */
:root {
  --sc-cyan: #29C4E8;
  --sc-cyan-bright: #73E5FB;
  --sc-yellow: #EEFA3C;
  --sc-ink: #0A0A0A;
  --sc-nav: #6F82E8;
  --sc-nav-hover: #29C4E8;
}
body { font-family: "Poppins", "Spectral", Georgia, serif; }

/* ---- site header ---- */
.sc-header {
  background: #fff;
  border-top: 4px solid var(--sc-ink);
  border-bottom: 1px solid #eaeaea;
}
.sc-header-inner {
  max-width: 68rem; margin: 0 auto; padding: .9rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.sc-logo { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 1.4rem; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.sc-logo .a { color: var(--sc-ink); }
.sc-logo .b { color: var(--sc-cyan); }
.sc-nav { display: flex; flex-wrap: wrap; gap: 1.1rem 1.3rem; }
.sc-nav a {
  font-family: "Poppins", sans-serif; font-weight: 600; font-size: .92rem;
  color: var(--sc-nav); text-decoration: none;
}
.sc-nav a:hover, .sc-nav a:focus-visible { color: var(--sc-nav-hover); }
.sc-nav a.current { color: var(--sc-ink); border-bottom: 2px solid var(--sc-cyan); padding-bottom: 2px; }

/* ---- title band (replaces plain masthead) ---- */
.sc-band {
  background: var(--sc-ink);
  position: relative;
  overflow: hidden;
}
.sc-band-inner { max-width: 68rem; margin: 0 auto; padding: 2.4rem 1.1rem 3.6rem; position: relative; z-index: 1; }
.sc-kicker { font-family: "Poppins", sans-serif; font-weight: 600; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--sc-cyan-bright); margin: 0 0 .5rem; }
.sc-band h1 {
  font-family: "Poppins", sans-serif; font-weight: 800; color: var(--sc-yellow);
  font-size: clamp(1.7rem, 6vw, 2.7rem); line-height: 1.08; margin: 0 0 .6rem; letter-spacing: -.01em;
}
.sc-band .sc-sub { color: #fff; font-family: "Poppins", sans-serif; font-weight: 400; font-size: 1.02rem; margin: 0; max-width: 40rem; opacity: .92; }
.sc-wave { display: block; width: 100%; height: auto; position: relative; z-index: 1; margin-top: -2px; }

/* content wrap sits on white below the band/wave */
.wrap { max-width: 42rem; margin: 0 auto; padding: 2.4rem 1.1rem 5rem; background: #fff; }
.mast, .intro h2 { border-bottom: none; }
.mast { display: none; } /* replaced by .sc-band */

.intro h2, .recap h2 { font-family: "Poppins", sans-serif; font-weight: 700; color: var(--sc-ink); }
.sec h2 { font-family: "Poppins", sans-serif; font-weight: 700; }
.num { color: var(--sc-cyan); font-family: "Poppins", sans-serif; font-weight: 800; }
.crumb a, .foot a { color: var(--sc-nav); }

.start, .choice, .rec { font-family: "Poppins", sans-serif !important; }
.start {
  background: var(--sc-cyan); color: #04252c; border-radius: 999px; font-weight: 700; font-size: 1rem;
  padding: .8rem 1.5rem;
}
.start:hover { background: var(--sc-cyan-bright); filter: none; }
.choice { border-left-color: var(--sc-cyan); }
.choice:hover { border-left-color: var(--sc-nav-hover); background: #eafbff; }
.turn { color: var(--sc-nav-hover); font-family: "Poppins", sans-serif; font-weight: 700; }
.note { background: #eafbff; border: 1px solid #bdeefc; }
.note-h { color: #0B7285; font-family: "Poppins", sans-serif; font-weight: 700; }
.rec { border-color: var(--sc-ink); font-weight: 600; border-radius: 999px; }
.rec:hover { background: var(--sc-ink); }
.theend { background: var(--sc-ink); }
.theend .end-h { color: var(--sc-yellow); font-family: "Poppins", sans-serif; }
thead th { font-family: "Poppins", sans-serif; }
tbody th { color: #0B7285; font-family: "Poppins", sans-serif; }
h3 { font-family: "Poppins", sans-serif; color: #0B7285; }
.marks { font-family: "Poppins", sans-serif; }

#nbBtn { background: var(--sc-cyan); color: #04252c; font-family: "Poppins", sans-serif; font-weight: 700; border-radius: 999px; }
#nb { border-color: var(--sc-ink); }
#nb h2 { font-family: "Poppins", sans-serif; color: var(--sc-ink); }
#nb h3 { font-family: "Poppins", sans-serif; }
.code { color: #0B7285 !important; }

/* ---- footer ---- */
.sc-footer { background: var(--sc-ink); color: #cfd8dc; margin-top: 2rem; }
.sc-footer-inner { max-width: 68rem; margin: 0 auto; padding: 2.4rem 1.1rem; }
.sc-footer h2 { font-family: "Poppins", sans-serif; color: #fff; font-size: 1.3rem; margin: 0 0 .8rem; }
.sc-footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.sc-footer-links a { color: var(--sc-cyan-bright); text-decoration: none; font-family: "Poppins", sans-serif; font-size: .95rem; }
.sc-footer-links a:hover { color: var(--sc-yellow); }
.sc-footer .credit { font-size: .85rem; color: #8b98a0; margin: 0; }

@media (max-width: 30rem) {
  .sc-band-inner { padding: 1.8rem 1.1rem 2.6rem; }
  .sc-nav { gap: .7rem 1rem; }
  .sc-nav a { font-size: .85rem; }
}
