:root {
  --ink: #0b1c2c;
  --ink-soft: #183247;
  --paper: #f4f2eb;
  --paper-bright: #fffdf7;
  --muted: #5b6871;
  --line: #cad4d8;
  --cyan: #72e7c3;
  --cyan-deep: #087f72;
  --amber: #ffb454;
  --coral: #ff6b5e;
  --blue: #3f7cff;
  --green: #4ca66b;
  --shadow: 0 22px 70px rgba(11, 28, 44, 0.1);
  --radius: 22px;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #0f202e;
  --paper-bright: #152938;
  --ink: #f5f5ee;
  --ink-soft: #dbe8ec;
  --muted: #a7bac3;
  --line: #2d4858;
  --cyan-deep: #72e7c3;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: -80px;
  z-index: 1000;
  padding: 12px 18px;
  background: var(--amber);
  color: #0b1c2c;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(20px, 4vw, 64px);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.scrolled {
  border-color: var(--line);
  box-shadow: 0 10px 30px rgba(11, 28, 44, 0.06);
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--cyan);
  font-family: "IBM Plex Mono", monospace;
  font-size: 24px;
  font-weight: 600;
  border-radius: 50% 50% 50% 10px;
}

.brand-copy {
  display: grid;
  line-height: 1.08;
}

.brand-copy strong {
  font-size: 17px;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.main-nav a {
  position: relative;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 2px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  transform: scaleX(1);
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.icon-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.moon-icon,
[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: block;
}

.compact-cta {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  padding: 0 17px;
  background: var(--ink);
  color: var(--paper-bright);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 3px 16px 16px 16px;
}

.section-shell {
  width: min(1380px, calc(100% - 48px));
  margin-inline: auto;
}

.hero {
  position: relative;
  min-height: calc(100vh - 76px);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  align-items: center;
  gap: clamp(32px, 6vw, 100px);
  padding: clamp(64px, 8vw, 120px) max(24px, calc((100vw - 1380px) / 2));
  background: #0b1c2c;
  color: #f7f6ef;
}

.hero::after {
  content: "";
  position: absolute;
  width: 550px;
  height: 550px;
  left: -280px;
  bottom: -330px;
  border: 90px solid rgba(114, 231, 195, 0.08);
  border-radius: 50%;
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to right, black, transparent 72%);
}

.hero-copy,
.hero-lab {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--cyan);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 34px;
  height: 1px;
  background: currentColor;
}

.eyebrow.dark {
  color: var(--cyan-deep);
}

.hero h1,
.section-heading h2,
.path-intro h2,
.challenge-copy h2,
.toolkit-layout h2 {
  margin: 0;
  font-size: clamp(42px, 5.3vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero h1 em {
  color: var(--amber);
  font-style: normal;
}

.hero-intro {
  max-width: 690px;
  margin: 30px 0 0;
  color: #b9cad2;
  font-size: clamp(18px, 1.7vw, 23px);
  line-height: 1.55;
}

.hero-actions,
.challenge-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
}

.primary-button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 0 22px;
  background: var(--cyan);
  color: #0b1c2c;
  border: 0;
  border-radius: 4px 20px 20px 20px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(114, 231, 195, 0.18);
}

.text-button {
  min-height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d8e4e8;
  font-weight: 600;
  cursor: pointer;
}

.text-button span {
  margin-left: 5px;
  color: var(--amber);
}

.hero-stats {
  display: flex;
  gap: clamp(24px, 4vw, 55px);
  margin: 58px 0 0;
}

.hero-stats div {
  display: grid;
  gap: 4px;
}

.hero-stats dt {
  color: #fff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 28px;
  font-weight: 600;
}

.hero-stats dd {
  margin: 0;
  color: #8ba1ac;
  font-size: 12px;
}

.hero-lab {
  max-width: 650px;
  justify-self: end;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 45px 100px rgba(0, 0, 0, 0.22);
  border-radius: 38px 10px 38px 38px;
  backdrop-filter: blur(12px);
}

