/* ============================================================
   Tiyi marketing site — main.css
   Brand: cyan #00E5FF → blue #0066FF on dark navy #0A0E1A
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Brand — same in both themes */
  --brand-cyan:   #00E5FF;
  --brand-blue:   #0066FF;
  --brand-grad:   linear-gradient(135deg, #00E5FF 0%, #0066FF 100%);
  --brand-grad-soft: linear-gradient(135deg, rgba(0,229,255,0.16) 0%, rgba(0,102,255,0.16) 100%);

  /* Status — slightly tuned per theme below */
  --success:      #10B981;
  --warning:      #F59E0B;
  --danger:       #EF4444;
  --info:         #3B82F6;

  /* Layout */
  --content:      1200px;
  --content-wide: 1320px;
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    20px;
  --radius-pill:  999px;

  /* Motion */
  --ease:         cubic-bezier(.2, .7, .2, 1);
  --dur:          .35s;
}

/* Dark theme (default) */
:root,
[data-theme="dark"] {
  /* Surfaces */
  --bg:           #07090F;
  --bg-2:         #0A0E1A;
  --surface:      #0F1424;
  --surface-2:    #131A2E;
  --surface-3:    #1A2238;
  --border:       rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --hairline:     rgba(0, 229, 255, 0.18);

  /* Text */
  --fg:           #F4F6F9;
  --fg-2:         #C7CFDD;
  --fg-3:         #8892A4;
  --fg-4:         #5E6A82;

  /* Component-specific */
  --nav-bg:       rgba(10, 14, 26, .72);
  --code-bg:      rgba(0, 229, 255, .07);
  --code-border:  rgba(0, 229, 255, .14);
  --code-fg:      #9ff5ff;
  --hero-grid-color: rgba(255, 255, 255, .025);
  --frame-tab-bg: rgba(255, 255, 255, .02);

  /* Shadows */
  --shadow-glow:  0 0 0 1px rgba(0,229,255,.15), 0 20px 60px -20px rgba(0,102,255,.45);
  --shadow-card:  0 1px 0 rgba(255,255,255,.04) inset, 0 24px 48px -28px rgba(0,0,0,.6);
}

/* Light theme */
[data-theme="light"] {
  --bg:           #F4F6F9;
  --bg-2:         #FFFFFF;
  --surface:      #FFFFFF;
  --surface-2:    #F8FAFC;
  --surface-3:    #EEF2F8;
  --border:       rgba(15, 20, 36, 0.08);
  --border-strong: rgba(15, 20, 36, 0.16);
  --hairline:     rgba(0, 102, 255, 0.18);

  --fg:           #0A0E1A;
  --fg-2:         #2A344A;
  --fg-3:         #5E6A82;
  --fg-4:         #8892A4;

  --nav-bg:       rgba(255, 255, 255, .82);
  --code-bg:      rgba(0, 102, 255, .06);
  --code-border:  rgba(0, 102, 255, .15);
  --code-fg:      #0050C0;
  --hero-grid-color: rgba(15, 20, 36, .04);
  --frame-tab-bg: rgba(15, 20, 36, .03);

  --shadow-glow:  0 0 0 1px rgba(0, 102, 255, .12), 0 20px 60px -20px rgba(0, 102, 255, .25);
  --shadow-card:  0 1px 0 rgba(255,255,255,1) inset, 0 12px 32px -20px rgba(15, 20, 36, .15);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-2);
  color: var(--fg);
  font: 16px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  letter-spacing: -.005em;
  overflow-x: hidden;
  transition: background .3s var(--ease), color .3s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: var(--brand-cyan); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: #66f0ff; }
button { font: inherit; }
code, pre, .mono {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, 'Cascadia Code', monospace;
  font-size: .92em;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0; }

/* Selection */
::selection { background: rgba(0, 229, 255, 0.28); color: #fff; }

/* ---------- Background field ---------- */
.bg-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(800px 500px at 12% -10%, rgba(0, 229, 255, .14), transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(0, 102, 255, .12), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 40%, var(--bg-2) 100%);
}
.bg-field::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hero-grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid-color) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide { max-width: var(--content-wide); }
section { padding: 96px 0; position: relative; }
section + section { padding-top: 0; }

