/* ==========================================================================
   KAPI (kapi.im) — Yuzu-Onsen Architectural UI & Interactive Workbench
   Refined warm obsidian & hinoki light themes, 1px hairlines, morphing
   capsule nav, theme-adaptive syntax highlighting, zero bloat
   ========================================================================== */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0c0a;
  --bg-subtle: #15120f;
  --bg-card: #191511;
  --bg-card-elevated: #13100d;
  --bg-muted: rgba(255, 244, 224, 0.042);
  --bg-muted-hover: rgba(255, 244, 224, 0.08);
  --bg-nav-float: rgba(18, 15, 12, 0.82);

  --border: rgba(246, 231, 206, 0.095);
  --border-subtle: rgba(246, 231, 206, 0.055);
  --border-strong: rgba(245, 158, 11, 0.46);

  --fg: #f6f1e7;
  --fg-secondary: #afa596;
  --fg-muted: #736a5e;

  --primary: #f59e0b;
  --primary-hover: #fbbf24;
  --primary-fg: #140f07;
  --primary-grad: linear-gradient(135deg, #fbbf24 0%, #f59e0b 52%, #ea781c 100%);
  --primary-grad-hover: linear-gradient(135deg, #fde68a 0%, #fbbf24 55%, #f59e0b 100%);
  --primary-shadow: 0 8px 26px -6px rgba(245, 158, 11, 0.5);

  --gold: #f59e0b;
  --gold-bright: #fcd34d;
  --gold-soft: rgba(245, 158, 11, 0.14);
  --accent-text-grad: linear-gradient(92deg, #fde68a 0%, #f59e0b 52%, #fb923c 100%);

  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.13);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.12);
  --amber: #f59e0b;
  --teal: #2dd4bf;

  /* Theme-adaptive syntax tokens */
  --syn-bg: rgba(16, 13, 11, 0.96);
  --syn-pane-alt: rgba(255, 244, 224, 0.022);
  --syn-footer: rgba(255, 244, 224, 0.03);
  --syn-cmd: #34d399;
  --syn-kw: #2dd4bf;
  --syn-key: #7dd3fc;
  --syn-str: #fcd34d;
  --syn-num: #fb923c;
  --syn-comment: #6e655a;
  --syn-punct: rgba(246, 241, 231, 0.48);

  --card-shadow: 0 24px 64px -26px rgba(0, 0, 0, 0.84);
  --nav-shadow: 0 8px 28px -10px rgba(0, 0, 0, 0.72);
  --mesh-1: rgba(245, 158, 11, 0.15);
  --mesh-2: rgba(45, 212, 191, 0.095);
  --grid-stroke: rgba(246, 231, 206, 0.04);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #fcfaf5;
  --bg-subtle: #f5efe6;
  --bg-card: #ffffff;
  --bg-card-elevated: #fffdf9;
  --bg-muted: rgba(42, 31, 18, 0.042);
  --bg-muted-hover: rgba(42, 31, 18, 0.08);
  --bg-nav-float: rgba(252, 250, 245, 0.88);

  --border: rgba(42, 31, 18, 0.1);
  --border-subtle: rgba(42, 31, 18, 0.06);
  --border-strong: rgba(217, 119, 6, 0.4);

  --fg: #1a1510;
  --fg-secondary: #5e5447;
  --fg-muted: #877b6c;

  --primary: #d97706;
  --primary-hover: #b45309;
  --primary-fg: #ffffff;
  --primary-grad: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  --primary-grad-hover: linear-gradient(135deg, #d97706 0%, #c2410c 100%);
  --primary-shadow: 0 8px 22px -6px rgba(234, 88, 12, 0.4);

  --gold: #d97706;
  --gold-bright: #b45309;
  --gold-soft: rgba(217, 119, 6, 0.11);
  --accent-text-grad: linear-gradient(92deg, #b45309 0%, #d97706 52%, #ea580c 100%);

  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.095);
  --sky: #0284c7;
  --sky-soft: rgba(2, 132, 199, 0.095);
  --amber: #d97706;
  --teal: #0d9488;

  /* Crisp light-mode syntax tokens (matches console hinoki light workbench) */
  --syn-bg: rgba(255, 253, 250, 0.97);
  --syn-pane-alt: rgba(42, 31, 18, 0.022);
  --syn-footer: rgba(42, 31, 18, 0.032);
  --syn-cmd: #059669;
  --syn-kw: #0d9488;
  --syn-key: #0369a1;
  --syn-str: #b45309;
  --syn-num: #c2410c;
  --syn-comment: #8a8073;
  --syn-punct: rgba(26, 21, 16, 0.48);

  --card-shadow: 0 22px 54px -26px rgba(42, 31, 18, 0.14);
  --nav-shadow: 0 6px 24px -8px rgba(42, 31, 18, 0.09);
  --mesh-1: rgba(245, 158, 11, 0.13);
  --mesh-2: rgba(13, 148, 136, 0.08);
  --grid-stroke: rgba(42, 31, 18, 0.045);
}

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

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

code,
pre,
.mono {
  font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Monaco,
    Consolas, "Liberation Mono", monospace;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

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

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   1. Morphing Floating Capsule Header
   ========================================================================== */
.header-wrap {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  pointer-events: none;
  padding: 0 20px;
  transition: padding 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-wrap.scrolled {
  padding-top: 12px;
}

.nav-bar {
  pointer-events: auto;
  max-width: 1160px;
  height: 64px;
  margin: 0 auto;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 0;
  border: 1px solid transparent;
  transition:
    max-width 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.3s ease,
    border-color 0.3s ease,
    border-radius 0.4s ease,
    box-shadow 0.4s ease;
}

.header-wrap.scrolled .nav-bar {
  max-width: 860px;
  height: 50px;
  padding: 0 8px 0 16px;
  border-radius: 999px;
  background: var(--bg-nav-float);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: var(--border);
  box-shadow: var(--nav-shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.96rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}

.brand-tld {
  font-size: 0.8em;
  font-weight: 650;
  color: var(--gold);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 18px -6px rgba(245, 158, 11, 0.55);
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.brand:hover .brand-logo {
  transform: rotate(-4deg) scale(1.04);
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-secondary);
}

.nav-center a {
  transition: color 0.16s ease;
}

.nav-center a:hover {
  color: var(--fg);
}

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

.nav-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 4px;
}

.ghost-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  min-width: 34px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.ghost-icon-btn:hover {
  background: var(--bg-muted-hover);
  color: var(--fg);
}

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

/* --- Tactile Pill Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 550;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.15s ease,
    box-shadow 0.18s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-nav {
  height: 32px;
  padding: 0 14px;
  font-size: 0.78rem;
}

.btn-primary {
  background: var(--primary-grad);
  color: var(--primary-fg);
  font-weight: 650;
  box-shadow: var(--primary-shadow);
}

.btn-primary:hover {
  background: var(--primary-grad-hover);
  box-shadow: 0 10px 28px -6px rgba(240, 168, 48, 0.62);
}

.btn-primary .arrow-icon {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.btn-primary:hover .arrow-icon {
  transform: translateX(3px);
}

.btn-outline {
  background: var(--bg-muted);
  border-color: var(--border);
  color: var(--fg);
}

.btn-outline:hover {
  background: var(--bg-muted-hover);
  border-color: var(--border-strong);
}

.btn-outline svg {
  width: 15px;
  height: 15px;
  color: var(--fg-secondary);
}

/* ==========================================================================
   2. Hero Section & Masked Ambient Backdrop
   ========================================================================== */
.hero {
  position: relative;
  padding: 128px 0 84px;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(56% 48% at 18% 18%, var(--mesh-1) 0%, transparent 72%),
    radial-gradient(46% 40% at 82% 16%, var(--mesh-2) 0%, transparent 70%);
}

.hero-grid-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--grid-stroke) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-stroke) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 68% 58% at 50% 26%, #000 18%, transparent 100%);
  mask-image: radial-gradient(ellipse 68% 58% at 50% 26%, #000 18%, transparent 100%);
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.06fr;
  gap: 44px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 0.74rem;
  font-weight: 550;
  color: var(--fg-secondary);
  margin-bottom: 22px;
}

.pulse-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.36;
  animation: pulseRing 2.2s ease-out infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.7); opacity: 0.55; }
  100% { transform: scale(2); opacity: 0; }
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.25rem, 4.3vw, 3.25rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 760;
}

