:root {
  --ink: #1a1a2e;
  --paper: #fafaf7;
  --accent: #2e5395;
  --accent-light: #d9e2f3;
  --accent-dark: #1f3864;
  --muted: #4f4f4f;
  --soft: #eeeeee;
  --border: #cccccc;
  --story: #e8e2f5;
  --concepts: #d9e7f3;
  --do: #fff4d9;
  --show: #e2efda;
  --reflect: #f5e6d9;
  --good: #e2efda;
  --ai-orange: #f5a623;
  --ai-orange-hover: #ffb947;
  /* Saturated spines + deep heading text per rhythm family.
     --spine-do is deliberately duller than --ai-orange: the brightness
     gap keeps AI chips unmistakable. Do not brighten it. */
  --spine-story: #7a5fc0;
  --deep-story: #3d2e66;
  --spine-concepts: #3f72b8;
  --deep-concepts: #173a63;
  --spine-do: #b58310; /* darkened from spec's #c99212 to pass 3:1 on white (2.76 → 3.38) */
  --deep-do: #5c4508;
  --spine-show: #6da144;
  --deep-show: #2f4a1c;
  --spine-reflect: #c0763a;
  --deep-reflect: #6e3a14;
  --panel-bg: #eef2fa;
  --divider: #e3e1da;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ====== Skip link (a11y) ====== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 700;
  z-index: 200;
  text-decoration: none;
}
.skip-link:focus {
  left: 8px;
  outline: 2px solid var(--spine-do);
  outline-offset: 2px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

img { max-width: 100%; height: auto; display: block; }

/* ====== Top nav ====== */
.topnav {
  background: var(--ink);
  color: white;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav .brand {
  font-weight: 700;
  font-size: 16px;
  color: white;
  text-decoration: none;
}
.topnav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 4px;
}
.topnav a:hover { background: rgba(255, 255, 255, 0.15); color: white; }
.topnav a.active { background: var(--accent); color: white; font-weight: 600; }
.topnav .spacer { flex: 1; }
.topnav .ai-btn {
  background: var(--ai-orange);
  color: var(--ink);
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
}
.topnav .ai-btn:hover { background: var(--ai-orange-hover); color: var(--ink); }

/* ====== Breadcrumbs ====== */
.breadcrumbs {
  background: white;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.breadcrumbs-inner { padding: 0; max-width: 1100px; }
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .crumb-current { color: var(--ink); font-weight: 600; }

/* ====== Home hero ====== */
.home-hero {
  background:
    radial-gradient(ellipse at 20% 30%, rgba(201, 146, 18, 0.18), transparent 55%),
    linear-gradient(135deg, var(--ink) 0%, var(--accent-dark) 60%, var(--accent) 100%);
  color: white;
  padding: 56px 24px 48px;
  position: relative;
  overflow: hidden;
}
.home-hero .container { padding: 0; position: relative; z-index: 1; }
.home-hero h1 {
  font-size: 40px;
  line-height: 1.15;
  color: white;
  max-width: 720px;
  margin-bottom: 14px;
}
.home-hero .hero-tagline {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.88);
  max-width: 640px;
  line-height: 1.55;
}
.home-hero .hero-mark {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 220px;
  opacity: 0.18;
  pointer-events: none;
  line-height: 1;
}

/* ====== Page header ====== */
/* The one saturated block at the top of every page. */
.page-header {
  background: var(--accent-dark);
  padding: 32px 24px 24px;
  border-bottom: 2px solid var(--accent-light);
}
.page-header .container { padding: 0; }
.page-header h1 {
  font-size: 32px;
  color: white;
  margin-bottom: 8px;
  line-height: 1.2;
}
.page-header .tagline {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 720px;
}
/* Unit landing pages: real calendar span under the unit title. */
.page-header .unit-span {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
}

/* ====== Layout ====== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* ====== Section grid (landing-page entry points) ====== */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.section-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.section-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 83, 149, 0.08);
  color: var(--ink);
}
.section-card .card-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 6px;
}
.section-card .card-desc {
  font-size: 14px;
  color: var(--muted);
}
/* Meeting dates on a unit landing page's block cards. */
.section-card .card-dates {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-top: 8px;
}

