:root {
  color-scheme: light dark;
  --canvas: #ffffff;
  --surface: #f0f4f9;
  --ink: #1f1f1f;
  --muted: #5f6368;
  --line: #e3e3e3;
  --blue: #4285f4;
  --violet: #9b72cb;
  --coral: #d96570;
  --link: #185abc;
  --button: #185abc;
  --button-ink: #ffffff;
  --paper: #fdfcfa;
  --paper-under: #eef2f7;
}
body { background: var(--canvas); }
a { color: var(--link); }
a:hover { text-decoration: underline; }
button { border: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
.site-header__brand { color: var(--ink); }
.site-header__brand:hover { text-decoration: none; }
.site-header__mark { background: linear-gradient(135deg, var(--blue), var(--violet) 66%, var(--coral)); clip-path: polygon(0 5%, 73% 0, 100% 25%, 95% 100%, 0 90%); }
.site-header__mark::after { background: var(--canvas); clip-path: polygon(0 0, 76% 0, 100% 22%, 100% 100%, 0 90%); }
.skip-link { background: var(--canvas); border: 1px solid var(--line); border-radius: 18px; }
.page-heading__eyebrow { color: var(--muted); }
.reader-turn__question { color: var(--ink); background: var(--surface); border-radius: 20px 20px 4px 20px; }
.answer__mark { background: linear-gradient(135deg, var(--blue), var(--violet) 65%, var(--coral)); border-radius: 2px 5px 2px 5px; transform: rotate(-12deg); }
.source-note { border-top: 1px solid var(--line); }
.source-note__label, .source-note__context, .next-note__label, .question-hub__caption, .note-menu__group-label, .visit-sheet__note-label { color: var(--muted); }
.next-note__link { border-bottom: 1px solid var(--line); }
.note-menu__trigger { color: var(--ink); background: var(--surface); border-radius: 26px; }
.note-menu__trigger:hover { background: var(--line); }
.note-menu__glyph::before, .note-menu__glyph::after { background: currentColor; }
.note-menu__scrim { background: rgb(0 0 0 / 40%); }
.note-menu__drawer { background: var(--surface); border-right: 1px solid var(--line); border-radius: 0 20px 20px 0; box-shadow: 8px 0 28px rgb(0 0 0 / 14%); }
.note-menu__link { color: var(--ink); border-radius: 18px; }
.note-menu__link:hover { background: var(--canvas); }
.note-menu__link[aria-current='page'] { color: var(--link); background: var(--canvas); box-shadow: inset 3px 0 var(--blue); }
.question-hub__branch { border-top: 1px solid var(--line); }
.question-hub__link { color: var(--ink); }
.question-hub__link:hover { color: var(--link); }
.question-hub__arrow { color: var(--link); }
.question-hub__summary { color: var(--muted); }
.paper-collage__sheet { background: var(--paper-under); clip-path: polygon(0 0, 99% 3%, 100% 95%, 4% 100%, 1% 87%, 3% 65%, 0 40%); }
.paper-collage__fold { background: var(--paper); border: 1px solid var(--line); clip-path: polygon(2% 0, 97% 3%, 100% 99%, 0 95%); }
.paper-collage__ribbon { background: #a5c3f5; clip-path: polygon(0 16%, 62% 0, 76% 60%, 100% 76%, 99% 100%, 69% 86%, 56% 27%, 0 42%); }
.paper-collage__tab { background: var(--violet); clip-path: polygon(0 0, 92% 2%, 100% 91%, 52% 84%, 7% 100%); }
.paper-collage__tab::after { content: ''; position: absolute; width: 100%; height: 18%; bottom: 0; background: var(--coral); }
.print-tools__button { background: var(--button); color: var(--button-ink); border-radius: 26px; }
.print-tools__button:hover { background: var(--link); box-shadow: 0 2px 8px rgb(31 31 31 / 12%); }
.print-tools__help { color: var(--muted); }
.visit-sheet__section { border-top: 1px solid var(--line); }
.visit-sheet__checkbox { appearance: none; background: transparent; }
.visit-sheet__checkbox::before { content: ''; position: absolute; width: 22px; height: 22px; left: 11px; top: 11px; border: 1px solid var(--muted); border-radius: 3px; }
.visit-sheet__checkbox:checked::before { background: var(--link); border-color: var(--link); }
.visit-sheet__checkbox:checked::after { content: ''; position: absolute; top: 16px; left: 16px; width: 12px; height: 7px; border-left: 2px solid var(--canvas); border-bottom: 2px solid var(--canvas); transform: rotate(-45deg); }
.visit-sheet__check:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.visit-sheet__check input:focus-visible { outline: none; }
.visit-sheet__writing-space { border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 32px, var(--line) 32px, var(--line) 33px, transparent 33px, transparent 34px); }
.site-footer { border-top: 1px solid var(--line); }
.site-footer__purpose { color: var(--muted); }

@media (prefers-color-scheme: dark) {
  :root { --canvas: #1e1e1e; --surface: #282a2c; --ink: #f0f4f9; --muted: #b4b9c1; --line: #4b4e52; --link: #8ab4f8; --button: #8ab4f8; --button-ink: #1e1e1e; --paper: #35383b; --paper-under: #282a2c; }
  .paper-collage__image { filter: brightness(0.85); }
  .paper-collage__ribbon { background: #577cb7; }
}

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

@media (forced-colors: active) {
  .site-header__mark, .answer__mark { background: CanvasText; }
  .note-menu__glyph::before, .note-menu__glyph::after { background: ButtonText; }
  .note-menu__trigger, .print-tools__button { border: 1px solid ButtonText; }
  .visit-sheet__checkbox { appearance: auto; }
}

@media print {
  :root { color-scheme: light; --canvas: #ffffff; --surface: #ffffff; --ink: #000000; --muted: #333333; --line: #b0b0b0; --link: #000000; }
  body { color: #000000; background: #ffffff; }
  .visit-sheet__writing-space { background: none; border-bottom: 1px solid #b0b0b0; }
  .visit-sheet__checkbox::before { left: 5px; top: 5px; }
  .visit-sheet__checkbox:checked::after { left: 10px; top: 10px; }
  .site-footer__purpose { color: #333333; }
}