.hero-accent {
  background: var(--accent-text-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  margin: 0 0 22px;
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--fg-secondary);
  max-width: 510px;
}

.hero-endpoint-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 7px 10px 7px 14px;
  margin-bottom: 24px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  box-shadow: 0 10px 28px -18px rgba(245, 158, 11, 0.45);
}

.hep-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  flex-shrink: 0;
}

.hep-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.hep-url {
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--gold-bright);
  padding-right: 4px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.ecosystem-block {
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.ecosystem-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 12px;
}

.ecosystem-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.eco-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.eco-pill:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--bg-muted-hover);
  color: var(--fg);
}

.eco-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ==========================================================================
   3. Hero Interactive Request / Response Workbench Card
   ========================================================================== */
.workbench {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--syn-bg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.wb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 46px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.wb-tabs {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.wb-tabs::-webkit-scrollbar {
  display: none;
}

.wb-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease;
}

.wb-tab:hover {
  color: var(--fg-secondary);
}

.wb-tab::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background-color 0.2s ease;
}

.wb-tab.active[data-accent="emerald"] { color: var(--emerald); }
.wb-tab.active[data-accent="emerald"]::after { background: var(--emerald); }

.wb-tab.active[data-accent="sky"] { color: var(--sky); }
.wb-tab.active[data-accent="sky"]::after { background: var(--sky); }

