/* Redwood Gigantea — Newsroom Decision Simulator
   Visual system: blue / yellow / off-white, rounded cards, DM Sans —
   matching the1001.org's palette, type and navigation chrome.
   Font is bundled locally in fonts/ (Latin subset, OFL-licensed) so
   the site keeps working fully offline with zero external requests —
   see fonts/OFL-LICENSE.txt. */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/dm-sans-500.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/dm-sans-600.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/dm-sans-700.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/dm-sans-800.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../fonts/dm-sans-900.woff2") format("woff2");
}

:root {
  --paper: #f4f5f8;
  --paper-dim: #eceef2;
  --card: #ffffff;
  --card-border: #eceef2;
  --ink: #111827;
  --ink-soft: #6b7280;
  --rule: #e2e5eb;

  --accent: #003da5;
  --accent-dark: #002d7a;
  --accent-tint: #e6edf9;

  --yellow: #f5d924;
  --yellow-dark: #e6c700;

  --success: #2e7d32;
  --success-bg: #e8f5e9;
  --recovery: #7a6200;
  --recovery-bg: #fdf8d8;
  --danger: #b3261e;
  --danger-bg: #fdeceb;

  --focus: #f5d924;

  --shadow-sm: 0 2px 10px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 6px 20px rgba(17, 24, 39, 0.09);
  --shadow-accent: 0 8px 30px rgba(0, 61, 165, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --serif: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 800;
  margin: 0;
}

p {
  margin: 0 0 1em;
}

button {
  font-family: inherit;
  font-size: inherit;
}

/* Focus states: visible everywhere, keyboard or touch. Yellow reads
   clearly on both the white cards and the solid-blue hero cards. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Screen-transition focus target (see renderScreen in main.js): moves
   screen-reader focus to the new heading without drawing a visible
   ring for sighted mouse/touch users on every single transition. */
.a11y-focus-target:focus {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent);
  color: #fff;
  padding: 0.6em 1em;
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* ------------------------------------------------------------------ */
/* Masthead                                                            */
/* ------------------------------------------------------------------ */

.masthead {
  padding: 1.75rem 1.25rem 1.5rem;
  text-align: center;
  background: var(--accent);
}

.masthead__eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.masthead__title {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
}

.masthead__sub {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.4rem;
}

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */

.app-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.screen {
  animation: fade-in 0.28s ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen {
    animation: none;
  }
}

/* ------------------------------------------------------------------ */
/* Home screen — scenario list                                         */
/* ------------------------------------------------------------------ */

.home-intro {
  padding: 2rem 0 1rem;
}

.home-intro h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.home-intro p {
  color: var(--ink-soft);
}

.scenario-list {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.scenario-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--card-border);
  background: var(--card);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.scenario-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-tint);
  transform: translateY(-1px);
}

.scenario-card:active {
  transform: translateY(0);
}

.scenario-card[disabled] {
  cursor: default;
  box-shadow: none;
  color: var(--ink-soft);
  opacity: 0.65;
}

.scenario-card[disabled]:hover {
  box-shadow: none;
  border-color: var(--card-border);
  transform: none;
}

.scenario-card__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  background: var(--paper-dim);
  color: var(--ink-soft);
}

.scenario-card--available .scenario-card__num {
  background: var(--accent-tint);
  color: var(--accent);
}

.scenario-card__body {
  flex: 1;
  min-width: 0;
}

.scenario-card__title {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
}

.scenario-card__meta {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
}

.scenario-card__tag {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3em 0.65em;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  background: var(--paper-dim);
  color: var(--ink-soft);
}

.scenario-card--available .scenario-card__tag {
  background: var(--accent-tint);
  color: var(--accent);
}

/* ------------------------------------------------------------------ */
/* Scenario intro screen — styled as a hero card, like the1001's        */
/* "Next Up" card: solid blue, yellow eyebrow, colored glow shadow.    */
/* ------------------------------------------------------------------ */

.intro-screen {
  margin-top: 1.75rem;
  padding: 2.25rem 1.75rem;
  text-align: center;
  background: var(--accent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-accent);
}

.intro-screen__kicker {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--yellow);
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.intro-screen h2 {
  font-size: clamp(1.8rem, 6vw, 2.3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.75rem;
}

.intro-screen p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}

.intro-screen__meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 1.25rem;
}

.intro-screen .primary-btn {
  margin-top: 1.5rem;
}

.intro-screen .restart-btn,
.debrief .restart-btn {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.intro-screen .restart-btn:hover,
.debrief .restart-btn:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* ------------------------------------------------------------------ */
/* In-game header: progress + meter + restart                          */
/* ------------------------------------------------------------------ */

.game-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0 0.5rem;
  flex-wrap: wrap;
}

.progress {
  flex: 1;
  min-width: 140px;
}

.progress__label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.progress__label::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 3px;
  margin-right: 0.5em;
  background: var(--yellow);
  border-radius: 2px;
  vertical-align: middle;
}

.progress__track {
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.meter {
  min-width: 150px;
}

.meter__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}

.meter__value {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 700;
}

