:root {
  --cream: #f6f0e5;
  --paper: #fffdf8;
  --teal: #103e43;
  --teal-2: #1b5960;
  --ink: #173336;
  --muted: #5d6c68;
  --coral: #b34f3d;
  --coral-pale: #f4d8ce;
  --saffron: #efbd58;
  --saffron-pale: #fae8bd;
  --sage: #a8bda5;
  --line: #d6cabb;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
  --shadow: 0 24px 65px rgba(16, 62, 67, 0.14);
  --wide: 78rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 88% 5%, rgba(239, 189, 88, 0.18), transparent 24rem),
    var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
}
button, input { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 300;
  top: 0.7rem;
  left: 0.7rem;
  padding: 0.7rem 1rem;
  border-radius: 0.35rem;
  background: var(--teal);
  color: white;
  transform: translateY(-170%);
}
.skip-link:focus { transform: none; }

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  width: min(calc(100% - 3rem), var(--wide));
  margin: 0 auto;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
}
.brand__mark {
  position: relative;
  width: 2.15rem;
  height: 1.55rem;
  border: 2px solid var(--teal);
}
.brand__mark::after {
  position: absolute;
  inset: 0.28rem -0.32rem -0.28rem 0.32rem;
  border: 2px solid var(--coral);
  content: "";
}
.header-meta {
  display: flex;
  justify-content: center;
  gap: 1.3rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.header-actions { display: flex; gap: 0.55rem; }
.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.64rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,62,67,.12); }
.button--quiet { background: transparent; }
.button--coral { border-color: var(--coral); background: var(--coral); color: white; }
.button--teal { border-color: var(--teal); background: var(--teal); color: white; }
.button--saffron { border-color: var(--saffron); background: var(--saffron); color: var(--teal); }
.button--light { border-color: white; background: white; color: var(--teal); }
.button--guide { flex-direction: column; gap: .05rem; line-height: 1.15; }
.button--guide small { font-size: .65rem; font-weight: 650; }
.text-button {
  padding: 0.25rem 0;
  border: 0;
  border-bottom: 2px solid var(--coral);
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-weight: 750;
}

