:root {
  --bg: #08120f;
  --bg-2: #10211c;
  --card: #13261f;
  --cream: #f3f6f1;
  --muted: #c5d5cc;
  --amber: #f0b429;
  --amber-2: #ffe08a;
  --line: rgba(243, 246, 241, 0.12);
  --ink: #14241e;
  --paper: #f4f7f2;
  --danger: #c4492c;
  --ok: #1f7a56;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --header-bg: rgba(8, 18, 15, 0.82);
  --nav-bg: #0c1915;
  --visual-bg: #0c1a15;
  --lab-bg: #173028;
  --hint-bg: rgba(8, 18, 15, 0.72);
  --hero-lede: rgba(243, 246, 241, 0.86);
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Unbounded", "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(240, 180, 41, 0.14), transparent 55%),
    var(--bg);
  color: var(--cream);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}
body.nav-open { overflow: hidden; }
img, canvas { max-width: 100%; }
button, input { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
::selection { background: var(--amber); color: #1a1406; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--amber);
  color: #1a1406;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 50;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 74px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}
.logo img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.pillar {
  border-radius: 18px;
  padding: 14px 14px 12px;
  background: rgba(243, 246, 241, 0.04);
  border: 1px solid var(--line);
}
.pillar b { display: block; font-size: 1rem; }
.pillar span { color: var(--muted); font-size: 0.92rem; }
.pillar.health { box-shadow: inset 3px 0 0 #1d4e9f; }
.pillar.env { box-shadow: inset 3px 0 0 #2f9e4f; }
.pillar.safe { box-shadow: inset 3px 0 0 #ef8b14; }
.logo strong {
  display: block;
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: -0.03em;
}
.logo small {
  color: var(--muted);
  letter-spacing: 0.08em;
}

.nav { display: flex; gap: 18px; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--cream); }

.langs {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.langs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.langs button.is-active { background: var(--amber); color: #1a1406; }
.theme-toggle {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  font-size: 1.05rem;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  padding: 0;
  cursor: pointer;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.nav-toggle > span:first-child,
.nav-toggle > span:first-child::before,
.nav-toggle > span:first-child::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--cream);
  position: relative;
  margin: 0 auto;
}
.nav-toggle > span:first-child::before,
.nav-toggle > span:first-child::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle > span:first-child::before { top: -6px; }
.nav-toggle > span:first-child::after { top: 6px; }

.hero { padding: 28px 0 72px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  align-items: center;
}
.kicker {
  margin: 0 0 10px;
  color: var(--amber-2);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.04em; line-height: 1.05; }
h1 { margin: 0; font-size: clamp(2.7rem, 7vw, 5.4rem); }
#method-title { font-size: clamp(1.7rem, 4vw, 2.8rem); max-width: 16ch; margin-top: 8px; }
h2 { margin: 0 0 12px; font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { margin: 0 0 8px; font-size: 1.35rem; }
.lede { margin: 16px 0 0; max-width: 40rem; color: var(--muted); font-size: 1.08rem; }
.hero .lede { color: var(--hero-lede); }

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--amber); color: #1a1406; }
.btn-primary:hover { background: #ffd56a; }
.btn-ghost { border-color: rgba(243, 246, 241, 0.28); color: var(--cream); background: transparent; }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 28px 0 0;
  list-style: none;
}
.stats li {
  min-width: 92px;
  padding: 12px 14px 10px;
  border-radius: 16px;
  background: rgba(243, 246, 241, 0.04);
  border: 1px solid var(--line);
}
.stats b {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--amber);
}
.stats span { color: var(--muted); font-size: 0.82rem; }

.visual {
  position: relative;
  height: min(68vh, 640px);
  min-height: 460px;
  border-radius: 32px;
  background:
    radial-gradient(420px 280px at 50% 42%, rgba(240, 180, 41, 0.2), transparent 68%),
    radial-gradient(280px 220px at 62% 62%, rgba(31, 163, 122, 0.18), transparent 70%),
    var(--visual-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.visual canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
.visual canvas:active { cursor: grabbing; }
.drag-hint {
  position: absolute;
  left: 16px;
  bottom: 14px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--hint-bg);
  color: var(--cream);
  font-size: 0.82rem;
  font-weight: 700;
}

.css-helmet {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 900px;
}
.css-helmet[hidden] { display: none; }
.css-helmet-inner {
  width: 230px;
  height: 190px;
  position: relative;
  transform-style: preserve-3d;
  animation: spin 9s linear infinite;
}
.css-dome {
  position: absolute;
  left: 34px;
  right: 34px;
  top: 8px;
  height: 124px;
  border-radius: 120px 120px 46px 46px;
  background: linear-gradient(160deg, #ffe7a3, #e2a31a 58%, #8d6410);
}
.css-brim {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 34px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(#f6c453, #c4890d);
  transform: rotateX(62deg);
}
.css-lamp {
  position: absolute;
  width: 42px;
  height: 42px;
  left: 94px;
  top: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #f0b429 42%, #1b1b1b 44%);
  box-shadow: 0 0 28px rgba(240, 180, 41, 0.85);
}
@keyframes spin { to { transform: rotateY(360deg); } }

.section { padding: 84px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 28px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}
.card, .topic-detail, .lab-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
}
.card p:last-child, .topic-detail p:last-child { margin-bottom: 0; }
.tasks, .self { margin: 0; padding-left: 18px; }
.tasks li, .self li { margin: 8px 0; }
.outcomes { display: grid; gap: 10px; }
.outcomes article {
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: rgba(243, 246, 241, 0.04);
  border: 1px solid var(--line);
}
.outcomes span {
  display: block;
  color: var(--amber);
  font-family: var(--display);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.plan-layout {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 18px;
  align-items: start;
}
.topic-list { display: grid; gap: 6px; }
.topic {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.topic:hover { background: rgba(243, 246, 241, 0.04); }
.topic.is-active {
  background: rgba(240, 180, 41, 0.1);
  border-color: rgba(240, 180, 41, 0.4);
}
.topic .n {
  font-family: var(--display);
  color: var(--amber);
  font-size: 0.82rem;
}
.topic small { color: var(--muted); white-space: nowrap; }
.topic-detail { position: sticky; top: 92px; }
.hours {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.hours span, .pill {
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(240, 180, 41, 0.14);
  color: var(--amber-2);
  font-size: 0.82rem;
  font-weight: 800;
}

.stage-wrap { position: relative; }
.stage {
  height: 460px;
  position: relative;
  overflow: hidden;
}
.ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.lab-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 250px;
  height: 280px;
  margin: -140px 0 0 -125px;
  padding: 18px;
  text-align: left;
  border-radius: 22px;
  border: 1px solid rgba(243, 246, 241, 0.16);
  background:
    linear-gradient(180deg, rgba(240, 180, 41, 0.16), transparent 42%),
    var(--lab-bg);
  color: var(--cream);
  box-shadow: var(--shadow);
  cursor: pointer;
  backface-visibility: hidden;
}
.lab-card .n {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--amber);
  display: block;
}
.lab-card b { display: block; margin: 10px 0; font-size: 1.05rem; line-height: 1.25; }
.lab-card.is-front { border-color: var(--amber); }
.principle { margin: 16px 0 0; }

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 18px;
}
.lab-detail .measure { color: var(--muted); }
.lab-block h4 {
  margin: 18px 0 8px;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}
.lab-block p { margin: 0 0 10px; }
.norms-wrap { overflow-x: auto; margin: 8px 0 4px; }
.norms {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.norms th, .norms td {
  border: 1px solid rgba(243, 246, 241, 0.16);
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
}
.norms th { color: var(--amber-2); font-weight: 800; }
.norms tbody th { text-align: left; color: var(--cream); }

.fire { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fire button {
  min-width: 52px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  font-weight: 800;
  cursor: pointer;
}
.fire button.is-on { background: var(--amber); color: #1a1406; border-color: var(--amber); }
.fire-result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(243, 246, 241, 0.05);
}

.aid-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}
.aid-flow li {
  counter-increment: flow;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(243, 246, 241, 0.06);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 0.92rem;
}
.aid-flow li::before {
  content: counter(flow);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--amber);
  color: #1a1406;
  font-size: 0.75rem;
}
.see { margin: 8px 0 0; }
.how {
  margin: 16px 0 0;
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: -0.03em;
}
.hotline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.hotline a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  background: var(--amber);
  color: #1a1406;
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 800;
}
.hotline b { font-family: var(--display); font-size: 1.4rem; }

.aid-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 16px;
  align-items: start;
}
.aid-tabs { display: grid; gap: 8px; }
.aid-tab {
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}
.aid-tab.is-active { background: var(--cream); color: var(--ink); }
.protocol {
  background: var(--paper);
  color: var(--ink);
  border-radius: 28px;
  padding: 22px 22px 10px;
  transform-style: preserve-3d;
  box-shadow: var(--shadow);
}
.protocol h3 { font-size: 1.6rem; }
.steps { list-style: none; margin: 12px 0 0; padding: 0; }
.step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(20, 36, 30, 0.1);
}
.step .n {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--amber);
  color: #1a1406;
  font-family: var(--display);
}
.step p { margin: 0; }
.note {
  margin: 8px 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #efe4d4;
}

.quiz-card { max-width: 760px; }
.bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(243, 246, 241, 0.1);
  overflow: hidden;
  margin: 14px 0 18px;
}
.bar span {
  display: block;
  height: 100%;
  background: var(--amber);
  width: 0;
}
.options { display: grid; gap: 10px; }
.option {
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(243, 246, 241, 0.03);
  color: var(--cream);
  padding: 12px 14px;
  cursor: pointer;
}
.option:hover { border-color: var(--amber); }
.option:disabled { cursor: default; opacity: 1; }
.option.is-correct { background: var(--ok); border-color: var(--ok); }
.option.is-wrong { background: #8d3328; border-color: #8d3328; }
.explain { color: var(--amber-2); font-weight: 700; }
.quiz-nav { margin-top: 16px; }
.score {
  font-family: var(--display);
  font-size: 2.4rem;
  margin: 0;
  color: var(--amber);
}

.identity {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.identity img {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  flex: none;
}
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
}
.brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: 640px;
}
.brand img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  flex: none;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer strong { color: var(--cream); }
.footer a { color: var(--amber-2); }
.authors { margin: 8px 0 0; line-height: 1.45; white-space: pre-line; }

@media (max-width: 980px) {
  .hero-grid, .grid-2, .plan-layout, .aid-layout, .footer-inner { grid-template-columns: 1fr; display: grid; }
  .footer-inner { display: grid; }
  .hero { padding: 16px 0 36px; }
  .section { padding: 48px 0; }
  .visual { order: -1; height: 240px; min-height: 0; border-radius: 22px; }
  .topic-detail { position: static; }
  .nav-toggle { display: grid; place-items: center; }
  .nav {
    display: none;
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    padding: 10px 16px 16px;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--line);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 10px 0; }
}