@media (max-width: 768px) {
  section { padding: 64px 0; }
  .container { padding: 0 20px; }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; letter-spacing: -.01em;
  color: var(--fg);
}
.brand img { width: 28px; height: 28px; }
.brand:hover { color: var(--brand-cyan); }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  color: var(--fg-2);
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--dur) var(--ease);
}
.nav-links a:hover { color: var(--fg); background: var(--surface-2); }
.nav-cta { margin-left: 6px; }

@media (max-width: 768px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -.005em;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 6px 24px -8px rgba(0, 102, 255, .55), 0 0 0 1px rgba(0,229,255,.25) inset;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 32px -10px rgba(0, 102, 255, .7), 0 0 0 1px rgba(0,229,255,.4) inset;
  color: #fff;
}
.btn-ghost {
  background: var(--surface-2);
  color: var(--fg);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--fg);
}
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---------- Pill / Badge ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 8px;
  background: rgba(0, 229, 255, .08);
  border: 1px solid rgba(0, 229, 255, .22);
  color: var(--brand-cyan);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
}
.pill-dot {
  width: 6px; height: 6px;
  background: var(--brand-cyan);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(0, 229, 255, .14);
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 72px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px; color: var(--fg-2);
  margin-bottom: 28px;
}
.hero-eyebrow .tag {
  background: var(--brand-grad);
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 24px;
  letter-spacing: -.035em;
}
.hero h1 .grad {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--fg-2);
  max-width: 720px;
  margin: 0 auto 36px;
  line-height: 1.55;
}
.hero-actions {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 28px;
}
.hero-meta {
  display: flex; align-items: center; gap: 24px;
  color: var(--fg-3);
  font-size: 13.5px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-meta .dot { width: 4px; height: 4px; background: var(--fg-4); border-radius: 50%; }
.hero-meta strong { color: var(--fg-2); font-weight: 600; }

/* Hero terminal-ish run command */
.hero-cmd {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 24px;
  padding: 11px 16px 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13.5px;
  color: var(--fg-2);
}
.hero-cmd .prompt { color: var(--brand-cyan); }
.hero-cmd .cmd { color: var(--fg); }
.hero-cmd .copy {
  color: var(--fg-3);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.hero-cmd .copy:hover {
  color: var(--brand-cyan);
  border-color: rgba(0, 229, 255, .4);
  background: rgba(0, 229, 255, .06);
}
.hero-cmd .copy.copied { color: var(--success); border-color: rgba(16,185,129,.4); }

/* ---------- Hero screenshot frame ---------- */
.hero-screenshot {
  margin-top: 48px;
  position: relative;
}
.frame {
  position: relative;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  padding: 1px;
  box-shadow: var(--shadow-glow);
}
.frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0,229,255,.5), rgba(0,102,255,.5), transparent 50%);
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  padding: 1px;
  opacity: .5;
  pointer-events: none;
}
.frame img {
  display: block;
  border-radius: 15px;
  width: 100%;
  height: auto;
}
.frame-tabs {
  display: flex; gap: 6px; padding: 10px 14px;
  background: var(--frame-tab-bg);
  border-bottom: 1px solid var(--border);
  border-radius: 15px 15px 0 0;
}
.frame-tabs .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.frame-tabs .dot.r { background: #ff5f57; }
.frame-tabs .dot.y { background: #ffbd2e; }
.frame-tabs .dot.g { background: #28c940; }
.frame-tabs .url {
  margin-left: auto;
  color: var(--fg-3);
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- Logos / trust strip ---------- */
.trust {
  padding: 56px 0 0;
  text-align: center;
}
.trust .label {
  color: var(--fg-3);
  font-size: 12.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.trust-row {
  display: flex; align-items: center; justify-content: center;
  gap: 36px; flex-wrap: wrap;
  color: var(--fg-3);
  opacity: .9;
}
.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-2);
}

/* ---------- Section heading ---------- */
.section-head {
  text-align: center;
  margin-bottom: 56px;
}
.section-head .eyebrow {
  display: inline-block;
  color: var(--brand-cyan);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(30px, 3.5vw, 44px);
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 14px;
}
.section-head p {
  font-size: 17px;
  color: var(--fg-2);
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- Features grid ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 960px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features-grid { grid-template-columns: 1fr; } }

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: all var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}
.feature:hover {
  border-color: rgba(0, 229, 255, .3);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -20px rgba(0, 102, 255, .35);
}
.feature::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 60px; height: 1px;
  background: var(--brand-grad);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.feature:hover::before { opacity: 1; }
.feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--brand-grad-soft);
  border: 1px solid rgba(0, 229, 255, .2);
  color: var(--brand-cyan);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.feature-icon svg { width: 20px; height: 20px; }
.feature h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature p {
  color: var(--fg-3);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ---------- Tour (alternating screenshot rows) ---------- */
.tour-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 96px;
}
.tour-row:nth-child(even) { grid-template-columns: 1.4fr 1fr; }
.tour-row:nth-child(even) .tour-text { order: 2; }
.tour-row:last-child { margin-bottom: 0; }
@media (max-width: 880px) {
  .tour-row, .tour-row:nth-child(even) { grid-template-columns: 1fr; gap: 28px; }
  .tour-row:nth-child(even) .tour-text { order: unset; }
}
.tour-eyebrow {
  display: inline-block;
  color: var(--brand-cyan);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.tour-text h3 {
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: -.022em;
  margin-bottom: 14px;
}
.tour-text p {
  color: var(--fg-2);
  font-size: 16px;
  margin-bottom: 18px;
  line-height: 1.65;
}
.tour-text ul {
  margin: 0; padding: 0; list-style: none;
}
.tour-text li {
  position: relative;
  padding-left: 22px;
  color: var(--fg-2);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 8px;
}
.tour-text li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 12px; height: 2px;
  background: var(--brand-grad);
  border-radius: 2px;
}

/* ---------- Stats strip ---------- */
.stats-strip {
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(0, 229, 255, .04), rgba(0, 102, 255, .03));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 760px) { .stats-strip { grid-template-columns: repeat(2, 1fr); } }
.stat .num {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 800;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -.02em;
}
.stat .lbl {
  color: var(--fg-3);
  font-size: 13px;
  margin-top: 4px;
}

