/* ============================================================
   Alien Lab — styles
   A dark, high-contrast chemistry lab aesthetic.
   ============================================================ */

@font-face {
  font-family: "Noto Sans Myanmar";
  src: url("../assets/fonts/NotoSansMyanmar.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #060a12;
  --bg-deep: #04070d;
  --bg-soft: #0a1220;
  --panel: rgba(13, 23, 39, 0.72);
  --panel-solid: #0c1524;
  --panel-2: rgba(18, 31, 51, 0.72);
  --line: rgba(150, 190, 255, 0.13);
  --line-strong: rgba(150, 190, 255, 0.24);
  --text: #eaf2ff;
  --text-soft: #c6d3e8;
  --muted: #8fa2c0;
  --muted-2: #6e819e;
  --cyan: #58f0d2;
  --cyan-2: #2fc6ff;
  --violet: #a78bfa;
  --violet-2: #7c6cf6;
  --amber: #ffb454;
  --red: #ff6f86;
  --green: #44e6a8;
  --grad: linear-gradient(105deg, #61f5d8 0%, #35c8ff 38%, #a78bfa 100%);
  --grad-soft: linear-gradient(135deg, rgba(88, 240, 210, 0.16), rgba(167, 139, 250, 0.14));
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Noto Sans Myanmar", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --radius: 26px;
  --radius-sm: 16px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --container: 1180px;
  --header-h: 74px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html.has-js {
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.chat-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

code, kbd {
  font-family: var(--font-mono);
}

sub, sup {
  font-size: 0.68em;
  line-height: 0;
}

::selection {
  background: rgba(88, 240, 210, 0.28);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.container {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 999;
  padding: 12px 20px;
  background: var(--cyan);
  color: #041016;
  border-radius: 8px;
  font-weight: 700;
  transition: top 0.2s ease;
}

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

/* ---------- ambient background ---------- */

.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.34;
}

.blob-a {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(47, 198, 255, 0.55), transparent 68%);
  animation: drift 22s ease-in-out infinite alternate;
}

.blob-b {
  width: 620px;
  height: 620px;
  top: 28%;
  right: -260px;
  background: radial-gradient(circle, rgba(124, 108, 246, 0.5), transparent 68%);
  animation: drift 28s ease-in-out infinite alternate-reverse;
}

.blob-c {
  width: 480px;
  height: 480px;
  bottom: -240px;
  left: 38%;
  background: radial-gradient(circle, rgba(88, 240, 210, 0.32), transparent 68%);
  animation: drift 25s ease-in-out infinite alternate;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

main,
.site-footer {
  position: relative;
  z-index: 2;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, 50px, 0) scale(1.12); }
}

/* ---------- scroll progress ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 120;
  background: var(--grad);
  box-shadow: 0 0 16px rgba(88, 240, 210, 0.7);
}

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
  transition-delay: var(--delay, 0s);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Above-the-fold content must never wait for an observer. */
.hero .reveal {
  opacity: 1;
  transform: none;
  animation: hero-reveal 0.9s var(--ease) both;
  animation-delay: var(--delay, 0s);
}

@keyframes hero-reveal {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

/* ---------- text & buttons ---------- */

.gradient-text {
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-pan 7s linear infinite;
}

@keyframes gradient-pan {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 20, 34, 0.6);
  backdrop-filter: blur(12px);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    background 0.3s ease,
    border-color 0.3s ease;
  overflow: hidden;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-primary {
  background: var(--grad);
  color: #04131b;
  box-shadow: 0 8px 30px rgba(53, 200, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: skewX(-18deg);
  transition: left 0.65s var(--ease);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 42px rgba(53, 200, 255, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:hover::after {
  left: 130%;
}

.btn-ghost {
  background: rgba(14, 26, 44, 0.7);
  border-color: var(--line-strong);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(88, 240, 210, 0.45);
  background: rgba(20, 38, 60, 0.85);
}

.btn-ai {
  background: linear-gradient(120deg, rgba(88, 240, 210, 0.14), rgba(167, 139, 250, 0.2));
  border-color: rgba(167, 139, 250, 0.38);
  color: #e9f7ff;
  backdrop-filter: blur(12px);
}

.btn-ai:hover {
  transform: translateY(-1px);
  border-color: rgba(88, 240, 210, 0.55);
  box-shadow: 0 8px 30px rgba(124, 108, 246, 0.2);
}

.btn-sm {
  min-height: 40px;
  padding: 0 17px;
  font-size: 12.5px;
}

.btn-sm svg {
  width: 15px;
  height: 15px;
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: gap 0.25s ease, color 0.2s ease;
}

.text-link svg {
  width: 15px;
  height: 15px;
}

.text-link:hover {
  gap: 11px;
  color: #9bffe9;
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}

.site-header.is-scrolled {
  background: rgba(6, 11, 19, 0.78);
  border-bottom-color: var(--line);
  backdrop-filter: blur(18px) saturate(140%);
}

.nav-wrap {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(88, 240, 210, 0.28);
  border-radius: 12px;
  background: rgba(88, 240, 210, 0.06);
  box-shadow: inset 0 0 20px rgba(88, 240, 210, 0.06);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
  animation: brand-spin 18s linear infinite;
}

@keyframes brand-spin {
  to { transform: rotate(360deg); }
}

.brand-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-text span {
  color: var(--cyan);
  font-weight: 500;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(150, 190, 255, 0.08);
  border-radius: 999px;
  background: rgba(9, 18, 31, 0.42);
}

.main-nav a {
  position: relative;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--text);
  background: rgba(150, 190, 255, 0.08);
}

.main-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cyan);
  transform: translateX(-50%);
  box-shadow: 0 0 8px var(--cyan);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.chapter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.chapter-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  position: relative;
  background: rgba(14, 26, 44, 0.7);
}

.menu-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}

.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 24px; }

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 20px;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  top: 20px;
  transform: rotate(-45deg);
}

body.menu-open::after {
  content: "";
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 90;
  background: rgba(3, 7, 13, 0.58);
  backdrop-filter: blur(3px);
  pointer-events: none;
}

.mobile-menu {
  position: absolute;
  top: calc(var(--header-h) - 2px);
  left: 16px;
  right: 16px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(8, 16, 28, 0.97);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  animation: menu-in 0.28s var(--ease);
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.mobile-menu nav {
  display: grid;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(150, 190, 255, 0.08);
  font-size: 15px;
  font-weight: 500;
}

.mobile-menu a span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan);
}

