:root {
  --bg: #071014;
  --bg-2: #0b171b;
  --page-bg:
    radial-gradient(circle at 16% 12%, rgba(56, 216, 255, 0.12), transparent 30rem),
    radial-gradient(circle at 84% 4%, rgba(246, 185, 95, 0.1), transparent 24rem),
    linear-gradient(180deg, #061014 0%, #071014 48%, #091317 100%);
  --grid-overlay:
    linear-gradient(rgba(150, 207, 218, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 207, 218, 0.045) 1px, transparent 1px);
  --header-bg: rgba(5, 14, 17, 0.9);
  --nav-menu-bg: rgba(5, 14, 17, 0.98);
  --surface: rgba(13, 28, 34, 0.9);
  --surface-2: rgba(16, 38, 45, 0.9);
  --surface-solid: #0d1c22;
  --surface-card: linear-gradient(180deg, var(--surface), rgba(7, 20, 24, 0.9));
  --surface-subtle: rgba(255, 255, 255, 0.045);
  --field-bg: rgba(255, 255, 255, 0.055);
  --canvas-bg: #02080a;
  --plot-bg: rgba(0, 0, 0, 0.22);
  --ink: #eaf6f8;
  --muted: #9eb5bb;
  --lead: #cfe2e7;
  --soft-text: #c4d9de;
  --line: rgba(150, 207, 218, 0.2);
  --cyan: #38d8ff;
  --teal: #31c7ac;
  --amber: #f6b95f;
  --green: #8ce49b;
  --red: #ff806d;
  --primary-button: linear-gradient(135deg, rgba(56, 216, 255, 0.92), rgba(49, 199, 172, 0.86));
  --primary-button-ink: #031014;
  --hero-overlay:
    linear-gradient(90deg, rgba(5, 13, 16, 0.92), rgba(5, 13, 16, 0.58), rgba(5, 13, 16, 0.12)),
    linear-gradient(0deg, #071014 0%, transparent 32%);
  --hero-carousel-overlay:
    linear-gradient(90deg, rgba(5, 13, 16, 0.96), rgba(5, 13, 16, 0.62), rgba(5, 13, 16, 0.2)),
    linear-gradient(0deg, #071014 0%, transparent 34%);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  --max: 1160px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4f8f9;
  --bg-2: #e7f0f2;
  --page-bg:
    radial-gradient(circle at 12% 10%, rgba(0, 116, 138, 0.12), transparent 30rem),
    radial-gradient(circle at 86% 2%, rgba(166, 104, 12, 0.12), transparent 25rem),
    linear-gradient(180deg, #f9fcfc 0%, #eef6f7 48%, #e7f0f2 100%);
  --grid-overlay:
    linear-gradient(rgba(24, 86, 98, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 86, 98, 0.07) 1px, transparent 1px);
  --header-bg: rgba(250, 253, 253, 0.92);
  --nav-menu-bg: rgba(250, 253, 253, 0.98);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-2: rgba(242, 249, 250, 0.94);
  --surface-solid: #ffffff;
  --surface-card: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 249, 0.94));
  --surface-subtle: rgba(9, 52, 62, 0.055);
  --field-bg: rgba(255, 255, 255, 0.88);
  --canvas-bg: #071014;
  --plot-bg: rgba(255, 255, 255, 0.72);
  --ink: #10292f;
  --muted: #4d6870;
  --lead: #28484f;
  --soft-text: #3f6269;
  --line: rgba(28, 91, 105, 0.2);
  --cyan: #006f86;
  --teal: #087d6e;
  --amber: #95610b;
  --green: #247348;
  --red: #b94235;
  --primary-button: linear-gradient(135deg, #007f98, #0b8c78);
  --primary-button-ink: #ffffff;
  --hero-overlay:
    linear-gradient(90deg, rgba(250, 253, 253, 0.94), rgba(250, 253, 253, 0.7), rgba(250, 253, 253, 0.22)),
    linear-gradient(0deg, #eef6f7 0%, transparent 34%);
  --hero-carousel-overlay:
    linear-gradient(90deg, rgba(250, 253, 253, 0.98), rgba(250, 253, 253, 0.76), rgba(250, 253, 253, 0.34)),
    linear-gradient(0deg, #eef6f7 0%, transparent 34%);
  --shadow: 0 18px 42px rgba(19, 63, 75, 0.13);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.62;
  color: var(--ink);
  background: var(--page-bg);
}

body.protected-content {
  -webkit-user-select: none;
  user-select: none;
}

body.protected-content img,
body.protected-content canvas {
  -webkit-user-drag: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--grid-overlay);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
.shell { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(860px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.nav {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  position: relative;
}

.brand {
  display: inline-grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  text-decoration: none;
  line-height: 1.2;
}

.brand::before {
  content: "";
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: url("/assets/generated/fusenergy-logo-mark.png") center / cover no-repeat;
  box-shadow: 0 0 22px rgba(56, 216, 255, 0.18);
}

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

.brand span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: nowrap;
  margin-left: auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-links a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  padding: 7px 7px;
  border-radius: 8px;
}

.nav-links a:hover { color: var(--ink); }
.nav-links a.nav-link-active {
  color: var(--ink);
  background: rgba(56, 216, 255, 0.1);
}

html[data-theme="light"] .nav-links a.nav-link-active {
  background: rgba(0, 111, 134, 0.1);
}

.nav-toggle {
  display: none;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle {
  flex: 0 0 auto;
  width: 38px;
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: rgba(56, 216, 255, 0.44);
}

.theme-icon {
  width: 18px;
  height: 18px;
  display: none;
}

html[data-theme="dark"] .theme-icon-moon,
html:not([data-theme]) .theme-icon-moon,
html[data-theme="light"] .theme-icon-sun {
  display: block;
}
.button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid rgba(56, 216, 255, 0.52);
  background: var(--primary-button);
  color: var(--primary-button-ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: var(--surface-subtle);
  color: var(--ink);
  border-color: var(--line);
}

.button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.hero {
  position: relative;
  min-height: 72svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 78px 0 36px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    var(--hero-overlay),
    url("/assets/fusion-reactor-hero.png") center right / cover no-repeat;
}

.hero-with-carousel::before {
  z-index: 0;
  background: var(--hero-carousel-overlay);
  pointer-events: none;
}

.hero-slides {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.025);
  background-position: center right;
  background-size: cover;
  transition: opacity 720ms ease, transform 6200ms ease;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-copy { max-width: 700px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: 0;
}

h1 { font-size: clamp(29px, 4.2vw, 48px); max-width: 760px; }
h2 { font-size: clamp(22px, 2.6vw, 32px); }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
p { color: var(--muted); margin: 10px 0 0; }
.lead { max-width: 680px; color: var(--lead); font-size: clamp(15px, 1.4vw, 17px); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }
.carousel-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.carousel-controls .button {
  min-width: 42px;
  min-height: 36px;
  padding: 7px 11px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
}

.carousel-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.carousel-dots button {
  width: 22px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 26%, transparent);
  cursor: pointer;
}

.carousel-dots button.active {
  width: 34px;
  background: var(--amber);
}
section { padding: 32px 0; }
.page-hero { padding: 54px 0 20px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 18px;
}
.section-head p { max-width: 610px; margin: 0; }

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

.card, .panel, .form-panel, .counter-card, .news-card, .article-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.card, .panel, .form-panel, .news-card, .article-card { padding: 18px; }
.card p, .panel p, .news-card p, .article-card p { margin-bottom: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(56, 216, 255, 0.11);
  border: 1px solid rgba(56, 216, 255, 0.26);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 500;
}

.counter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}
.counter-card { padding: 14px; }
.counter-card strong { display: block; color: var(--ink); font-size: 26px; font-weight: 500; line-height: 1; }
.counter-card span { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.counter-card small { color: color-mix(in srgb, var(--muted) 78%, transparent); }

.learning-map {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 16px;
  align-items: stretch;
}
.process-visual {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: url("/assets/fusion-fuel-to-grid.png") center / cover no-repeat;
}

.concept-lab {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 16px;
  align-items: stretch;
}

.concept-canvas-wrap {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 58% 42%, rgba(56, 216, 255, 0.1), transparent 24rem),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 84%, transparent), var(--canvas-bg));
}

#conceptLabCanvas {
  width: 100%;
  height: clamp(340px, 44vw, 500px);
  min-height: 0;
  display: block;
}

.concept-readout {
  position: static;
  margin: 0 12px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  color: var(--lead);
  font-size: 12px;
  backdrop-filter: blur(12px);
}

.concept-controls {
  display: grid;
  gap: 12px;
}

.fact-grid .card p { color: var(--soft-text); }

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.source-strip a {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  background: var(--surface-subtle);
}

.source-strip a:hover { color: var(--ink); border-color: rgba(56, 216, 255, 0.4); }
.premium-visual {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas-bg) center / cover no-repeat;
}
.premium-dashboard { background-image: url("/assets/premium-dashboard.png"); }
.premium-fuel-cycle { background-image: url("/assets/premium-fuel-cycle.png"); }
.sequence {
  display: grid;
  gap: 10px;
  counter-reset: seq;
}
.sequence .card {
  position: relative;
  padding-left: 58px;
}
.sequence .card::before {
  counter-increment: seq;
  content: counter(seq);
  position: absolute;
  left: 18px;
  top: 20px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary-button-ink);
  background: var(--amber);
}