/* ---------- Pricing ---------- */
.pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 920px) { .pricing { grid-template-columns: 1fr; } }

.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.plan:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.plan.featured {
  border-color: rgba(0, 229, 255, .35);
  background: linear-gradient(180deg, rgba(0, 229, 255, .04), rgba(0, 102, 255, .04)), var(--surface);
  box-shadow: 0 0 0 1px rgba(0,229,255,.12), 0 30px 60px -28px rgba(0,102,255,.4);
}
.plan-badge {
  position: absolute;
  top: -12px; left: 28px;
  background: var(--brand-grad);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}
.plan h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}
.plan .who { color: var(--fg-3); font-size: 14px; margin-bottom: 22px; line-height: 1.5; }
.plan .price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}
.plan .price .amount {
  font-size: 44px; font-weight: 800; letter-spacing: -.03em;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.plan .price .unit { color: var(--fg-3); font-size: 14.5px; }
.plan .price-note { color: var(--fg-3); font-size: 13px; margin-bottom: 24px; }
.plan ul {
  list-style: none;
  margin: 0 0 28px;
  padding: 24px 0 0;
  border-top: 1px dashed var(--border);
  flex: 1;
}
.plan li {
  display: flex; gap: 10px;
  font-size: 14.5px;
  color: var(--fg-2);
  margin-bottom: 12px;
  line-height: 1.45;
}
.plan li svg {
  flex-shrink: 0;
  width: 16px; height: 16px;
  color: var(--brand-cyan);
  margin-top: 3px;
}
.plan .btn { width: 100%; justify-content: center; }

/* ---------- Comparison footnote ---------- */
.pricing-foot {
  margin-top: 28px;
  text-align: center;
  color: var(--fg-3);
  font-size: 13.5px;
}
.pricing-foot a { font-weight: 600; }

/* ---------- Changelog & roadmap ---------- */
.timeline {
  position: relative;
  padding: 8px 0 0;
  max-width: 880px;
  margin: 0 auto;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: linear-gradient(180deg, rgba(0,229,255,.3), var(--border) 80%);
}
.tl-item {
  position: relative;
  padding-left: 44px;
  padding-bottom: 28px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: 5px; top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--brand-cyan);
  box-shadow: 0 0 0 4px rgba(0, 229, 255, .12);
}
.tl-item.future .tl-dot {
  border-color: var(--fg-4);
  box-shadow: 0 0 0 4px rgba(94, 106, 130, .12);
}
.tl-item.shipped .tl-dot {
  background: var(--brand-cyan);
}
.tl-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.tl-version {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.tl-date {
  color: var(--fg-3);
  font-size: 13px;
}
.tl-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid;
}
.tl-tag.shipped {
  color: var(--success);
  border-color: rgba(16, 185, 129, .35);
  background: rgba(16, 185, 129, .08);
}
.tl-tag.current {
  color: var(--brand-cyan);
  border-color: rgba(0, 229, 255, .4);
  background: rgba(0, 229, 255, .08);
}
.tl-tag.future {
  color: var(--fg-3);
  border-color: var(--border);
  background: rgba(255,255,255,.03);
}
.tl-title {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}
.tl-body {
  color: var(--fg-3);
  font-size: 14px;
  line-height: 1.65;
}
.tl-body ul {
  margin: 8px 0 0; padding-left: 18px;
}
.tl-body li { margin-bottom: 4px; }