.lab-label,
.lab-readout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 19px 24px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.lab-label {
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.lab-label span,
.lab-readout span:last-child {
  color: #8197a2;
}

.lab-label strong {
  color: var(--amber);
  font-size: 14px;
}

.lab-readout {
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--cyan);
}

.lab-visual {
  display: block;
  width: 100%;
  padding: 12px;
  color: rgba(255, 255, 255, 0.13);
}

.grid-plane {
  color: rgba(255, 255, 255, 0.12);
}

.trajectory {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 16px rgba(114, 231, 195, 0.4));
}

.moving-particle {
  fill: var(--amber);
  filter: drop-shadow(0 0 14px rgba(255, 180, 84, 0.6));
}

.vector {
  color: var(--coral);
}

.vector line,
.axes line {
  stroke: currentColor;
  stroke-width: 3;
}

.vector text,
.axes text,
.equation,
.energy-bars text {
  fill: currentColor;
  font-family: "IBM Plex Mono", monospace;
  font-size: 20px;
}

.axes {
  color: rgba(255, 255, 255, 0.38);
}

.energy-bars rect:first-child {
  fill: var(--blue);
}

.energy-bars rect:nth-child(2) {
  fill: var(--amber);
}

.energy-bars text {
  fill: #9bb0ba;
}

.equation {
  fill: #a6bac4;
}

.pulse-ring {
  fill: none;
  stroke: var(--coral);
  stroke-width: 2;
  opacity: 0.55;
  animation: pulse 2.2s ease-out infinite;
}

.nucleus-halo {
  fill: rgba(114, 231, 195, 0.08);
  stroke: rgba(114, 231, 195, 0.18);
  stroke-width: 1.5;
  animation: nucleus-breathe 3.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.heavy-nucleus {
  stroke: rgba(255, 255, 255, 0.32);
  stroke-width: 2;
}

.nucleon-texture circle {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1;
}

.nucleon-texture .p,
.alpha-proton {
  fill: var(--coral);
}

.nucleon-texture .n,
.alpha-neutron {
  fill: var(--blue);
}

.model-caption,
.parent-label text,
.daughter-label text,
.stage-label,
.alpha-key text,
.decay-equation,
.energy-note {
  font-family: "IBM Plex Mono", monospace;
}

.model-caption {
  fill: #8197a2;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.parent-label text,
.daughter-label text {
  fill: #fffaf3;
  text-anchor: middle;
  font-size: 23px;
  font-weight: 600;
}

.parent-label .nucleus-count,
.daughter-label .nucleus-count {
  fill: #b8c9d0;
  font-size: 10px;
  font-weight: 500;
}

.stage-label {
  fill: #8197a2;
  text-anchor: middle;
  font-size: 9px;
}

.radiation-path {
  fill: none;
  stroke: var(--amber);
  stroke-width: 2;
  stroke-dasharray: 5 8;
  opacity: 0.58;
}

.alpha-cluster circle {
  stroke: rgba(255, 255, 255, 0.65);
  stroke-width: 1.5;
}

.alpha-key {
  fill: #a6bac4;
  font-size: 10px;
}

.alpha-key .alpha-title {
  fill: var(--amber);
  font-size: 13px;
  font-weight: 600;
}

.alpha-key circle {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1;
}

.decay-equation {
  fill: #fffaf3;
  font-size: 18px;
  font-weight: 600;
  filter: drop-shadow(0 0 14px rgba(255, 180, 84, 0.8));
}

.energy-note {
  fill: var(--cyan);
  font-size: 11px;
}

.nuclear-pulse {
  stroke: var(--cyan);
  animation: nuclear-pulse 3.4s ease-out infinite;
}

@keyframes nucleus-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes nuclear-pulse {
  from { r: 96px; opacity: 0.42; }
  to { r: 132px; opacity: 0; }
}

@keyframes pulse {
  from { r: 22px; opacity: 0.75; }
  to { r: 60px; opacity: 0; }
}

.course-section,
.explorer-section {
  padding-block: clamp(80px, 10vw, 150px);
}

.section-heading {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 80px;
  align-items: end;
  margin-bottom: 58px;
}

.section-heading h2,
.path-intro h2,
.toolkit-layout h2 {
  font-size: clamp(38px, 4.6vw, 68px);
}

.section-heading > p {
  max-width: 560px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.course-card {
  position: relative;
  min-height: 315px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper-bright);
  color: var(--ink);
  border-radius: 4px 26px 26px 26px;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.course-card::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -70px;
  top: -70px;
  border: 28px solid var(--line);
  border-radius: 50%;
  opacity: 0.55;
}

.course-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow);
}