@media (max-width: 700px) {
  body { font-size: 16px; overflow-x: clip; }
  .wrap { width: min(1120px, calc(100% - 24px)); }
  .header-inner { gap: 8px; min-height: 60px; }
  .langs button { padding: 6px 7px; letter-spacing: 0.02em; }
  .theme-toggle { width: 36px; height: 36px; }
  .logo img { width: 40px; height: 40px; }
  .logo strong { font-size: 0.78rem; line-height: 1.15; }
  .logo small { font-size: 0.68rem; }
  .nav { top: 60px; }
  .pillars { grid-template-columns: 1fr; }
  .identity { align-items: flex-start; }
  .identity img, .brand img { width: 64px; height: 64px; }
  .visual { height: 200px; }
  .drag-hint { font-size: 0.75rem; left: 10px; bottom: 10px; }
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.45rem; }
  h3 { font-size: 1.15rem; }
  .kicker { letter-spacing: 0.04em; font-size: 0.68rem; }
  .lede { font-size: 0.98rem; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; }
  .stats li { min-width: 0; }
  .cta .btn { min-height: 44px; padding: 0 14px; font-size: 0.92rem; }
  .stage-wrap, .stage { overflow: hidden; }
  .stage { height: 280px; }
  .lab-card {
    width: 168px;
    height: 196px;
    margin: -98px 0 0 -84px;
    padding: 14px;
  }
  .lab-card .n { font-size: 1.4rem; }
  .lab-card b { font-size: 0.92rem; }
  .lab-detail, .protocol { padding: 16px 14px 8px; border-radius: 18px; }
  .protocol h3 { font-size: 1.25rem; }
  .step { grid-template-columns: 34px 1fr; gap: 10px; }
  .step .n { width: 34px; height: 34px; }
  .aid-tabs { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .topic { grid-template-columns: 28px minmax(0, 1fr); }
  .principle { margin-top: 14px; }
}

