:root {
  color-scheme: light;
  --violet: #7132f5;
  --violet-ink: #5741d8;
  --violet-deep: #5b1ecf;
  --violet-wash: rgba(133, 91, 251, 0.16);
  --paper: #ffffff;
  --ink: #101114;
  --muted: #686b82;
  --silver: #9497a9;
  --rule: #dedee5;
  --soft-rule: rgba(104, 107, 130, 0.24);
  --green: #149e61;
  --green-ink: #026b3f;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.03);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
}

/* Composition utilities keep spacing and layout separate from component meaning. */
.u-container { width: calc(100% - 48px); max-width: 1160px; margin-inline: auto; }
.u-flex { display: flex; align-items: center; }
.u-between { justify-content: space-between; }
.u-wrap { flex-wrap: wrap; }
.u-grid { display: grid; min-width: 0; }
.u-gap-12 { gap: 12px; }
.u-gap-16 { gap: 16px; }
.u-gap-24 { gap: 24px; }
.u-inset-24 { padding: 24px; }
.u-stack-8 > * + * { margin-top: 8px; }
.u-stack-12 > * + * { margin-top: 12px; }
.u-stack-16 > * + * { margin-top: 16px; }
.u-stack-24 > * + * { margin-top: 24px; }
.u-stack-32 > * + * { margin-top: 32px; }
.u-grid-hero { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; }
.u-grid-article { grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr); align-items: start; }
.u-grid-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; padding-bottom: 116px; color: var(--ink); background: var(--paper); font-size: 18px; line-height: 1.55; }
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { font-family: Arial, Helvetica, sans-serif; font-weight: 700; overflow-wrap: anywhere; }
h1 { font-size: 48px; line-height: 1.17; letter-spacing: -1px; }
h2 { font-size: 36px; line-height: 1.22; letter-spacing: -0.5px; }
h3 { font-size: 22px; line-height: 1.3; letter-spacing: -0.25px; }
p, li, label, textarea { overflow-wrap: anywhere; }
button, textarea, input { font: inherit; }
a { color: var(--violet-ink); text-decoration-thickness: 1px; text-underline-offset: 4px; font-size: 16px; }
a:hover { color: var(--violet-deep); }
a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; }
::selection { color: var(--ink); background: var(--violet-wash); }
[hidden] { display: none !important; }
svg { display: block; max-width: 100%; }
.line-icon { width: 24px; height: 24px; flex-shrink: 0; }
.eyebrow { color: var(--violet-ink); font-size: 16px; font-weight: 600; line-height: 1.5; }

