/**
 * api.bytario.com — premium B2B design system.
 * Matches the consumer site aesthetic with a more professional edge.
 */

:root {
  --bg: #07090c;
  --bg-elev: #0d1117;
  --bg-elev-2: #131a22;
  --fg: #f0f3f7;
  --fg-2: #c1c7d0;
  --muted: #9ca3af;
  --accent: #4f9eff;
  --accent-bright: #79b8ff;
  --accent-fg: #ffffff;
  --accent-glow: rgba(79, 158, 255, 0.4);
  --border: #e5e7eb;
  --success: #3fb950;
  --max-width: 960px;
  --radius: 10px;
  --radius-lg: 14px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; display: flex; flex-direction: column; }

a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { color: var(--accent-bright); text-decoration: underline; }

code, pre { font-family: var(--font-mono); font-size: 0.875rem; }

/* ─── Nav ───────────────────────────────────────────── */

nav.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 9, 12, 0.75);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

nav.top .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav.top .brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav.top .brand .badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

nav.top .links a {
  margin-left: 1.5rem;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 500;
}
nav.top .links a:hover { color: var(--accent-bright); text-decoration: none; }

/* ─── Main ──────────────────────────────────────────── */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  flex: 1;
  width: 100%;
}

/* ─── Hero ──────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  margin: 0 calc(-50vw + 50%);
  width: 100vw;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(circle 350px at 30% 40%, rgba(79, 158, 255, 0.18), transparent 60%),
    radial-gradient(circle 300px at 70% 50%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(circle 250px at 50% 80%, rgba(14, 165, 233, 0.10), transparent 60%);
  animation: aurora-api 14s ease-in-out infinite alternate;
  filter: blur(50px);
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(79, 158, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 158, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 70%);
  z-index: 0;
}

@keyframes aurora-api {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(20px, -15px) scale(1.03); }
  100% { transform: translate(-10px, 10px) scale(1.01); }
}

.hero > * { position: relative; z-index: 1; }

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(13, 17, 23, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #ffffff;
  max-width: 16ch;
  margin: 0 auto 1.25rem;
}

.hero .tagline {
  color: #9ca3af;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  max-width: 38rem;
  margin: 0 auto 2rem;
  line-height: 1.55;
}

/* ─── Buttons ───────────────────────────────────────── */

.cta-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  text-decoration: none;
  border: 1px solid var(--border);
}

.button.primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.button.primary:hover {
  background: #ffffff;
  color: #07090c;
  border-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

.button.ghost {
  background: transparent;
  color: #ffffff;
}
.button.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ffffff;
  transform: translateY(-1px);
  text-decoration: none;
}

/* ─── Value cards ───────────────────────────────────── */

.value-section {
  padding: 3.5rem 0;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.value-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.value-card:hover {
  border-color: rgba(79, 158, 255, 0.3);
  box-shadow: 0 4px 16px -4px rgba(79, 158, 255, 0.1);
}

.value-icon {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79, 158, 255, 0.12), rgba(139, 92, 246, 0.08));
  border: 1px solid var(--border);
  border-radius: 8px;
}

.value-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.value-card p {
  font-size: 0.88rem;
  color: #9ca3af;
  margin: 0;
  line-height: 1.5;
}

/* ─── Endpoints ─────────────────────────────────────── */

.endpoints-section {
  padding: 2rem 0 3rem;
}

.endpoints-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.family-group {
  margin-bottom: 1.5rem;
}

.family-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--family-color, var(--accent));
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.family-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--family-color, var(--accent));
  box-shadow: 0 0 6px var(--family-color, var(--accent));
}

.endpoint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.5rem;
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #d1d5db;
  padding: 0.55rem 0.85rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.15s ease;
}

.endpoint:hover {
  border-color: rgba(79, 158, 255, 0.3);
}

.method {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(79, 158, 255, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ─── Quickstart ────────────────────────────────────── */

.quickstart-section {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
}

.quickstart-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  color: #d1d5db;
}

.quickstart-section p {
  color: #9ca3af;
  font-size: 0.92rem;
}

/* ─── Footer ────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem 2.5rem;
  text-align: center;
  font-size: 0.85rem;
}

footer nav { margin-bottom: 0.65rem; }
footer nav a { margin: 0 0.6rem; color: #ffffff; font-weight: 500; }
footer nav a:hover { color: var(--accent-bright); }
footer p { color: var(--muted); }

/* ─── Billing toggle (pricing page) ──────────────── */

.billing-toggle {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.toggle-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.toggle-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
}
.save-badge {
  display: inline-block;
  background: #1a3a2a;
  color: #4ade80;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ─── Pricing cards ──────────────────────────────── */

/* ─── Pricing grid: 3 top + 2 bottom centered ──── */

.tier-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.tier-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 66.666%;
  margin: 0 auto;
}

@media (max-width: 800px) {
  .tier-row-3 { grid-template-columns: 1fr; }
  .tier-row-2 { grid-template-columns: 1fr; max-width: 100%; }
}

.tier-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  position: relative;
  overflow: hidden;
}