.wb-tab.active[data-accent="amber"] { color: var(--amber); }
.wb-tab.active[data-accent="amber"]::after { background: var(--amber); }

.wb-tab.active[data-accent="teal"] { color: var(--teal); }
.wb-tab.active[data-accent="teal"]::after { background: var(--teal); }

.wb-status-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wb-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--fg-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wb-copy-btn:hover {
  border-color: var(--border-strong);
  color: var(--fg);
}

.wb-copy-btn.copied {
  border-color: var(--emerald);
  color: var(--emerald);
}

.wb-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--fg-muted);
}

.wb-ok-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.55);
}

.wb-route-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--syn-pane-alt);
  font-size: 0.78rem;
}

.wb-route-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.method-badge {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--emerald-soft);
  color: var(--emerald);
  letter-spacing: 0.03em;
}

.method-badge.config {
  background: var(--sky-soft);
  color: var(--sky);
}

.wb-url {
  color: var(--fg-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-body {
  transition: opacity 0.16s ease;
}

.wb-pane {
  padding: 15px 18px;
}

.wb-pane-response {
  border-top: 1px solid var(--border-subtle);
  background: var(--syn-pane-alt);
}

.wb-pane-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 9px;
}

.wb-model-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
  color: var(--fg-secondary);
}

.wb-default-tag {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}

.wb-model-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold-bright);
  background: var(--gold-soft);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 3px 24px 3px 9px;
  cursor: pointer;
  outline: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 11px) 50%, calc(100% - 6px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 0.16s ease;
}

.wb-model-select:hover {
  border-color: var(--gold);
}

.wb-model-select option {
  background: var(--bg-card);
  color: var(--fg);
}

.wb-code {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--fg);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Syntax Classes */
.s-cmd { color: var(--syn-cmd); font-weight: 600; }
.s-kw  { color: var(--syn-kw); }
.s-key { color: var(--syn-key); }
.s-str { color: var(--syn-str); }
.s-num { color: var(--syn-num); font-weight: 600; }
.s-cmt { color: var(--syn-comment); font-style: italic; }
.s-pnc { color: var(--syn-punct); }

/* Quick copy rows inside Cursor tab */
.wb-kv-grid {
  display: grid;
  gap: 8px;
}

.wb-kv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  font-size: 12.5px;
}

.wb-kv-item .k {
  color: var(--fg-muted);
  font-size: 0.72rem;
}