.mobile-ai {
  width: 100%;
  margin-top: 14px;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 50px) 0 70px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 72% 42%, rgba(47, 198, 255, 0.12), transparent 62%),
    radial-gradient(ellipse 44% 44% at 20% 24%, rgba(167, 139, 250, 0.08), transparent 65%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 30px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  margin: 22px 0 22px;
  font-size: clamp(3.35rem, 7.6vw, 6.7rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.hero-copy h1 .line {
  display: block;
}

.hero-lede {
  max-width: 520px;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  line-height: 1.72;
}

.hero-lede em {
  color: var(--text);
  font-style: normal;
  border-bottom: 1px solid rgba(88, 240, 210, 0.45);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-bilingual {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 18, 31, 0.5);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.hero-bilingual button {
  padding: 0;
  color: var(--cyan);
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 1px solid rgba(88, 240, 210, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.hero-bilingual button:hover {
  color: #b9fff2;
  border-color: #b9fff2;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: clamp(18px, 3vw, 36px);
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  max-width: 540px;
}

.hero-stats dt {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}

.hero-stats dd {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.scroll-cue {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 26px;
  background: linear-gradient(var(--cyan), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: "";
  position: absolute;
  top: -26px;
  left: 0;
  width: 100%;
  height: 26px;
  background: var(--cyan);
  animation: scroll-drop 2s ease-in-out infinite;
}

@keyframes scroll-drop {
  0% { top: -26px; }
  60%, 100% { top: 26px; }
}

/* ---------- atom visual ---------- */

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 500px;
}

.atom-scene {
  position: relative;
  width: min(470px, 42vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  perspective: 1000px;
}

.atom-halo {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px solid rgba(88, 240, 210, 0.12);
  background: radial-gradient(circle, rgba(47, 198, 255, 0.12), transparent 62%);
  filter: blur(6px);
  animation: halo-pulse 6s ease-in-out infinite;
}

@keyframes halo-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 1; }
}

.atom-core {
  position: relative;
  z-index: 3;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.5), transparent 24%),
    radial-gradient(circle at 50% 60%, #1a4a66, #0a1c30 68%);
  border: 1px solid rgba(88, 240, 210, 0.5);
  box-shadow:
    0 0 0 10px rgba(88, 240, 210, 0.04),
    0 0 60px rgba(47, 198, 255, 0.4),
    inset 0 0 34px rgba(88, 240, 210, 0.22);
  animation: core-float 7s ease-in-out infinite;
}

@keyframes core-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.core-symbol {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1;
  color: #dcfff8;
  text-shadow: 0 0 22px rgba(88, 240, 210, 0.7);
}

.core-symbol sup {
  font-size: 0.5em;
}

.core-caption {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(220, 255, 248, 0.62);
  text-align: center;
  line-height: 1.5;
}

.orbit {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 50%;
}

.orbit::before {
  content: "";
  position: absolute;
  inset: 25% 1%;
  border: 1.5px solid rgba(88, 240, 210, 0.38);
  border-radius: 50%;
  box-shadow:
    0 0 22px rgba(47, 198, 255, 0.1),
    inset 0 0 26px rgba(47, 198, 255, 0.06);
}

.orbit-1 { transform: rotate(24deg); }
.orbit-2 { transform: rotate(-38deg); }
.orbit-3 { transform: rotate(78deg); }

.orbit-2::before { border-color: rgba(167, 139, 250, 0.42); }
.orbit-3::before { border-color: rgba(255, 180, 84, 0.32); }

.electron {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan), 0 0 24px rgba(88, 240, 210, 0.6);
  offset-path: ellipse(48% 24% at 50% 50%);
  offset-rotate: 0deg;
  animation: orbit 12s linear infinite;
}

.electron.e2 {
  background: var(--violet);
  box-shadow: 0 0 10px var(--violet), 0 0 24px rgba(167, 139, 250, 0.6);
  animation-duration: 16s;
  animation-direction: reverse;
}

.electron.e3 {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber), 0 0 24px rgba(255, 180, 84, 0.6);
  animation-duration: 20s;
}

@keyframes orbit {
  from { offset-distance: 0%; }
  to { offset-distance: 100%; }
}

.orbit-label {
  position: absolute;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 12, 21, 0.85);
}

.label-donor { top: 20%; right: -2%; }
.label-acceptor { bottom: 19%; left: -1%; }

.float-card {
  position: absolute;
  z-index: 5;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 18, 31, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: floaty 6s ease-in-out infinite;
}

.float-card strong {
  font-size: 11.5px;
  font-weight: 600;
}

.float-card small {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.fc-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: #ffd9a6;
  background: rgba(255, 180, 84, 0.12);
  border: 1px solid rgba(255, 180, 84, 0.28);
  border-radius: 4px;
  padding: 1px 5px;
  margin-bottom: 3px;
}

.fc-tag.cyan {
  color: #b9fff2;
  background: rgba(88, 240, 210, 0.12);
  border-color: rgba(88, 240, 210, 0.3);
}

.float-card-a {
  top: 4%;
  left: -3%;
  animation-delay: -1s;
}

.float-card-b {
  bottom: 7%;
  right: -3%;
  animation-delay: -3s;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.float-equation {
  position: absolute;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 12, 21, 0.8);
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

/* ---------- marquee ---------- */

.term-marquee {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 15, 26, 0.55);
  overflow: hidden;
  padding: 13px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 26px;
  width: max-content;
  animation: marquee 42s linear infinite;
}

.term-marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track span {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--muted-2);
  white-space: nowrap;
}

.marquee-track i {
  color: rgba(88, 240, 210, 0.5);
  font-style: normal;
  font-size: 9px;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- sections ---------- */

.section {
  position: relative;
  padding: clamp(82px, 10vw, 132px) 0;
  scroll-margin-top: 80px;
}

.section-tint {
  background:
    radial-gradient(ellipse 75% 60% at 82% 12%, rgba(47, 198, 255, 0.055), transparent 64%),
    linear-gradient(180deg, rgba(10, 18, 32, 0.55), rgba(6, 10, 18, 0.3) 55%, rgba(10, 18, 32, 0.5));
  border-top: 1px solid rgba(150, 190, 255, 0.06);
  border-bottom: 1px solid rgba(150, 190, 255, 0.06);
}

.section-head {
  max-width: 700px;
  margin-bottom: clamp(38px, 5vw, 58px);
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.section-kicker span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(88, 240, 210, 0.3);
  border-radius: 8px;
  color: var(--cyan);
  font-size: 9.5px;
  background: rgba(88, 240, 210, 0.07);
}

.section-head h2 {
  font-size: clamp(2.15rem, 4.4vw, 3.55rem);
  letter-spacing: -0.045em;
}

.section-lede {
  margin-top: 17px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

/* ---------- concept ---------- */

.concept-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.concept-card {
  --accent: var(--amber);
  --accent-rgb: 255, 180, 84;
  position: relative;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 90% 60% at 10% 0%, rgba(var(--accent-rgb), 0.12), transparent 62%),
    linear-gradient(160deg, rgba(17, 29, 47, 0.9), rgba(9, 17, 29, 0.82));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.45s var(--ease), border-color 0.3s ease, box-shadow 0.4s ease;
}

.concept-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.045), transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.9s var(--ease);
  pointer-events: none;
}

.concept-card:hover {
  transform: translateY(-5px);
  border-color: rgba(var(--accent-rgb), 0.42);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

.concept-card:hover::before {
  transform: translateX(100%);
}

.ox-card { --accent: var(--amber); --accent-rgb: 255, 180, 84; }
.red-card { --accent: var(--cyan); --accent-rgb: 88, 240, 210; }

.concept-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.concept-index {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  border: 1px solid var(--line);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.concept-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.09);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}

.concept-icon {
  width: 58px;
  height: 58px;
  margin: 26px 0 18px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 17px;
  background: rgba(var(--accent-rgb), 0.07);
  box-shadow: inset 0 0 28px rgba(var(--accent-rgb), 0.06);
}

.concept-icon svg {
  width: 32px;
  height: 32px;
}

.concept-card h3 {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
}

.concept-card > p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.concept-card > p strong {
  color: var(--text);
  font-weight: 600;
}

.concept-points {
  display: grid;
  gap: 9px;
  margin: 22px 0;
}

.concept-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-soft);
}

.concept-points span {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 23px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.09);
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
}

.equation-chip {
  margin-top: auto;
  padding: 14px 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 12px;
  background: rgba(4, 10, 18, 0.55);
}

.eq-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 5px;
}

.equation-chip code {
  font-size: clamp(11px, 1.35vw, 13.5px);
  color: var(--text);
  white-space: nowrap;
}

.concept-mnemonic {
  display: block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--muted-2);
}

.concept-mnemonic b {
  color: var(--accent);
  font-weight: 500;
}

.concept-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
  position: relative;
}

.bridge-top,
.bridge-bottom {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
  writing-mode: vertical-rl;
}

.bridge-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
}

.bridge-electron {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
  border: 1px solid rgba(88, 240, 210, 0.35);
  background: radial-gradient(circle at 35% 30%, rgba(88, 240, 210, 0.22), rgba(7, 15, 26, 0.9));
  box-shadow: 0 0 24px rgba(88, 240, 210, 0.18);
  animation: bridge-breathe 3s ease-in-out infinite;
}

@keyframes bridge-breathe {
  0%, 100% { box-shadow: 0 0 18px rgba(88, 240, 210, 0.14); transform: scale(1); }
  50% { box-shadow: 0 0 34px rgba(88, 240, 210, 0.32); transform: scale(1.06); }
}

.bridge-arrow {
  color: var(--muted-2);
  font-size: 16px;
}

.bridge-core {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  padding: 4px 8px;
  margin-top: 8px;
}

.mnemonic-strip {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  flex-wrap: wrap;
  margin-top: 26px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(110deg, rgba(15, 27, 45, 0.7), rgba(8, 16, 28, 0.5));
}

.mnemonic-item {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}

.mnemonic-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #ffd9a6;
  border: 1px solid rgba(255, 180, 84, 0.28);
  background: rgba(255, 180, 84, 0.08);
  border-radius: 7px;
  padding: 5px 9px;
}

.mnemonic-badge.amber {
  color: #b9fff2;
  border-color: rgba(88, 240, 210, 0.28);
  background: rgba(88, 240, 210, 0.08);
}

.mnemonic-item p {
  font-size: 12px;
  color: var(--muted);
}

.mnemonic-item b {
  color: var(--text-soft);
  font-weight: 600;
}

.mnemonic-divider {
  width: 1px;
  height: 26px;
  background: var(--line);
}

.mnemonic-strip .text-link {
  margin-left: auto;
}

.definition-note {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 17px 22px;
  border-left: 2px solid rgba(167, 139, 250, 0.5);
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.07), transparent 75%);
  border-radius: 0 12px 12px 0;
}

.note-label {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--violet);
  padding-top: 3px;
}

.definition-note p {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 82ch;
}

.definition-note b {
  color: var(--text-soft);
  font-weight: 600;
}

/* ---------- electron lab ---------- */

.lab-shell {
  position: relative;
  padding: clamp(16px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(ellipse 70% 60% at 20% 0%, rgba(47, 198, 255, 0.08), transparent 60%),
    linear-gradient(155deg, rgba(15, 27, 45, 0.92), rgba(7, 14, 25, 0.94));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lab-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(150, 190, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 190, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000, transparent 78%);
  pointer-events: none;
}

.lab-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.lab-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 13, 23, 0.65);
  flex-wrap: wrap;
}

