/* ==========================================================================
   SmithAPI — Clean Editorial Scrollytelling + Morphing Capsule Nav + 3D Pets
   ========================================================================== */

@property --beam-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 9999; }

/* --------------------------------------------------------------------------
   Theme & 4-Chapter Chromatic Palettes (Light & Dark)
   -------------------------------------------------------------------------- */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7ff;
  --bg-subtle: rgba(15, 23, 42, 0.04);
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-elev: #f8fafc;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.15);
  --text: #0f172a;
  --text-strong: #020617;
  --text-sec: #475569;
  --text-muted: #64748b;

  /* Ch 1: Cobalt & Mint */
  --accent: #2563eb;
  --accent-bright: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.10);
  --accent-ring: rgba(37, 99, 235, 0.24);
  --aurora-a: rgba(37, 99, 235, 0.15);
  --aurora-b: rgba(16, 185, 129, 0.13);

  --cta-bg: #0f172a;
  --cta-bg-hover: #1e293b;
  --cta-text: #ffffff;
  --grid-line: rgba(15, 23, 42, 0.036);
  --shadow-card: 0 20px 48px -16px rgba(15, 23, 42, 0.09), 0 2px 8px rgba(15, 23, 42, 0.03);
  --shadow-pill: 0 14px 36px -8px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.05);

  --term-bg: #ffffff;
  --term-bar: #f8fafc;
  --term-footer: #f8fafc;
  --term-text: #1e293b;
  --t-dim: #94a3b8;
  --t-cmd: #0f172a;
  --t-str: #0369a1;
  --t-ok: #059669;
  --t-key: #334155;
  --code-inline-bg: rgba(15, 23, 42, 0.06);
  --code-inline-text: #0f172a;

  --smith-suit: #161d2b;
  --smith-skin: #ffffff;
  --smith-ink: #0b0f19;

  --err-bg: rgba(225, 29, 72, 0.08);
  --err-border: rgba(225, 29, 72, 0.28);
  --err-text: #be123c;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

[data-theme="light"][data-chapter="2"] {
  --bg: #fff7ed;
  --accent: #ea580c;
  --accent-bright: #c2410c;
  --accent-soft: rgba(234, 88, 12, 0.11);
  --accent-ring: rgba(234, 88, 12, 0.25);
  --aurora-a: rgba(249, 115, 22, 0.16);
  --aurora-b: rgba(245, 158, 11, 0.14);
}

[data-theme="light"][data-chapter="3"] {
  --bg: #f6f3ff;
  --accent: #7c3aed;
  --accent-bright: #6d28d9;
  --accent-soft: rgba(124, 58, 237, 0.11);
  --accent-ring: rgba(124, 58, 237, 0.25);
  --aurora-a: rgba(124, 58, 237, 0.16);
  --aurora-b: rgba(236, 72, 153, 0.13);
}

[data-theme="light"][data-chapter="4"] {
  --bg: #f1fbf7;
  --accent: #059669;
  --accent-bright: #047857;
  --accent-soft: rgba(5, 150, 105, 0.11);
  --accent-ring: rgba(5, 150, 105, 0.25);
  --aurora-a: rgba(16, 185, 129, 0.15);
  --aurora-b: rgba(14, 165, 233, 0.12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080b14;
  --bg-subtle: rgba(255, 255, 255, 0.055);
  --surface: rgba(16, 22, 36, 0.86);
  --surface-solid: #111827;
  --surface-elev: #182133;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text: #f4f6f9;
  --text-strong: #ffffff;
  --text-sec: #94a3b8;
  --text-muted: #64748b;

  --accent: #3b82f6;
  --accent-bright: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --accent-ring: rgba(59, 130, 246, 0.32);
  --aurora-a: rgba(59, 130, 246, 0.20);
  --aurora-b: rgba(56, 189, 248, 0.14);

  --cta-bg: #f8fafc;
  --cta-bg-hover: #ffffff;
  --cta-text: #07090e;
  --grid-line: rgba(148, 163, 184, 0.042);
  --shadow-card: 0 24px 58px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-pill: 0 16px 40px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.08);

  --term-bg: #0b0f1a;
  --term-bar: #111827;
  --term-footer: rgba(17, 24, 39, 0.78);
  --term-text: #cbd5e1;
  --t-dim: #64748b;
  --t-cmd: #f8fafc;
  --t-str: #93c5fd;
  --t-ok: #4ade80;
  --t-key: #e2e8f0;
  --code-inline-bg: rgba(148, 163, 184, 0.15);
  --code-inline-text: #e2e8f0;

  --smith-suit: #2a374d;
  --smith-skin: #f8fafc;
  --smith-ink: #0a0f1a;

  --err-bg: rgba(251, 113, 133, 0.12);
  --err-border: rgba(251, 113, 133, 0.36);
  --err-text: #fecdd3;
}

