/* EAISys v0.3 — Minimalist Editorial Paper Aesthetic + Tactile Motion
 * Palette: Warm Paper (#FAF9F6 / #FFFFFF), Slate Charcoal (#2A2F34 / #494E52),
 *          Restrained Haze Blue (#3E6280), Muted Lavender (#6A5484), Dusty Rose (#98505E).
 */

:root {
  --bg: #FAF9F6;
  --paper: #F4F1EB;
  --surface: #FFFFFF;
  --surface-tint: #F7F5F0;

  --ink-strong: #23272B;
  --ink: #494E52;
  --muted: #7A8288;

  --line: #E7E3DC;
  --line-soft: #EFECE6;
  --line-cool: #DCE4EC;

  --blue-ink: #3E6280;
  --blue-soft: #8EA6BE;
  --blue-bg: #F0F4F8;

  --purple-ink: #6A5484;
  --purple-soft: #ADA1C2;
  --purple-bg: #F4F1F8;

  --rose-ink: #98505E;
  --rose-accent: #C7747C;
  --rose-bg: #FBF2F3;

  --oat-ink: #7D6854;
  --oat-bg: #F6F1EA;

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-xs: 0 1px 2px rgba(35, 39, 43, 0.04);
  --shadow-sm: 0 6px 24px rgba(35, 39, 43, 0.045);
  --shadow-md: 0 16px 40px rgba(35, 39, 43, 0.08);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Georgia", "Songti SC", "Noto Serif CJK SC", serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--blue-ink); text-decoration: none; transition: color 0.18s var(--ease); }
a:hover { color: var(--ink-strong); }
h1, h2, h3, h4, p { margin: 0; }
code, pre { font-family: var(--mono); }
button { font-family: inherit; }
button:focus:not(:focus-visible) { outline: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 2px; border-radius: 8px; }

/* ── Top Scroll Progress Hairline ────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-ink), var(--purple-ink), var(--rose-accent));
  z-index: 90;
  transition: width 0.08s linear;
}

/* ── Minimal Sticky Topbar ───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 249, 246, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(231, 227, 220, 0.8);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-strong);
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-xs);
  transition: transform 0.25s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.04); }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.brand-ver {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--paper);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.2s var(--ease);
}
.nav-links a:hover, .nav-links a.active {
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: var(--shadow-xs);
}

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

/* Sliding Language Switch */
.lang-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.lang-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform 0.26s var(--ease);
}
.lang-switch.is-zh .lang-thumb { transform: translateX(100%); }
.lang-switch button {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.lang-switch button.active { color: var(--ink-strong); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--blue-soft); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-strong);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Main Container & Reveal Choreography ────────────────────────────── */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 24px 88px;
  display: flex;
  flex-direction: column;
  gap: 88px;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

.kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-ink);
}

.chapter { scroll-margin-top: 86px; display: flex; flex-direction: column; gap: 26px; }
.chapter-head { display: flex; flex-direction: column; gap: 10px; }
.chapter-head.row-between {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px;
}
.chapter-head h2 {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 35px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}
.chapter-lead {
  max-width: 680px;
  font-size: 15.5px;
  color: var(--ink);
  line-height: 1.7;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.btn-primary {
  background: var(--ink-strong);
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(35, 39, 43, 0.14);
}
.btn-primary:hover {
  background: var(--blue-ink);
  color: #FFFFFF;
  transform: translateY(-2px);
}
.btn-ghost {
  background: var(--surface);
  color: var(--ink-strong);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover {
  border-color: var(--blue-soft);
  background: var(--blue-bg);
  color: var(--blue-ink);
  transform: translateY(-2px);
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 44px;
  align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: 18px; }
.hero-copy h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 4.3vw, 52px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.028em;
  color: var(--ink-strong);
}
.hero-lead {
  font-size: 16.5px;
  color: var(--ink);
  line-height: 1.72;
  max-width: 540px;
}

.pillar-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.pillar-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease);
}
.pillar-item:hover { transform: translateY(-2px); }
.pillar-item.blue { border-left: 3px solid var(--blue-ink); }
.pillar-item.purple { border-left: 3px solid var(--purple-ink); }
.pillar-item strong { font-size: 13.8px; color: var(--ink-strong); }
.pillar-item span { font-size: 12.6px; color: var(--muted); line-height: 1.5; }

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