.lab-tab {
  padding: 8px 13px;
  min-height: 32px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.lab-tab:hover {
  color: var(--text-soft);
  background: rgba(150, 190, 255, 0.06);
}

.lab-tab.is-active {
  color: var(--text);
  background: rgba(88, 240, 210, 0.1);
  border-color: rgba(88, 240, 210, 0.24);
  box-shadow: inset 0 0 16px rgba(88, 240, 210, 0.05);
}

.et-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 2.5vw, 28px);
  min-height: 310px;
  padding: clamp(20px, 3.4vw, 36px);
  border: 1px solid rgba(150, 190, 255, 0.09);
  border-radius: 22px;
  background:
    radial-gradient(ellipse 50% 60% at 22% 50%, rgba(255, 180, 84, 0.07), transparent 65%),
    radial-gradient(ellipse 50% 60% at 78% 50%, rgba(88, 240, 210, 0.07), transparent 65%),
    rgba(4, 9, 16, 0.5);
  overflow: hidden;
}

.et-stage::after {
  content: "electron transfer";
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(143, 162, 192, 0.4);
  white-space: nowrap;
}

.et-species {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(10, 19, 33, 0.65);
  transition: border-color 0.5s ease, box-shadow 0.5s ease, transform 0.5s var(--ease);
  min-height: 220px;
  justify-content: center;
}

.et-species.donor {
  border-color: rgba(255, 180, 84, 0.16);
}

.et-species.acceptor {
  border-color: rgba(88, 240, 210, 0.16);
}

.et-stage.is-transferred .et-species.donor {
  border-color: rgba(255, 111, 134, 0.35);
  box-shadow: 0 0 40px rgba(255, 111, 134, 0.08), inset 0 0 30px rgba(255, 111, 134, 0.03);
}

.et-stage.is-transferred .et-species.acceptor {
  border-color: rgba(88, 240, 210, 0.38);
  box-shadow: 0 0 40px rgba(88, 240, 210, 0.1), inset 0 0 30px rgba(88, 240, 210, 0.04);
}

.et-role {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}

.et-orb {
  width: clamp(82px, 9vw, 106px);
  height: clamp(82px, 9vw, 106px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
  border: 1px solid rgba(255, 180, 84, 0.3);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.16), transparent 32%),
    radial-gradient(circle at 50% 60%, rgba(255, 180, 84, 0.18), rgba(9, 17, 29, 0.9) 68%);
  box-shadow: 0 0 34px rgba(255, 180, 84, 0.1), inset 0 0 24px rgba(255, 180, 84, 0.08);
  transition: border-color 0.5s ease, box-shadow 0.5s ease, background 0.5s ease;
}

.acceptor .et-orb {
  border-color: rgba(88, 240, 210, 0.3);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.16), transparent 32%),
    radial-gradient(circle at 50% 60%, rgba(88, 240, 210, 0.16), rgba(9, 17, 29, 0.9) 68%);
  box-shadow: 0 0 34px rgba(88, 240, 210, 0.1), inset 0 0 24px rgba(88, 240, 210, 0.08);
}

.et-stage.is-transferred .donor .et-orb {
  border-color: rgba(255, 111, 134, 0.5);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.14), transparent 32%),
    radial-gradient(circle at 50% 60%, rgba(255, 111, 134, 0.18), rgba(9, 17, 29, 0.9) 68%);
  box-shadow: 0 0 40px rgba(255, 111, 134, 0.2);
}

.et-stage.is-transferred .acceptor .et-orb {
  border-color: rgba(88, 240, 210, 0.6);
  box-shadow: 0 0 44px rgba(88, 240, 210, 0.26), inset 0 0 30px rgba(88, 240, 210, 0.12);
}

.et-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.et-state > span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  text-align: center;
}

.charge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 13, 23, 0.6);
  transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

.charge.is-pos {
  color: #ffb1bc;
  border-color: rgba(255, 111, 134, 0.35);
  background: rgba(255, 111, 134, 0.1);
}

.charge.is-neg {
  color: #9bfff0;
  border-color: rgba(88, 240, 210, 0.35);
  background: rgba(88, 240, 210, 0.1);
}

.et-transfer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.et-transfer-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.et-line {
  position: relative;
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
}

.et-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(150, 190, 255, 0.22) 0 4px, transparent 4px 9px);
}

.et-line::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 1px solid rgba(150, 190, 255, 0.4);
  border-right: 1px solid rgba(150, 190, 255, 0.4);
  transform: translateY(-50%) rotate(45deg);
}

.et-electron {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #04131b;
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(88, 240, 210, 0.1), 0 0 26px rgba(88, 240, 210, 0.6);
  transition: left 1.15s cubic-bezier(0.45, 0, 0.2, 1);
  z-index: 2;
}

.et-stage.is-transferred .et-electron {
  left: calc(100% - 34px);
}

.et-hint {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
  opacity: 0.75;
  text-align: center;
}

.et-readout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.readout-card {
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(9, 17, 29, 0.6);
  transition: border-color 0.3s ease;
}

.readout-card.ox { border-top-color: rgba(255, 180, 84, 0.35); }
.readout-card.red { border-top-color: rgba(88, 240, 210, 0.35); }
.readout-card.summary { border-top-color: rgba(167, 139, 250, 0.35); }

.readout-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 9px;
}

.readout-head .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.readout-card.red .dot { background: var(--cyan); }
.readout-card.summary .dot { background: var(--violet); }

.readout-card code {
  display: block;
  font-size: clamp(9.5px, 1.1vw, 11.5px);
  color: var(--text);
  line-height: 1.6;
  word-break: break-word;
}

.readout-card p {
  margin-top: 7px;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
}

.readout-card.summary p {
  margin-top: 0;
  font-size: 11px;
  color: var(--text-soft);
}

.readout-card.summary p + p {
  margin-top: 4px;
}

.readout-card.summary b {
  color: var(--muted-2);
  font-weight: 500;
}

.readout-card .readout-small {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  color: var(--muted-2);
}

.lab-note {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 180, 84, 0.4);
  font-size: 10.5px;
  color: var(--muted-2);
}

.lab-note b {
  color: var(--amber);
  font-weight: 500;
}

/* ---------- oxidation number lab ---------- */

.ox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
}

.ox-lab,
.rules-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(15, 27, 45, 0.9), rgba(8, 16, 28, 0.88));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.ox-lab {
  padding: clamp(20px, 3vw, 30px);
}

.ox-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.ox-chip {
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(150, 190, 255, 0.04);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ox-chip:hover {
  color: var(--text);
  background: rgba(150, 190, 255, 0.09);
}

.ox-chip.is-active {
  color: var(--text);
  border-color: rgba(88, 240, 210, 0.3);
  background: rgba(88, 240, 210, 0.1);
}

.ox-display {
  text-align: center;
  padding: 14px 0 20px;
}

.ox-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.ox-target {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}

.ox-target > span:first-child {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  color: var(--cyan);
  text-shadow: 0 0 30px rgba(88, 240, 210, 0.25);
}

.ox-target small {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ox-target > span:last-child {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--text);
}

.ox-breakdown {
  display: flex;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
}

.ox-part {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted);
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(6, 13, 23, 0.5);
}

.ox-part b {
  color: var(--text-soft);
  font-weight: 500;
}

.ox-part.unknown {
  color: var(--cyan);
  border-color: rgba(88, 240, 210, 0.28);
  background: rgba(88, 240, 210, 0.06);
}

.ox-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.ox-input-row label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  width: 100%;
}

.ox-input-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.ox-input-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 84px 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(5, 11, 20, 0.75);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ox-input-wrap input::placeholder {
  color: var(--muted-2);
  font-size: 12px;
}

.ox-input-wrap input:focus {
  outline: none;
  border-color: rgba(88, 240, 210, 0.55);
  box-shadow: 0 0 0 3px rgba(88, 240, 210, 0.1);
}

.input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  pointer-events: none;
}

.ox-hint {
  margin-top: 8px;
  font-size: 9.5px;
  color: var(--muted-2);
}

.ox-feedback {
  display: none;
  margin-top: 14px;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid var(--line);
  background: rgba(150, 190, 255, 0.05);
}

.ox-feedback.is-visible { display: block; }

.ox-feedback.success {
  color: #b9ffe9;
  border-color: rgba(68, 230, 168, 0.35);
  background: rgba(68, 230, 168, 0.08);
  animation: pop-in 0.35s var(--ease);
}

.ox-feedback.error {
  color: #ffc1c9;
  border-color: rgba(255, 111, 134, 0.35);
  background: rgba(255, 111, 134, 0.07);
  animation: shake 0.4s ease;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.ox-steps {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 10, 18, 0.55);
  animation: pop-in 0.3s var(--ease);
}

.ox-steps h4 {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}

.ox-steps ol {
  counter-reset: oxstep;
  display: grid;
  gap: 8px;
}

.ox-steps li {
  counter-increment: oxstep;
  position: relative;
  padding-left: 26px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.ox-steps li::before {
  content: counter(oxstep);
  position: absolute;
  left: 0;
  top: 1px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(88, 240, 210, 0.28);
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: var(--cyan);
}

.ox-steps code {
  color: var(--text-soft);
  font-size: 10.5px;
}

.ox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

#oxScore {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--muted-2);
}

.rules-card {
  padding: 24px;
  position: sticky;
  top: 96px;
}