/* Keep Dark Mode canvas & surfaces in cohesive deep obsidian-slate (never muddy brown!),
   while shifting accent & aurora glow vibrantly per chapter */
[data-theme="dark"][data-chapter="2"] {
  --bg: #0b0c14;
  --surface: rgba(19, 21, 33, 0.88);
  --surface-solid: #141724;
  --surface-elev: #1b2030;
  --accent: #f97316;
  --accent-bright: #fb923c;
  --accent-soft: rgba(249, 115, 22, 0.16);
  --accent-ring: rgba(249, 115, 22, 0.34);
  --aurora-a: rgba(249, 115, 22, 0.16);
  --aurora-b: rgba(99, 102, 241, 0.12);
}

[data-theme="dark"][data-chapter="3"] {
  --bg: #090a16;
  --surface: rgba(18, 17, 36, 0.88);
  --surface-solid: #131326;
  --surface-elev: #1b1b34;
  --accent: #8b5cf6;
  --accent-bright: #a78bfa;
  --accent-soft: rgba(139, 92, 246, 0.17);
  --accent-ring: rgba(139, 92, 246, 0.34);
  --aurora-a: rgba(139, 92, 246, 0.19);
  --aurora-b: rgba(56, 189, 248, 0.12);
}

[data-theme="dark"][data-chapter="4"] {
  --bg: #080d14;
  --surface: rgba(14, 23, 33, 0.88);
  --surface-solid: #0f1924;
  --surface-elev: #162332;
  --accent: #10b981;
  --accent-bright: #34d399;
  --accent-soft: rgba(16, 185, 129, 0.16);
  --accent-ring: rgba(52, 211, 153, 0.32);
  --aurora-a: rgba(16, 185, 129, 0.16);
  --aurora-b: rgba(59, 130, 246, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.68s cubic-bezier(0.22, 1, 0.36, 1), color 0.32s ease;
}

.hidden { display: none !important; }

/* Ambient Grid + Drifting Aurora */
.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 24%, #000 20%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 24%, #000 20%, transparent 90%);
}

.radial-glow {
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 1080px;
  height: 520px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 60% at 35% 45%, var(--aurora-a) 0%, transparent 72%),
    radial-gradient(ellipse 50% 55% at 68% 42%, var(--aurora-b) 0%, transparent 72%);
  transition: background 0.7s ease;
}

/* ==========================================================================
   SINGLE MORPHING NAVIGATION BAR
   Top of page: airy full-width header -> Scroll down: compact floating capsule!
   ========================================================================== */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0;
  pointer-events: none;
  transition: padding 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-wrap.is-pill {
  padding: 12px 16px 0;
}

.nav-inner {
  pointer-events: auto;
  max-width: 1160px;
  margin: 0 auto;
  height: 66px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    max-width 0.46s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.nav-wrap.is-pill .nav-inner {
  max-width: 720px;
  height: 50px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-pill);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text-strong);
  flex-shrink: 0;
}

.brand-icon {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.8), 0 2px 8px rgba(15, 23, 42, 0.14);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.3s ease, height 0.3s ease;
}

[data-theme="dark"] .brand-icon {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.24), 0 4px 12px rgba(0, 0, 0, 0.45);
}

.nav-wrap.is-pill .brand-icon {
  width: 26px;
  height: 26px;
}

.brand:hover .brand-icon {
  transform: rotate(16deg) scale(1.06);
}

.brand-word {
  font-family: var(--mono);
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  transition: font-size 0.3s ease;
}

.nav-wrap.is-pill .brand-word {
  font-size: 14.5px;
}

.brand-dim {
  color: var(--text-sec);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-sec);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.22s ease;
}

.nav-links a:hover {
  color: var(--text-strong);
  background: var(--bg-subtle);
}

.nav-links a .nav-num {
  font-family: var(--mono);
  font-size: 10.5px;
  opacity: 0.65;
}