/* Interactive Arm Playground */
.playground-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.playground-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.seg-group {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  gap: 2px;
}
.seg-btn {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.seg-btn.active {
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: var(--shadow-xs);
}
.live-token {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--blue-ink);
  border: 1px solid var(--line-cool);
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.live-token.pulse { transform: scale(1.08); background: var(--rose-bg); color: var(--rose-ink); border-color: #E7CDD2; }

.canvas-stage {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 75% 22%, #F3F6FA 0%, #FAF8F4 62%, #F5F2EC 100%);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
#hero-arm-canvas {
  display: block;
  width: 100%;
  height: 292px;
}
.canvas-caption {
  position: absolute;
  left: 12px;
  bottom: 10px;
  right: 12px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid rgba(231, 227, 220, 0.7);
}

.playground-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ctrl-pill {
  flex: 1 1 auto;
  min-width: 72px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.ctrl-pill:hover { background: var(--blue-bg); border-color: var(--blue-soft); color: var(--blue-ink); transform: translateY(-1px); }
.ctrl-pill:active { transform: scale(0.96); }
.ctrl-pill.rose:hover, .ctrl-pill.rose.active { background: var(--rose-bg); border-color: #E3C2C9; color: var(--rose-ink); }
.ctrl-pill.purple.active { background: var(--purple-bg); border-color: var(--purple-soft); color: var(--purple-ink); }

/* ── Quiet 4-Stat Editorial Strip ────────────────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
  gap: 20px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 16px;
  border-right: 1px solid var(--line-soft);
}
.stat-item:last-child { border-right: 0; padding-right: 0; }
.stat-num {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink-strong);
  letter-spacing: -0.02em;
}
.stat-item span { font-size: 13.5px; color: var(--muted); }

/* ── Filter Rail ─────────────────────────────────────────────────────── */
.filter-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.filter-btn:hover { border-color: var(--blue-soft); color: var(--blue-ink); transform: translateY(-1px); }
.filter-btn.active {
  background: var(--ink-strong);
  color: #FFFFFF;
  border-color: var(--ink-strong);
  box-shadow: 0 4px 12px rgba(35, 39, 43, 0.14);
}

/* ── Theater Showcase (Chapter 1) ────────────────────────────────────── */
.theater-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 26px;
  align-items: start;
}
.theater-left, .theater-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.demo-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}
.badge.blue { background: var(--blue-bg); color: var(--blue-ink); }
.badge.purple { background: var(--purple-bg); color: var(--purple-ink); }
.badge.rose { background: var(--rose-bg); color: var(--rose-ink); }
.badge.oat { background: var(--oat-bg); color: var(--oat-ink); }

.demo-summary {
  font-size: 14.8px;
  color: var(--ink-strong);
  line-height: 1.6;
}
.video-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line-cool);
  background: #1B1F24;
  box-shadow: var(--shadow-xs);
}
.video-frame video {
  width: 100%;
  display: block;
  max-height: 460px;
  object-fit: contain;
}

.filmstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}
.film-thumb {
  flex: 0 0 96px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg);
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s var(--ease);
}
.film-thumb:hover { transform: translateY(-2px); border-color: var(--blue-soft); }
.film-thumb.active { border-color: var(--ink-strong); box-shadow: 0 4px 12px rgba(35, 39, 43, 0.12); }
.film-thumb img { width: 100%; height: 54px; object-fit: cover; display: block; }
.film-thumb span {
  display: block;
  padding: 3px 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Right Side: Clean Step-by-Step Story Card */
.step-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.step-nav-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-strong);
}
.step-btns { display: flex; gap: 6px; }
.mini-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s var(--ease);
}
.mini-btn:hover:not(:disabled) { border-color: var(--blue-soft); color: var(--blue-ink); }
.mini-btn:disabled { opacity: 0.4; cursor: default; }