/* ---------- CTA banner ---------- */
.cta {
  position: relative;
  padding: 72px 56px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(700px 320px at 0% 0%, rgba(0,229,255,.18), transparent 60%),
    radial-gradient(700px 320px at 100% 100%, rgba(0,102,255,.18), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  text-align: center;
  overflow: hidden;
}
.cta h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 14px;
}
.cta p {
  color: var(--fg-2);
  font-size: 17px;
  margin: 0 auto 28px;
  max-width: 620px;
}
.cta-actions {
  display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
@media (max-width: 600px) { .cta { padding: 48px 24px; } }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 96px;
  padding: 56px 0 32px;
  background: var(--surface-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer .brand { margin-bottom: 14px; }
.footer .tag {
  color: var(--fg-3); font-size: 14px; line-height: 1.55; max-width: 320px;
}
.footer h4 {
  font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-3); font-weight: 600; margin-bottom: 14px;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 10px; }
.footer a {
  color: var(--fg-2);
  font-size: 14px;
  transition: color var(--dur) var(--ease);
}
.footer a:hover { color: var(--fg); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--fg-3);
  font-size: 13px;
  flex-wrap: wrap;
}
.footer-bottom .build {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--fg-3);
}

/* ---------- Reveal on scroll ---------- *
 * Initial state is *visible* — the .in animation is only a polish
 * for users who scroll. This guarantees fullPage screenshots and
 * users with reduced-motion preferences always see the content.
 */
.reveal { opacity: 1; transform: translateY(0); transition: opacity .6s var(--ease), transform .6s var(--ease); }
@media (prefers-reduced-motion: no-preference) {
  .reveal:not(.in) { opacity: 0; transform: translateY(16px); }
  .reveal.in { opacity: 1; transform: translateY(0); }
}

/* ---------- Misc ---------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0 auto;
  max-width: var(--content);
}
.kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--fg-2);
}

/* ---------- Print/utility ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   Docs layout
   ============================================================ */
:root {
  --docs-content-width: 1280px;
  --docs-sidebar:       240px;
  --docs-toc:           200px;
  --docs-gap:           48px;
}