/* When condensed into capsule pill, active chapter lights up just like the capsule HUD! */
.nav-links a.doc-active {
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.nav-wrap.is-pill .nav-links a.active,
.nav-wrap.is-pill .nav-links a.doc-active {
  background: var(--accent);
  color: #ffffff;
}

.nav-wrap.is-pill .nav-links a.active .nav-num {
  opacity: 0.9;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text-sec);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
}

.nav-wrap.is-pill .theme-toggle {
  height: 34px;
  padding: 0 10px;
  background: var(--bg-subtle);
  border-color: transparent;
}

.nav-wrap.is-pill .theme-label {
  display: none;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text-strong);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  display: block;
}

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

/* Main Shell */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.chapter-sec {
  scroll-margin-top: 88px;
}

/* ==========================================================================
   CHAPTER 01: Clean Hero + Frameless 3D Auto-Cycling AI Pets
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 32px;
  align-items: center;
  min-height: 520px;
}

.hero > * { min-width: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 13px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  margin-bottom: 20px;
}

.eyebrow-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.eyebrow-text {
  font-size: 12.5px;
  color: var(--text-sec);
  font-weight: 500;
}

/* Clean Typographic Drum Slot-Roll (ZERO boxy border!) */
h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4.3vw, 48px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.word-reel {
  display: inline-grid;
  vertical-align: -0.15em;
  overflow: hidden;
  height: 1.22em;
  padding: 0 2px;
  color: var(--accent);
  transition: color 0.35s ease;
}

.word-reel-item {
  grid-area: 1 / 1;
  will-change: transform, opacity;
  white-space: nowrap;
}

.word-reel-item.is-current {
  transform: translateY(0%);
  opacity: 1;
  transition: transform 0.56s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.42s ease;
}

.word-reel-item.is-exit {
  transform: translateY(-108%);
  opacity: 0;
  transition: transform 0.56s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.word-reel-item.is-enter-prep {
  transform: translateY(108%);
  opacity: 0;
  transition: none;
}

.headline-accent {
  background: linear-gradient(110deg, #2563eb 0%, #7c3aed 42%, #ea580c 82%, #10b981 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmerFlow 8s linear infinite;
}

@keyframes shimmerFlow {
  to { background-position: 220% center; }
}

.subtitle {
  margin: 0 0 24px;
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--text-sec);
  max-width: 520px;
}

.subtitle strong {
  color: var(--text-strong);
  font-weight: 700;
}

/* Waitlist Card */
.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.beam-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 19px;
  padding: 1.5px;
  background: conic-gradient(
    from var(--beam-angle),
    transparent 0deg,
    transparent 255deg,
    var(--accent) 305deg,
    #ec4899 338deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.8;
  animation: spinBeam 5.5s linear infinite;
}

@keyframes spinBeam {
  to { --beam-angle: 360deg; }
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.usecase-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface-elev);
  color: var(--text-sec);
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text-strong);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-ring);
}

.cta-btn {
  height: 46px;
  padding: 0 22px;
  border-radius: 11px;
  border: none;
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cta-btn:hover:not(:disabled) {
  background: var(--cta-bg-hover);
  transform: translateY(-1px);
}

.form-error {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--err-bg);
  border: 1px solid var(--err-border);
  color: var(--err-text);
  font-size: 12.5px;
}

.form-footnote {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.success-box { display: flex; flex-direction: column; gap: 10px; }
.success-head { display: flex; align-items: center; justify-content: space-between; }
.success-badge-wrap { display: inline-flex; align-items: center; gap: 8px; }
.check-svg { width: 20px; height: 20px; color: var(--accent); }
.success-badge { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent-bright); }
.success-pos { font-family: var(--mono); font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 6px; background: var(--accent-soft); border: 1px solid var(--accent-ring); color: var(--accent-bright); }
.success-box h2 { margin: 0; font-size: 18px; color: var(--text-strong); }
.success-msg { margin: 0; font-size: 13.5px; color: var(--text-sec); }
.success-meta { padding: 11px 14px; border-radius: 10px; background: var(--surface-elev); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.success-meta > div { display: flex; justify-content: space-between; gap: 12px; }
.meta-k { color: var(--text-muted); flex-shrink: 0; }
.meta-v { color: var(--text-strong); font-family: var(--mono); text-align: right; word-break: break-all; }
.link-btn { align-self: flex-start; padding: 0; border: none; background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer; text-decoration: underline; }

/* Frameless 3D AI Pets Stage (Hero Right) */
.hero-pet-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pet-canvas-wrap {
  position: relative;
  width: 380px;
  height: 380px;
  max-width: 100%;
  cursor: grab;
  touch-action: pan-y;
}

.pet-canvas-wrap:active {
  cursor: grabbing;
}

.pet-glow-backdrop {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--aurora-a) 0%, var(--aurora-b) 52%, transparent 74%);
  filter: blur(24px);
  pointer-events: none;
  transition: background 0.55s ease;
}