.course-card.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-bright);
}

.course-index {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.course-symbol {
  margin: 34px 0 24px;
  color: var(--coral);
  font-family: "IBM Plex Mono", monospace;
  font-size: 42px;
  font-weight: 600;
}

.vector-symbol {
  position: relative;
  display: inline-block;
  min-width: 1.15em;
  padding-top: 0.28em;
  line-height: 1;
  text-align: center;
}

.vector-arrow {
  position: absolute;
  top: -0.08em;
  left: 50%;
  font-size: 0.62em;
  font-weight: 500;
  line-height: 1;
  transform: translateX(-50%);
}

.course-card:nth-child(2) .course-symbol { color: var(--amber); }
.course-card:nth-child(3) .course-symbol { color: var(--blue); }
.course-card:nth-child(4) .course-symbol { color: var(--cyan-deep); }
.course-card:nth-child(5) .course-symbol { color: var(--coral); }
.course-card:nth-child(6) .course-symbol { color: var(--green); }
.course-card.active .course-symbol { color: var(--cyan); }

.course-card strong {
  max-width: 240px;
  font-size: 20px;
  line-height: 1.25;
}

.course-card small {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.course-card.active small,
.course-card.active .course-index {
  color: #a9bdc6;
}

.course-state {
  margin-top: auto;
  padding-top: 22px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.course-state.ready {
  color: var(--cyan-deep);
}

.course-card.active .course-state.ready {
  color: var(--cyan);
}

.path-section {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(50px, 8vw, 130px);
  padding-bottom: clamp(90px, 10vw, 150px);
}

.path-track {
  border-top: 1px solid var(--line);
}

.path-track a {
  display: grid;
  grid-template-columns: 46px minmax(230px, 0.8fr) 1fr;
  gap: 22px;
  align-items: center;
  min-height: 104px;
  padding: 15px 8px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding 0.2s ease, background 0.2s ease;
}

.path-track a:hover {
  padding-left: 18px;
  background: var(--paper-bright);
}

.path-track span {
  color: var(--coral);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.path-track strong {
  font-size: 19px;
  line-height: 1.2;
}

.path-track small {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.challenge-section {
  overflow: hidden;
  background: var(--coral);
  color: #fffaf3;
}

.challenge-layout {
  position: relative;
  min-height: 590px;
  display: grid;
  grid-template-columns: 0.55fr 1.15fr 0.75fr;
  align-items: center;
  gap: 50px;
  padding-block: 80px;
}

.challenge-number {
  color: rgba(255, 250, 243, 0.95);
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(85px, 13vw, 190px);
  font-weight: 600;
  letter-spacing: -0.1em;
}

.challenge-copy .eyebrow {
  color: #fff0d8;
}

.challenge-copy h2 {
  max-width: 720px;
  font-size: clamp(42px, 5vw, 72px);
}

.challenge-copy > p:not(.eyebrow) {
  max-width: 720px;
  color: #ffe7df;
  font-size: 19px;
  line-height: 1.65;
}

.primary-button.light {
  background: #fffaf3;
  color: #3d1c18;
}

.text-button.light {
  color: #fffaf3;
}

.text-button.light span {
  color: #fffaf3;
}

.challenge-rule {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #fff5eb;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.challenge-rule i {
  width: 1px;
  height: 58px;
  background: rgba(255, 255, 255, 0.5);
}

.explorer-heading {
  grid-template-columns: 1fr;
  align-items: center;
  margin-bottom: 38px;
}

.library-course-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  margin: -16px 0 18px;
  padding: 4px 0;
}

.library-course-filter > span {
  margin-right: 4px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-course-filter button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-bright);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.library-course-filter button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-bright);
}

.library-course-filter small {
  min-width: 25px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  text-align: center;
}

.audience-switch {
  justify-self: end;
  display: inline-flex;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-bright);
}

.audience-switch button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.audience-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-bright);
}