.rules-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.rules-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.1);
  color: var(--violet);
  font-family: var(--font-mono);
  font-size: 15px;
}

.rules-head h3 {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.rules-head p {
  font-size: 9.5px;
  color: var(--muted-2);
  margin-top: 2px;
}

.rules-list {
  display: grid;
  gap: 0;
  margin-top: 4px;
}

.rules-list li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(150, 190, 255, 0.06);
}

.rules-list li > span {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--violet);
  padding-top: 3px;
  flex: none;
}

.rules-list p {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.rules-list b {
  color: var(--text-soft);
  font-weight: 600;
}

.rules-ai {
  margin-top: 16px;
  font-size: 11px;
}

/* ---------- balancing ---------- */

.balance-shell {
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(ellipse 60% 50% at 80% 0%, rgba(167, 139, 250, 0.08), transparent 65%),
    linear-gradient(155deg, rgba(15, 27, 45, 0.94), rgba(7, 14, 25, 0.95));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.balance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.balance-medium {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
  padding: 5px 10px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  background: rgba(167, 139, 250, 0.07);
  border-radius: 999px;
}

.equation-stage {
  position: relative;
  padding: clamp(26px, 4vw, 40px) 24px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(rgba(150, 190, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 190, 255, 0.03) 1px, transparent 1px);
  background-size: 38px 38px;
}

.equation-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 12px;
}

.balance-equation {
  font-family: var(--font-mono);
  font-size: clamp(13px, 2.4vw, 22px);
  font-weight: 500;
  line-height: 1.7;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
  word-break: break-word;
}

.balance-equation .coeff {
  color: var(--cyan);
  font-weight: 600;
}

.balance-equation .changed {
  animation: eq-flash 0.55s var(--ease);
}

@keyframes eq-flash {
  0% { color: var(--cyan); text-shadow: 0 0 18px rgba(88, 240, 210, 0.7); }
  100% { color: var(--text); text-shadow: none; }
}

.balance-status {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 0.35s ease;
}

.balance-status.balanced {
  color: #b9ffe9;
  border-color: rgba(68, 230, 168, 0.4);
  background: rgba(68, 230, 168, 0.1);
  box-shadow: 0 0 20px rgba(68, 230, 168, 0.12);
}

.balance-progress {
  height: 2px;
  background: rgba(150, 190, 255, 0.08);
  overflow: hidden;
}

.balance-progress-fill {
  height: 100%;
  width: 20%;
  background: var(--grad);
  transition: width 0.45s var(--ease);
  box-shadow: 0 0 12px rgba(88, 240, 210, 0.5);
}

.balance-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: clamp(20px, 4vw, 44px);
  padding: clamp(24px, 4vw, 38px);
  align-items: center;
}

.step-count {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.balance-copy h3 {
  margin: 8px 0 10px;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

.balance-copy p {
  font-size: 13px;
  line-height: 1.72;
  color: var(--muted);
  max-width: 56ch;
}

.step-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.step-tags span {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-soft);
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(6, 13, 23, 0.5);
}

.electron-ledger {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 11, 20, 0.55);
}

.ledger-row {
  margin-bottom: 15px;
}

.ledger-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.ledger-label span {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.ledger-label b {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.ledger-row.gain b { color: var(--cyan); }
.ledger-row.loss b { color: var(--amber); }

.ledger-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(150, 190, 255, 0.08);
  overflow: hidden;
}

.ledger-track i {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--ease);
}

.ledger-row.gain .ledger-track i {
  background: linear-gradient(90deg, rgba(88, 240, 210, 0.4), var(--cyan));
  box-shadow: 0 0 12px rgba(88, 240, 210, 0.3);
}

.ledger-row.loss .ledger-track i {
  background: linear-gradient(90deg, rgba(255, 180, 84, 0.4), var(--amber));
  box-shadow: 0 0 12px rgba(255, 180, 84, 0.3);
}

.ledger-row small {
  display: block;
  margin-top: 5px;
  font-size: 9px;
  color: var(--muted-2);
}

.ledger-balance {
  margin-top: 4px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  color: var(--muted-2);
}

.ledger-balance.ok {
  color: var(--green);
}

.balance-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
}

.balance-dots {
  display: flex;
  gap: 5px;
}

.balance-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(150, 190, 255, 0.16);
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.balance-dots i.is-done {
  background: rgba(88, 240, 210, 0.5);
}

.balance-dots i.is-current {
  background: var(--cyan);
  transform: scale(1.35);
  box-shadow: 0 0 9px var(--cyan);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.method-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10, 19, 33, 0.55);
  transition: border-color 0.3s ease, transform 0.3s var(--ease);
}

.method-card:hover {
  border-color: rgba(167, 139, 250, 0.3);
  transform: translateY(-3px);
}

.method-num {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--violet);
  letter-spacing: 0.08em;
}

.method-card h3 {
  margin: 8px 0 6px;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.method-card p {
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- real world bento ---------- */

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

.bento-card {
  position: relative;
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(20px, 2.6vw, 28px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(15, 27, 45, 0.8), rgba(8, 15, 26, 0.78));
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.3s ease, box-shadow 0.4s ease;
}

.bento-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at var(--mx, 50%) var(--my, 0%), rgba(88, 240, 210, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: rgba(88, 240, 210, 0.24);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.bento-card:hover::after {
  opacity: 1;
}

.bento-rust { grid-column: span 7; }
.bento-wide { grid-column: span 12; flex-direction: row; align-items: center; gap: 22px; }

.bento-icon {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(88, 240, 210, 0.2);
  border-radius: 13px;
  background: rgba(88, 240, 210, 0.06);
}

.bento-icon svg {
  width: 27px;
  height: 27px;
}

.bento-rust .bento-icon { color: var(--amber); border-color: rgba(255, 180, 84, 0.22); background: rgba(255, 180, 84, 0.06); }

.bento-tag {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.bento-card h3 {
  margin: 7px 0 8px;
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
}

.bento-card p {
  font-size: 12px;
  line-height: 1.68;
  color: var(--muted);
  max-width: 52ch;
}

.bento-eq {
  display: inline-block;
  margin-top: 13px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-soft);
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(4, 10, 18, 0.5);
  max-width: 100%;
  overflow-wrap: break-word;
}

.bento-rust { min-height: 250px; }

.bento-rust > div:nth-child(2) {
  position: relative;
  z-index: 2;
}

.rust-flakes {
  position: absolute;
  right: 8%;
  bottom: 4%;
  width: 160px;
  height: 160px;
  opacity: 0.55;
  pointer-events: none;
}

.rust-flakes i {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d9853f, #7a3b19 70%);
  box-shadow: 0 0 22px rgba(217, 133, 63, 0.2);
  animation: flake 7s ease-in-out infinite;
}

.rust-flakes i:nth-child(1) { width: 54px; height: 54px; left: 50%; top: 30%; }
.rust-flakes i:nth-child(2) { width: 26px; height: 26px; left: 24%; top: 66%; animation-delay: -2s; }
.rust-flakes i:nth-child(3) { width: 16px; height: 16px; left: 78%; top: 12%; animation-delay: -4s; }

@keyframes flake {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-8px) rotate(12deg); }
}

.mini-flow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  flex-wrap: wrap;
}

.mini-flow span {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.mini-flow i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--cyan);
}

.energy-meter {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.energy-meter i {
  width: 70px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(88, 240, 210, 0.3), var(--cyan), var(--violet));
  box-shadow: 0 0 12px rgba(88, 240, 210, 0.3);
}

.energy-meter b {
  color: var(--text-soft);
  font-weight: 500;
}

.fact-strip {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 17px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 19, 33, 0.55);
}

.fact-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--amber);
  padding: 3px 8px;
  border: 1px solid rgba(255, 180, 84, 0.25);
  border-radius: 4px;
  flex: none;
}

.fact-strip p {
  font-size: 11.5px;
  color: var(--muted);
  flex: 1;
  min-width: 240px;
}

.fact-strip b {
  color: var(--text-soft);
  font-weight: 600;
}

.fact-strip .text-link {
  font-size: 11px;
}

/* ---------- quiz ---------- */

.quiz-shell {
  max-width: 860px;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(47, 198, 255, 0.09), transparent 65%),
    linear-gradient(155deg, rgba(15, 27, 45, 0.94), rgba(7, 14, 25, 0.96));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.quiz-start,
.quiz-game,
.quiz-result {
  padding: clamp(30px, 5vw, 52px);
}

.quiz-start,
.quiz-result {
  text-align: center;
}

.quiz-orbit {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(88, 240, 210, 0.15);
  border-radius: 50%;
}

.quiz-orbit::before,
.quiz-orbit::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(88, 240, 210, 0.18);
  border-radius: 50%;
  transform: rotate(35deg) scaleY(0.5);
}

.quiz-orbit::after {
  transform: rotate(-35deg) scaleY(0.5);
  border-color: rgba(167, 139, 250, 0.2);
}

.quiz-orbit b {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--cyan);
  text-shadow: 0 0 24px rgba(88, 240, 210, 0.5);
}

