/* ============================================================
   Open LLM — shared styles, animations & code theme
   ============================================================ */

:root {
  --bg: #07080a;
  --bg-soft: #0d0f13;
  --panel: #111318;
  --border: #22252c;
  --border-soft: #191c22;
  --text: #f4f6f8;
  --muted: #8b929c;
  --muted-dim: #5b616b;
  --accent: #d4ff33;
  --accent-dim: #a9cc1f;
  --accent-glow: rgba(212, 255, 51, 0.25);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #07080a;
}

/* ---------- Ambient animated background ---------- */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60rem 60rem at 12% -5%, rgba(212, 255, 51, 0.10), transparent 60%),
    radial-gradient(50rem 50rem at 100% 0%, rgba(80, 120, 255, 0.08), transparent 55%),
    var(--bg);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  animation: gridDrift 22s linear infinite;
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 54px 54px, 54px 54px; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .bg-grid { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ---------- Hero gradient text shimmer ---------- */
.shimmer {
  background: linear-gradient(100deg, #ffffff 20%, var(--accent) 45%, #ffffff 70%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmerMove 6s linear infinite;
}
@keyframes shimmerMove {
  to { background-position: 220% center; }
}

/* ---------- Glow / card hover ---------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1),
              border-color 0.35s ease, box-shadow 0.35s ease;
  will-change: transform;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 255, 51, 0.4);
  box-shadow: 0 0 0 1px rgba(212,255,51,0.15), 0 18px 50px -20px var(--accent-glow);
}

/* Accent button pulse */
.btn-accent {
  position: relative;
  background: var(--accent);
  color: #07080a;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px var(--accent-glow), 0 0 22px 0 var(--accent-glow);
}
.btn-accent:active { transform: translateY(0); }

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: rgba(212,255,51,0.06);
  transform: translateY(-2px);
}

/* ---------- Provider logos ---------- */
.provider {
  filter: grayscale(1) opacity(0.55);
  transition: filter 0.35s ease, transform 0.35s ease;
}
.provider:hover {
  filter: grayscale(0) opacity(1);
  transform: translateY(-4px) scale(1.06);
}

/* ---------- Count-up stat ---------- */
.stat-num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* ---------- Code block (VS Code Dark+ inspired) ---------- */
.code-shell {
  background: #0b0d11;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.code-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.015);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.7;
  tab-size: 4;
}
pre code { white-space: pre; }

/* Syntax token colors */
.tok-kw  { color: #c586c0; }   /* keyword: from, import, def */
.tok-fn  { color: #dcdcaa; }   /* function / method */
.tok-str { color: #6ee7a8; }   /* strings (green) */
.tok-num { color: #b5cea8; }   /* numbers */
.tok-com { color: #6a7380; font-style: italic; } /* comments */
.tok-var { color: #9cdcfe; }   /* variables / identifiers */
.tok-cls { color: #4ec9b0; }   /* class names */
.tok-punc{ color: #cfd3da; }   /* punctuation */
.tok-op  { color: #d4ff33; }   /* operators */

/* Copy button */
.copy-btn {
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }

/* ---------- Navbar ---------- */
.nav-link {
  position: relative;
  color: var(--muted);
  transition: color 0.25s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  height: 2px; width: 0;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(0.22,1,0.36,1);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-scrolled {
  background: rgba(7, 8, 10, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

/* ---------- Badges ---------- */
.badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.badge-free { color: var(--accent); background: rgba(212,255,51,0.10); border-color: rgba(212,255,51,0.3); }
.badge-paid { color: #7cc5ff; background: rgba(124,197,255,0.10); border-color: rgba(124,197,255,0.3); }
.badge-kind { color: var(--muted); background: rgba(255,255,255,0.04); border-color: var(--border); }

/* Floating orbit animation for hero visual */
.float { animation: floaty 7s ease-in-out infinite; }
.float-2 { animation: floaty 9s ease-in-out infinite; animation-delay: -2s; }
@keyframes floaty {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Marquee for provider strip */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* scrollbar */
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #22252c; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #313641; }

/* ---------- Provider key toggles ---------- */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #2a2e36;
  border: 1px solid var(--border);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.toggle-switch input:checked ~ .toggle-thumb {
  transform: translateX(20px);
  background: #07080a;
}
.provider-key-card {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.provider-key-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.provider-key-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.provider-key-input:focus {
  border-color: var(--accent);
}
.provider-key-input::placeholder {
  color: var(--muted-dim);
}
.provider-key-input.is-saved {
  color: var(--muted);
}