.wb-kv-item .v {
  color: var(--fg);
  font-weight: 600;
}

.wb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--syn-footer);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ==========================================================================
   4. Metrics Strip (Real Pricing & Infrastructure Facts)
   ========================================================================== */
.metrics-strip {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 36px 0;
}

.metric-cell {
  text-align: center;
}

.metric-val {
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  font-weight: 760;
  letter-spacing: -0.025em;
  color: var(--fg);
  line-height: 1.2;
}

.metric-val.emerald {
  color: var(--emerald);
}

.metric-label {
  margin-top: 5px;
  font-size: 0.82rem;
  color: var(--fg-secondary);
}

/* ==========================================================================
   5. Generic Section Headers
   ========================================================================== */
.section {
  padding: 88px 0;
}

.section-bordered {
  border-top: 1px solid var(--border-subtle);
}

.sec-head {
  margin-bottom: 44px;
  max-width: 640px;
}

.sec-head.center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.sec-eyebrow {
  display: inline-block;
  font-size: 0.73rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 10px;
}

.sec-head h2 {
  margin: 0 0 12px;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 740;
}

.sec-head p {
  margin: 0;
  color: var(--fg-secondary);
  font-size: 0.96rem;
}

/* ==========================================================================
   6. Seamless 1px Hairline Bento Grid (Core Features)
   ========================================================================== */
.bento-frame {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

.bento-cell {
  background: var(--bg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  transition: background-color 0.2s ease;
}

.bento-cell:hover {
  background: var(--bg-subtle);
}

.bento-span-2 {
  grid-column: span 2;
}

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

.bento-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--fg-muted);
}

.bento-cell h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.bento-cell p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--fg-secondary);
  max-width: 520px;
}

/* Micro-visuals inside Bento cells */
.client-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.client-chip {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 0.8rem;
  font-weight: 550;
  text-align: center;
  color: var(--fg-secondary);
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.bento-cell:hover .client-chip:hover {
  border-color: var(--border-strong);
  background: var(--sky-soft);
  color: var(--sky);
}

.cache-compare {
  display: grid;
  gap: 10px;
}

.cache-bar-row {
  display: grid;
  gap: 5px;
  font-size: 0.76rem;
}

.cache-bar-head {
  display: flex;
  justify-content: space-between;
  color: var(--fg-secondary);
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-muted-hover);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.bar-fill.std {
  width: 100%;
  background: var(--fg-muted);
  opacity: 0.45;
}

.bar-fill.hit {
  width: 6%;
  min-width: 10px;
  background: var(--emerald);
}

.route-steps {
  display: grid;
  gap: 9px;
}

.route-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--fg-secondary);
}

.route-row .step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--fg-muted);
}

.route-row.active .step-dot {
  border-color: var(--border-strong);
  background: var(--sky-soft);
  color: var(--sky);
}

.route-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
  margin: 0 10px;
}

.log-preview {
  display: grid;
  gap: 8px;
}

.log-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  font-size: 0.76rem;
}

.log-tag {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-weight: 600;
}

/* 4-item sub-feature row below bento */
.sub-features {
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.sub-feat {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.sub-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--fg-secondary);
}

.sub-icon svg {
  width: 17px;
  height: 17px;
}

.sub-feat h4 {
  margin: 0 0 3px;
  font-size: 0.88rem;
  font-weight: 650;
}

.sub-feat p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--fg-secondary);
}

/* ==========================================================================
   7. Transparent Pricing Principles & Auto-Sync Model Catalog (Playbook B)
   ========================================================================== */
.principles-frame {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 20px;
}

.principle-cell {
  background: var(--bg);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background-color 0.2s ease;
}

.principle-cell:hover {
  background: var(--bg-subtle);
}

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

.principle-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.principle-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}

.principle-pill.gold {
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.principle-pill.emerald {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.principle-pill.sky {
  background: var(--sky-soft);
  color: var(--sky);
}

.principle-cell h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.principle-cell p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.64;
  color: var(--fg-secondary);
}

.principle-cell strong {
  color: var(--fg);
}

/* Auto-Sync Model & Discount Catalog */
.catalog-frame {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg);
  overflow: hidden;
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.catalog-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.catalog-status-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--fg-secondary);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  flex-shrink: 0;
}