/* ====== Unit map dashboard ====== */
/* Summative panel: same treatment as a block page's learning panel. */
.map-summative {
  background: var(--panel-bg);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.map-summative-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.map-summative h2 {
  font-size: 22px;
  color: var(--ink);
  margin: 6px 0 2px;
}
.map-strands {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 10px;
}
.map-components {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.map-chip {
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 3px 10px;
  border-radius: 999px;
}
.map-summative-note {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 0;
}

.map-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.map-row {
  background: white;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin-bottom: 12px;
}
.map-row.is-highlight {
  background: var(--do);
  border-left-color: var(--spine-do);
}
.map-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.map-block {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  text-decoration: none;
}
a.map-block:hover { text-decoration: underline; }
.map-dates {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
}
.map-li {
  font-size: 14px;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 6px;
}
/* The line is already italic, so nested emphasis flips upright to stay visible. */
.map-li em {
  font-style: normal;
  font-weight: 600;
}
.map-produces {
  font-size: 14px;
  margin: 0 0 4px;
}
.map-feeds {
  font-size: 14px;
  font-weight: 600;
  color: var(--deep-concepts);
  margin: 0;
}
.map-event {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
}
.map-row.is-highlight .map-event {
  font-weight: 700;
  color: var(--deep-do);
}
.map-foot {
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--divider);
  padding-top: 12px;
  margin-top: 20px;
}

/* Prominent entry link to a unit map. */
.map-link-card {
  display: block;
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  text-decoration: none;
  color: var(--accent-dark);
  font-weight: 700;
}
.map-link-card:hover {
  background: white;
  color: var(--accent-dark);
}
.map-link-card .map-link-sub {
  display: block;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ====== Unit schedule ("when each block runs") ====== */
.unit-schedule {
  background: white;
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
}
.unit-schedule > summary {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-dark);
  cursor: pointer;
}
.unit-schedule-scroll { overflow-x: auto; }
.unit-schedule table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 0;
  font-size: 13px;
}
.unit-schedule th, .unit-schedule td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}
.unit-schedule thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.unit-schedule tbody th { font-weight: 600; }
.unit-schedule tbody tr:last-child th,
.unit-schedule tbody tr:last-child td { border-bottom: none; }
/* Reserved for locked formative/summative dates. */
.unit-schedule tr.is-assessment { background: var(--show); }
.unit-schedule tr.is-assessment th { color: var(--deep-show); }
.schedule-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--spine-show);
  color: white;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}
.unit-schedule-note {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ====== Stub section card (non-clickable "coming soon" tile) ====== */
.section-card.stub {
  border-style: dashed;
  border-color: var(--muted);
  cursor: default;
  background: var(--paper);
}
.section-card.stub:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--muted);
}
.section-card.stub .card-title { color: var(--muted); }
.section-card.stub .card-desc { color: var(--muted); }
.coming-soon-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--soft);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* ====== Stub-page note ====== */
.stub-note {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 14px 16px;
  border-radius: 6px;
  margin: 16px 0 24px;
  font-size: 14px;
  color: var(--ink);
}
.stub-note strong { color: var(--accent-dark); }

/* ====== Prose ====== */
.prose h2 {
  font-size: 22px;
  color: var(--ink);
  margin: 28px 0 10px;
}
.prose h3 {
  font-size: 17px;
  color: var(--ink);
  margin: 22px 0 8px;
}
.prose p { margin-bottom: 12px; }
.prose ul, .prose ol { margin: 8px 0 14px 24px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); }
.prose em { color: var(--ink); }
.prose blockquote {
  border-left: 4px solid var(--accent-light);
  padding: 4px 0 4px 16px;
  margin: 14px 0;
  color: var(--muted);
  font-style: italic;
}