.skip-link { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 13px 16px; min-height: 48px; border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.site-header { min-height: 96px; padding-block: 16px; border-bottom: 1px solid var(--rule); }
.site-name { min-height: 48px; padding-block: 4px; font-size: 18px; color: var(--ink); font-weight: 600; line-height: 1.35; text-decoration: none; }
.site-name > .line-icon { width: 36px; height: 36px; color: var(--violet); }
.site-kind { display: block; font-size: 16px; font-weight: 400; color: var(--muted); }
.guide-tag { padding: 6px 12px; border-radius: 8px; color: var(--green-ink); background: rgba(20, 158, 97, 0.16); font-size: 16px; font-weight: 500; white-space: nowrap; }
.reading-progress { position: fixed; z-index: 12; inset: 0 0 auto; width: 100%; height: 3px; border: 0; border-radius: 0; appearance: none; background: transparent; color: var(--violet); }
.reading-progress::-webkit-progress-bar { background: transparent; }
.reading-progress::-webkit-progress-value { background: var(--violet); }
.reading-progress::-moz-progress-bar { background: var(--violet); }

.welcome-hero { padding-block: 52px 64px; }
.hero-copy h1 { max-width: 21ch; }
.hero-lead { max-width: 48ch; font-size: 20px; line-height: 1.5; color: var(--muted); }
.hero-actions { align-items: stretch; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px; padding: 13px 16px; border: 1px solid transparent; border-radius: 12px; font-size: 16px; font-weight: 600; line-height: 1.4; text-decoration: none; text-align: center; }
.button-primary { color: #fff; background: var(--violet); }
.button-primary:hover { color: #fff; background: var(--violet-deep); }
.button-subtle { color: var(--violet-ink); background: var(--violet-wash); }
.button-subtle:hover { background: #e9dfff; }
.button-outline { color: var(--violet-ink); border-color: var(--violet-ink); background: var(--paper); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03); }
.button-outline:hover { background: #f8f5ff; }
.hero-art { min-width: 0; }
.workbook-art { width: 100%; height: auto; }
.art-caption { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; color: var(--muted); }
.status-mark { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--green); }

.desk-location { padding-block: 20px 16px; color: var(--muted); font-size: 16px; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 12px; margin-left: -12px; }
.page-intro { max-width: 800px; padding-block: 12px 48px; }
.page-intro h1 { max-width: 24ch; }
.page-lead { max-width: 60ch; color: var(--muted); font-size: 20px; }
.reading-body { max-width: 70ch; min-width: 0; }
.reading-section { padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.question-list { padding-left: 24px; }
.question-list li { padding-left: 4px; }
.question-list li::marker { color: var(--violet); }
.worksheet { position: sticky; top: 24px; border: 1px solid var(--soft-rule); border-top: 3px solid var(--violet); border-radius: 12px; background: #fcfaff; box-shadow: var(--shadow); font-size: 16px; }
.worksheet h2 { font-size: 28px; line-height: 1.29; }
.worksheet-long { position: static; }
.check-item { display: flex; align-items: flex-start; gap: 12px; padding-block: 10px; min-height: 48px; cursor: pointer; font-size: 16px; }
.check-item input { width: 44px; height: 44px; margin: 0; flex-shrink: 0; accent-color: var(--violet); cursor: pointer; }
.check-item:has(input:checked) span { color: var(--green-ink); }
.note-label { display: block; font-size: 16px; font-weight: 500; }
.notes-field { display: block; width: 100%; min-height: 132px; resize: vertical; padding: 12px; color: var(--ink); border: 1px solid var(--muted); border-radius: 8px; font-size: 16px; line-height: 1.6; background: var(--paper); }
.sources-box { border: 1px solid var(--soft-rule); border-radius: 12px; background: var(--paper); }
.sources-box h2 { font-size: 28px; line-height: 1.29; }
.source-list { list-style: none; padding: 0; }
.source-list li + li { border-top: 1px solid var(--rule); }
.source-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 54px; padding-block: 12px; font-size: 16px; }
.source-link > span:last-child { flex-shrink: 0; font-size: 20px; }
.desk-index { margin-top: 64px; padding-block: 32px; border-top: 1px solid var(--rule); }
.desk-index > div > p:not(.eyebrow) { max-width: 60ch; color: var(--muted); }
.index-group { padding: 24px; border: 1px solid var(--soft-rule); border-radius: 12px; }
.index-list { list-style: none; padding: 0; }
.index-list li + li { border-top: 1px solid var(--rule); }
.index-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding-block: 12px; line-height: 1.5; font-size: 16px; text-decoration: none; }
.index-link:hover > span:first-child { text-decoration: underline; text-underline-offset: 4px; }
.link-arrow { flex-shrink: 0; font-size: 20px; }
.next-desk { margin-top: 48px; padding-block: 24px; padding-inline: 24px; background: var(--violet-wash); border-radius: 12px; }
.next-desk > div { flex: 1 1 200px; }
.next-desk > div > p:last-child { font-size: 22px; font-weight: 600; line-height: 1.35; }
.site-footer { margin-top: 48px; padding-block: 24px; border-top: 1px solid var(--rule); font-size: 16px; color: var(--muted); }
.site-footer > p { max-width: 70ch; }
.footer-links a { display: inline-flex; align-items: center; min-height: 48px; padding: 10px 12px; border-radius: 8px; font-size: 16px; }
.footer-links { margin-left: -12px; }
.bottom-dock { position: fixed; z-index: 8; bottom: 16px; left: 50%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; width: min(760px, calc(100% - 32px)); padding: 8px; border: 1px solid var(--soft-rule); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); transform: translateX(-50%); }
.dock-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 62px; padding: 8px 4px; border-radius: 12px; color: var(--muted); font-size: 16px; line-height: 1.3; text-decoration: none; }
.dock-link:hover { background: #f8f5ff; }
.dock-link.is-active { color: var(--violet-deep); background: var(--violet-wash); }

@media (min-width: 1536px) { .u-container { max-width: 1216px; } }
@media (max-width: 1023px) {
  .u-grid-hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .u-grid-article { grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); }
  .u-grid-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 44px; }
  h2 { font-size: 32px; }
}
@media (max-width: 767px) {
  .u-container { width: calc(100% - 32px); }
  .u-grid-hero, .u-grid-article, .u-grid-index { grid-template-columns: minmax(0, 1fr); }
  .site-header { min-height: 88px; padding-block: 16px; }
  .site-name { font-size: 17px; }
  .guide-tag { display: none; }
  .welcome-hero { padding-block: 32px 40px; }
  .hero-copy h1 { font-size: 42px; line-height: 1.17; max-width: 19ch; }
  .hero-lead, .page-lead { font-size: 18px; }
  .hero-actions { align-items: stretch; }
  .hero-actions .button { flex: 1 1 auto; }
  .hero-art { max-width: 340px; justify-self: center; width: 100%; }
  .workbook-art { max-height: 280px; }
  .art-caption { text-align: center; }
  .page-intro { padding-bottom: 32px; }
  .page-intro h1 { font-size: 38px; }
  h2 { font-size: 28px; line-height: 1.29; }
  .worksheet { position: static; }
  .desk-index { margin-top: 40px; }
  .next-desk, .site-footer { margin-top: 32px; }
  .bottom-dock { bottom: max(8px, env(safe-area-inset-bottom)); width: calc(100% - 16px); padding: 4px; gap: 0; border-radius: 12px; }
  .dock-link { min-height: 66px; padding-inline: 2px; font-size: 16px; }
  body { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
}
@media (max-width: 374px) {
  .hero-copy h1 { font-size: 36px; }
  .dock-link { font-size: 16px; }
  .dock-link span { max-width: 5ch; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media print {
  body { padding-bottom: 0; font-size: 16px; }
  .bottom-dock, .reading-progress, .skip-link, .hero-art, .hero-actions, .next-desk { display: none !important; }
  .u-container { width: 100%; max-width: none; }
  .u-grid-article { grid-template-columns: minmax(0, 1fr); }
  .worksheet { position: static; margin-top: 24px; background: #fff; box-shadow: none; break-inside: avoid; }
  .page-intro { padding-bottom: 24px; }
  .reading-section, .sources-box { break-inside: avoid; }
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .notes-field { min-height: 120px; }
}