.cat-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-pill {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-secondary);
  font-size: 0.76rem;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.16s ease;
}

.cat-pill:hover {
  border-color: var(--border-strong);
  color: var(--fg);
}

.cat-pill.active {
  border-color: var(--border-strong);
  background: var(--gold-soft);
  color: var(--gold-bright);
  font-weight: 650;
}

.catalog-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: var(--emerald-soft);
  color: var(--emerald);
  font-size: 0.71rem;
  font-weight: 650;
}

.sync-badge.fallback {
  border-color: var(--border);
  background: var(--bg-muted);
  color: var(--fg-muted);
}

.endpoint-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.71rem;
  color: var(--fg-muted);
}

.endpoint-mini strong {
  color: var(--gold-bright);
  font-weight: 700;
}

.catalog-head {
  display: grid;
  grid-template-columns: minmax(280px, 1.9fr) 168px minmax(200px, 1.15fr) 156px;
  gap: 14px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.catalog-head .right {
  text-align: right;
}

.model-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1.9fr) 168px minmax(200px, 1.15fr) 156px;
  gap: 14px;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
  transition: background-color 0.16s ease;
}

.model-row:hover {
  background: var(--bg-subtle);
}

.model-row.is-default {
  background: linear-gradient(90deg, var(--gold-soft) 0%, transparent 42%);
}

.model-row.is-default::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
}

.mr-main {
  min-width: 0;
}

.mr-id-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.mr-id {
  font-size: 0.94rem;
  font-weight: 720;
  color: var(--fg);
  letter-spacing: -0.015em;
}

.mr-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 650;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--fg-secondary);
}

.mr-badge.default {
  border-color: var(--border-strong);
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.mr-badge.coding {
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.1);
  color: var(--teal);
}

.mr-badge.reasoning {
  border-color: rgba(56, 189, 248, 0.35);
  background: var(--sky-soft);
  color: var(--sky);
}

.mr-badge.fast {
  border-color: rgba(16, 185, 129, 0.35);
  background: var(--emerald-soft);
  color: var(--emerald);
}

.mr-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.79rem;
  color: var(--fg-secondary);
}

.mr-ctx {
  font-size: 0.69rem;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  color: var(--fg-muted);
}

.discount-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.discount-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.discount-pill.deep {
  border-color: rgba(16, 185, 129, 0.42);
  background: var(--emerald-soft);
  color: var(--emerald);
}

.discount-num {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.discount-zh {
  font-size: 0.71rem;
  font-weight: 650;
  opacity: 0.92;
}

.discount-sub {
  font-size: 0.7rem;
  color: var(--fg-muted);
  padding-left: 2px;
}

.ref-price-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.82rem;
}

.ref-main {
  color: var(--fg);
  font-weight: 620;
}

.ref-main span.sep {
  color: var(--fg-muted);
  margin: 0 5px;
}

.ref-cache {
  font-size: 0.73rem;
  color: var(--emerald);
  font-weight: 550;
}

.ref-cache.muted {
  color: var(--fg-muted);
  font-weight: 400;
}

.mr-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.try-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--fg-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.try-btn:hover {
  border-color: var(--border-strong);
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.roadmap-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 22px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.roadmap-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  font-size: 0.81rem;
  color: var(--fg-secondary);
}

.roadmap-left strong {
  color: var(--fg);
}

.roadmap-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  flex-shrink: 0;
}

.roadmap-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.roadmap-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  color: var(--fg-muted);
}

.catalog-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  background: var(--bg-muted);
}

.catalog-footer-note {
  font-size: 0.82rem;
  color: var(--fg-secondary);
}

.catalog-footer-note strong {
  color: var(--fg);
}

/* ==========================================================================
   8. Dual-Channel Top-Up & Redeem Workflow
   ========================================================================== */
.topup-channels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 980px;
  margin: 0 auto 24px;
}

.channel-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  transition: border-color 0.2s ease;
}