.explorer-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  margin-bottom: 16px;
}

.search-field {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: var(--paper-bright);
  border-radius: 3px 20px 20px 20px;
}

.search-field:focus-within {
  border-color: var(--cyan-deep);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 22%, transparent);
}

.search-field svg {
  width: 22px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-field input::placeholder {
  color: var(--muted);
}

kbd {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.saved-filter {
  min-height: 66px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--paper-bright);
  color: var(--ink);
  border-radius: 18px 3px 18px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.saved-filter svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.saved-filter[aria-pressed="true"] {
  border-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 18%, var(--paper-bright));
}

.saved-filter span {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--ink);
  color: var(--paper-bright);
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  scrollbar-width: thin;
}

.filter-chip {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-bright);
}

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.results-meta p {
  margin: 0;
}

.results-meta strong {
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
}

.results-meta label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-meta select {
  min-height: 38px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-bright);
  color: var(--ink);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.resource-card {
  position: relative;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: 23px;
  border: 1px solid var(--line);
  background: var(--paper-bright);
  border-radius: 4px 24px 24px 24px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.resource-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--ink) 45%, var(--line));
  box-shadow: var(--shadow);
}

.resource-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.source-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--source-color, var(--cyan-deep));
}

.save-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin: -8px -8px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.save-button:hover {
  background: var(--paper);
}

.save-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.save-button.active {
  color: var(--coral);
}

.save-button.active svg {
  fill: currentColor;
}

.resource-card h3 {
  margin: 27px 0 12px;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.resource-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.teacher-note {
  display: none;
  margin-top: 18px;
  padding: 14px 0 0;
  border-top: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

[data-audience-mode="teacher"] .teacher-note {
  display: block;
}

.teacher-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--coral);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resource-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 25px;
}

.resource-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 9px;
}

.resource-course {
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
}

.resource-topic {
  color: var(--muted);
  font-size: 11px;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.resource-link span {
  color: var(--coral);
  transition: transform 0.2s ease;
}

.resource-link:hover span {
  transform: translate(3px, -3px);
}

.empty-state {
  padding: 80px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty-state > span {
  color: var(--coral);
  font-family: "IBM Plex Mono", monospace;
  font-size: 50px;
}

.empty-state h3 {
  margin: 8px 0;
  font-size: 24px;
}

.empty-state p {
  color: var(--muted);
}

.empty-state button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-bright);
  border-radius: 12px;
  cursor: pointer;
}

.toolkit-section {
  padding-block: clamp(80px, 10vw, 150px);
  background: #dce8ec;
  color: #0b1c2c;
}

[data-theme="dark"] .toolkit-section {
  background: #0b1c2c;
  color: #f4f2eb;
}

.toolkit-layout {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(55px, 8vw, 130px);
  align-items: start;
}

.toolkit-layout > div:first-child > p:last-child {
  max-width: 510px;
  margin-top: 28px;
  color: #536975;
  font-size: 17px;
  line-height: 1.7;
}

[data-theme="dark"] .toolkit-layout > div:first-child > p:last-child {
  color: #a7bac3;
}

.toolkit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.tool-card {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid #b6c8cf;
  background: rgba(255, 255, 255, 0.45);
  color: #0b1c2c;
  border-radius: 4px 24px 24px 24px;
  text-decoration: none;
}

[data-theme="dark"] .tool-card {
  border-color: #294352;
  background: #132938;
  color: #f4f2eb;
}