.quiz-orbit span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.quiz-orbit span:nth-child(1) { top: 12px; left: 28px; }
.quiz-orbit span:nth-child(2) { bottom: 18px; right: 18px; background: var(--violet); box-shadow: 0 0 10px var(--violet); }
.quiz-orbit span:nth-child(3) { bottom: 33px; left: 10px; width: 4px; height: 4px; background: var(--amber); box-shadow: 0 0 8px var(--amber); }

.quiz-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 5px 10px;
  border: 1px solid rgba(88, 240, 210, 0.24);
  border-radius: 999px;
  background: rgba(88, 240, 210, 0.06);
  margin-bottom: 14px;
}

.quiz-start h3,
.quiz-result h3 {
  font-size: clamp(1.65rem, 3.5vw, 2.3rem);
}

.quiz-start > p,
.quiz-result > p {
  max-width: 52ch;
  margin: 12px auto 24px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.quiz-best {
  margin-top: 18px !important;
  font-family: var(--font-mono);
  font-size: 9px !important;
  letter-spacing: 0.06em;
  color: var(--muted-2) !important;
}

.quiz-best span { color: var(--cyan); }

.quiz-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}

#quizScoreText { color: var(--cyan); }

.quiz-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(150, 190, 255, 0.08);
  overflow: hidden;
  margin-bottom: 28px;
}

.quiz-track i {
  display: block;
  height: 100%;
  width: 10%;
  background: var(--grad);
  border-radius: 2px;
  transition: width 0.4s var(--ease);
}

#quizQuestion {
  font-size: clamp(1.2rem, 2.3vw, 1.55rem);
  line-height: 1.42;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
  max-width: 62ch;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 14, 25, 0.6);
  text-align: left;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-soft);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease);
}

.quiz-option:hover:not(:disabled) {
  border-color: rgba(88, 240, 210, 0.35);
  background: rgba(88, 240, 210, 0.06);
  transform: translateY(-1px);
}

.quiz-option .option-letter {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  transition: all 0.2s ease;
}

.quiz-option.is-correct {
  border-color: rgba(68, 230, 168, 0.55);
  background: rgba(68, 230, 168, 0.1);
  color: #d5ffee;
}

.quiz-option.is-correct .option-letter {
  background: var(--green);
  border-color: var(--green);
  color: #04130d;
}

.quiz-option.is-wrong {
  border-color: rgba(255, 111, 134, 0.55);
  background: rgba(255, 111, 134, 0.08);
  color: #ffd4da;
}

.quiz-option.is-wrong .option-letter {
  background: var(--red);
  border-color: var(--red);
  color: #1b0408;
}

.quiz-option.is-dimmed {
  opacity: 0.45;
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-feedback {
  display: none;
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  background: rgba(150, 190, 255, 0.04);
}

.quiz-feedback.is-visible { display: block; animation: pop-in 0.3s var(--ease); }
.quiz-feedback.good { border-color: rgba(68, 230, 168, 0.3); background: rgba(68, 230, 168, 0.06); color: #c9ffea; }
.quiz-feedback.bad { border-color: rgba(255, 111, 134, 0.3); background: rgba(255, 111, 134, 0.06); color: #ffd0d6; }
.quiz-feedback b { color: var(--text); font-weight: 600; }

.quiz-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.score-ring {
  --score: 0;
  position: relative;
  width: 156px;
  height: 156px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: conic-gradient(var(--cyan) calc(var(--score) * 1%), rgba(150, 190, 255, 0.09) 0);
  display: grid;
  place-items: center;
  box-shadow: 0 0 50px rgba(88, 240, 210, 0.12);
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #0a1422;
}

.score-ring-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-ring-inner strong {
  font-family: var(--font-display);
  font-size: 2.8rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.score-ring-inner span {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.result-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
  border: 1px solid rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.08);
  border-radius: 999px;
  padding: 5px 11px;
  margin-bottom: 12px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quiz-tips {
  display: flex;
  align-items: center;
  gap: 13px;
  max-width: 860px;
  margin: 18px auto 0;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 19, 33, 0.45);
}

.quiz-tips span {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  flex: none;
}

.quiz-tips p {
  font-size: 11px;
  color: var(--muted-2);
}

/* ---------- CTA ---------- */

.cta-section {
  padding: 0 0 clamp(70px, 9vw, 110px);
}

.cta-card {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 6vw, 64px);
  border: 1px solid rgba(88, 240, 210, 0.22);
  border-radius: 32px;
  background:
    radial-gradient(ellipse 55% 80% at 82% 50%, rgba(167, 139, 250, 0.16), transparent 65%),
    radial-gradient(ellipse 55% 80% at 12% 20%, rgba(47, 198, 255, 0.13), transparent 65%),
    linear-gradient(140deg, #0b1829, #080f1b);
  text-align: center;
}

.cta-glow {
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(88, 240, 210, 0.18), transparent 65%);
  filter: blur(30px);
  pointer-events: none;
}

.cta-card h2 {
  position: relative;
  margin: 20px 0 14px;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  letter-spacing: -0.045em;
}

.cta-card > p {
  position: relative;
  max-width: 58ch;
  margin: 0 auto;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

.cta-actions {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(5, 10, 18, 0.75);
  padding: 52px 0 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 0.9fr 1.2fr;
  gap: 34px;
}

.footer-brand p {
  margin: 14px 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted-2);
  max-width: 32ch;
}

.footer-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 7px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links h4,
.footer-meta h4 {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 7px;
}

.footer-links a {
  font-size: 11.5px;
  color: var(--muted);
  width: fit-content;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--cyan);
}

.footer-meta p {
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--muted-2);
  max-width: 34ch;
}

.footer-ai {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}

.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
  flex: none;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid rgba(150, 190, 255, 0.07);
}

.footer-bottom p {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  color: var(--muted-2);
}

/* ============================================================
   CHATBOT
   ============================================================ */

.chat-widget {
  position: relative;
  z-index: 200;
}

.chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 205;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #04131b;
  background: var(--grad);
  box-shadow: 0 12px 40px rgba(47, 198, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
}

.chat-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 18px 50px rgba(47, 198, 255, 0.45);
}

.fab-icon {
  width: 27px;
  height: 27px;
  position: relative;
  z-index: 2;
}

.fab-glow {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--cyan), var(--violet), var(--cyan));
  filter: blur(12px);
  opacity: 0.45;
  z-index: 0;
  animation: spin-slow 7s linear infinite;
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

.fab-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(88, 240, 210, 0.6);
  animation: ping 3s ease-out infinite;
  pointer-events: none;
}

@keyframes ping {
  0% { transform: scale(1); opacity: 0.65; }
  80%, 100% { transform: scale(1.55); opacity: 0; }
}

.fab-label {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 16, 28, 0.92);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(10px);
}

.chat-fab:hover .fab-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 98px;
  z-index: 204;
  width: 402px;
  height: min(640px, calc(100dvh - 130px));
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(150, 190, 255, 0.2);
  border-radius: 24px;
  background: #0a1422;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(88, 240, 210, 0.05);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.97);
  transform-origin: bottom right;
  will-change: opacity, transform;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}

.chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(88, 240, 210, 0.06), rgba(167, 139, 250, 0.06));
  flex: none;
}

.chat-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--grad);
  color: #06131c;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 0 20px rgba(88, 240, 210, 0.22);
}

.chat-avatar i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #0a1422;
  background: var(--green);
}

.chat-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.chat-identity strong {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.chat-identity > span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  white-space: nowrap;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.chat-icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.chat-icon-btn:hover {
  background: rgba(150, 190, 255, 0.08);
  color: var(--text);
}

.chat-icon-btn svg {
  width: 16px;
  height: 16px;
}

.chat-lang {
  width: auto;
  min-width: 34px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  border: 1px solid var(--line);
  letter-spacing: 0.03em;
}

.chat-lang.is-my {
  color: #ffe0b0;
  border-color: rgba(255, 180, 84, 0.35);
  background: rgba(255, 180, 84, 0.08);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 190, 255, 0.18) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(150, 190, 255, 0.18);
  border-radius: 4px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  animation: msg-in 0.3s var(--ease);
  max-width: 100%;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.chat-msg.user {
  justify-content: flex-end;
}

.msg-avatar {
  width: 25px;
  height: 25px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(88, 240, 210, 0.12);
  border: 1px solid rgba(88, 240, 210, 0.2);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
}

.msg-bubble {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 4px 14px 14px 14px;
  background: rgba(19, 33, 53, 0.8);
  border: 1px solid rgba(150, 190, 255, 0.09);
  font-size: 11.8px;
  line-height: 1.65;
  color: var(--text-soft);
  overflow-wrap: break-word;
}

.chat-msg.user .msg-bubble {
  border-radius: 14px 4px 14px 14px;
  background: linear-gradient(130deg, rgba(88, 240, 210, 0.16), rgba(47, 198, 255, 0.14));
  border-color: rgba(88, 240, 210, 0.22);
  color: #e8fffb;
}

.msg-bubble > *:first-child { margin-top: 0; }
.msg-bubble > *:last-child { margin-bottom: 0; }

.msg-bubble p {
  margin: 0 0 8px;
}

.msg-bubble strong {
  color: var(--text);
  font-weight: 600;
}

.msg-bubble code {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(4, 10, 18, 0.7);
  border: 1px solid rgba(150, 190, 255, 0.1);
  color: #b9fff2;
}

.msg-bubble .formula {
  display: block;
  margin: 7px 0;
  padding: 7px 9px;
  border-left: 2px solid rgba(88, 240, 210, 0.45);
  background: rgba(4, 10, 18, 0.45);
  border-radius: 0 6px 6px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #dffdf8;
  overflow-x: auto;
  white-space: nowrap;
}

.msg-bubble ul {
  margin: 6px 0;
  display: grid;
  gap: 4px;
}

.msg-bubble li {
  position: relative;
  padding-left: 13px;
}

.msg-bubble li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.65em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cyan);
}