.channel-card:hover {
  border-color: var(--border-strong);
}

.channel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.channel-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.channel-badge.sky {
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.channel-badge.emerald {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.channel-rate {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-secondary);
}

.channel-card h3 {
  margin: 0 0 10px;
  font-size: 1.12rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.channel-desc {
  margin: 0 0 16px;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--fg-secondary);
}

.channel-steps {
  margin: 0 0 20px;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  font-size: 0.83rem;
  color: var(--fg-secondary);
  line-height: 1.55;
}

.chain-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
}

.chain-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.72rem;
  color: var(--fg-secondary);
}

.qr-drawer {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 14px;
}

.qr-drawer[hidden] {
  display: none;
}

.qr-drawer img {
  width: 112px;
  height: 112px;
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  flex-shrink: 0;
}

.qr-drawer-text {
  font-size: 0.81rem;
  line-height: 1.55;
  color: var(--fg-secondary);
}

.channel-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.redeem-bar {
  max-width: 980px;
  margin: 16px auto 0;
  padding: 16px 22px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  text-align: center;
}

.redeem-bar-text {
  font-size: 0.85rem;
  color: var(--fg-secondary);
}

.redeem-bar-text strong {
  color: var(--fg);
}

.inline-toast {
  max-width: 980px;
  margin: 0 auto 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--gold-soft);
  color: var(--gold-bright);
  font-size: 0.83rem;
  display: none;
}

.inline-toast.visible {
  display: block;
}

/* ==========================================================================
   9. FAQ & Bottom CTA
   ========================================================================== */
.faq-stack {
  max-width: 780px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--border);
  display: grid;
  gap: 1px;
}

.faq-row {
  background: var(--bg);
}

.faq-row summary {
  list-style: none;
  padding: 18px 22px;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background-color 0.15s ease;
}

.faq-row summary:hover {
  background: var(--bg-subtle);
}

.faq-row summary::-webkit-details-marker {
  display: none;
}

.faq-chev {
  color: var(--fg-muted);
  transition: transform 0.2s ease;
}

.faq-row[open] .faq-chev {
  transform: rotate(180deg);
  color: var(--gold);
}

.faq-body {
  padding: 0 22px 18px;
  font-size: 0.87rem;
  color: var(--fg-secondary);
  line-height: 1.68;
}

.bottom-cta {
  position: relative;
  padding: 84px 0;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  overflow: hidden;
}

.bottom-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(48% 55% at 50% 50%, var(--mesh-1) 0%, transparent 75%);
}

.bottom-cta-inner {
  position: relative;
  z-index: 1;
  max-width: 580px;
  margin: 0 auto;
}

.cta-mascot {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 36px -10px rgba(245, 158, 11, 0.55);
  object-fit: cover;
  margin: 0 auto 18px;
  display: block;
}

.bottom-cta h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  letter-spacing: -0.025em;
}

.bottom-cta p {
  margin: 0 0 24px;
  color: var(--fg-secondary);
  font-size: 0.95rem;
}

.bottom-cta-btns {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   10. Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0 48px;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

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

.footer-tagline {
  margin-top: 6px;
  color: var(--fg-secondary);
  font-size: 0.82rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  color: var(--fg-secondary);
}

.footer-nav a:hover {
  color: var(--fg);
}

.footer-bottom {
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

/* ==========================================================================
   11. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 980px) {
  .hero-layout,
  .principles-frame {
    grid-template-columns: 1fr;
  }

  .catalog-head {
    display: none;
  }

  .model-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mr-actions {
    justify-content: flex-start;
  }

  .bento-frame {
    grid-template-columns: 1fr;
  }

  .bento-span-2 {
    grid-column: span 1;
  }

  .sub-features {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topup-channels {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .nav-center {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 102px 0 56px;
  }

  .section {
    padding: 60px 0;
  }

  .sub-features,
  .client-matrix {
    grid-template-columns: 1fr;
  }

  .principle-cell,
  .bento-cell {
    padding: 22px;
  }

  .catalog-toolbar,
  .model-row,
  .roadmap-row,
  .catalog-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}