.primary-tool {
  grid-row: span 2;
  min-height: 504px;
  background: var(--amber);
  border-color: var(--amber);
  color: #2c1f11;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .primary-tool {
  background: var(--amber);
  color: #2c1f11;
}

.primary-tool:hover {
  transform: rotate(-1deg) translateY(-4px);
}

.tool-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: "IBM Plex Mono", monospace;
  font-size: 22px;
}

.tool-card small {
  margin-top: 30px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.tool-card strong {
  max-width: 370px;
  margin-top: 13px;
  font-size: 23px;
  line-height: 1.22;
}

.primary-tool strong {
  margin-top: auto;
  font-size: clamp(28px, 3vw, 42px);
}

.tool-card > span:last-child {
  margin-top: auto;
  padding-top: 20px;
  font-size: 13px;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 46px max(24px, calc((100vw - 1380px) / 2));
  background: #071621;
  color: #d6e2e7;
}

.footer-brand .brand-mark {
  background: var(--cyan);
  color: #071621;
}

.footer-brand div {
  display: grid;
}

.footer-brand small,
.site-footer p {
  color: #8198a4;
  font-size: 12px;
}

.site-footer p {
  max-width: 480px;
  margin: 0;
  line-height: 1.6;
}

.footer-note {
  font-family: "IBM Plex Mono", monospace;
  text-align: right;
}

.footer-credit {
  grid-column: 1 / -1;
  justify-self: stretch;
  max-width: none !important;
  padding-top: 16px;
  border-top: 1px solid rgba(129, 152, 164, 0.22);
  color: #6f8793 !important;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.04em;
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  max-width: 330px;
  padding: 14px 18px;
  background: var(--ink);
  color: var(--paper-bright);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 13px;
  transform: translateY(30px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1120px) {
  .site-header { grid-template-columns: 1fr auto; }
  .main-nav { display: none; }
  .hero { grid-template-columns: 1fr 0.85fr; gap: 40px; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .challenge-layout { grid-template-columns: 0.45fr 1.3fr; }
  .challenge-rule { display: none; }
  .site-footer { grid-template-columns: 1fr 1fr; }
  .footer-note { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 820px) {
  .section-shell { width: min(100% - 32px, 700px); }
  .site-header { min-height: 68px; padding-inline: 16px; }
  .brand-copy small, .compact-cta { display: none; }
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 74px 20px;
  }
  .hero-lab { width: min(100%, 620px); justify-self: center; }
  .section-heading,
  .path-section,
  .toolkit-layout { grid-template-columns: 1fr; gap: 36px; }
  .section-heading > p { max-width: none; }
  .challenge-layout { grid-template-columns: 1fr; gap: 12px; }
  .challenge-number { font-size: 90px; }
  .resource-grid { grid-template-columns: 1fr; }
  .toolkit-grid { grid-template-columns: 1fr; }
  .primary-tool { grid-row: auto; min-height: 350px; }
  .site-footer { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .hero h1 { font-size: 42px; }
  .hero-intro { font-size: 17px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 10px; }
  .hero-stats { justify-content: space-between; gap: 12px; }
  .hero-stats dt { font-size: 23px; }
  .hero-lab { border-radius: 24px 6px 24px 24px; }
  .lab-label, .lab-readout { padding: 14px 16px; }
  .course-grid { grid-template-columns: 1fr; }
  .course-card { min-height: 255px; }
  .path-track a { grid-template-columns: 38px 1fr; }
  .path-track small { grid-column: 2; }
  .challenge-layout { min-height: 600px; }
  .challenge-copy h2 { font-size: 40px; }
  .challenge-actions { align-items: flex-start; flex-direction: column; gap: 8px; }
  .explorer-heading { align-items: start; }
  .audience-switch { justify-self: start; }
  .explorer-toolbar { grid-template-columns: 1fr; }
  .saved-filter { justify-content: center; }
  .results-meta { align-items: flex-start; flex-direction: column; }
  .resource-card { min-height: 300px; }
  .site-footer { padding-inline: 20px; }
}

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