.msg-bubble .my-text {
  font-family: var(--font-body);
  line-height: 1.85;
}

.msg-time {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--muted-2);
  opacity: 0.7;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.4;
  animation: typing 1.2s ease-in-out infinite;
}

.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-chips {
  display: flex;
  gap: 5px;
  padding: 4px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: none;
  min-height: 0;
}

.chat-chips::-webkit-scrollbar { display: none; }

.chat-chips:empty {
  padding: 0;
}

.chat-chip {
  flex: none;
  padding: 6px 10px;
  border: 1px solid rgba(150, 190, 255, 0.16);
  border-radius: 999px;
  background: rgba(150, 190, 255, 0.04);
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.chat-chip:hover {
  color: var(--text);
  border-color: rgba(88, 240, 210, 0.35);
  background: rgba(88, 240, 210, 0.07);
}

.chat-chip.quiz-chip {
  border-color: rgba(167, 139, 250, 0.3);
  color: #d5c9ff;
  background: rgba(167, 139, 250, 0.07);
}

.chat-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: rgba(6, 13, 23, 0.75);
  flex: none;
}

.chat-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 10, 18, 0.7);
  font-size: 11.5px;
  color: var(--text);
  transition: border-color 0.2s ease;
}

.chat-form input::placeholder {
  color: var(--muted-2);
  font-size: 10.5px;
}

.chat-form input:focus {
  outline: none;
  border-color: rgba(88, 240, 210, 0.4);
}

.chat-mic.is-listening {
  color: var(--red);
  background: rgba(255, 111, 134, 0.1);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.chat-send {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--grad);
  color: #04131b;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.chat-send:hover {
  transform: scale(1.04);
}

.chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-send svg {
  width: 18px;
  height: 18px;
}

.chat-disclaimer {
  padding: 0 12px 9px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 6.8px;
  letter-spacing: 0.02em;
  color: var(--muted-2);
  background: rgba(6, 13, 23, 0.75);
  flex: none;
}

/* ---------- toast & confetti ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 400;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(9, 18, 31, 0.96);
  color: var(--text-soft);
  font-size: 11px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 300;
  pointer-events: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1120px) {
  .main-nav { display: none; }
  .menu-toggle { display: block; }
  .hero-grid { gap: 10px; }
  .atom-scene { width: min(430px, 43vw); }
}

@media (max-width: 980px) {
  .chapter-pill { display: none; }
  .hero { padding-top: calc(var(--header-h) + 36px); }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .hero-copy { text-align: center; }
  .hero-copy .eyebrow { margin-inline: auto; }
  .hero-copy h1 { font-size: clamp(3.6rem, 12vw, 6rem); }
  .hero-lede { margin-inline: auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero-bilingual { justify-content: center; margin-inline: auto; font-size: 11.5px; }
  .hero-stats { margin-inline: auto; }
  .hero-visual { min-height: auto; padding: 10px 0 36px; }
  .atom-scene { width: min(420px, 78vw); }
  .scroll-cue { display: none; }

  .concept-grid { grid-template-columns: 1fr; gap: 14px; }
  .concept-bridge { flex-direction: row; gap: 12px; padding: 2px 0; }
  .bridge-top, .bridge-bottom { writing-mode: horizontal-tb; }
  .bridge-flow { flex-direction: row; padding: 0; }
  .bridge-arrow { transform: rotate(90deg); }
  .bridge-core { display: none; }
  .concept-card { min-height: auto; }

  .ox-grid { grid-template-columns: 1fr; }
  .rules-card { position: static; }

  .balance-body { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }

  .bento-rust { grid-column: span 7; }
  .bento-card { grid-column: span 5; }
  .bento-wide { grid-column: span 12; }

  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-meta { grid-column: span 3; }
}

@media (max-width: 760px) {
  .container { width: calc(100% - 32px); }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 32px; }
  .section-lede { font-size: 14px; }

  .hero-stats { grid-template-columns: repeat(4, 1fr); gap: 14px; width: 100%; }
  .hero-stats dt { font-size: 1.4rem; }
  .hero-stats dd { font-size: 8px; }

  .et-stage {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 26px 18px;
  }
  .et-stage::after { top: 10px; }
  .et-species {
    flex-direction: row;
    min-height: 0;
    padding: 14px 16px;
    justify-content: flex-start;
    gap: 14px;
  }
  .et-state { align-items: flex-start; }
  .et-role { display: none; }
  .et-orb { width: 62px; height: 62px; font-size: 1.25rem; }
  .et-transfer { padding: 2px 0; }
  .et-line { height: 32px; }
  .et-transfer-label { font-size: 7.5px; }
  .et-hint { display: none; }
  .et-electron { width: 28px; height: 28px; font-size: 9px; }
  .et-stage.is-transferred .et-electron { left: calc(100% - 28px); }
  .et-readout { grid-template-columns: 1fr; }
  .readout-card code { font-size: 10.5px; }
  .lab-toolbar .btn { width: 100%; }

  .ox-input-row { align-items: stretch; }
  .ox-input-wrap { min-width: 100%; }
  .ox-input-row .btn { flex: 1; }

  .balance-top { padding: 14px 16px; }
  .equation-stage { padding: 26px 16px; }
  .balance-body { padding: 22px 18px; }
  .balance-controls { padding: 14px 16px 18px; flex-wrap: wrap; }
  .balance-dots { order: 3; width: 100%; justify-content: center; }

  .bento-grid { grid-template-columns: 1fr; }
  .bento-card, .bento-rust, .bento-wide { grid-column: span 1; }
  .bento-wide { flex-direction: column; align-items: flex-start; }
  .energy-meter { margin: 8px 0 0; }
  .rust-flakes { opacity: 0.35; right: -4%; }

  .quiz-options { grid-template-columns: 1fr; }
  .quiz-start, .quiz-game, .quiz-result { padding: 26px 20px; }

  .cta-card { padding: 34px 20px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .footer-brand { grid-column: span 2; }
  .footer-meta { grid-column: span 2; }
  .footer-bottom { flex-direction: column; gap: 6px; }

  .chat-panel {
    right: 10px;
    left: 10px;
    bottom: 86px;
    width: auto;
    height: min(620px, calc(100dvh - 100px));
    border-radius: 20px;
  }
  .chat-fab { right: 16px; bottom: 16px; width: 56px; height: 56px; }
  .fab-label { display: none; }

  /* account gate: full-screen sheet on phones */
  .auth-panel {
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    width: auto;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: 0;
  }
  .auth-hero { padding: 22px 20px 16px; }
  .auth-body { padding: 16px 18px 26px; overflow-y: auto; }
  .auth-panel .auth-close { top: 14px; right: 14px; }

  .mnemonic-strip { gap: 12px; }
  .mnemonic-divider { display: none; }
  .mnemonic-strip .text-link { margin-left: 0; }
  .definition-note { flex-direction: column; gap: 6px; }

  .fact-strip .text-link { margin-left: 0; }
}

@media (max-width: 360px) {
  .chat-identity > span {
    display: none;
  }
  .chat-header {
    padding: 12px;
    gap: 9px;
  }
  .chat-header-actions {
    gap: 0;
  }
}