main { width: min(calc(100% - 3rem), var(--wide)); margin: 0 auto; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  min-height: 27rem;
  padding: clamp(2.8rem, 6vw, 4.8rem) 0 2.8rem;
}
.kicker {
  margin: 0 0 0.6rem;
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 15ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.8rem, 7vw, 6.7rem);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.82;
}
.hero h1 em { color: var(--coral); font-weight: 500; }
.hero__lead {
  max-width: 43rem;
  margin: 2rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.5;
}
.hero__facts { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.6rem; }
.hero__facts span {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--sage);
  border-radius: 2rem;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 750;
}
.hero__note {
  padding: 1.5rem;
  border-top: 5px solid var(--saffron);
  background: var(--teal);
  box-shadow: var(--shadow);
  color: white;
}
.note-number { font-family: var(--serif); font-size: 4.5rem; line-height: 1; }
.note-unit { color: var(--saffron); font-weight: 800; text-transform: uppercase; }
.hero__note p { margin: 1rem 0; color: #dfe9e4; }
.hero__note a { color: var(--saffron); font-weight: 750; text-underline-offset: 0.25rem; }

.step-nav {
  position: sticky;
  z-index: 30;
  top: 0;
  margin-inline: calc(50% - 50vw);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 240, 229, 0.96);
  backdrop-filter: blur(12px);
}
.step-nav ol {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(calc(100% - 3rem), var(--wide));
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.step-nav a {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  min-height: 3.6rem;
  padding: 0.6rem 1rem;
  border-right: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 750;
  text-decoration: none;
}
.step-nav li:first-child a { border-left: 1px solid var(--line); }
.step-nav a:hover, .step-nav a.is-current { background: var(--teal); color: white; }
.step-nav span { color: var(--coral); font-family: var(--serif); font-size: 1.1rem; }

.activity { padding-bottom: 3rem; }
.scene-lab {
  margin-top: 2rem;
  padding: clamp(1rem, 2.5vw, 2rem);
  border-radius: 0.7rem;
  background: var(--teal);
  box-shadow: var(--shadow);
  color: white;
  scroll-margin-top: 4.4rem;
}
.scene-lab__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.scene-lab h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 500;
  line-height: 1.05;
}
.scene-lab .kicker { color: var(--saffron); }
.step-nav a.is-active span { color: var(--saffron); }
.scene-shell {
  position: relative;
  min-height: 34rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 0.45rem;
  background: linear-gradient(145deg, #d4dfd4, #8ea99f);
}
.scene-host { position: absolute; inset: 0 0 106px; }
.scene-host canvas { display: block; width: 100%; height: 100%; }
.post-overlay {
  position: absolute;
  z-index: 4;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 106px;
  padding: 1rem 1.1rem;
  border-left: 5px solid var(--coral);
  background: rgba(255,253,248,.95);
  box-shadow: none;
  color: var(--ink);
}
.post-overlay__label { color: var(--coral); font-size: .66rem; font-weight: 850; letter-spacing: .12em; }
.post-overlay strong { display: block; margin: .35rem 0 .55rem; font-family: var(--serif); font-size: 1.45rem; line-height: 1.12; }
.post-overlay > span:last-child { color: var(--muted); font-size: .75rem; }
.scene-fallback {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  align-content: center;
  padding: 2rem;
  background: #dce7df;
  color: var(--ink);
  text-align: center;
}
.scene-fallback strong { font-family: var(--serif); font-size: 2rem; }
.scene-fallback p { max-width: 42rem; margin: .75rem auto; }
.scene-disclosure { margin: .8rem 0 0; color: #cbdad4; font-size: .78rem; }

.lesson-step {
  display: grid;
  grid-template-columns: 7rem minmax(0,1fr);
  margin-top: 2rem;
  scroll-margin-top: 5rem;
  border: 1px solid var(--line);
  background: var(--paper);
}
.step-rail {
  padding: 2rem 1rem;
  border-right: 1px solid var(--line);
  text-align: center;
}
.step-rail span { color: var(--coral); font-family: var(--serif); font-size: clamp(2.6rem, 5vw, 4.7rem); line-height: 1; }
.step-rail p { margin: .5rem 0 0; font-size: .7rem; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.step-content { padding: clamp(1.5rem, 4vw, 3.5rem); }
.step-content > h2, .resource-pane h2 {
  max-width: 19ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.04;
}
.step-content > p:not(.kicker) { max-width: 50rem; color: var(--muted); }
.teacher-cue {
  margin: 1.2rem 0;
  padding: .8rem 1rem;
  border-left: 4px solid var(--saffron);
  background: var(--saffron-pale);
  color: var(--ink) !important;
}
.choice-set fieldset { display: grid; gap: .7rem; margin: 1.4rem 0 1rem; padding: 0; border: 0; }
.choice-card, .choice-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: .85rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
}
.choice-card:hover, .choice-row:hover { border-color: var(--coral); }
.choice-card input, .choice-row input, .transfer label input { width: 1.15rem; height: 1.15rem; margin-top: .18rem; accent-color: var(--coral); }
.choice-card strong { display: block; font-family: var(--serif); font-size: 1.16rem; }
.feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-left: 5px solid var(--teal-2);
  background: #e5f0ea;
}
.feedback.is-retry { border-color: var(--coral); background: var(--coral-pale); }
.feedback h3, .feedback p { margin: 0; }
.feedback p + p { margin-top: .45rem; }

.lesson-step--saffron { background: var(--saffron-pale); }
.frame-control { margin: 1.8rem 0 1.2rem; padding: 1.3rem; background: var(--paper); color: var(--ink); }
.frame-control--scene { margin: .8rem 0 0; }
.frame-control__heading { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: .65rem; }
.frame-control__heading strong { font-family: var(--serif); font-size: 1.16rem; }
.frame-control__heading span { color: var(--muted); font-size: .78rem; }
.frame-control__labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.frame-control input { width: 100%; margin: .9rem 0; accent-color: var(--coral); cursor: ew-resize; }
.frame-control output { display: block; min-height: 1.5rem; font-family: var(--serif); font-size: 1.05rem; }
.full-scene-text { margin-top: 1rem; padding: 1rem; border: 1px solid #d5b866; background: #fff8df; }
.full-scene-text p { margin: .35rem 0 0; }
.return-link {
  display: inline-block;
  margin: 1rem 1rem 1rem 0;
  color: var(--teal);
  font-weight: 800;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 2px;
  text-underline-offset: .25rem;
}

.evidence-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-top: 1.6rem; }
.evidence-item { position: relative; min-height: 16rem; padding: 1.2rem; border-top: 5px solid var(--coral); background: var(--cream); }
.evidence-item:nth-child(2) { border-top-color: var(--teal-2); }
.evidence-item:nth-child(3) { border-top-color: var(--saffron); }
.source-type { display: block; color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.evidence-item time { display: block; margin: .4rem 0 1.2rem; color: var(--coral); font-weight: 800; }
.evidence-item blockquote { margin: 0; font-family: var(--serif); font-size: 1.25rem; line-height: 1.35; }
.evidence-item p { color: var(--muted); font-size: .84rem; }
.timeline-line { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; margin-top: 1.5rem; color: var(--muted); font-size: .82rem; }
.timeline-line span { display: grid; }
.timeline-line i { height: 2px; background: linear-gradient(90deg,var(--coral),var(--saffron)); }

.lesson-step--teal { border-color: var(--teal); background: var(--teal); color: white; }
.lesson-step--teal .step-rail { border-color: rgba(255,255,255,.2); }
.lesson-step--teal .kicker { color: var(--saffron); }
.lesson-step--teal :focus-visible { outline-color: var(--saffron); }
.choice-set--light .choice-row { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: white; }
.choice-set--light input { accent-color: var(--saffron); }
.feedback--dark { border-color: var(--saffron); background: rgba(255,255,255,.11); color: white; }
.transfer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.25); }
.transfer__label { color: var(--saffron); font-size: .7rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.transfer h3 { margin: .35rem 0; font-family: var(--serif); font-size: 1.65rem; }
.transfer p { color: #dce9e4; }
.transfer__form fieldset { display: grid; gap: .5rem; margin: 1rem 0; padding: 0; border: 0; }
.transfer label { display: grid; grid-template-columns: auto 1fr; gap: .7rem; padding: .75rem; border: 1px solid rgba(255,255,255,.22); cursor: pointer; }

.resource-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin: 3rem 0;
  padding: clamp(1.5rem,4vw,3rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.resource-links { display: grid; align-content: center; }
.resource-links a { padding: .9rem 0; border-bottom: 1px solid var(--line); font-weight: 750; text-decoration: none; }
.resource-links a:hover { color: var(--coral); }
.site-footer {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 2rem;
  padding: 2rem max(1.5rem, calc((100vw - var(--wide))/2));
  background: #0b3034;
  color: #dce9e4;
  font-size: .78rem;
}
.site-footer strong { color: white; font-family: var(--serif); font-size: 1.25rem; }
.site-footer p { margin: 0; }

.projection-bar {
  position: fixed;
  z-index: 200;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: .65rem .7rem .65rem 1rem;
  border-radius: .35rem;
  background: var(--coral);
  box-shadow: var(--shadow);
  color: white;
  font-weight: 800;
}
.live-status {
  position: fixed;
  z-index: 220;
  left: 50%;
  bottom: 1rem;
  max-width: calc(100% - 2rem);
  padding: .65rem .9rem;
  border-radius: .3rem;
  background: #08292d;
  color: white;
  font-size: .85rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%,1rem);
  transition: opacity 160ms ease, transform 160ms ease;
}
.live-status.is-visible { opacity: 1; transform: translate(-50%,0); }
.print-root { display: none; }
.noscript { margin: 1rem; padding: 1rem; border: 2px solid var(--coral); background: white; }

body.is-projecting { font-size: 1.13rem; }
body.is-projecting .site-header, body.is-projecting .hero, body.is-projecting .resource-pane, body.is-projecting .site-footer { display: none; }
body.is-projecting main { width: min(calc(100% - 2rem), 96rem); }
body.is-projecting .scene-shell { min-height: 48rem; }
body.is-projecting .lesson-step { grid-template-columns: 8rem 1fr; }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .header-meta { display: none; }
  .header-actions { grid-column: 1/-1; justify-content: flex-end; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__note { max-width: 25rem; }
  .evidence-strip { grid-template-columns: 1fr; }
  .evidence-item { min-height: 0; }
}

@media (min-width: 1100px) {
  .activity {
    display: grid;
    grid-template-columns: minmax(31rem, .94fr) minmax(0, 1.06fr);
    gap: 1.45rem;
    align-items: start;
    padding-top: 2rem;
  }
  .scene-lab {
    position: sticky;
    top: 4.35rem;
    grid-column: 1;
    grid-row: 1 / span 4;
    margin-top: 0;
    padding: 1rem;
  }
  .scene-lab__heading { margin-bottom: .7rem; }
  .scene-lab h2 { font-size: clamp(1.65rem, 2.2vw, 2.25rem); }
  .scene-shell { height: clamp(26.625rem, calc(38vh + 106px), 31.625rem); min-height: 26.625rem; }
  .post-overlay { padding: .8rem .9rem; }
  .post-overlay strong { font-size: 1.17rem; }
  .frame-control--scene { padding: .85rem 1rem; }
  .frame-control--scene .frame-control__heading { margin-bottom: .35rem; }
  .frame-control--scene input { margin: .55rem 0; }
  .frame-control--scene output { font-size: .92rem; }
  .scene-disclosure { font-size: .7rem; }
  .lesson-step {
    grid-column: 2;
    grid-template-columns: 5.2rem minmax(0,1fr);
    margin-top: 0;
  }
  .lesson-step + .lesson-step { margin-top: 1.45rem; }
  .step-rail { padding-inline: .65rem; }
  .step-content { padding: clamp(1.5rem, 3vw, 2.5rem); }
  .step-content > h2 { font-size: clamp(2rem, 3.2vw, 3rem); }
  .evidence-strip { grid-template-columns: 1fr; }
  .evidence-item { min-height: 0; }
}

@media (min-width: 681px) and (max-width: 1099px) {
  .scene-lab { padding: .8rem 1rem; }
  .scene-lab__heading { margin-bottom: .55rem; }
  .scene-lab h2 { font-size: clamp(1.65rem, 3vw, 2.25rem); }
  .scene-shell { height: calc(19rem + 106px); min-height: calc(19rem + 106px); }
  .frame-control--scene { padding: .7rem 1rem; }
  .frame-control--scene .frame-control__heading { margin-bottom: .25rem; }
  .frame-control--scene input { margin: .4rem 0; }
  .frame-control--scene output { font-size: .88rem; }
  .scene-disclosure { margin-top: .55rem; font-size: .7rem; }
}

@media (max-width: 680px) {
  .site-header, main { width: min(calc(100% - 1.2rem), var(--wide)); }
  .site-header { grid-template-columns: 1fr; }
  .header-actions { display: grid; grid-template-columns: 1fr 1fr; justify-content: stretch; }
  .header-actions .button--coral { grid-column: 1/-1; }
  .hero { padding: 3.5rem 0 2.5rem; }
  .hero h1 { font-size: clamp(3.5rem,18vw,5.5rem); }
  .step-nav ol { width: 100%; }
  .step-nav a { justify-content: center; padding: .5rem .2rem; font-size: .72rem; }
  .step-nav a span { display: none; }
  .scene-lab { padding: .65rem; }
  .scene-lab__heading { align-items: start; flex-direction: column; padding: .5rem; }
    .scene-shell { height: 360px; min-height: 360px; }
    .scene-host { inset: 0 0 106px; }
    .post-overlay { top: auto; right: 0; bottom: 0; width: 100%; height: 106px; padding: .55rem .7rem; box-shadow: none; }
    .post-overlay strong { font-size: 1.08rem; line-height: 1.15; }
  .frame-control__heading { align-items: flex-start; flex-direction: column; gap: .1rem; }
  .frame-control--scene { margin-top: .55rem; padding: .7rem .8rem; }
  .frame-control--scene .frame-control__heading { margin-bottom: .25rem; }
  .frame-control--scene input { margin: .45rem 0; }
  .frame-control--scene output { font-size: .82rem; line-height: 1.35; }
  .scene-disclosure { margin: .55rem .35rem 0; font-size: .68rem; }
  .lesson-step { grid-template-columns: 1fr; }
  .step-rail { display: flex; gap: .7rem; align-items: center; padding: .8rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); text-align: left; }
  .step-rail span { font-size: 2rem; }
  .step-rail p { margin: 0; }
  .step-content { padding: 1.25rem; }
  .timeline-line { grid-template-columns: 1fr; }
  .timeline-line i { width: 2px; height: 1.6rem; margin-left: 1rem; }
  .resource-pane { grid-template-columns: 1fr; gap: 1rem; }
  .site-footer { grid-template-columns: 1fr; gap: 1rem; }
  .projection-bar { right: .5rem; bottom: .5rem; left: .5rem; justify-content: space-between; }
}

/* Keep the text equivalent and repost in separate rows when WebGL is unavailable. */
.scene-shell:has(.scene-fallback:not([hidden])) { height: auto; min-height: 0; display: flex; flex-direction: column; }
.scene-shell:has(.scene-fallback:not([hidden])) .scene-host { position: relative; inset: auto; min-height: 0; }
.scene-shell:has(.scene-fallback:not([hidden])) .scene-fallback { position: relative; inset: auto; min-height: 17rem; padding: 1.25rem !important; }
.scene-shell:has(.scene-fallback:not([hidden])) .scene-fallback strong { font-size: 1.65rem; }
.scene-shell:has(.scene-fallback:not([hidden])) .post-overlay { position: relative; inset: auto; width: 100%; height: auto; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  @page { size: letter; margin: .58in; }
  body { background: white; color: #111; font-family: Arial,sans-serif; font-size: 10pt; line-height: 1.35; }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block; }
  .print-head { padding-bottom: .16in; border-bottom: 2pt solid #103e43; }
  .print-head h1 { margin: 0; color: #103e43; font: 24pt Georgia,serif; }
  .print-head p { margin: .04in 0; }
  .print-step { margin: .2in 0; break-inside: avoid; }
  .print-step h2 { margin: 0 0 .08in; color: #103e43; font: 16pt Georgia,serif; }
  .print-answer { padding: .09in .12in; border-left: 4pt solid #df725e; background: #f8eee8; }
  .print-evidence { display: grid; grid-template-columns: repeat(3,1fr); gap: .1in; }
  .print-evidence div { padding: .1in; border: .6pt solid #aaa; }
  .print-page { break-before: page; }
  .print-foot { margin-top: .2in; color: #555; font-size: 8pt; }
}