[data-theme="dark"] .pet-glow-backdrop {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.28) 0%, rgba(139, 92, 246, 0.18) 48%, transparent 74%);
  filter: blur(28px);
}

#heroPetCanvas {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
}

.pet-stage-footer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: -8px;
}

.pet-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 29px;
  padding: 0 11px 0 6px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-strong);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
}

.pet-active-pill.is-pop {
  transform: translateY(-2px) scale(1.04);
}

.pet-pill-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .pet-pill-logo {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.14);
}

.pet-pill-logo img {
  display: block;
  width: 16px;
  height: 16px;
}

.pet-dots-bar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 29px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.pet-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease;
}

.pet-dot.active {
  width: 20px;
  background: var(--accent);
}

/* ==========================================================================
   SUPPORTED MODELS SLIDING PANEL (Dual Counter-Scrolling Brand Marquee)
   ========================================================================== */
.ecosystem-strip {
  margin: 44px 0 12px;
  padding: 24px 0 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: 100%;
  overflow: hidden;
}

.ecosystem-head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  text-align: center;
}

.ecosystem-kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.ecosystem-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
}

.marquee-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 5px 0;
  mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.marquee-viewport + .marquee-viewport {
  margin-top: 8px;
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

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

.track-left {
  animation: marqueeSlideLeft 40s linear infinite;
}

.track-right {
  animation: marqueeSlideRight 44s linear infinite;
}

@keyframes marqueeSlideLeft {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@keyframes marqueeSlideRight {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

.marquee-group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 12px;
  flex-shrink: 0;
}

.model-pill {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  height: 52px;
  padding: 7px 16px 7px 9px;
  border-radius: 14px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.model-pill:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px var(--accent-soft);
}

.model-logo-tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .model-logo-tile {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.model-logo-tile img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.model-logo-tile img.logo-dark {
  display: none;
}

[data-theme="dark"] .model-logo-tile img.logo-light {
  display: none;
}

[data-theme="dark"] .model-logo-tile img.logo-dark {
  display: block;
}

.model-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}

.model-brand {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
}

.model-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==========================================================================
   SHOPIFY EDITIONS KINETIC SECTION HEADING TRANSITIONS
   Scroll-scrubbed line mask + scale + sticky title-to-title slot reel!
   ========================================================================== */
.ed-chapter-intro {
  margin: 112px 0 36px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ed-kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}

.ed-mask {
  padding-bottom: 4px;
}

.ed-title {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 50px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.032em;
  color: var(--text-strong);
  transform: translateY(calc((1 - var(--ed-p, 1)) * 28px));
  opacity: calc(0.26 + var(--ed-p, 1) * 0.74);
  will-change: transform, opacity;
}

/* Chapter 02: Sticky Split Layout + Title-to-Title Morphing Reel */
.editions-section {
  margin-top: 104px;
}

.editions-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 44px;
  align-items: start;
}

.editions-sticky {
  position: sticky;
  top: 92px;
}

.sticky-title-stage {
  margin-bottom: 20px;
}

.sticky-step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.sticky-step-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.title-reel-mask {
  display: grid;
  overflow: hidden;
  min-height: 2.35em;
  align-items: end;
}

.sticky-morph-h2 {
  grid-area: 1 / 1;
  margin: 0;
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.026em;
  color: var(--text-strong);
  will-change: transform, opacity;
}

.sticky-morph-h2.is-current {
  transform: translateY(0%);
  opacity: 1;
  transition: transform 0.52s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.38s ease;
}

.sticky-morph-h2.is-exit-up {
  transform: translateY(-106%);
  opacity: 0;
  transition: transform 0.52s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s ease;
}

.sticky-morph-h2.is-prep-down {
  transform: translateY(106%);
  opacity: 0;
  transition: none;
}

/* Terminal Card */
.terminal {
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: var(--term-bg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.term-bar {
  min-height: 42px;
  padding: 6px 14px;
  background: var(--term-bar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.term-dots { display: flex; gap: 6px; }
.term-dots span:nth-child(1) { width: 10px; height: 10px; border-radius: 50%; background: #fb7185; }
.term-dots span:nth-child(2) { width: 10px; height: 10px; border-radius: 50%; background: #fbbf24; }
.term-dots span:nth-child(3) { width: 10px; height: 10px; border-radius: 50%; background: #34d399; }

.term-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: 8px;
}

.term-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.term-tab.active {
  background: var(--surface-solid);
  color: var(--accent-bright);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.term-actions { display: flex; align-items: center; gap: 6px; }
.term-copy-btn { border: 1px solid var(--border); background: var(--surface-solid); color: var(--text-sec); font-family: var(--mono); font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; cursor: pointer; }
.term-badge { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; color: var(--accent-bright); background: var(--accent-soft); }

.term-code {
  margin: 0;
  padding: 18px;
  min-height: 230px;
  font-family: var(--mono);
  font-size: 12.2px;
  line-height: 1.68;
  color: var(--term-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.t-dim { color: var(--t-dim); }
.t-cmd { color: var(--t-cmd); font-weight: 700; }
.t-str { color: var(--t-str); }
.t-ok { color: var(--t-ok); font-weight: 700; }
.t-key { color: var(--t-key); }

.stream-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: cursorBlink 1s steps(2, start) infinite;
}

@keyframes cursorBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* Concise Story Beats (Right Column) */
.story-beats {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 0 36px;
}

.story-beat {
  padding: 28px 26px;
  border-radius: 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-beat.active {
  border-color: var(--accent);
  transform: translateX(-4px);
}

.beat-step {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
}

.story-beat h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-strong);
}

.story-beat p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--text-sec);
}

/* ==========================================================================
   CHAPTER 03: Clean Visual Router Stage (Zero Meta-Chatter)
   ========================================================================== */
.router-stage {
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.router-stage.fault-active {
  border-color: #f59e0b;
}

.router-top {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--term-bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.router-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-strong);
}

.router-controls { display: flex; align-items: center; gap: 8px; }

.viz-btn {
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text-strong);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.viz-btn:hover { border-color: var(--accent); }
.viz-btn.fault-btn.active { border-color: #f59e0b; background: rgba(245, 158, 11, 0.15); color: #d97706; }
[data-theme="dark"] .viz-btn.fault-btn.active { color: #fbbf24; }

.viz-canvas-wrap { padding: 18px 16px 14px; }
.router-svg { width: 100%; height: auto; display: block; }

.r-node-box { fill: var(--surface-solid); stroke: var(--border-strong); stroke-width: 1.3; transition: all 0.25s ease; }
.r-node-box.faulted { stroke: #ef4444; fill: rgba(239, 68, 68, 0.09); }
.r-node-box.backup-hot { stroke: #10b981; stroke-width: 2; }
.r-node-title { fill: var(--text-strong); font-family: var(--sans); font-size: 13px; font-weight: 700; }
.r-node-sub { fill: var(--text-muted); font-family: var(--mono); font-size: 10.5px; }
.r-node-status { font-family: var(--mono); font-size: 10px; font-weight: 700; fill: #10b981; }
.r-node-status.err { fill: #ef4444; }

.r-path-base { fill: none; stroke: var(--border-strong); stroke-width: 1.4; }
.r-path-flow { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 12; opacity: 0.78; animation: dashFlow 1.5s linear infinite; }
.r-path-flow.faulted { stroke: #ef4444; stroke-dasharray: 3 9; opacity: 0.42; animation: none; }
.r-path-flow.rerouted { stroke: #10b981; stroke-width: 2.8; opacity: 0.96; animation: dashFlow 0.8s linear infinite; }
@keyframes dashFlow { to { stroke-dashoffset: -36; } }

.hub-orbit-outer { fill: none; stroke: var(--accent-ring); stroke-width: 1.5; stroke-dasharray: 6 6; transform-origin: 480px 155px; animation: spinOrbit 18s linear infinite; }
.hub-orbit-inner { fill: none; stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 8; transform-origin: 480px 155px; animation: spinOrbitRev 12s linear infinite; }
@keyframes spinOrbit { to { transform: rotate(360deg); } }
@keyframes spinOrbitRev { to { transform: rotate(-360deg); } }
.hub-core { fill: var(--surface-solid); stroke: var(--accent); stroke-width: 2.2; }
.hub-shockwave { fill: none; stroke: var(--accent); stroke-width: 2.2; opacity: 0; transform-origin: 480px 155px; }
.hub-shockwave.pop { animation: shockwavePop 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes shockwavePop { 0% { transform: scale(0.9); opacity: 0.9; } 100% { transform: scale(2.1); opacity: 0; } }

/* ==========================================================================
   CHAPTER 04: Guides, FAQ + Compact Rigged Agent Smith Footer Vignette
   ========================================================================== */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.guide-card {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  transition: border-color 0.22s ease, transform 0.22s ease;
}

.guide-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.guide-tag { font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--accent-bright); margin-bottom: 8px; }
.guide-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; color: var(--text-strong); }
.guide-card p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.62; color: var(--text-sec); flex: 1; }
.guide-more { font-size: 12.5px; font-weight: 700; color: var(--accent-bright); font-family: var(--mono); }

.faq-block {
  margin-top: 64px;
}

.faq-block h3 {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-strong);
}

.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { border-radius: 14px; background: var(--surface); border: 1px solid var(--border); padding: 0 20px; }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 0; font-size: 15px; font-weight: 600; color: var(--text-strong); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--mono); font-size: 16px; color: var(--accent-bright); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 16px; font-size: 14px; line-height: 1.7; color: var(--text-sec); }

.faq-item code, .prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--code-inline-bg);
  color: var(--code-inline-text);
}

/* Compact Rigged Agent Smith Pre-Footer Vignette (Bottom of Page!) */
.bottom-smith-bar {
  margin-top: 84px;
  padding: 20px 28px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.bottom-smith-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.smith-mini-stage {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

[data-theme="dark"] .smith-mini-stage {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.03) 58%, transparent 74%);
}

.smith-mini-stage:active {
  cursor: grabbing;
}

.smith-rig-svg {
  width: 112px;
  height: 112px;
  overflow: visible;
}

[data-theme="dark"] .smith-rig-svg {
  filter: drop-shadow(0 0 1.2px rgba(255, 255, 255, 0.42)) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.bottom-smith-copy h3 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 800;
  color: var(--text-strong);
}

.bottom-smith-copy p {
  margin: 0;
  font-size: 14px;
  color: var(--text-sec);
}

/* Guide Article Pages */
.article-shell { max-width: 820px; padding-top: 36px; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 24px; }
.breadcrumb a { color: var(--text-sec); text-decoration: none; }
.crumb-cur { color: var(--text-strong); font-weight: 600; }
.prose h1 { font-size: clamp(26px, 3.6vw, 36px); margin-bottom: 14px; }
.prose .lead { font-size: 15.5px; line-height: 1.75; color: var(--text-sec); margin: 0 0 28px; }
.prose h2 { margin: 32px 0 12px; font-size: 19px; font-weight: 700; color: var(--text-strong); padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.prose p, .prose ul, .prose ol { margin: 0 0 15px; font-size: 14.5px; line-height: 1.75; color: var(--text-sec); }
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose li strong { color: var(--text-strong); }
.code-wrap { position: relative; margin: 12px 0 18px; }
.code-block { margin: 0; padding: 16px 72px 16px 18px; border-radius: 12px; background: var(--term-bg); border: 1px solid var(--border-strong); font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: var(--term-text); overflow-x: auto; max-width: 100%; }
.code-block code { padding: 0; background: transparent; color: inherit; }
.copy-btn { position: absolute; top: 10px; right: 10px; border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--text-sec); font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.cta-banner { margin-top: 36px; padding: 24px 26px; border-radius: 16px; background: var(--surface); border: 1px solid var(--accent-ring); display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: var(--shadow-card); }
.cta-banner h3 { margin: 0 0 6px; font-size: 17px; color: var(--text-strong); }
.cta-banner p { margin: 0; font-size: 13.5px; color: var(--text-sec); }
.related-links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 14px; font-size: 13.5px; color: var(--text-muted); }
.related-links a { color: var(--accent-bright); text-decoration: none; font-weight: 600; }

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.footer-left, .footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer a { color: var(--text-sec); text-decoration: none; }
.footer a:hover { color: var(--text-strong); }
.footer-compliance {
  max-width: 1080px;
  margin: 10px auto 0;
  padding: 10px 24px 0;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.ecosystem-more {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-bright);
  text-decoration: none;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-ring);
  background: var(--accent-soft);
  transition: transform 0.18s ease, background-color 0.2s ease;
}

.ecosystem-more:hover {
  transform: translateY(-1px);
}

/* Models Catalog (/models) & Custom 404 Page */
.catalog-shell { max-width: 1120px; padding-top: 32px; }
.catalog-hero .subtitle { max-width: 680px; margin-bottom: 24px; }
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}
.catalog-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-search-wrap { flex: 1; min-width: 240px; max-width: 360px; }
.catalog-search-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text-strong);
  font-size: 13.5px;
  outline: none;
}
.catalog-search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.catalog-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.catalog-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.cat-card-top { display: flex; align-items: center; gap: 12px; }
.cat-card-top h2 { margin: 0; font-size: 16.5px; font-weight: 800; color: var(--text-strong); line-height: 1.25; }
.cat-proto { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.catalog-card p { margin: 0; font-size: 13.5px; line-height: 1.62; color: var(--text-sec); flex: 1; }
.cat-id-list { display: flex; flex-wrap: wrap; gap: 8px; }
.model-id-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text-strong);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}
.model-id-btn code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.model-id-btn:hover { border-color: var(--accent); color: var(--accent-bright); }
.model-id-btn.copied { border-color: #10b981; background: rgba(16, 185, 129, 0.12); color: #10b981; }
.catalog-empty { text-align: center; padding: 36px 16px; color: var(--text-muted); font-size: 14px; }

.notfound-shell { max-width: 680px; padding: 84px 24px 96px; }
.notfound-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.notfound-sec-btn { height: 46px; padding: 0 18px; display: inline-flex; align-items: center; text-decoration: none; border-radius: 11px; }

@media (max-width: 920px) {
  .shell { padding: 28px 18px 56px; }
  .hero, .editions-grid, .guide-grid, .catalog-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .catalog-search-wrap { max-width: 100%; width: 100%; }
  .editions-sticky { position: static; }
  .story-beat.active { transform: none; }
  .pet-canvas-wrap { width: 300px; height: 300px; }
  .bottom-smith-bar, .cta-banner { flex-direction: column; align-items: flex-start; }
  .bottom-smith-bar .cta-btn, .cta-banner .cta-btn { width: 100%; }
}

@media (max-width: 640px) {
  .nav-links a .nav-num { display: none; }
  .nav-links a { padding: 5px 9px; font-size: 12px; }
  .brand-word { display: none; }
  .theme-label { display: none; }
  .theme-toggle { padding: 0 9px; }
  h1 { font-size: 29px; }
  .card { padding: 16px; }
  .input-row { flex-direction: column; gap: 10px; }
  .input-row input, .cta-btn { flex: none; width: 100%; height: 46px; }
  .viz-canvas-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .router-svg { min-width: 600px; }
  .bottom-smith-left { flex-direction: column; align-items: flex-start; gap: 12px; }
  .pet-stage-footer { flex-wrap: wrap; justify-content: center; }
  .ecosystem-strip { margin: 28px 0 8px; padding: 18px 0; }
  .model-pill { height: 46px; padding: 6px 13px 6px 8px; }
  .model-logo-tile { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .ed-title { transform: none !important; opacity: 1 !important; }
}

/* ---------- SmithAPI Quick Setup & CC Switch Widget ---------- */
.qsw-card {
  margin: 28px 0;
  padding: 24px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.qsw-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.qsw-kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 6px;
}
.qsw-head h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--text-strong);
}
.qsw-sub {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-sec);
}
.qsw-key-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qsw-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sec);
}
.qsw-input {
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text-strong);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
}
.qsw-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.qsw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.qsw-pane {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qsw-pane-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-strong);
}
.qsw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.qsw-tab {
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-sec);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.qsw-tab.is-active {
  border-color: var(--accent);
  background: var(--accent-soft, rgba(16, 185, 129, 0.12));
  color: var(--accent-bright);
}
.qsw-cmd-box {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #0b1120;
  color: #6ee7b7;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
}
.qsw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.qsw-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-strong);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.qsw-btn:hover {
  border-color: var(--accent);
}
.qsw-btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}
.qsw-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-strong);
  background: var(--surface-solid);
}
.qsw-status[data-tone="warn"] {
  border-color: rgba(245, 158, 11, 0.45);
}
.qsw-status[data-tone="ok"] {
  border-color: rgba(16, 185, 129, 0.45);
}
@media (max-width: 780px) {
  .qsw-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