@media (max-width: 380px) {
  .eyebrow {
    font-size: 9.5px;
    letter-spacing: 0.1em;
    padding: 7px 11px;
  }
  .nav-actions .btn-ai {
    width: 42px;
    padding: 0;
    font-size: 0;
    gap: 0;
  }
  .nav-actions .btn-ai svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 520px) {
  .hero-copy h1 { font-size: clamp(3rem, 15vw, 4.6rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .hero-stats dt { font-size: 1.5rem; }
  .float-card { transform: scale(0.88); }
  .float-card-a { left: -5%; }
  .float-card-b { right: -5%; }
  .float-equation { font-size: 8px; }

  .ox-lab { padding: 18px 15px; }
  .ox-chip { font-size: 9.5px; padding: 6px 8px; }
  .ox-target { gap: 7px; }

  .quiz-orbit { width: 92px; height: 92px; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand, .footer-meta { grid-column: span 1; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero .reveal { animation-delay: 0s; }
  .et-electron { transition: none; }
}

/* ---------- print ---------- */

@media print {
  .site-header, .bg-canvas, .ambient, .term-marquee, .chat-widget, .confetti-canvas, .toast, .scroll-progress { display: none !important; }
  body { background: #fff; color: #111; }
  .section, .hero { padding: 20px 0; }
  .reveal { opacity: 1; transform: none; }
  .section-tint { background: none; border: 0; }
  .concept-card, .lab-shell, .ox-lab, .rules-card, .balance-shell, .bento-card, .quiz-shell, .cta-card { break-inside: avoid; border-color: #ddd; background: #fff; box-shadow: none; color: #111; }
  .section-lede, .concept-card > p, .bento-card p, .method-card p { color: #444; }
}

/* ============================================================
   Chapter notes promo
   ============================================================ */

.lesson-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 20px;
  border: 1px solid rgba(88, 240, 210, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(ellipse 45% 120% at 0% 50%, rgba(88, 240, 210, 0.1), transparent 70%),
    linear-gradient(105deg, rgba(15, 30, 48, 0.86), rgba(9, 18, 31, 0.72));
  transition: border-color 0.25s ease, transform 0.3s var(--ease), background 0.3s ease;
}

.lesson-banner:hover {
  transform: translateY(-2px);
  border-color: rgba(88, 240, 210, 0.42);
  background:
    radial-gradient(ellipse 45% 120% at 0% 50%, rgba(88, 240, 210, 0.14), transparent 70%),
    linear-gradient(105deg, rgba(18, 36, 56, 0.92), rgba(10, 20, 35, 0.8));
}

.lesson-banner-icon {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(88, 240, 210, 0.24);
  border-radius: 12px;
  background: rgba(88, 240, 210, 0.07);
}

.lesson-banner-icon svg {
  width: 23px;
  height: 23px;
}

.lesson-banner-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.lesson-banner-kicker {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.lesson-banner-text strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lesson-banner-text > span:last-child {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.lesson-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 13, 23, 0.5);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lesson-banner:hover .lesson-banner-cta {
  border-color: rgba(88, 240, 210, 0.4);
  color: var(--cyan);
}

/* ============================================================
   DeepSeek settings inside the chat
   ============================================================ */

.chat-settings {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 18px;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(88, 240, 210, 0.08), transparent 70%),
    #0a1422;
  animation: settings-in 0.25s var(--ease);
}

@keyframes settings-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.chat-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 5px;
}

.chat-settings-head h3 {
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.settings-intro {
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
}

.settings-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: -5px;
}

.settings-key-row {
  display: flex;
  gap: 6px;
}

.settings-key-row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(4, 10, 18, 0.8);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
}

.settings-key-row input:focus {
  outline: none;
  border-color: rgba(88, 240, 210, 0.55);
  box-shadow: 0 0 0 3px rgba(88, 240, 210, 0.08);
}

.settings-eye {
  flex: none;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--muted);
  background: rgba(150, 190, 255, 0.04);
}

.settings-eye:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.settings-hint {
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--muted-2);
}

.settings-hint b {
  color: var(--text-soft);
  font-weight: 600;
}

.settings-hint span {
  color: var(--cyan);
}

.settings-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.settings-actions .btn {
  min-height: 36px;
  font-size: 11px;
  padding: 0 14px;
}

.settings-status {
  min-height: 17px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
  color: var(--green);
}

.settings-status.is-error {
  color: var(--red);
}

.settings-warning {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  line-height: 1.6;
  color: var(--muted-2);
}

.chat-status-live .status-dot {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

@media (max-width: 760px) {
  .lesson-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .lesson-banner-text {
    flex-basis: calc(100% - 60px);
  }
  .lesson-banner-cta {
    margin-left: 58px;
  }
}

@media (max-width: 380px) {
  .lesson-banner-cta {
    margin-left: 0;
  }
  .chat-settings {
    padding: 14px;
  }
}

.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;
}

/* ============================================================
   Problem / solution + hosting help
   ============================================================ */

.problem-section {
  border-top: 1px solid rgba(150, 190, 255, 0.07);
}

.problem-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 22px;
  align-items: start;
}

.problem-shot {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(10, 19, 33, 0.75);
  box-shadow: var(--shadow);
}

.problem-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 1100;
  max-height: 540px;
  object-fit: cover;
  object-position: top center;
  background: #1b1d21;
  border-bottom: 1px solid var(--line);
  filter: saturate(0.92);
}

.problem-shot figcaption {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 16px;
}

.problem-shot-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid rgba(255, 111, 134, 0.3);
  background: rgba(255, 111, 134, 0.07);
  border-radius: 4px;
  padding: 3px 7px;
}

.problem-shot figcaption span:last-child {
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
}

.problem-shot code,
.problem-copy code,
.host-card code,
.host-note code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(4, 10, 18, 0.75);
  border: 1px solid rgba(150, 190, 255, 0.12);
  color: #b9fff2;
}

.problem-copy {
  display: grid;
  gap: 14px;
}

.problem-card {
  padding: clamp(18px, 2.6vw, 24px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(15, 27, 45, 0.85), rgba(8, 15, 26, 0.8));
}

.problem-card.is-cause {
  border-left: 2px solid rgba(255, 111, 134, 0.55);
}

.problem-card.is-fix {
  border-left: 2px solid rgba(88, 240, 210, 0.6);
  background:
    radial-gradient(ellipse 60% 90% at 100% 0%, rgba(88, 240, 210, 0.07), transparent 60%),
    linear-gradient(155deg, rgba(15, 27, 45, 0.85), rgba(8, 15, 26, 0.8));
}

.problem-tag {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--red);
}

.problem-card.is-fix .problem-tag {
  color: var(--cyan);
}

.problem-card h3 {
  margin: 7px 0 8px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.problem-card p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.problem-card ul {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.problem-card li {
  position: relative;
  padding-left: 15px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted-2);
}

.problem-card li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--red);
}

.problem-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.problem-checks span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--text-soft);
  padding: 5px 9px;
  border: 1px solid rgba(88, 240, 210, 0.2);
  border-radius: 5px;
  background: rgba(88, 240, 210, 0.05);
}

.problem-checks b {
  color: var(--cyan);
  margin-right: 4px;
}

.host-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.host-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 19, 33, 0.55);
  transition: border-color 0.3s ease, transform 0.3s var(--ease);
}

.host-card:hover {
  transform: translateY(-3px);
  border-color: rgba(88, 240, 210, 0.28);
}

.host-num {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.host-card h3 {
  margin: 8px 0 6px;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.host-card p {
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
}

.host-card ol {
  counter-reset: hoststep;
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.host-card li {
  counter-increment: hoststep;
  position: relative;
  padding-left: 18px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted-2);
}

.host-card li::before {
  content: counter(hoststep) ".";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--cyan);
}

.host-url {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #b9fff2;
}

.host-note {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 19, 33, 0.5);
}

.host-note p {
  flex: 1;
  min-width: 240px;
  font-size: 11px;
  color: var(--muted-2);
}

.host-note b {
  color: var(--text-soft);
}

.host-note .text-link {
  font-size: 11px;
}

@media (max-width: 1020px) {
  .problem-grid { grid-template-columns: 1fr; }
  .problem-shot img { max-height: 420px; }
  .host-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .host-grid { grid-template-columns: 1fr; }
  .problem-shot img { max-height: 360px; }
}


/* ============================================================
   Account gate (needed before using the AI chat)
   ============================================================ */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 7, 13, 0.74);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.auth-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.auth-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(150, 190, 255, 0.2);
  border-radius: 24px;
  background: #0a1422;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s var(--ease), opacity 0.3s ease;
}

.auth-overlay.is-open .auth-panel {
  transform: none;
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(6, 13, 23, 0.7);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.auth-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.auth-close svg {
  width: 16px;
  height: 16px;
}

.auth-hero {
  position: relative;
  flex: none;
  padding: 26px 26px 20px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 70% 90% at 50% 0%, rgba(88, 240, 210, 0.1), transparent 70%),
    linear-gradient(120deg, rgba(167, 139, 250, 0.08), transparent 60%);
}

.auth-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  border: 1px solid rgba(88, 240, 210, 0.3);
  background: rgba(88, 240, 210, 0.07);
  color: var(--cyan);
  box-shadow: 0 0 30px rgba(88, 240, 210, 0.12);
}

.auth-mark svg {
  width: 34px;
  height: 34px;
}

.auth-kicker {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.auth-hero h2 {
  margin: 7px 0 8px;
  font-size: clamp(1.35rem, 3.2vw, 1.65rem);
  letter-spacing: -0.03em;
}

.auth-hero p {
  max-width: 42ch;
  margin-inline: auto;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
}

.auth-confirmed {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 5px 11px;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: #d5c9ff;
  background: rgba(167, 139, 250, 0.08);
}

.auth-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 24px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field > span {
  font-family: var(--font-body);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.field input,
.field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(4, 10, 18, 0.8);
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

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

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(88, 240, 210, 0.55);
  box-shadow: 0 0 0 3px rgba(88, 240, 210, 0.08);
}

.field input[aria-invalid="true"] {
  border-color: rgba(255, 111, 134, 0.6);
}

.field-error {
  min-height: 0;
  font-size: 9.5px;
  line-height: 1.4;
  color: var(--red);
}

.field-error:empty {
  display: none;
}

.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(4, 10, 18, 0.45);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
  cursor: pointer;
}

.auth-consent input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--cyan);
}

