:root {
  --brand-red: #ea1f27;
  --brand-pbs: #2638c4;
  --brand-blue: #1e7fc1;
  --brand-navy: #121340;
  --brand-gradient: linear-gradient(90deg, #ea1f27 0%, #a5002f 30%, #625d80 62%, #2638c4 100%);
  --bg: #f3f4fa;
  --panel: #ffffff;
  --panel-2: #f8f9fd;
  --panel-3: #eceefa;
  --line: rgba(18, 19, 64, .12);
  --line-strong: rgba(18, 19, 64, .22);
  --text: #121340;
  --text-2: #2f325e;
  --muted: #5d6187;
  --accent: #176aa3;
  --accent-hover: #125682;
  --accent-ink: #ffffff;
  --accent-soft: rgba(30, 127, 193, .1);
  --accent-rgb: 30, 127, 193;
  --ok: #0d7f52;
  --warn: #8a5d00;
  --warn-soft: rgba(255, 191, 0, .16);
  --danger: #c62828;
  --danger-text: #9f1d1d;
  --danger-soft: rgba(198, 40, 40, .07);
  --field-bg: #ffffff;
  --bar-bg: rgba(255, 255, 255, .92);
  --ink-rgb: 18, 19, 64;
  --hero-bg: #121340;
  --hero-text: #ffffff;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(18, 19, 64, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --max: 1120px;
  --bar-h: 60px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.55; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
h3 { font-size: clamp(18px, 2vw, 22px); margin-top: 1.4em; }
h4 { font-size: 16px; }
p { margin: 0 0 .9em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--panel); color: var(--text); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { left: 8px; }

/* App bar */
.appbar { position: sticky; top: 0; z-index: 50; height: var(--bar-h); background: var(--bar-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.appbar::after { content: ""; display: block; height: 3px; background: var(--brand-gradient); }
.appbar-inner { max-width: var(--max); margin: 0 auto; height: calc(var(--bar-h) - 3px); padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none !important; font-weight: 700; font-size: 16px; min-width: 0; }
.brand img { height: 26px; display: block; }
.brand span { border-left: 1px solid var(--line-strong); padding-left: 12px; white-space: nowrap; transform: translateY(var(--brand-nudge, 0)); }
.appbar nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.appbar nav a { color: var(--text-2); text-decoration: none; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; }
.appbar nav a:hover { background: rgba(var(--ink-rgb), .06); color: var(--text); }
@media (max-width: 720px) { .appbar nav a.nav-link { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); font: inherit; font-weight: 600; font-size: 15px; padding: 10px 16px; border-radius: 999px; cursor: pointer; text-decoration: none !important; transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.btn:hover { background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: #c9151c; border-color: #c9151c; color: #fff; }
.btn.primary:hover { background: #a8111a; border-color: #a8111a; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(var(--ink-rgb), .06); }
.btn.icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.btn.danger { color: var(--danger-text); border-color: var(--danger); background: var(--danger-soft); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Layout */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
main.wrap { padding-bottom: 72px; }
.hero { background: var(--hero-bg); color: var(--hero-text); }
.hero.hero.hero-photo { background: var(--bg); padding: 0 20px; }
.hero.hero-photo .wrap { position: relative; isolation: isolate; overflow: hidden; max-width: var(--max); min-height: 430px; padding-left: 28px; padding-right: 28px; border-radius: 0 0 24px 24px; background: #121340; box-shadow: var(--shadow); }
.hero.hero-photo .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--hero-x, 50%) var(--hero-y, 6%); z-index: -2; animation: none !important; }
.hero.hero-photo .wrap::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(18,19,64,.94) 0%, rgba(18,19,64,.82) 34%, rgba(18,19,64,.30) 54%, rgba(18,19,64,.12) 100%); }
.hero.hero-photo h1 { max-width: 560px; }
.hero.hero-photo .dek { max-width: 500px; }
.hero.hero-photo .dek, .hero.hero-photo h1, .hero.hero-photo .eyebrow { text-shadow: 0 2px 12px rgba(0,0,0,.5); }
@media (max-width: 860px) {
  .hero.hero.hero-photo { padding: 0; }
  .hero.hero-photo .wrap { border-radius: 0; min-height: 0; padding-top: calc(56.25vw - 24px); }
  .hero.hero-photo .hero-img { height: 56.25vw; object-position: 50% 0; }
  .hero.hero-photo .wrap::before { background: linear-gradient(180deg, rgba(18,19,64,0) 0, rgba(18,19,64,0) calc(56.25vw - 120px), rgba(18,19,64,1) 56.25vw); }
  .hero.hero-photo h1, .hero.hero-photo .dek { max-width: none; }
}
.hero-photo .snapshot { box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.hero .wrap { padding-top: clamp(32px, 6vw, 64px); padding-bottom: clamp(28px, 5vw, 52px); display: grid; grid-template-columns: 1.3fr .7fr; gap: 32px; align-items: end; }
.hero h1 { font-size: clamp(32px, 5vw, 56px); margin: 10px 0 12px; letter-spacing: -.02em; }
.hero .eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #dde3ff; }
.hero .dek { font-size: clamp(16px, 2vw, 20px); color: #e2e6ff; max-width: 760px; margin: 0; }
.hero .dek a { color: #fff; }
.snapshot { background: var(--panel); color: var(--text); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.snapshot h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.snapshot p { margin: 0 0 6px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: #155f91; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }

.section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 3vw, 32px); margin: 22px 0; }
.section > h2 { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.num { color: var(--brand-red); font-weight: 800; margin-right: 6px; }
.lead { font-size: 17px; color: var(--text-2); }

.notice { border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 16px; margin: 14px 0; }
.notice.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.notice.danger { border-left-color: var(--danger); background: var(--danger-soft); }

.callout-row { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
@media (max-width: 720px) { .callout-row { grid-template-columns: 1fr; } .callout-row .btn { width: 100%; } }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.grid-2 > *, .grid-3 > * { min-width: 0; }

.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.card .tag { display: inline-block; font-size: 12px; font-weight: 700; color: #155f91; margin-bottom: 6px; }
.card b, .card strong { display: block; margin-bottom: 4px; }
.card small { display: block; color: var(--muted); margin-top: 8px; }
.card ol, .card ul { padding-left: 20px; margin: 6px 0 0; }
.card li { margin-bottom: 6px; }

.objectives { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.objectives > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; font-size: 15px; }
.objectives b { display: block; color: var(--brand-pbs); margin-bottom: 4px; }
@media (max-width: 760px) { .objectives { grid-template-columns: 1fr; } }

.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
.step { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--panel-2); }
.step .time { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.step h4 { margin: 4px 0 6px; }
.step p { margin: 0; }

/* Pathway + timeline */
.pathway { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; counter-reset: step; }
.pathway > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; font-size: 14px; position: relative; }
.pathway > div::before { counter-increment: step; content: counter(step); display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-navy); color: #fff; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.pathway b { display: block; }
@media (max-width: 900px) { .pathway { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .pathway { grid-template-columns: 1fr; } }
.timeline { list-style: none; padding-left: 18px; margin: 8px 0 8px 8px; }
.timeline { border-left: 3px solid var(--line-strong); margin: 8px 0 8px 8px; padding-left: 18px; display: grid; gap: 10px; }
.timeline > div { position: relative; font-size: 15px; }
.timeline > div::before { content: ""; position: absolute; left: -26px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--brand-red); border: 2px solid var(--panel); }
.timeline b { display: inline-block; min-width: 110px; color: var(--text-2); }
.status { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin: 0 4px 6px 0; border: 1px solid var(--line-strong); color: var(--text-2); }
.status.ok { color: var(--ok); border-color: var(--ok); }
.status.warn { color: var(--warn); border-color: var(--warn); }
.graphic { margin: 18px 0; }
.graphic .caption { font-size: 14px; color: var(--muted); margin: 10px 0 0; }

/* Podcast */
.podcast { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr); gap: 16px; }
@media (max-width: 860px) { .podcast { grid-template-columns: 1fr; } }
.podcast > * { min-width: 0; }
.player { display: flex; flex-direction: column; gap: 12px; }
.player audio { width: 100%; display: block; }
.transcript { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); display: flex; flex-direction: column; }
.transcript-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.transcript-head b { font-size: 15px; }
.transcript-meta { color: var(--muted); display: flex; gap: 10px; font-variant-numeric: tabular-nums; }
.transcript-scroll { height: 320px; overflow-y: auto; padding: 6px; scroll-behavior: smooth; }
.transcript-row { display: grid; grid-template-columns: 52px 1fr; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.transcript-row:hover { background: rgba(var(--ink-rgb), .06); }
.transcript-row.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.transcript-row .stamp { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 2px; }
.transcript-row.active .stamp { color: #155f91; }

/* Video facade */
.videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 720px) { .videos { grid-template-columns: 1fr; } }
.video { min-width: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: #000; border: 1px solid var(--line); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; background: center / cover no-repeat #000; display: flex; align-items: center; justify-content: center; }
.video-play::after { content: ""; width: 64px; height: 44px; border-radius: 12px; background: var(--brand-red) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='white' d='M8 5v14l11-7z'/></svg>") center / 26px no-repeat; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.video-play:hover::after { background-color: #c9151c; }
.video b { display: block; margin-top: 8px; }
.video small { display: block; color: var(--muted); }
.video .fallback { font-size: 13px; color: var(--muted); margin-top: 4px; }

.standards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .standards { grid-template-columns: 1fr; } }
.standards > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; }
.standards b { display: block; color: var(--brand-pbs); margin-bottom: 2px; }

footer { color: var(--muted); font-size: 13px; padding: 20px; text-align: center; border-top: 1px solid var(--line); }

/* Worksheet */
.ws-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .prompt { font-weight: 600; color: var(--text-2); }
input[type=text], input[type=date], textarea { width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--field-bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; }
textarea { min-height: 96px; resize: vertical; }
textarea.tall { min-height: 180px; }
input.blank { display: inline-block; width: 180px; padding: 6px 10px; margin: 0 4px; vertical-align: baseline; }
.question { margin: 0 0 14px; }
.question p { margin: 0 0 6px; }
.table-wrap { overflow-x: auto; }
table.chart { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.chart th, table.chart td { border: 1px solid var(--line); padding: 8px; vertical-align: top; text-align: left; }
table.chart th { background: var(--panel-3); font-weight: 700; }
table.chart td:first-child { font-weight: 600; width: 130px; }
table.chart textarea { min-height: 80px; }
.ws-actions { position: sticky; bottom: 0; z-index: 40; background: var(--bar-bg); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 12px 0; }
.ws-actions .wrap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ws-actions .ws-status { color: var(--ok); font-weight: 600; font-size: 14px; margin-left: auto; }

/* Catalog */
.lesson-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 720px) { .lesson-list { grid-template-columns: 1fr; } }
.lesson-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .15s ease, border-color .15s ease; }
.lesson-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.lesson-card h3 { margin: 6px 0 8px; }
.lesson-card .meta { color: var(--muted); font-size: 14px; }

/* Motion: a brief entrance on the hero only. Everything else stays still. */
@media (prefers-reduced-motion: no-preference) {
  .hero .wrap > * { animation: rise .5s ease both; }
  .hero .wrap > :nth-child(2) { animation-delay: .08s; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Print */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  .appbar, .ws-actions, .no-print, .theme-toggle, .skip-link, audio, .video-frame, .transcript { display: none !important; }
  .hero { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .hero .eyebrow, .hero .dek { color: #000; }
  .hero-photo .wrap { background: none !important; min-height: 0; padding-top: 0 !important; } .hero-photo .hero-img, .hero-photo .wrap::before { display: none !important; }
  .snapshot, .section, .card, .step, .objectives > div, .standards > div, .pathway > div { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .section { margin: 12px 0; padding: 14px; }
  a { color: #000; }
  .video b::after { content: " (" attr(data-url) ")"; font-weight: 400; font-size: 12px; }
  input, textarea { border: 1px solid #777 !important; background: #fff !important; color: #000 !important; }
  textarea { min-height: 110px; }
  .objectives, .steps, .grid-2, .grid-3, .standards, .videos { grid-template-columns: 1fr 1fr; }
}