.tier-card:hover {
  border-color: rgba(79, 158, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(79, 158, 255, 0.1);
}

.tier-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(79, 158, 255, 0.12);
}

/* "Most popular" badge */
.tier-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  border-radius: 0 var(--radius-lg) 0 8px;
}

.tier-header {
  margin-bottom: 0.75rem;
}

.tier-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: #ffffff;
  border: none;
  padding: 0;
  background: none;
  display: block;
}

.tier-for {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.tier-card .price {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0.25rem 0 0.15rem;
  color: #ffffff;
  line-height: 1.1;
}

.tier-card .price small {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}

.tier-card .price .billed-note {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--fg-2);
  margin-top: 2px;
}

.tier-card .quota {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.tier-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  flex: 1;
}

.tier-card li {
  font-size: 0.82rem;
  padding: 0.3rem 0;
  color: #d1d5db;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.tier-card li::before {
  content: '\2713';
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.tier-card .button {
  display: block;
  text-align: center;
  background: transparent;
  color: #ffffff;
  padding: 0.7rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
  margin-top: auto;
}

.tier-card .button:hover {
  background: #ffffff;
  color: #07090c;
  border-color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.tier-card.featured .button {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.tier-card.featured .button:hover {
  background: #ffffff;
  color: #07090c;
  border-color: #ffffff;
}

/* ─── FAQ ─────────────────────────────────────────── */

.faq h3 { font-size: 0.95rem; margin-top: 1.5rem; margin-bottom: 0.25rem; color: #ffffff; }
.faq p { color: #9ca3af; font-size: 0.9rem; }

/* ─── Docs ───────────────────────────────────────── */

h2 {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 3.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

main > h3,
main > .tagline + p + h2 {
  border-top: none;
}

/* Endpoint doc sections */
main > h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  font-family: var(--font-mono);
  margin: 2.5rem 0 0.5rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  display: block;
  overflow-x: auto;
}

main > h3 + p {
  color: #9ca3af;
  font-size: 0.9rem;
  margin: 0.5rem 0 0.75rem;
}

main > p {
  color: #d1d5db;
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

main > pre {
  margin: 0.75rem 0 1.5rem;
}

main > .tagline {
  color: #9ca3af;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

main > .tagline + p {
  margin-bottom: 2rem;
}

/* Tables (rate limits etc.) */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.88rem;
}

th {
  text-align: left;
  color: #ffffff;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-bottom: 2px solid var(--border);
  background: var(--bg-elev);
}

td {
  padding: 0.55rem 1rem;
  color: #d1d5db;
  border-bottom: 1px solid var(--border);
}

tr:hover td {
  background: rgba(79, 158, 255, 0.03);
}

code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: rgba(79, 158, 255, 0.08);
  border: 1px solid rgba(79, 158, 255, 0.15);
  border-radius: 5px;
  padding: 0.2rem 0.45rem;
  color: var(--accent-bright);
  white-space: nowrap;
  line-height: 1;
  display: inline-block;
  vertical-align: baseline;
  margin: 1px 0;
}

pre code {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  color: #d1d5db;
  font-size: 0.82rem;
  white-space: pre;
  display: inline;
  margin: 0;
  line-height: inherit;
}

/* ─── Prose (legal) ──────────────────────────────── */

main.prose {
  max-width: 720px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
}
main.prose h1 { font-size: 2rem; margin-bottom: 0.5rem; color: #ffffff; }
main.prose h2 { font-size: 1.2rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
main.prose p, main.prose ul { margin: 0.75rem 0; color: #d1d5db; }
main.prose ul { padding-left: 1.25rem; }
main.prose li { margin: 0.35rem 0; }
main.prose a { text-decoration: underline; text-underline-offset: 2px; }
main.prose em { opacity: 0.7; font-style: normal; font-size: 0.85rem; }

/* ─── Mobile ─────────────────────────────────────── */

@media (max-width: 640px) {
  .value-grid { grid-template-columns: 1fr; }
  .endpoint-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 1.25rem 2rem; }
  nav.top .links a { margin-left: 0.8rem; font-size: 0.85rem; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