.concept-orbit {
  position: relative;
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.concept-orbit::before,
.concept-orbit::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 130px;
  border: 2px solid rgba(56, 216, 255, 0.34);
  border-radius: 50%;
  animation: spin 7s linear infinite;
}
.concept-orbit::after {
  width: 270px;
  height: 170px;
  border-color: rgba(246, 185, 95, 0.32);
  animation-duration: 10s;
  animation-direction: reverse;
}
.core-dot {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 8%, var(--cyan) 18%, rgba(56, 216, 255, 0.08) 70%);
  box-shadow: 0 0 38px rgba(56, 216, 255, 0.72);
  animation: breathe 2.4s ease-in-out infinite;
}

.sim-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}
.sim-stage {
  min-height: 560px;
  position: relative;
  overflow: hidden;
}
#fusion3d {
  width: 100%;
  height: 560px;
  display: block;
  border-radius: 8px;
  background: var(--canvas-bg);
}
.control-panel { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
.field label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--ink);
  padding: 10px 11px;
}
select option { color: var(--ink); background: var(--surface-solid); }
input[type="range"] { padding: 0; accent-color: var(--cyan); }
textarea { min-height: 140px; resize: vertical; }
.readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.readout .card { padding: 14px; }
.readout strong { font-size: 22px; font-weight: 500; }
.status { color: var(--green); }
.status.warn { color: var(--amber); }
.status.hot { color: var(--red); }

