/* Moment of Canada — one stylesheet, no build step, no web fonts.
   The site has to work offline on a school laptop, so everything here is
   system fonts and plain CSS. */

:root {
  color-scheme: light dark;

  --ink: #1c1a17;
  --ink-soft: #4a4540;
  --ink-faint: #6d665f;
  --paper: #f6f1e7;
  --card: #fffdf8;
  --rule: #ded4c2;
  --accent: #a5222c;
  --accent-soft: #f3dcdb;
  --accent-ink: #7a1720;
  --slate: #24404f;
  --slate-soft: #dde7ec;
  --focus: #1a6ea8;

  --radius: 10px;
  --measure: 68ch;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece6dc;
    --ink-soft: #c3bbb0;
    --ink-faint: #9a938a;
    --paper: #16171a;
    --card: #1f2126;
    --rule: #343740;
    --accent: #e8828a;
    --accent-soft: #3a2226;
    --accent-ink: #f2b3b7;
    --slate: #a8c7d8;
    --slate-soft: #22303a;
    --focus: #78bdf0;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.2;
  color: var(--ink);
}

h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); margin: 0.2em 0 0.4em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); margin: 2rem 0 0.6rem; }
h3 { font-size: 1.15rem; margin: 1.4rem 0 0.4rem; }
h4 { font-size: 1rem; margin: 1.1rem 0 0.3rem; }

p { max-width: var(--measure); }

a { color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { a { color: var(--accent); } }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--card);
  padding: 0.6rem 1rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
}

.muted { color: var(--ink-faint); }

/* ------------------------------------------------------------------ header */

.site-header {
  background: linear-gradient(180deg, var(--accent-soft), var(--paper));
  border-bottom: 1px solid var(--rule);
  padding: 2.5rem 0 2rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0;
  text-decoration: none;
  display: inline-block;
}

.site-header .lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

.count {
  font-size: 0.9rem;
  color: var(--ink-faint);
  margin-bottom: 0;
}

.play-header {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
  background: var(--card);
}

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding: 1.5rem 0 3rem;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 0.35em;
}

/* ------------------------------------------------------------------- chips */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
  padding: 0;
}

.chip {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--slate-soft);
  color: var(--slate);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  white-space: nowrap;
}

.chip.tone-historical { background: var(--slate-soft); color: var(--slate); }
.chip.tone-plausible { background: var(--accent-soft); color: var(--accent-ink); }
.chip.tone-divergent {
  background: transparent;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
}

.tag {
  font-size: 0.8rem;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin-right: 0.35rem;
  display: inline-block;
}

/* -------------------------------------------------------------- how it works */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.2rem;
}

.steps li h3 { margin-top: 0.2rem; }

.steps li::before {
  content: counter(step);
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--accent);
}

.steps p { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 0; }

/* ------------------------------------------------------------------- cards */

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--accent);
}

.card h3 { margin: 0.1rem 0 0.2rem; font-size: 1.35rem; }
.card .subtitle { color: var(--ink-faint); font-style: italic; margin: 0 0 0.6rem; }
.card .summary { margin: 0 0 0.8rem; }

.stakes {
  border-left: 3px solid var(--accent);
  padding-left: 0.9rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.card-context {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0;
  margin: 0.8rem 0;
}

.card-context p, .card-context dd { font-size: 0.95rem; color: var(--ink-soft); }

details > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-ink);
  list-style-position: outside;
}
@media (prefers-color-scheme: dark) { details > summary { color: var(--accent); } }

.themes { margin: 0.2rem 0 1rem; }

.card footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.done {
  font-size: 0.85rem;
  color: var(--slate);
  background: var(--slate-soft);
  border-radius: 999px;
  padding: 0.1rem 0.7rem;
}

.empty, .warning {
  background: var(--card);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem;
  color: var(--ink-soft);
  max-width: none;
}

.warning { border-color: var(--accent); }

/* ----------------------------------------------------------------- buttons */

