:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --ink: #0f172a;
  --ink-muted: #475569;
  --ink-faint: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}
.nav a { color: var(--ink-muted); font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--accent); text-decoration: none; }

.badge-privacy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Hero */
.hero {
  padding: 28px 0 18px;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.hero p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1rem;
  max-width: 720px;
}

/* Tool Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tabs {
  display: inline-flex;
  background: var(--surface-subtle);
  padding: 4px;
  border-radius: 9px;
  gap: 4px;
}
.tab-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
}
.tab-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn, .btn-secondary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.btn {
  background: var(--accent);
  color: #fff;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-subtle); text-decoration: none; }
.btn-ghost {
  background: var(--surface-subtle);
  color: var(--ink-muted);
  padding: 5px 10px;
  font-size: 0.8rem;
}
.btn-ghost:hover { background: #e2e8f0; color: var(--ink); }

.prompt-input {
  width: 100%;
  min-height: 180px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}
.prompt-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.metric {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.metric.primary {
  background: var(--accent-soft);
  border-color: #bfdbfe;
}
.metric-label {
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.metric-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}
.metric.primary .metric-value { color: var(--accent); }
.metric-sub {
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* Controls */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.field select, .field input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
.field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

/* Context Window Bar */
.context-wrap {
  margin-top: 16px;
}
.context-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.progress-track {
  height: 8px;
  background: var(--surface-subtle);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

/* Token Visualizer */
.token-viz {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: #fcfdff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  max-height: 220px;
  overflow-y: auto;
  word-break: break-word;
}
.tok {
  display: inline;
  padding: 1px 2px;
  border-radius: 3px;
  margin-right: 1px;
}
.tok-0 { background: #dbeafe; }
.tok-1 { background: #dcfce7; }
.tok-2 { background: #fef3c7; }
.tok-3 { background: #f3e8ff; }
.tok-4 { background: #ffe4e6; }

/* Table */
.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  background: var(--surface-subtle);
}
td.num, th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
tr.highlight-row {
  background: var(--accent-soft);
}
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--ink-muted);
}
.pill-best {
  background: var(--green-soft);
  color: var(--green);
}

/* Batch section */
.hidden { display: none !important; }
.notice-banner {
  background: var(--amber-soft);
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.86rem;
  margin-top: 12px;
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.price-card.featured {
  border: 2px solid var(--accent);
}
.price-amount {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  margin: 10px 0 4px;
}
.price-cycle {
  font-size: 0.86rem;
  color: var(--ink-faint);
  margin-bottom: 16px;
}
.price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.price-features li {
  padding: 6px 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}
.price-features li::before {
  content: "✓ ";
  color: var(--green);
  font-weight: 700;
}

/* Content / SEO prose */
.prose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}
.prose h2 {
  margin-top: 24px;
  margin-bottom: 10px;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  margin-top: 18px;
  margin-bottom: 6px;
  font-size: 1.05rem;
}
.prose p, .prose li {
  color: var(--ink-muted);
  font-size: 0.96rem;
}
.faq-item {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.faq-item:first-of-type { border-top: 0; }
.faq-item h3 { margin: 0 0 6px; color: var(--ink); }
.faq-item p { margin: 0; }

/* Model links grid */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}
.link-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--ink);
  transition: border-color 0.15s, transform 0.15s;
}
.link-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.link-card strong { display: block; font-size: 0.96rem; }
.link-card span { font-size: 0.82rem; color: var(--ink-faint); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 0 36px;
  margin-top: 32px;
  font-size: 0.86rem;
  color: var(--ink-faint);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links a { color: var(--ink-muted); }