.article-body {
  color: var(--muted);
}
.article-body h2 { margin-top: 28px; font-size: 24px; color: var(--ink); }
.article-body h3 { margin-top: 22px; color: var(--ink); }
.article-body p, .article-body li { font-size: 15px; }
.article-body li { margin: 8px 0; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  overflow: hidden;
  border-radius: 8px;
}
.article-body th, .article-body td {
  border: 1px solid var(--line);
  padding: 11px;
  vertical-align: top;
}
.article-body th { color: var(--ink); font-weight: 500; background: rgba(56, 216, 255, 0.08); }

.news-list { display: grid; gap: 12px; }
.news-card a { color: var(--ink); text-decoration: none; }
.news-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 12px; }
.blog-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: stretch;
}
.blog-image,
.post-image {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas-bg) center / cover no-repeat;
  overflow: hidden;
}
.post-image { min-height: 380px; margin: 18px 0; }
.blog-image img,
.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-card {
  display: grid;
  grid-template-rows: 190px auto;
  overflow: hidden;
  padding: 0;
}
.blog-card .blog-thumb {
  background: var(--canvas-bg) center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.blog-card .blog-body { padding: 18px; }
.blog-card a { text-decoration: none; }
.blog-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}
.chapter-visual-lead {
  padding: 0 0 16px;
}

.chapter-image-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.chapter-image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--canvas-bg);
}

.chapter-image-card figcaption {
  padding: 11px 12px;
  color: var(--soft-text);
  font-size: 12px;
  line-height: 1.45;
}

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

.chapter-inline-visual {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: center;
}

.chapter-inline-visual .chapter-image-card img {
  min-height: 220px;
}
.comment-list { display: grid; gap: 10px; margin-top: 14px; }
.comment {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}
.comment strong { color: var(--ink); font-weight: 500; }
.comment small { color: var(--muted); display: block; margin-top: 3px; }
.locked { filter: blur(3px); user-select: none; pointer-events: none; }
.gate-message { display: none; }
.gate-message.active { display: block; }
.auth-note { margin-top: 12px; min-height: 24px; color: var(--amber); }
.hidden { display: none !important; }

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}