html[data-theme="light"] {
  --bg: #f7f4ee;
  --bg-2: #fffdf8;
  --card: #ffffff;
  --cream: #17241e;
  --muted: #41584e;
  --amber: #c9850d;
  --amber-2: #8a5600;
  --line: rgba(23, 36, 30, 0.14);
  --shadow: 0 16px 40px rgba(23, 36, 30, 0.08);
  --header-bg: rgba(247, 244, 238, 0.94);
  --nav-bg: #fffdf8;
  --visual-bg: #efe6d4;
  --lab-bg: #fffdf8;
  --hint-bg: rgba(255, 253, 248, 0.92);
  --hero-lede: #41584e;
  color-scheme: light;
}
html[data-theme="light"] .lab-card,
html[data-theme="light"] .topic.is-active {
  box-shadow: 0 8px 24px rgba(23, 36, 30, 0.06);
}
html[data-theme="light"] .pillar,
html[data-theme="light"] .stats li,
html[data-theme="light"] .outcomes article,
html[data-theme="light"] .fire-result,
html[data-theme="light"] .aid-flow li,
html[data-theme="light"] .option,
html[data-theme="light"] .bar {
  background: rgba(23, 36, 30, 0.05);
}
html[data-theme="light"] .topic:hover { background: rgba(23, 36, 30, 0.05); }
html[data-theme="light"] .aid-tab.is-active {
  background: #17241e;
  color: #f7f4ee;
}
html[data-theme="light"] .option.is-correct,
html[data-theme="light"] .option.is-wrong {
  color: #f7f4ee;
}
html[data-theme="light"] .option.is-correct { background: var(--ok); }
html[data-theme="light"] .option.is-wrong { background: #8d3328; }
html[data-theme="light"] .btn-ghost,
html[data-theme="light"] .lab-card,
html[data-theme="light"] .norms th,
html[data-theme="light"] .norms td {
  border-color: rgba(23, 36, 30, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .css-helmet-inner { animation: none; }
  .protocol { transition: none; }
}