.meter__track {
  height: 8px;
  background: var(--rule);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.meter__fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.restart-btn {
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.5em 0.9em;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.restart-btn:hover {
  background: var(--accent-tint);
}

/* ------------------------------------------------------------------ */
/* Decision card                                                       */
/* ------------------------------------------------------------------ */

.decision-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.4rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
}

.decision-card__body p {
  margin-bottom: 0.9em;
}

.decision-card__body p:last-child {
  margin-bottom: 0;
}

.decision-card__prompt {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 1.2rem 0 0.9rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.choice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.choice-btn {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
  min-height: 44px;
}

.choice-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.choice-btn:active {
  transform: translateY(1px);
}

.choice-btn__key {
  font-family: var(--serif);
  font-weight: 800;
  color: var(--accent);
  min-width: 1.4rem;
}

.choice-btn__text {
  flex: 1;
}

.choice-btn__label {
  font-weight: 600;
}

.choice-btn__detail {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.choice-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

/* ------------------------------------------------------------------ */
/* Multi-select ("choose N of these") — scenario 03's reporting plan   */
/* ------------------------------------------------------------------ */

.choice-list--grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

@media (min-width: 640px) {
  .choice-list--grid {
    grid-template-columns: 1fr 1fr;
  }
}

.choice-btn--toggle {
  align-items: center;
}

.choice-btn--toggle .choice-btn__key {
  min-width: 1.4rem;
  font-size: 1.1rem;
  color: var(--success);
}

.choice-btn--picked {
  background: var(--accent-tint);
  border-color: var(--accent);
}

.multiselect-counter {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.primary-btn[disabled] {
  cursor: not-allowed;
  opacity: 1;
  background: var(--rule);
  color: var(--ink-soft);
  box-shadow: none;
}

.plan-review {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.plan-review__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
}

.plan-review__label {
  flex: 1;
}

.badge--negative {
  background: var(--paper-dim);
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Consequence interstitial                                            */
/* ------------------------------------------------------------------ */

.consequence-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.4rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
}

.consequence-card p {
  margin-bottom: 0.8em;
}

.consequence-card p:last-child {
  margin-bottom: 0;
}

.award-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 1.2rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  padding: 0.3em 0.7em;
  background: var(--paper-dim);
  color: var(--ink-soft);
}

.badge--score {
  background: var(--accent-tint);
  color: var(--accent);
}

.continue-btn,
.primary-btn {
  background: var(--yellow);
  color: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75em 1.4em;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  min-height: 44px;
  transition: background-color 0.12s ease, transform 0.08s ease;
}

.continue-btn:hover,
.primary-btn:hover {
  background: var(--yellow-dark);
}

.continue-btn:active,
.primary-btn:active {
  transform: translateY(1px);
}

/* ------------------------------------------------------------------ */
/* Ending screen                                                       */
/* ------------------------------------------------------------------ */

.ending-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
}

.ending-card--success {
  border-left: 6px solid var(--success);
}

.ending-card--recovery {
  border-left: 6px solid var(--recovery);
}

.ending-card--gameover {
  border-left: 6px solid var(--danger);
}

.ending-card__stamp {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  padding: 0.3em 0.75em;
  border-radius: var(--radius-sm);
  margin-bottom: 0.9rem;
}

.ending-card--success .ending-card__stamp {
  background: var(--success-bg);
  color: var(--success);
}

.ending-card--recovery .ending-card__stamp {
  background: var(--recovery-bg);
  color: var(--recovery);
}

.ending-card--gameover .ending-card__stamp {
  background: var(--danger-bg);
  color: var(--danger);
}

.ending-card__label {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.9rem;
}

.ending-card p {
  margin-bottom: 0.8em;
}

.ending-card p:last-child {
  margin-bottom: 0;
}

/* The closing-lesson card ("The Rule" / "What Background Is For.") */

.the-rule {
  margin-top: 1.5rem;
  padding: 1.6rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.the-rule h3 {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}

.the-rule h3::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 3px;
  margin-right: 0.5em;
  background: var(--yellow);
  border-radius: 2px;
  vertical-align: middle;
}

.the-rule p {
  margin-bottom: 0.85em;
}

.the-rule ul {
  margin: 0.9rem 0 1.1rem;
  padding-left: 1.2rem;
}

.the-rule li {
  margin-bottom: 0.35em;
}

.the-rule__closer {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  margin-top: 1.1rem;
}

.the-rule__closer + .the-rule__closer {
  border-top: none;
  padding-top: 0;
  margin-top: 0.5rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Debrief / final score — the other hero card, echoing the1001's
   solid-blue "Next Up" treatment for the run's headline result. */

.debrief {
  margin-top: 1.5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--accent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-accent);
  color: #fff;
}

.debrief__score-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yellow);
}

.debrief__score {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0.3rem 0 0.5rem;
}

.debrief__result {
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.debrief__summary {
  color: rgba(255, 255, 255, 0.78);
  max-width: 42ch;
  margin: 0 auto 1.4rem;
}

/* ------------------------------------------------------------------ */
/* Footer                                                               */
/* ------------------------------------------------------------------ */

.site-footer {
  text-align: center;
  padding: 2rem 1.25rem 3rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.site-footer a {
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Small screens (Chromebooks / phones): comfortable defaults already
   apply; just tighten padding a touch. Desktop gets more breathing
   room via the max-width container above. */
/* ------------------------------------------------------------------ */

@media (max-width: 420px) {
  .app-shell {
    padding: 0 1rem 2.5rem;
  }

  .decision-card,
  .consequence-card,
  .ending-card,
  .the-rule,
  .debrief {
    padding: 1.15rem 1rem;
  }

  .intro-screen {
    padding: 1.85rem 1.25rem;
  }
}

@media (min-width: 720px) {
  body {
    font-size: 18px;
  }
}