.auth-consent b {
  color: var(--text-soft);
  font-weight: 600;
}

.auth-submit {
  width: 100%;
  margin-top: 2px;
}

.auth-note {
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--muted-2);
  text-align: center;
}

/* account chip in the chat header */
.chat-account-btn {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  padding: 0 7px;
  min-width: 0;
  width: auto;
}

.chat-account-btn.is-member {
  color: #d5c9ff;
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.08);
}

.auth-account-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(10, 19, 33, 0.6);
}

.auth-account-card span {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.auth-account-card strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.auth-account-card small {
  font-size: 10.5px;
  color: var(--muted);
}

.auth-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.auth-actions-row .btn {
  min-height: 38px;
  font-size: 11px;
  padding: 0 14px;
}

@media (max-width: 520px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }
}

.chat-locked-note {
  display: none;
  padding: 0 12px 9px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  color: var(--amber);
  background: rgba(6, 13, 23, 0.75);
  flex: none;
}

.chat-panel.is-locked .chat-locked-note {
  display: block;
}

.chat-panel.is-locked .chat-mic {
  display: none;
}

body.auth-open {
  overflow: hidden;
}

/* ============================================================
   Alien Lab artwork brand
   ============================================================ */

.brand-mark-img {
  padding: 0;
  overflow: hidden;
  border-color: rgba(88, 240, 210, 0.5);
  background: #0a1a12;
  box-shadow: 0 0 0 1px rgba(88, 240, 210, 0.12), 0 0 18px rgba(88, 240, 210, 0.18);
}

.brand-mark-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.brand-text span {
  color: #8dff4a;
}

.hero-branded {
  position: relative;
  isolation: isolate;
}

.hero-bg-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero-bg-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(1.15) contrast(1.12) brightness(1.45);
}

.hero-bg-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 10, 18, 0.86) 0%, rgba(6, 10, 18, 0.35) 24%, rgba(6, 10, 18, 0.25) 55%, rgba(6, 10, 18, 0.9) 100%),
    linear-gradient(90deg, rgba(6, 10, 18, 0.8) 0%, rgba(6, 10, 18, 0.28) 50%, rgba(6, 10, 18, 0.05) 100%);
}

.hero-branded::before {
  opacity: 0.35;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 0.54em;
  letter-spacing: 0.02em;
  color: #eafff4;
  text-shadow: 0 0 34px rgba(141, 255, 74, 0.28);
}

.brand-word em {
  font-style: italic;
  font-weight: 600;
  background: linear-gradient(100deg, #b6ff8a, #58f0d2 60%, #2fc6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-branded .hero-copy h1 {
  line-height: 0.98;
}

.hero-branded .hero-copy h1 .gradient-text {
  font-size: 0.92em;
}

.hero-branded .float-card,
.hero-branded .float-equation,
.hero-branded .atom-scene {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

@media (max-width: 980px) {
  .hero-bg-art img {
    object-position: center 30%;
  }
  .hero-bg-fade {
    background:
      linear-gradient(180deg, rgba(6, 10, 18, 0.9) 0%, rgba(6, 10, 18, 0.62) 40%, rgba(6, 10, 18, 0.94) 100%);
  }
  .brand-word {
    font-size: 0.6em;
  }
}

.hero-scroll-note {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  margin-top: clamp(22px, 4vw, 40px);
  padding-bottom: 26px;
}

.hero-scroll-note a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: 1px solid rgba(141, 255, 74, 0.28);
  border-radius: 999px;
  background: rgba(6, 13, 23, 0.7);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.hero-scroll-note a:hover {
  border-color: rgba(141, 255, 74, 0.6);
  color: #d6ffc2;
}

.hero-scroll-note span {
  font-style: normal;
  color: #8dff4a;
}

@media (max-width: 760px) {
  .hero-scroll-note a {
    font-size: 8px;
    letter-spacing: 0.08em;
  }
}

/* ---------- desktop hero: readable brand + sized artwork ---------- */

@media (min-width: 981px) {
  .hero-branded .hero-bg-art img {
    object-position: center 38%;
    transform: scale(1.03);
  }

  .hero-branded .hero-copy {
    padding: 26px 28px 26px 30px;
    border: 1px solid rgba(141, 255, 74, 0.14);
    border-radius: 26px;
    background:
      linear-gradient(120deg, rgba(4, 9, 16, 0.86) 0%, rgba(4, 9, 16, 0.62) 70%, rgba(4, 9, 16, 0.35) 100%);
    backdrop-filter: blur(10px) saturate(120%);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  }

  .hero-branded .hero-visual .atom-scene::before {
    background: rgba(8, 14, 22, 0.55);
    border-color: rgba(88, 240, 210, 0.18);
  }
}

/* open an offline copy with a double click: make that path obvious too */
.offline-hint {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}

.offline-hint b {
  color: var(--text-soft);
  font-weight: 500;
}

/* Compact AI settings sheet */
.auth-hero { padding: 24px 22px 18px; }
.auth-panel { max-height: calc(100dvh - 24px); }
.auth-body { overflow-y: auto; }

.chat-settings {
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 92%;
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 16px 16px 18px;
  gap: 9px;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.55);
}

.chat-settings-head h3 {
  font-size: 1.1rem;
}

.settings-intro {
  font-size: 10.5px;
}

.settings-hint {
  font-size: 9px;
}

.settings-actions .btn {
  min-height: 34px;
  font-size: 10.5px;
  padding: 0 13px;
}

@media (max-width: 760px) {
  .chat-settings {
    max-height: 96%;
    border-radius: 16px 16px 0 0;
    padding: 14px 14px 16px;
  }
}

.field-help {
  font-style: normal;
  font-size: 9px;
  line-height: 1.4;
  color: var(--muted-2);
}

/* ---------- login / sign up tabs ---------- */

.auth-tabs {
  display: inline-flex;
  gap: 3px;
  margin-top: 14px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 13, 23, 0.6);
}

.auth-tabs button {
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.auth-tabs button.is-active {
  color: #04131b;
  background: var(--grad);
}

.auth-tabs button:not(.is-active):hover {
  color: var(--text);
  background: rgba(150, 190, 255, 0.07);
}

.auth-note.is-error {
  color: var(--red);
  font-size: 10px;
}

.auth-panel .auth-body {
  overflow-y: auto;
}

.auth-body:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

#fieldName[hidden],
#authForm .auth-grid[hidden] {
  display: none;
}

/* ============================================================
   AI reply animation
   ============================================================ */

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-color: rgba(88, 240, 210, 0.18);
  background:
    radial-gradient(ellipse 60% 120% at 0% 50%, rgba(88, 240, 210, 0.08), transparent 70%),
    rgba(19, 33, 53, 0.8);
  animation: bubble-in 0.28s var(--ease);
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.typing-bubble .typing {
  display: inline-flex;
  gap: 4px;
}

.typing-bubble .typing i {
  width: 6px;
  height: 6px;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(88, 240, 210, 0.6);
}

.typing-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  white-space: nowrap;
  animation: label-pulse 1.8s ease-in-out infinite;
}

@keyframes label-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* each block of the answer fades in like live writing */
.chat-msg.bot .reveal-block {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.32s var(--ease), transform 0.32s var(--ease);
}

.chat-msg.bot .reveal-block.is-revealed {
  opacity: 1;
  transform: none;
}

.chat-msg.bot .is-writing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 3px;
  vertical-align: -0.12em;
  border-radius: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(88, 240, 210, 0.7);
  animation: caret-blink 0.9s steps(2, start) infinite;
}

@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* user bubble gets a small pop */
.chat-msg.user .msg-bubble {
  animation: user-pop 0.32s var(--ease);
}

@keyframes user-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* avatar glows while the AI answers */
.chat-msg.bot.typing-msg .msg-avatar,
.chat-messages.is-thinking {
  /* handled by bubble styles */
}

.typing-msg .msg-avatar {
  animation: avatar-pulse 1.4s ease-in-out infinite;
}

@keyframes avatar-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(88, 240, 210, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(88, 240, 210, 0.06); }
}

@media (prefers-reduced-motion: reduce) {
  .chat-msg.bot .reveal-block { opacity: 1; transform: none; transition: none; }
  .chat-msg.bot .is-writing::after { display: none; }
  .typing-bubble .typing,
  .typing-label,
  .typing-msg .msg-avatar,
  .chat-msg.user .msg-bubble { animation: none; }
}

/* clearer login / sign up switch */
.auth-tabs {
  width: 100%;
  max-width: 280px;
  display: flex;
  margin-inline: auto;
}

.auth-tabs button {
  flex: 1;
  padding: 9px 12px;
  font-size: 12px;
}

.auth-tabs button[aria-selected="false"] {
  color: var(--muted);
}

.auth-switch {
  display: block;
  width: 100%;
  margin: 2px 0 0;
  padding: 10px;
  border: 1px dashed rgba(88, 240, 210, 0.3);
  border-radius: 9px;
  background: rgba(88, 240, 210, 0.04);
  color: var(--cyan);
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-switch:hover {
  background: rgba(88, 240, 210, 0.09);
  border-color: rgba(88, 240, 210, 0.5);
}