.plot-wrap {
  min-height: 360px;
}

#analysisPlot,
#premiumPreviewPlot,
#premiumOrbit {
  width: 100%;
  height: 340px;
  min-height: 340px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--plot-bg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.data-table th,
.data-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  color: var(--muted);
}

.data-table th {
  color: var(--ink);
  font-weight: 500;
  background: rgba(56, 216, 255, 0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 16px;
}
form { display: grid; gap: 12px; }
.honeypot { position: absolute; left: -9999px; opacity: 0; }

.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding: 28px 0 42px;
  color: var(--muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: start;
}
.footer-counter {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.footer-counter span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 13px;
}

.footer-rating {
  display: grid;
  gap: 5px;
  min-width: min(100%, 260px);
  padding: 10px 12px;
  border: 1px solid rgba(246, 185, 95, 0.24);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
}

.footer-rating strong {
  color: var(--ink);
  font-weight: 500;
}

.rating-stars {
  color: var(--amber);
  font-size: 16px;
  letter-spacing: 1px;
}

.feedback-popup {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  width: min(360px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid rgba(56, 216, 255, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 90% 0%, rgba(246, 185, 95, 0.16), transparent 12rem),
    color-mix(in srgb, var(--surface-solid) 98%, transparent);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.feedback-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--muted);
  cursor: pointer;
}

.feedback-form {
  display: grid;
  gap: 10px;
}

.feedback-form h2 {
  max-width: 280px;
  font-size: 18px;
}

.star-rating {
  display: flex;
  gap: 7px;
  align-items: center;
}

.star-button {
  width: 38px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(246, 185, 95, 0.26);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  color: rgba(246, 185, 95, 0.45);
  font-size: 20px;
  cursor: pointer;
}

.star-button.is-selected,
.star-button:hover {
  color: var(--amber);
  border-color: rgba(246, 185, 95, 0.62);
  box-shadow: 0 0 18px rgba(246, 185, 95, 0.14);
}

.feedback-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 78px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--field-bg);
  color: var(--ink);
}

.feedback-status {
  min-height: 20px;
  margin: 0;
  color: var(--amber);
  font-size: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.78; }
  50% { transform: scale(1.08); opacity: 1; }
}

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

@media (max-width: 980px) {
  .grid-4, .counter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2, .learning-map, .concept-lab, .chapter-image-grid, .chapter-inline-visual, .sim-layout, .analysis-layout, .form-grid, .footer-grid, .blog-hero { grid-template-columns: 1fr; }
  .concept-canvas-wrap, #conceptLabCanvas { min-height: 390px; }
  .footer-counter { justify-content: flex-start; }
  .nav {
    min-height: 62px;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
  }
  .theme-toggle { margin-left: auto; }
  .nav-links {
    margin-left: 0;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    display: none;
    max-height: min(72vh, 520px);
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--nav-menu-bg);
    box-shadow: var(--shadow);
  }
  .nav.nav-open .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .nav-links a {
    padding: 10px;
    border: 1px solid var(--line);
    background: var(--surface-subtle);
  }
}

@media (max-width: 700px) {
  body { font-size: 13px; }
  .shell, .narrow { width: min(100% - 20px, var(--max)); }
  .nav { align-items: center; flex-direction: row; }
  .nav.nav-open .nav-links { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 48px 0 28px; }
  .hero::before { background-position: 63% center; }
  .hero-slide { background-position: 68% center; }
  .carousel-controls .button { min-width: 38px; }
  .brand { grid-template-columns: 34px 1fr; }
  .brand::before { width: 34px; height: 34px; }
  h1 { font-size: clamp(27px, 8.8vw, 36px); }
  h2 { font-size: 22px; }
  .section-head { display: grid; }
  .grid-4, .counter-row, .readout { grid-template-columns: 1fr; }
  .concept-canvas-wrap { min-height: 0; }
  #conceptLabCanvas { height: 340px; min-height: 0; }
  .feedback-popup {
    right: 10px;
    bottom: 10px;
    width: min(340px, calc(100vw - 20px));
    padding: 13px;
  }
  .star-button {
    width: 32px;
    min-height: 30px;
    font-size: 17px;
  }
  #fusion3d { height: 430px; }
  .sim-stage { min-height: 430px; }
}