.step-img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-cool);
  display: block;
}
.thought-quote {
  font-size: 13.8px;
  color: var(--ink);
  line-height: 1.62;
  padding-left: 12px;
  border-left: 2.5px solid var(--blue-soft);
}
.token-stream-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.token-stream {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.skill-tok {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--line-cool);
  color: var(--blue-ink);
  transition: all 0.22s var(--ease);
}
.skill-tok.left { background: var(--purple-bg); color: var(--purple-ink); border-color: #DBD3E8; }
.skill-tok.right { background: var(--rose-bg); color: var(--rose-ink); border-color: #E7CDD2; }
.skill-tok.special { background: var(--rose-bg); color: var(--rose-ink); border-color: #E7CDD2; }
.skill-tok.lit {
  transform: translateY(-2px) scale(1.06);
  background: var(--ink-strong);
  color: #FFFFFF;
  border-color: var(--ink-strong);
  box-shadow: 0 4px 10px rgba(35, 39, 43, 0.18);
}

.result-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.result-chip {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
}
.result-chip span { display: block; font-size: 11.5px; color: var(--muted); }
.result-chip strong { display: block; margin-top: 2px; font-size: 14.5px; color: var(--ink-strong); }

/* Clean Collapsible Technical Inspector */
details.tech-drawer {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
details.tech-drawer > summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.tech-drawer > summary::-webkit-details-marker { display: none; }
.tech-drawer-body {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Selector Grid Below Video */
.demo-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.demo-tile {
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.22s var(--ease);
}
.demo-tile:hover { transform: translateY(-2px); border-color: var(--blue-soft); box-shadow: var(--shadow-sm); }
.demo-tile.active {
  border-color: var(--ink-strong);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--ink-strong), var(--shadow-sm);
}
.demo-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.demo-tile-title { font-size: 13.8px; font-weight: 650; color: var(--ink-strong); line-height: 1.3; }
.demo-tile-metric {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--blue-ink);
  white-space: nowrap;
}
.demo-tile-metric.rose { background: var(--rose-bg); color: var(--rose-ink); }
.demo-tile-metric.purple { background: var(--purple-bg); color: var(--purple-ink); }
.demo-tile-sub { font-size: 12.2px; color: var(--muted); }

/* ── Chapter 2: Universal Skill Library ──────────────────────────────── */
.skill-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  align-self: flex-start;
}
.skill-tab-btn {
  padding: 8px 16px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.skill-tab-btn:hover { color: var(--ink-strong); }
.skill-tab-btn.active {
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: var(--shadow-xs);
}

.skill-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  animation: fadeSwap 0.3s var(--ease);
}
@keyframes fadeSwap {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.skills-motion-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 28px;
  align-items: start;
}
.skill-groups { display: flex; flex-direction: column; gap: 16px; }
.skill-group h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.skill-chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.skill-btn {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-strong);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.skill-btn:hover { border-color: var(--blue-soft); color: var(--blue-ink); transform: translateY(-1px); }
.skill-btn.active {
  background: var(--blue-ink);
  color: #FFFFFF;
  border-color: var(--blue-ink);
  box-shadow: 0 4px 12px rgba(62, 98, 128, 0.22);
}

.skill-preview-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#skill-preview-canvas {
  width: 100%;
  height: 210px;
  display: block;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
}
.skill-preview-card h3 {
  font-family: var(--mono);
  font-size: 17px;
  color: var(--ink-strong);
}
.skill-preview-card p { font-size: 14px; color: var(--ink); line-height: 1.6; }

/* Engine & Code Box */
pre.code-box {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #F6F7F9;
  border: 1px solid var(--line-cool);
  font-size: 12px;
  line-height: 1.58;
  color: var(--ink-strong);
  overflow: auto;
  max-height: 360px;
  white-space: pre-wrap;
  word-break: break-word;
}

.engine-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}
.flow-box {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-strong);
}
.flow-box.accent { background: var(--blue-bg); border-color: #C7D7E7; color: var(--blue-ink); }
.flow-sep { color: var(--muted); font-family: var(--mono); font-size: 14px; }

.reuser-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 18px; }
.reuser-chip {
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.16s var(--ease);
}
.reuser-chip:hover { border-color: var(--blue-soft); color: var(--blue-ink); background: var(--blue-bg); }