body.docs { background: var(--bg-2); }
.docs-layout {
  max-width: var(--docs-content-width);
  margin: 0 auto;
  padding: 32px 24px 96px;
  display: grid;
  grid-template-columns: var(--docs-sidebar) minmax(0, 1fr) var(--docs-toc);
  gap: var(--docs-gap);
}
@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: var(--docs-sidebar) minmax(0, 1fr);
    --docs-gap: 36px;
  }
  .docs-toc { display: none; }
}
@media (max-width: 760px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; padding: 20px 20px 72px; }
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: 8px;
}
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
.docs-nav-group + .docs-nav-group { margin-top: 24px; }
.docs-nav-group h4 {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 10px;
  padding: 0 12px;
}
.docs-nav-group ul { list-style: none; padding: 0; margin: 0; }
.docs-nav-group li { margin: 0; }
.docs-nav-group a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.4;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.docs-nav-group a:hover { background: var(--surface-2); color: var(--fg); }
.docs-nav-group a.active {
  background: var(--brand-grad-soft);
  color: var(--brand-cyan);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--brand-cyan);
}
@media (max-width: 760px) {
  .docs-sidebar {
    position: static;
    max-height: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--surface);
  }
}

/* Content */
.docs-content {
  min-width: 0;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--fg-2);
}
.docs-content > .docs-eyebrow {
  display: inline-block;
  color: var(--brand-cyan);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.docs-content h1 {
  font-size: clamp(30px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -.025em;
  margin: 0 0 16px;
  color: var(--fg);
  line-height: 1.15;
}
.docs-content > p.lede {
  font-size: 17.5px;
  color: var(--fg-2);
  line-height: 1.6;
  margin: 0 0 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.docs-content h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--fg);
  margin: 56px 0 14px;
  scroll-margin-top: 96px;
  position: relative;
}
.docs-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  margin: 36px 0 10px;
  scroll-margin-top: 96px;
}
.docs-content h2 .anchor,
.docs-content h3 .anchor {
  opacity: 0;
  text-decoration: none;
  color: var(--fg-3);
  margin-left: 8px;
  font-weight: 400;
  transition: opacity var(--dur) var(--ease);
}
.docs-content h2:hover .anchor,
.docs-content h3:hover .anchor { opacity: 1; }
.docs-content p { margin: 14px 0; }
.docs-content a { font-weight: 500; }
.docs-content a:not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }
.docs-content strong { color: var(--fg); font-weight: 600; }
.docs-content ul, .docs-content ol {
  padding-left: 22px;
  margin: 14px 0;
}
.docs-content li {
  margin: 6px 0;
  line-height: 1.65;
}
.docs-content li::marker { color: var(--fg-4); }
.docs-content hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 48px 0;
}

