/* ============================================================
   VANTA — monochrome design system
   Palette: strict grayscale. No color accents anywhere.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #050505;
  --bg-2: #0a0a0a;
  --panel: #0d0d0d;
  --panel-2: #121212;
  --line: #1e1e1e;
  --line-2: #2b2b2b;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --dim: #8a8a8a;
  --white: #ffffff;
  --r: 12px;
  --r-sm: 8px;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Onest', 'Geist', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 64px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

@keyframes pagein { from { opacity: 0; } }
body { animation: pagein .3s ease; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: #fff; color: #000; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #262626; border-radius: 6px; border: 2px solid #0a0a0a; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
img, svg { display: block; }

/* ---------- utilities ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.strike { text-decoration: line-through; color: var(--dim); }
.hidden { display: none !important; }
[hidden] { display: none !important; }   /* .btn and .banner set display, which would override the attribute */

.section { padding: 124px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 64px; }
.section-head h2 {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 450;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0 0 14px;
}
.section-head p { color: var(--muted); font-size: 16px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--white); color: #000; }
.btn-primary:hover { background: #d9d9d9; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: #4a4a4a; background: #101010; }
.btn-danger { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-danger:hover { background: #fff; color: #000; border-color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 7px; min-height: 32px; display: inline-flex; align-items: center; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- badges / chips / pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  white-space: nowrap;
}
.badge-inv { background: var(--white); color: #000; border-color: var(--white); }
.badge-dim { color: var(--dim); }

.chip {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--text); border-color: #4a4a4a; }
.chip.active { background: var(--white); color: #000; border-color: var(--white); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--panel);
}

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot-on { background: var(--white); }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.nav.scrolled {
  background: rgba(5,5,5,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color .15s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: transparent; color: var(--text); border: 1px solid var(--line-2);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Exo 2', 'Geist', sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: .02em;
}
.logo svg { width: 20px; height: 20px; }
.logo img.logo-mark { height: 18px; width: auto; display: block; }
.logo small { font-family: var(--mono); font-size: 9px; color: var(--dim); letter-spacing: .2em; }

/* ---------- hero ---------- */
.hero { padding: calc(var(--nav-h) + 128px) 0 128px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 450;
  letter-spacing: -.025em;
  line-height: 1.04;
  margin: 0 0 28px;
}

.hero-sub { color: var(--muted); font-size: 17px; max-width: 480px; margin-bottom: 44px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-note { font-family: var(--sans); font-size: 12.5px; color: var(--dim); }

/* terminal */
/* macOS Terminal.app window */
.term {
  background: #0d0d0f;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 0 .5px rgba(255,255,255,.14),
    0 28px 70px rgba(0,0,0,.6),
    0 4px 18px rgba(0,0,0,.45);
}
.term-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  background: #1c1c1e;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 1px 0 rgba(0,0,0,.5);
}
.tl {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.tl-1 { background: #ff5f57; box-shadow: inset 0 0 0 .5px #d94d43; }
.tl-2 { background: #febc2e; box-shadow: inset 0 0 0 .5px #d79b22; }
.tl-3 { background: #28c840; box-shadow: inset 0 0 0 .5px #1dad2b; }
.tl::after {
  opacity: 0;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: rgba(0,0,0,.55);
  transition: opacity .12s;
}
.tl-1::after { content: "\00D7"; }
.tl-2::after { content: "\2013"; }
.tl-3::after { content: "+"; }
.term-head:hover .tl::after { opacity: 1; }
.term-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .01em;
  color: #b8b8bd;
  white-space: nowrap;
}
.term-body {
  padding: 14px 16px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  height: 352px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #e8e8e9;
}
.term-body .p { color: var(--dim); }        /* prompt / punctuation */
.term-body .s { color: #e8e8e8; }           /* strings */
.term-body .c { color: #4d4d4d; }           /* comments */
.term-body .k { color: #bdbdbd; }           /* keys */
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--white); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* hero code window (x.ai style): blueprint frame + corner marks + soft glow */
.hero-code { position: relative; min-width: 0; }
.code-frame {
  position: relative;
  border: none;
  padding: 52px 52px;
  background:
    radial-gradient(ellipse 130% 110% at 80% 4%, rgba(255,255,255,.22), transparent 52%),
    radial-gradient(ellipse 110% 100% at 10% 98%, rgba(255,255,255,.05), transparent 58%),
    linear-gradient(160deg, #202022 0%, #121213 45%, #0b0b0c 100%);
}
.code-frame::before {
  content: none;
}
.code-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .16;
  pointer-events: none;
}
.code-frame .term { position: relative; z-index: 1; }
.corner {
  position: absolute;
  width: 20px; height: 20px;
  background: var(--bg);
  border: none;
  z-index: 2;
}
.corner.nw { top: 0; left: 0; }
.corner.ne { top: 0; right: 0; }
.corner.sw { bottom: 0; left: 0; }
.corner.se { bottom: 0; right: 0; }
.code-copy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: #9a9a9e;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.code-copy:hover { color: #fff; background: rgba(255,255,255,.07); }
.code-body {
  margin: 0;
  padding: 24px 26px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.8;
  height: 318px;
  overflow: auto;
  white-space: pre;
  color: #d7d7d7;
}
/* syntax colors inside the code window (x.ai palette, muted) */
.code-body .k, .code .k { color: #ff7d92; }   /* keywords */
.code-body .s, .code .s { color: #f2b28c; }   /* strings */
.code-body .f { color: #a8c7fa; }   /* functions / attrs */
.code-body .n { color: #8ab8ff; }   /* numbers */
.code-body .c, .code .c { color: #6e6e6e; }   /* comments */
.code-tabs { display: flex; gap: 6px; justify-content: center; margin-top: 30px; }
.code-tabs .chip { border: none; background: transparent; color: #777; font-size: 13.5px; padding: 9px 18px; border-radius: 999px; transition: color .15s, background .15s; }
.code-tabs .chip:hover { color: var(--text); }
.code-tabs .chip.active { background: #242426; color: #fff; }

/* ticker */
.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 26px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.ticker-group { display: flex; align-items: center; gap: 120px; padding-right: 120px; flex-shrink: 0; }
.tk { height: 24px; width: auto; opacity: .7; filter: grayscale(1); transition: opacity .2s; flex-shrink: 0; user-select: none; }
.tk:hover { opacity: 1; }
.tk-lock { display: flex; align-items: center; gap: 9px; flex-shrink: 0; opacity: .7; transition: opacity .2s; user-select: none; }
.tk-lock:hover { opacity: 1; }
.tk-lock img { height: 24px; width: auto; filter: grayscale(1); display: block; border-radius: 5px; }
.tk-lock span { font-family: var(--display); font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; color: #d9d9d9; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* stats strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.stat { padding: 42px 28px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; }
.stat b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.02em; font-family: var(--display); }
.stat span { font-size: 12.5px; color: var(--dim); }

/* ---------- tables ---------- */
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; background: var(--panel); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.tbl th {
  text-align: left;
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--dim);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl th:last-child, .tbl td:last-child { width: 1%; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #111; }
.tbl .num { color: var(--muted); }
.tbl .model-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.tbl .model-org { color: var(--dim); font-size: 12px; font-family: var(--mono); }

/* ---------- models catalog ---------- */
.models-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.tabs-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-shrink: 1; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs .tab { white-space: nowrap; }
.tab .tab-n { font-family: var(--mono); font-size: 11px; margin-left: 6px; opacity: .55; }
.models-search { position: relative; flex: 0 0 240px; }
.models-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.models-search .input { padding: 9px 12px 9px 34px; font-size: 13px; }
.models-search .input::-webkit-search-cancel-button { filter: invert(1) grayscale(1); opacity: .5; }

.tbl .r { text-align: right; }
.tbl-models td { padding-top: 13px; padding-bottom: 13px; }
.tbl-models th:first-child, .tbl-models td:first-child { width: auto; }
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  transition: color .15s;
}
.th-sort:hover, th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--text); }
.th-sort::after { content: "\2195"; font-family: var(--mono); font-size: 11px; opacity: .35; }
th[aria-sort="ascending"] .th-sort::after { content: "\2191"; opacity: .9; }
th[aria-sort="descending"] .th-sort::after { content: "\2193"; opacity: .9; }

.m-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.m-name .badge { font-weight: 600; }
.m-sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.m-id {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--dim);
  font: inherit;
  transition: color .15s;
}
.m-id svg { opacity: .35; transition: opacity .15s; }
.m-id:hover, .m-id:focus-visible { color: var(--text); }
.m-id:hover svg, .m-id:focus-visible svg { opacity: 1; }
.m-price { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }
.m-list { font-family: var(--mono); font-size: 11.5px; color: var(--dim); text-decoration: line-through; margin-right: 8px; }
.tbl-models .num { color: var(--muted); }
.tbl-models tr.is-offline td { opacity: .45; }

.models-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  min-height: 32px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
}

@media (max-width: 720px) {
  .models-bar { flex-direction: column; align-items: stretch; }
  .models-search { flex-basis: auto; }
  .tbl-models { min-width: 0; }
  .tbl-models .col-ctx, .tbl-models .col-ex, .m-tier { display: none; }
  .tbl-models th, .tbl-models td { white-space: normal; padding-left: 12px; padding-right: 12px; }
  .m-id { word-break: break-all; text-align: left; }
  .m-list { display: block; margin: 0 0 2px; }
}

/* ---------- cards ---------- */
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.card { padding: 28px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card h3 { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin: 16px 0 8px; }
.card p { color: var(--muted); font-size: 14px; }
.card-ico {
  width: 38px; height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2);
}
.card-ico svg { width: 17px; height: 17px; stroke: var(--text); }



/* ---------- plans ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plan-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px; display: flex; flex-direction: column; gap: 14px;
}
.plan-card-best { border-color: var(--line-2); background: linear-gradient(180deg, #141414, #0b0b0b); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-label { font-family: var(--display); font-size: 17px; font-weight: 600; }
.plan-price { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -.02em; }
.plan-cur { font-size: 20px; color: var(--muted); font-weight: 500; }
.plan-when { font-size: 12.5px; color: var(--dim); margin-top: -8px; }
.plan-limits { list-style: none; display: flex; flex-direction: column; gap: 7px; margin: 4px 0 8px; }
.plan-limits li { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-left: 14px; position: relative; }
.plan-limits li::before { content: "›"; position: absolute; left: 0; color: var(--dim); }
.plan-card .btn { margin-top: auto; }

@media (max-width: 1020px) { .plans { grid-template-columns: 1fr; } }

.plan-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 18px 20px; margin-bottom: 14px;
  background: linear-gradient(180deg, #141414, #0b0b0b);
}
.plan-strip-title { font-family: var(--display); font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.plan-strip-sub { font-size: 12.5px; color: var(--dim); margin-top: 4px; }
.plan-strip-right { text-align: right; }
.plan-strip-time { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- free rotation ---------- */
.free-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; align-items: stretch; }
.free-card { padding: 36px; display: flex; flex-direction: column; gap: 22px; }
.free-models { display: flex; flex-direction: column; gap: 12px; }
.free-model {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 16px 18px;
  background: var(--panel-2);
}
.free-model b { font-size: 15px; display: block; }
.free-price { text-align: right; font-family: var(--mono); }
.free-price b { color: var(--white); font-size: 16px; }

.cd-card { padding: 36px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 24px; background: linear-gradient(180deg, #101010, #0a0a0a); }
.cd { display: flex; gap: 10px; width: 100%; }
.cd-cell {
  flex: 1;
  text-align: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 18px 10px 14px;
  background: #0a0a0a;
}
.cd-cell b { display: block; font-family: var(--mono); font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.cd-cell span { font-family: var(--sans); font-size: 10.5px; font-weight: 600; color: var(--dim); }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { padding: 28px; position: relative; }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-block;
  margin-bottom: 18px;
}
.step h3 { font-family: var(--display); font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 13.5px; }

/* ---------- code block / tabs ---------- */
.tabs { display: flex; gap: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 4px; background: var(--panel); width: max-content; }
.tab {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--dim);
  transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--white); color: #000; }

.code { background: #0a0a0a; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--dim);
}
.code pre {
  padding: 20px 22px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  color: #d4d4d4;
}

.copy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--mono); font-size: 12.5px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 7px 10px;
  min-height: 32px;
  transition: all .15s;
}
.copy-btn:hover { color: var(--text); border-color: #4a4a4a; }

/* ---------- admin: FunPay auto-delivery bar ---------- */
.panel-body.delivery { display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); }
.delivery-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.delivery-row .label { margin: 0; white-space: nowrap; }
.delivery-row .input { flex: 1; min-width: 260px; padding: 8px 12px; font-size: 12.5px; }
.delivery-count { font-size: 12px; color: var(--dim); white-space: nowrap; }
.delivery-count.over { color: var(--bg); background: var(--white); padding: 3px 8px; border-radius: 6px; font-weight: 600; }

/* ---------- agent installers ---------- */
.agent-setup { display: flex; flex-direction: column; gap: 18px; }
.agent-body { display: flex; flex-direction: column; gap: 18px; }
.agent-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.agent-os .tab { padding: 6px 12px; font-size: 12px; }
.agent-cmd pre { white-space: pre; font-size: 13.5px; color: var(--text); }
.agent-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.agent-steps li { position: relative; padding-left: 18px; color: var(--muted); font-size: 14px; }
.agent-steps li::before { content: "\203A"; position: absolute; left: 2px; color: var(--dim); }
.agent-steps b { color: var(--text); font-weight: 600; }
.agent-setup a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.ic {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  background: #111;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}
.agent-foot { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--dim); padding-top: 14px; border-top: 1px solid var(--line); }
.agent-foot .ic { white-space: normal; word-break: break-all; }
.agent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.agent-field { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); padding: 14px 16px; min-width: 0; }
.agent-field .label { margin-bottom: 8px; }
.agent-copy { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.agent-copy code { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-field small { display: block; margin-top: 6px; font-size: 11.5px; color: var(--dim); }
.agent-ids-head { display: flex; align-items: baseline; gap: 10px; font-size: 11.5px; }
.agent-ids-head .label { margin-bottom: 0; }
.agent-ids { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 4px 9px;
  transition: color .15s, border-color .15s;
}
.agent-id:hover { color: var(--text); border-color: #4a4a4a; }
@media (max-width: 720px) {
  .agent-grid { grid-template-columns: 1fr; }
  .agent-bar { flex-direction: column; align-items: stretch; }
  .agent-os { width: auto; }
  .agent-os .tab { flex: 1; }
}

/* ---------- faq ---------- */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 18px;
  color: var(--dim);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-a { overflow: hidden; }
.faq .faq-a p { color: var(--muted); padding: 0 0 22px; max-width: 640px; font-size: 14.5px; }

/* ---------- cta band ---------- */
.cta-band { text-align: center; padding: 120px 24px; border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.cta-band::before {
  content: "";
  position: absolute;
  bottom: -260px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 420px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.07), transparent 65%);
  pointer-events: none;
}
.cta-band h2 { font-family: var(--display); font-size: clamp(32px, 5vw, 54px); font-weight: 450; letter-spacing: -.02em; line-height: 1.06; margin-bottom: 16px; }
.cta-band p { color: var(--muted); margin-bottom: 32px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 80px 0 48px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 56px; }
.foot-grid h4 { font-family: var(--sans); font-size: 11.5px; font-weight: 600; color: var(--dim); margin-bottom: 16px; }
.foot-grid ul { list-style: none; }
.foot-grid li { margin-bottom: 10px; }
.foot-grid ul a { font-size: 13.5px; color: var(--muted); transition: color .15s; }
.foot-grid ul a:hover { color: var(--text); }
.foot-brand p { color: var(--dim); font-size: 13px; margin: 14px 0 18px; max-width: 280px; }
.foot-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-family: var(--sans); font-size: 12px; color: var(--dim);
}

/* ---------- toast ---------- */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--white);
  color: #000;
  font-size: 13.5px;
  font-weight: 600;
  padding: 13px 18px;
  border-radius: 9px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: toast-in .25s cubic-bezier(.2,.9,.3,1.2);
  display: flex; align-items: center; gap: 10px;
  max-width: 360px;
}
.toast.err { background: #111; color: #fff; border: 1px solid var(--line-2); }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
.toast.out { animation: toast-out .2s forwards; }
@keyframes toast-out { to { transform: translateY(8px); opacity: 0; } }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal.open { display: flex; }
.modal-card {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  padding: 28px;
  animation: modal-in .2s cubic-bezier(.2,.9,.3,1.1);
  max-height: 85vh;
  overflow-y: auto;
}
@keyframes modal-in { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-card h3 { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.modal-card .modal-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-family: var(--sans); font-size: 11.5px; font-weight: 600; color: var(--dim); margin-bottom: 8px; }
.input, .select, textarea.input {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .15s;
}
.input:focus, .select:focus { border-color: #8a8a8a; }
a:focus-visible, button:focus-visible, summary:focus-visible, .input:focus-visible, .select:focus-visible {
  outline: 2px solid var(--white); outline-offset: 2px;
}
.input::placeholder { color: #7d7d7d; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input-row { display: flex; gap: 10px; }
.input-row .input { flex: 1; }

/* kill ugly native number spinners */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 2px 6px; color: var(--muted); background: #0a0a0a; }

/* switch */
.switch { position: relative; width: 36px; height: 20px; display: inline-block; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0;
  background: #1c1c1c;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: background .15s;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #777;
  border-radius: 50%;
  transition: all .15s;
}
.switch input:checked + i { background: var(--white); border-color: var(--white); }
.switch input:checked + i::after { left: 18px; background: #000; }

/* ---------- app shell (dashboard / admin) ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg);
}
.side-brand { padding: 4px 10px 20px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 500;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  transition: all .13s;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
}
.side-link svg { width: 15px; height: 15px; stroke: currentColor; flex-shrink: 0; }
.side-link:hover { color: var(--text); background: #101010; }
.side-link.active { color: var(--text); background: #141414; border-color: var(--line); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.side-tag {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600;
  color: var(--dim); padding: 12px 12px 6px;
}

.main { min-width: 0; }
.topbar {
  height: 60px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
  background: rgba(5,5,5,.85);
  backdrop-filter: blur(12px);
}
.topbar-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #3a3a3a, #141414);
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-family: var(--mono);
}
.page { padding: 32px 28px 64px; max-width: 1080px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: view-in .25s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

.page-head { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.stat-card .stat-label { font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--dim); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; min-height: 34px; }
.stat-card .stat-value { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.stat-card .stat-sub { font-size: 12px; color: var(--dim); margin-top: 6px; }

.panel { margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-title { font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: -.005em; display: flex; align-items: center; gap: 10px; }
.panel-body { padding: 20px; }
.panel-body.flush { padding: 0; overflow-x: auto; }   /* a wide table scrolls inside its panel, never past it */
.panel-body.flush .tbl td, .panel-body.flush .tbl th { padding-left: 14px; padding-right: 14px; }
.panel-body.flush .tbl td:first-child, .panel-body.flush .tbl th:first-child { padding-left: 20px; }
.panel-body.flush .tbl td:last-child, .panel-body.flush .tbl th:last-child { padding-right: 20px; }

/* bar chart */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 46px; background: #242424; border-radius: 4px 4px 0 0; transition: background .15s; min-height: 4px; }
.bar-col:hover .bar { background: #4a4a4a; }
.bar.hi { background: #e8e8e8; }
.bar-lbl { font-family: var(--sans); font-size: 10px; font-weight: 500; color: var(--dim); }

.meter { height: 4px; background: #1a1a1a; border-radius: 2px; overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 4px; background: var(--white); border-radius: 2px; transition: width .3s ease; }
.share { display: flex; align-items: center; gap: 10px; }
.share .meter { width: 80px; margin-top: 0; flex-shrink: 0; }

.key-row { display: flex; align-items: center; gap: 12px; }
.key-val { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: .02em; }

.empty { text-align: center; padding: 48px 20px; color: var(--dim); font-size: 13.5px; }

.banner {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 20px;
}
.banner b { color: var(--text); }

/* ---------- site mode: the server writes <html data-mode="plans"> while only plans are sold
   (pricing.json api_sales: false); pay-per-token wording and prices step aside ---------- */
[data-mode="plans"] .payg-only { display: none !important; }
html:not([data-mode="plans"]) .plans-only { display: none !important; }
[data-mode="plans"] .tbl-models .col-price, [data-mode="plans"] .tbl-models .col-ex { display: none; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track, body, .view.active, .toast, .modal-card { animation: none; }
}
/* stagger children inside grids */
.grid-2 .reveal:nth-child(2), .grid-3 .reveal:nth-child(2), .grid-4 .reveal:nth-child(2), .steps .reveal:nth-child(2) { transition-delay: .08s; }
.grid-3 .reveal:nth-child(3), .grid-4 .reveal:nth-child(3), .steps .reveal:nth-child(3) { transition-delay: .16s; }
.grid-4 .reveal:nth-child(4) { transition-delay: .24s; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .free-grid { grid-template-columns: 1fr; }
  .grid-4, .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .steps { grid-template-columns: 1fr 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .stat { border-top: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-top: none; }
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 24px 16px;
    background: rgba(5,5,5,.96); border-bottom: 1px solid var(--line);
  }
  .nav.open .nav-links { display: flex; }
  .nav.open { background: rgba(5,5,5,.96); }
  .nav-links a { padding: 12px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-cta .btn-ghost { display: none; }
  .code-frame { padding: 20px; }
  .cta-band { padding: 80px 24px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .topbar { padding: 0 16px; }
  .grid-2, .grid-3, .steps, .stat-grid { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  /* sidebar becomes one horizontally scrolling strip */
  .side {
    position: static; height: auto;
    flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 2px;
    overflow-x: auto; scrollbar-width: none;
    padding: 10px 12px;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .side::-webkit-scrollbar { display: none; }
  .side-brand { flex-shrink: 0; margin: 0 6px 0 0; padding: 4px 14px 4px 4px; border-bottom: none; border-right: 1px solid var(--line); }
  .side-link { width: auto; flex-shrink: 0; white-space: nowrap; padding: 8px 10px; }
  .side-foot { flex-shrink: 0; display: flex; gap: 2px; margin: 0 0 0 6px; padding: 0 0 0 6px; border-top: none; border-left: 1px solid var(--line); }
  .side-tag { display: none; }
  .page { padding: 20px 16px 48px; }
  .cd-cell { min-width: 60px; }
  .hero { padding-top: calc(var(--nav-h) + 64px); padding-bottom: 72px; }
  .section { padding: 80px 0; }
}