/* Playbook + Priors Grid */
.habit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.habit-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.habit-card:hover { transform: translateY(-2px); border-color: var(--purple-soft); }
.habit-card h4 { font-size: 14.2px; color: var(--ink-strong); }
.habit-card p { font-size: 13px; color: var(--ink); line-height: 1.55; }

.prior-search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.search-input {
  width: 280px;
  max-width: 100%;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 13px;
  color: var(--ink-strong);
  outline: none;
  transition: border-color 0.18s var(--ease);
}
.search-input:focus { border-color: var(--blue-ink); background: var(--surface); }

.prior-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.prior-item {
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.prior-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.prior-task { font-size: 13px; font-weight: 600; color: var(--ink-strong); }

/* Blind Self-Probe Timeline */
.probe-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.probe-steps { display: flex; flex-direction: column; gap: 12px; }
.probe-step {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.probe-step:hover { transform: translateX(4px); border-color: var(--purple-soft); }
.probe-num {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--purple-bg);
  color: var(--purple-ink);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.probe-step strong { display: block; font-size: 14px; color: var(--ink-strong); }
.probe-step p { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.probe-visual img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-cool);
  display: block;
}

/* ── Chapter 3: 15 Verified Robots Grid ──────────────────────────────── */
.robot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.robot-card {
  text-align: left;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.24s var(--ease);
}
.robot-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue-soft);
  box-shadow: var(--shadow-md);
}
.robot-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.robot-card-top h4 { font-family: var(--mono); font-size: 14.5px; color: var(--ink-strong); }
.robot-svg-wrap {
  height: 76px;
  border-radius: var(--radius-md);
  background: var(--bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.robot-svg-wrap svg { width: 100%; height: 68px; transition: transform 0.35s var(--ease); }
.robot-card:hover .robot-svg-wrap svg { transform: scale(1.05); }
.robot-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

/* ── Chapter 4: Try It Yourself + Comparison Drawer ──────────────────── */
.cli-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cli-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.cli-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.cli-tab {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 12.8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.cli-tab.active { background: var(--ink-strong); color: #FFFFFF; border-color: var(--ink-strong); }

details.compare-drawer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
details.compare-drawer > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-strong);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.compare-drawer > summary::-webkit-details-marker { display: none; }
.drawer-chevron {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.25s var(--ease);
}
details.compare-drawer[open] .drawer-chevron { transform: rotate(45deg); }
.compare-drawer-body {
  padding: 0 20px 20px;
  overflow-x: auto;
}
.compare-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 13.5px;
}
.compare-table th, .compare-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
.compare-table th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-top: 0;
}
.compare-table tr.ours { background: var(--blue-bg); }
.compare-table tr.ours td { color: var(--ink-strong); font-weight: 500; }

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(35, 39, 43, 0.45);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  position: relative;
  width: min(1020px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-md);
  animation: modalIn 0.24s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-strong);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.dual-code {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px 44px;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13.5px;
  color: var(--muted);
}
.footer-brand strong { color: var(--ink-strong); }
.footer-links { display: flex; gap: 18px; font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero, .theater-card, .skills-motion-grid, .probe-grid, .dual-code { grid-template-columns: 1fr; }
  .demo-selector-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .habit-grid, .robot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  main { padding: 26px 16px 64px; gap: 58px; }
  .topbar-inner { padding: 10px 16px; flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    width: 100%;
    order: 4;
    padding-top: 8px;
    border-top: 1px solid var(--line-soft);
    flex-wrap: wrap;
  }
  .nav-links.open { display: flex; }
  .icon-btn span { display: none; }
  .pillar-duo, .stats-strip, .demo-selector-grid, .habit-grid, .prior-list, .robot-grid {
    grid-template-columns: 1fr;
  }
  .stat-item { border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 0 0 14px; }
  .stat-item:last-child { border-bottom: 0; padding-bottom: 0; }
  .theater-card, .skill-stage, .cli-card { padding: 16px; }
}