/* Inline code + code blocks */
.docs-content code {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: .9em;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--code-fg);
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
.docs-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
  position: relative;
}
.docs-content pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--fg-2);
  font-size: inherit;
  white-space: pre;
}
.docs-content pre .c { color: var(--fg-3); font-style: italic; }
.docs-content pre .k { color: #c084fc; font-weight: 500; }
.docs-content pre .s { color: #93e9be; }
.docs-content pre .v { color: var(--brand-cyan); }
.docs-content pre .p { color: #8aa2ff; }
.docs-content pre .o { color: #f0a571; }

/* Light-theme syntax palette (better contrast on white) */
[data-theme="light"] .docs-content pre .k { color: #7c3aed; }
[data-theme="light"] .docs-content pre .s { color: #047857; }
[data-theme="light"] .docs-content pre .v { color: #0050C0; }
[data-theme="light"] .docs-content pre .p { color: #2563eb; }
[data-theme="light"] .docs-content pre .o { color: #b45309; }

/* Tables */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.docs-content thead { background: var(--surface-2); }
.docs-content th, .docs-content td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.docs-content th {
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.docs-content tr:last-child td { border-bottom: 0; }

/* Callouts */
.callout {
  margin: 22px 0;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid;
  background: var(--surface);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.callout-icon { flex: 0 0 auto; margin-top: 2px; }
.callout-body { flex: 1 1 auto; min-width: 0; }
.callout-body > :first-child { margin-top: 0; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-info {
  border-color: rgba(0, 229, 255, .25);
  background: rgba(0, 229, 255, .05);
}
.callout-info .callout-icon { color: var(--brand-cyan); }
.callout-warn {
  border-color: rgba(245, 158, 11, .35);
  background: rgba(245, 158, 11, .06);
}
.callout-warn .callout-icon { color: var(--warning); }
.callout-tip {
  border-color: rgba(16, 185, 129, .3);
  background: rgba(16, 185, 129, .05);
}
.callout-tip .callout-icon { color: var(--success); }
.callout-danger {
  border-color: rgba(239, 68, 68, .35);
  background: rgba(239, 68, 68, .05);
}
.callout-danger .callout-icon { color: var(--danger); }

/* Light theme: invert callout backgrounds slightly */
[data-theme="light"] .callout-info { background: rgba(0, 102, 255, .04); }
[data-theme="light"] .callout-warn { background: rgba(245, 158, 11, .07); }
[data-theme="light"] .callout-tip { background: rgba(16, 185, 129, .06); }
[data-theme="light"] .callout-danger { background: rgba(239, 68, 68, .05); }

/* Definition list grid */
.dl-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px 24px;
  margin: 18px 0;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
@media (max-width: 600px) { .dl-grid { grid-template-columns: 1fr; gap: 4px 0; } }
.dl-grid dt {
  color: var(--fg);
  font-weight: 600;
  font-size: 14px;
}
.dl-grid dd {
  margin: 0;
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.6;
}

/* Page footer (next/prev) */
.docs-pager {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.docs-pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--fg);
  background: var(--surface);
  min-width: 220px;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.docs-pager a:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.docs-pager .label { font-size: 12px; color: var(--fg-3); letter-spacing: .04em; }
.docs-pager .title { font-size: 15px; font-weight: 600; color: var(--fg); }
.docs-pager .next { text-align: right; margin-left: auto; }

/* TOC (right column) */
.docs-toc {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  font-size: 13px;
}
.docs-toc h4 {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 10px;
}
.docs-toc ul { list-style: none; padding: 0; margin: 0; }
.docs-toc li { margin: 0; }
.docs-toc a {
  display: block;
  padding: 5px 12px;
  border-left: 1px solid var(--border);
  color: var(--fg-3);
  line-height: 1.5;
}
.docs-toc a:hover { color: var(--fg); }
.docs-toc a.active {
  color: var(--brand-cyan);
  border-left-color: var(--brand-cyan);
  font-weight: 500;
}
.docs-toc li.lvl-3 a { padding-left: 24px; font-size: 12.5px; }

/* Docs landing cards */
.docs-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 24px 0;
}
@media (max-width: 700px) { .docs-cards { grid-template-columns: 1fr; } }
.docs-card {
  display: block;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.docs-card:hover {
  border-color: rgba(0,229,255,.3);
  transform: translateY(-1px);
  color: var(--fg);
}
.docs-card .docs-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.docs-card .docs-card-num {
  display: inline-flex;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand-grad-soft);
  border: 1px solid rgba(0,229,255,.25);
  color: var(--brand-cyan);
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.docs-card p {
  color: var(--fg-3);
  font-size: 14px;
  margin: 0;
  line-height: 1.55;
}

/* ============================================================
   Nav toggles (theme + language)
   ============================================================ */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.nav-toggle:hover {
  background: var(--surface-2);
  color: var(--fg);
  border-color: var(--border-strong);
}
.nav-toggle svg { width: 16px; height: 16px; }

.nav-lang {
  width: auto;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* Show the right icon for the current theme */
.nav-toggle .icon-sun { display: none; }
.nav-toggle .icon-moon { display: block; }
[data-theme="light"] .nav-toggle .icon-sun { display: block; }
[data-theme="light"] .nav-toggle .icon-moon { display: none; }

/* Mobile: still show toggles, hide some text links instead */
@media (max-width: 768px) {
  .nav-toggle { width: 32px; height: 32px; }
  .nav-lang { width: auto; padding: 0 10px; }
}