.button {
  display: inline-block;
  font: inherit;
  font-size: 0.98rem;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 0.55rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
}

.button:hover { border-color: var(--accent); }

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.button.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
@media (prefers-color-scheme: dark) {
  .button.primary { color: #21151a; }
}

.button.ghost { background: transparent; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 1rem;
}

/* ------------------------------------------------------------------- views */

.view { padding: 1.5rem 0 2rem; }
.view > header { margin-bottom: 1rem; }

.scenario-header h1, .scenario-header h2 { margin-top: 0.2rem; }
.subtitle { color: var(--ink-faint); font-style: italic; }

.dateline {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0;
}
@media (prefers-color-scheme: dark) { .dateline { color: var(--accent); } }

.view p { font-size: 1.05rem; }

.timeline dl, .terms dl, .people dl { margin: 0; }
.timeline dt, .terms dt, .people dt {
  font-weight: 700;
  font-family: var(--serif);
  margin-top: 0.7rem;
}
.timeline dd, .terms dd, .people dd {
  margin: 0.1rem 0 0;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.timeline dt { color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { .timeline dt { color: var(--accent); } }

.source {
  margin: 1.5rem 0;
  padding: 0.8rem 1.2rem;
  border-left: 4px solid var(--slate);
  background: var(--slate-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.source p { font-family: var(--serif); font-size: 1.08rem; margin: 0 0 0.4rem; }
.source cite { font-size: 0.88rem; color: var(--ink-soft); font-style: normal; }

.role, .teacher-notes, .sources {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}
.role h2 { margin-top: 0; }
.role .note { font-size: 0.95rem; color: var(--ink-faint); }

.teacher-notes ul, .sources ul { max-width: var(--measure); }
.teacher-notes li, .sources li { margin-bottom: 0.35rem; }

/* --------------------------------------------------------------- decisions */

.progress { margin-bottom: 1.5rem; }
.progress-bar {
  height: 6px;
  background: var(--rule);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 240ms ease;
}
.progress-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0.4rem 0 0;
}

.prompt h3 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
}

.choices {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.choice {
  width: 100%;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  text-align: left;
  font: inherit;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  cursor: pointer;
}

.choice:hover { border-color: var(--accent); border-left-color: var(--accent); }

.choice-key {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--accent);
  min-width: 1.2rem;
}

.choice-body { display: block; }
.choice-label { display: block; font-weight: 600; }
.choice-detail {
  display: block;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.outcome p:first-child { font-size: 1.1rem; }

.history-note {
  background: var(--slate-soft);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}
.history-note h2 {
  margin-top: 0;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
}
.history-note p { color: var(--ink-soft); }

/* ----------------------------------------------------------------- endings */

.actual { border-top: 1px solid var(--rule); padding-top: 0.5rem; }

.journal {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.2rem 1.2rem;
}

.name-row { display: grid; gap: 0.3rem; margin-bottom: 1rem; }
.name-row label { font-size: 0.9rem; color: var(--ink-faint); }
.name-row input {
  font: inherit;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  max-width: 26rem;
}

.journal-list { padding-left: 1.2rem; }
.journal-list li { margin-bottom: 1rem; }
.journal-scene {
  margin: 0;
  font-size: 0.82rem !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.journal-choice { margin: 0.1rem 0; font-weight: 600; }
.journal-history { margin: 0; color: var(--ink-soft); font-size: 0.95rem !important; }

.reflection li { margin-bottom: 0.4rem; }

.print-only { display: none; }

/* ------------------------------------------------------------------- print */

@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .no-print, .site-footer, .play-header, .skip-link, .card-context, .teacher-notes { display: none !important; }
  .print-only { display: block; }
  .journal-title { font-family: var(--serif); font-size: 14pt; font-weight: 700; }
  .journal, .history-note, .role { border: 1px solid #999; background: #fff; }
  a { color: #000; text-decoration: none; }
  .view { padding: 0; }
}

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