/* ====== Prose + block-section tables ====== */
.prose table, .block-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.prose th, .prose td, .block-section th, .block-section td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.prose th, .block-section th {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.prose tbody tr:last-child td, .block-section tbody tr:last-child td { border-bottom: none; }
.prose tbody tr:nth-child(even) td, .block-section tbody tr:nth-child(even) td { background: var(--paper); }

/* ====== Callouts (prose-scoped) ====== */
.callout {
  border-radius: 8px;
  padding: 14px 16px;
  margin: 16px 0;
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
  font-size: 14px;
}
/* Worked example of a notebook entry header. Monospace so students can see the
   pipes and spacing they are copying. */
.entry-header-demo {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--do);
  border-left: 4px solid var(--spine-do);
  padding: 12px 14px;
  border-radius: 0 6px 6px 0;
  margin: 12px 0;
  overflow-x: auto;
}
.callout.warn  { border-left-color: #b58832; background: #fff4d9; }
.callout.good  { border-left-color: #6b8e3d; background: var(--good); }
.callout.exemplar-note { border-left-color: #6b8e3d; background: var(--show); }
/* Two-texts reading pair. Both cards share this one class deliberately: any
   difference in border, width, type size or spacing between them reads as a
   clue about the texts themselves. Do not add a Text A or Text B variant. */
.text-card {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 18px 0;
  background: white;
}
.text-card h2 { font-size: 18px; color: var(--ink); margin-bottom: 10px; }
.text-card p { margin-bottom: 10px; }
.text-card p:last-child { margin-bottom: 0; }
.text-card-note { font-size: 13px; color: var(--muted); }
.two-texts-lede { font-size: 16px; margin-bottom: 18px; }

/* One task, an extension, a support. Used where a block has a single required
   task rather than a real choice board, so the routes are named for what they
   are: a stuck student can act on "If you are stuck" in a way they cannot act
   on "Path C, Pairs, Practice". `.support` repeats `.activity`'s colours on
   purpose; keeping the trio's names parallel matters more than avoiding it. */
.callout.task    { border-left-color: var(--spine-concepts); background: var(--concepts); }
.callout.extend  { border-left-color: var(--spine-show);     background: var(--show); }
.callout.support { border-left-color: var(--spine-do);       background: var(--do); }

.callout.activity { border-left-color: var(--spine-do); background: var(--do); }
.callout.sketch-first { border-left-color: #7c6bb0; background: var(--story); }
.callout.factstorm { border-left-color: var(--accent); background: var(--concepts); }

/* ====== Lesson-return links (supporting pages) ====== */
.lesson-return {
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 0;
}
.lesson-return-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 24px 0;
  font-size: 14px;
}
.lesson-return-bottom a {
  display: inline-block;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  text-decoration: none;
  font-weight: 600;
}

/* ====== EAL tap-to-define key terms ====== */
a.key-term {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px dotted var(--accent);
  cursor: help;
}
a.key-term[aria-expanded="true"] { background: var(--accent-light); }
.key-term-panel {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 14px;
}
.key-term-panel-title {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 4px;
}
.key-term-panel p { margin: 0 0 6px; }
.key-term-panel-links { font-size: 13px; margin-bottom: 0 !important; }

/* ====== Power Notes (worked example + seed strips) ====== */
.power-example {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.8;
}
.power-example .pe-topic { font-weight: 700; margin-bottom: 6px; }
.power-example .p2 { margin-left: 22px; }
.power-example .p3 { margin-left: 44px; }
.power-example .p4 { margin-left: 66px; }
.power-seeds {
  background: var(--do);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  margin: 0 0 14px;
  font-size: 13px;
}
.power-seeds summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.power-seeds-body { padding: 6px 2px 4px; }

/* ====== Content figures (shared) ====== */
.content-figure { margin: 20px auto; max-width: 720px; }
.content-figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.content-figure figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ====== Reading pages ====== */
.prose figure { margin: 20px 0; }
.prose figure img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; }
.prose figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.source-type { font-size: 12px; color: var(--muted); }

/* ====== Resources Library ====== */
.library-entry { margin-bottom: 4px; }
.opvl {
  margin: 8px 0 20px;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.opvl dt {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}
.opvl dt:first-child { margin-top: 0; }
.opvl dd { margin: 0; }
.callout .callout-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--ink);
}

/* ====== AI Partner launch button ====== */
.partner-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ai-orange);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  padding: 14px 22px;
  border-radius: 10px;
  text-decoration: none;
  margin: 18px 0 8px;
  border: 2px solid transparent;
  transition: background 0.15s, transform 0.1s;
}
.partner-launch:hover {
  background: var(--ai-orange-hover);
  color: var(--ink);
  transform: translateY(-1px);
}
.partner-launch.placeholder {
  background: transparent;
  color: var(--muted);
  border: 2px dashed var(--border);
  font-weight: 600;
  cursor: not-allowed;
}
.partner-launch.placeholder:hover {
  background: transparent;
  color: var(--muted);
  transform: none;
}
.partner-launch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.partner-launch-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

/* ====== Simulator iframe ====== */
.simulator-frame {
  width: 100%;
  min-height: 800px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  display: block;
}

/* ====== Footer ====== */
.site-footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 24px;
  margin-top: 48px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer-nav {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-weight: 600;
}
.site-footer-meta { color: var(--muted); }

/* ====== Responsive ====== */
@media (max-width: 640px) {
  .topnav {
    gap: 8px;
    padding: 10px 16px;
  }
  .topnav .spacer { display: none; }
  .container { padding: 16px; }
  .page-header { padding: 24px 16px 18px; }
  .page-header h1 { font-size: 26px; }
  .simulator-frame { min-height: 600px; }
  .home-hero { padding: 36px 16px 32px; }
  .home-hero h1 { font-size: 28px; }
  .home-hero .hero-tagline { font-size: 15px; }
  .home-hero .hero-mark { font-size: 140px; right: -30px; opacity: 0.12; }
  /* Wide tables become horizontally-scrollable on small screens */
  .prose table, .block-section table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    font-size: 13px;
    -webkit-overflow-scrolling: touch;
  }
  .prose th, .prose td, .block-section th, .block-section td { padding: 8px 10px; }
}
