:root {
  --ink: #101114;
  --muted: #666b73;
  --subtle: #8a9099;
  --line: #e3e5e8;
  --surface: #f5f5f7;
  --white: #ffffff;
  --blue: #1769e0;
  --blue-dark: #0d4ca8;
  --green: #138a55;
  --red: #c73838;
  --shadow: 0 24px 70px rgba(27, 31, 39, 0.09);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 13px;
  --content: 1180px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

.module.accent-blue { --accent: #1769e0; }
.module.accent-indigo { --accent: #5856d6; }
.module.accent-teal { --accent: #138a7a; }
.module.accent-orange { --accent: #d36c19; }
.module.accent-green { --accent: #138a55; }
.module.accent-red { --accent: #c73838; }
.module.accent-cyan { --accent: #087f9c; }
.module.accent-purple { --accent: #8b4bb7; }
.module.accent-gold { --accent: #9b6a05; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--white); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-size: 17px;
  line-height: 1.58;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, iframe { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--blue-dark); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  transform: translateY(-140%);
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(16, 17, 20, 0.08);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}
.header-inner {
  width: min(var(--content), calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  letter-spacing: -0.06em;
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.button {
  min-height: 42px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  font-size: 14px;
  font-weight: 680;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}
.button:hover { background: var(--blue-dark); color: var(--white); transform: translateY(-1px); }
.button.secondary { border-color: var(--line); background: var(--white); color: var(--ink); }
.button.secondary:hover { background: var(--surface); }

.hero {
  overflow: hidden;
  padding: 96px 0 64px;
  background:
    radial-gradient(circle at 82% 12%, rgba(70, 125, 255, 0.14), transparent 27%),
    radial-gradient(circle at 12% 80%, rgba(98, 214, 170, 0.12), transparent 25%),
    linear-gradient(180deg, #fbfcff 0%, #ffffff 78%);
}
.hero-inner {
  width: min(1020px, calc(100% - 40px));
  margin: 0 auto;
  text-align: center;
}
.eyebrow {
  margin: 0 0 18px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 900px;
  margin: 0 auto;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.062em;
}
.hero-lead {
  max-width: 760px;
  margin: 30px auto 0;
  color: var(--muted);
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.32;
  letter-spacing: -0.025em;
}
.hero-actions {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-note { margin: 20px auto 0; color: var(--subtle); font-size: 14px; }
.course-hero-art {
  width: min(920px, 100%);
  margin: 42px auto 0;
  overflow: hidden;
  aspect-ratio: 16 / 8.5;
  border: 1px solid rgba(16, 17, 20, 0.1);
  border-radius: 24px;
  background: #101418;
  box-shadow: 0 28px 70px rgba(25, 41, 75, 0.14);
}
.course-hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.progress-shell {
  width: min(820px, calc(100% - 40px));
  margin: 50px auto 0;
  padding: 24px;
  border: 1px solid rgba(16, 17, 20, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 45px rgba(40, 61, 108, 0.08);
  text-align: left;
}
.progress-copy { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; font-size: 14px; }
.progress-copy strong { font-weight: 720; }
.progress-copy span { color: var(--muted); }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e9edf4; }
.progress-value { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1769e0, #58a6ff); transition: width 300ms ease; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.course-nav-wrap {
  position: sticky;
  top: 64px;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.course-nav {
  width: min(var(--content), 100%);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.course-nav::-webkit-scrollbar { display: none; }
.course-nav a {
  flex: 0 0 auto;
  padding: 13px 12px 11px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.course-nav a:hover, .course-nav a.is-active { color: var(--ink); border-bottom-color: var(--blue); }

main { display: block; }
.overview {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  padding: 86px 0 42px;
}
.section-kicker { margin: 0 0 14px; color: var(--accent, var(--blue)); font-size: 13px; font-weight: 760; letter-spacing: 0.1em; text-transform: uppercase; }
.module .section-kicker { color: color-mix(in srgb, var(--accent) 72%, #000); }
.display-title {
  margin: 0;
  max-width: 900px;
  font-size: clamp(38px, 5.6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.052em;
}
.section-lead {
  max-width: 820px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(20px, 2.3vw, 25px);
  line-height: 1.42;
  letter-spacing: -0.02em;
}

.path {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
}
.path-step { min-width: 0; padding: 22px; background: var(--white); }
.path-step small { display: block; margin-bottom: 10px; color: var(--blue); font-weight: 720; }
.path-step strong { display: block; font-size: 17px; line-height: 1.22; }
.path-step p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

.module {
  --accent: #1769e0;
  scroll-margin-top: 126px;
  padding: 100px 0;
  border-top: 1px solid var(--line);
}
.module:nth-of-type(even) { background: #fafafa; }
.module-inner { width: min(var(--content), calc(100% - 40px)); margin: 0 auto; }
.module-head { max-width: 950px; }
.module-number {
  width: 46px;
  height: 46px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: color-mix(in srgb, var(--accent) 11%, white);
  color: var(--ink);
  font-size: 15px;
  font-weight: 790;
}

.outcomes {
  margin: 42px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  list-style: none;
}
.outcomes li {
  min-width: 0;
  padding: 18px 0 18px 22px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}
.outcomes strong { display: block; margin-bottom: 4px; color: var(--ink); }

.lesson-grid {
  margin-top: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 58px;
  align-items: start;
}
.lesson-grid > * { min-width: 0; }
.prose h3, .example-panel h3, .activity h3, .videos h3, .source-section h3 {
  margin: 0 0 16px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.032em;
}
.prose h4 { margin: 30px 0 10px; font-size: 18px; }
.prose p { margin: 0 0 20px; }
.prose ul, .prose ol { margin: 0 0 24px; padding-left: 24px; }
.prose li { margin: 8px 0; }
.muted { color: var(--muted); }

.concept-list { margin-top: 30px; border-top: 1px solid var(--line); }
.concept-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.34fr) minmax(0, 0.66fr);
  gap: 26px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.concept-row dt { font-weight: 720; }
.concept-row dd { margin: 0; color: var(--muted); }

.example-panel {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
}
.example-panel .label { display: block; margin-bottom: 10px; color: #83b8ff; font-size: 12px; font-weight: 760; letter-spacing: 0.1em; text-transform: uppercase; }
.example-panel p { color: #d8d9dd; }
.example-panel ol { padding-left: 22px; }
.example-panel li { margin: 10px 0; }
.formula {
  margin: 20px 0;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.5;
  white-space: nowrap;
}
.formula.light { border-color: var(--line); background: var(--surface); color: var(--ink); }
.note {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, white);
  color: #303641;
  font-size: 15px;
}
.note strong { color: var(--ink); }
.warning { background: #fff5e6; color: #6e4911; }

.activity {
  margin-top: 58px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
}
.activity-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr); gap: 40px; align-items: start; }
.activity ol { padding-left: 22px; }
.activity li { margin: 10px 0; }
.answer { padding: 22px; border-radius: var(--radius-md); background: var(--surface); color: var(--muted); }
.answer strong { color: var(--ink); }

.quiz { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.quiz-question { margin: 0 0 16px; font-weight: 720; }
.quiz-options { display: flex; flex-wrap: wrap; gap: 10px; }
.quiz-option {
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}
.quiz-option:hover { border-color: #aeb4bd; background: var(--surface); }
.quiz-option.is-correct { border-color: var(--green); background: #eaf8f1; color: #0c6b40; }
.quiz-option.is-wrong { border-color: var(--red); background: #fff0f0; color: #9f2525; }
.quiz-feedback { min-height: 24px; margin: 14px 0 0; color: var(--muted); }
.quiz-feedback.success { color: #08683c; }
.quiz-feedback.error { color: #982323; }

.videos { margin-top: 62px; }
.video-intro { max-width: 760px; color: var(--muted); }
.video-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.video-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #111; }
.video-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.video-copy { padding: 20px 22px 22px; }
.video-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.video-copy h4 { margin: 0; font-size: 18px; line-height: 1.28; letter-spacing: -0.016em; }
.video-copy p { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.video-link { display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 680; }

.complete-row { margin-top: 42px; display: flex; justify-content: flex-end; }
.complete-button {
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 680;
  cursor: pointer;
}
.complete-button::before { content: "○"; margin-right: 8px; color: var(--subtle); }
.complete-button.is-complete { border-color: #bde3cf; background: #ecf8f1; color: #0d6f42; }
.complete-button.is-complete::before { content: "✓"; color: var(--green); }

.source-section {
  scroll-margin-top: 120px;
  padding: 96px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.source-inner { width: min(980px, calc(100% - 40px)); margin: 0 auto; }
.source-list { margin: 32px 0 0; padding: 0; list-style: none; counter-reset: sources; }
.source-list li { position: relative; padding: 22px 0 22px 50px; border-top: 1px solid #d7d9dd; counter-increment: sources; }
.source-list li::before { content: counter(sources, decimal-leading-zero); position: absolute; left: 0; top: 24px; color: var(--subtle); font-size: 13px; font-weight: 740; }
.source-list strong { display: block; }
.source-list p { margin: 5px 0 0; color: var(--muted); }
.source-list a { overflow-wrap: anywhere; }

.site-footer { padding: 34px 0 46px; background: var(--surface); color: var(--muted); font-size: 13px; }
.footer-inner { width: min(980px, calc(100% - 40px)); margin: 0 auto; padding-top: 24px; border-top: 1px solid #d7d9dd; display: flex; justify-content: space-between; gap: 20px; }

@media (max-width: 900px) {
  .path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outcomes { grid-template-columns: 1fr; gap: 8px; }
  .lesson-grid { grid-template-columns: 1fr; gap: 36px; }
  .activity-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .header-inner { width: min(100% - 28px, var(--content)); min-height: 58px; }
  .brand span:last-child { display: none; }
  .header-actions .secondary { display: none; }
  .button { min-height: 40px; padding: 9px 13px; }
  .hero { padding: 68px 0 46px; }
  .hero-inner, .overview, .module-inner, .source-inner, .footer-inner { width: calc(100% - 30px); }
  .hero h1 { font-size: clamp(44px, 14vw, 66px); }
  .hero-lead { font-size: 20px; }
  .progress-shell { width: calc(100% - 30px); margin-top: 36px; padding: 20px; }
  .progress-copy { flex-direction: column; gap: 3px; }
  .course-nav-wrap { top: 58px; }
  .course-nav { padding: 0 10px; }
  .overview { padding: 66px 0 26px; }
  .path { grid-template-columns: 1fr; }
  .module { padding: 74px 0; scroll-margin-top: 114px; }
  .display-title { font-size: 40px; }
  .section-lead { font-size: 19px; }
  .concept-row { grid-template-columns: 1fr; gap: 5px; }
  .example-panel, .activity { padding: 24px 20px; border-radius: 22px; }
  .formula { font-size: 14px; }
  .video-grid { grid-template-columns: 1fr; }
  .complete-row { justify-content: stretch; }
  .complete-button { width: 100%; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  @page { size: A4; margin: 15mm 14mm 17mm; }
  :root { --ink: #000; --muted: #333; --line: #d0d0d0; }
  body { font-size: 10.5pt; line-height: 1.42; }
  .site-header, .course-nav-wrap, .hero-actions, .progress-shell, .complete-row, .quiz-options, .skip-link, .course-hero-art { display: none !important; }
  .hero { padding: 16mm 0 10mm; background: #fff; }
  .hero h1 { font-size: 34pt; }
  .hero-lead { font-size: 15pt; }
  .overview, .module, .source-section { padding: 12mm 0; }
  .display-title { font-size: 25pt; }
  .section-lead { font-size: 13pt; }
  .module-inner, .overview, .source-inner, .footer-inner, .hero-inner { width: 100%; }
  .lesson-grid { grid-template-columns: 1fr; gap: 8mm; }
  .outcomes { grid-template-columns: repeat(3, 1fr); }
  .example-panel { background: #f1f1f1; color: #000; box-shadow: none; break-inside: avoid; }
  .example-panel p { color: #222; }
  .example-panel .label { color: #174d94; }
  .formula { border-color: #bbb; background: #fff; color: #000; white-space: normal; }
  .activity, .video-card, .concept-row, .path-step { break-inside: avoid; }
  .video-grid { grid-template-columns: 1fr 1fr; gap: 5mm; }
  .video-frame { display: none; }
  .video-card { border-radius: 10px; }
  .video-copy { padding: 4mm; }
  .video-link::after { content: "  (" attr(href) ")"; color: #555; font-weight: 400; }
  .module:nth-of-type(even), .source-section, .site-footer { background: #fff; }
  a { color: #000; }
  .source-list a { color: #174d94; }
  .site-footer { padding: 8mm 0 0; }
}
