:root {
  --bg-primary: #0d0f14;
  --bg-secondary: #13161e;
  --bg-card: #1a1d28;
  --bg-card-hover: #1f2333;
  --border: #2a2d3e;
  --accent: #76b900;
  --accent-dim: rgba(118,185,0,0.15);
  --accent-glow: rgba(118,185,0,0.4);
  --text: #e8eaf0;
  --text-muted: #7a7f96;
  --reasoning: #1a1a2e;
  --reasoning-border: #4a3f7a;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--bg-primary); color: var(--text); font-family: 'Inter', sans-serif; margin: 0; }

/* ── Navbar ──────────────────────────────────────────────── */
.site-nav {
  background: rgba(13,15,20,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
  position: sticky; top: 0; z-index: 1000;
}
.site-nav .navbar-brand { color: var(--accent) !important; font-weight: 700; font-size: 1.2rem; }
.site-nav .nav-link { color: var(--text-muted) !important; transition: color .2s; font-size: .9rem; }
.site-nav .nav-link:hover { color: var(--text) !important; }
.btn-outline-accent {
  border: 1px solid var(--accent); color: var(--accent);
  background: transparent; border-radius: 6px; font-size: .85rem; padding: .35rem .9rem;
  transition: all .2s;
}
.btn-outline-accent:hover { background: var(--accent); color: #000; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  min-height: 72vh; display: flex; align-items: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(118,185,0,.12) 0%, transparent 70%),
              linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  padding: 5rem 0 4rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2376b900' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: .5;
}
.hero-badge {
  display: inline-block; background: var(--accent-dim); border: 1px solid var(--accent);
  color: var(--accent); border-radius: 999px; padding: .3rem .9rem; font-size: .8rem;
  font-weight: 600; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 1.5rem;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; line-height: 1.15; margin-bottom: 1.2rem; }
.hero h1 .accent { color: var(--accent); }
.hero p.lead { color: var(--text-muted); font-size: 1.15rem; max-width: 540px; line-height: 1.7; }
.hero-stats { display: flex; gap: 2rem; margin-top: 2.5rem; }
.stat { text-align: center; }
.stat-num { font-size: 2rem; font-weight: 700; color: var(--accent); display: block; }
.stat-lbl { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.hero-visual { position: relative; }
.orb {
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(118,185,0,.25) 0%, rgba(118,185,0,.05) 50%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.orb-inner {
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(118,185,0,.4) 0%, rgba(118,185,0,.1) 60%, transparent 80%);
  display: flex; align-items: center; justify-content: center; font-size: 5rem;
  animation: pulse 3s ease-in-out infinite reverse;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.06); opacity: 1; } }

/* ── Category sections ───────────────────────────────────── */
.models-section { padding: 5rem 0; }
.section-label {
  font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .5rem;
}
.section-title { font-size: 1.8rem; font-weight: 700; margin-bottom: .5rem; }
.section-desc { color: var(--text-muted); margin-bottom: 2.5rem; }

/* ── Model cards ─────────────────────────────────────────── */
.model-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.5rem; height: 100%; display: flex; flex-direction: column;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  position: relative; overflow: hidden;
}
.model-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .3s;
}
.model-card:hover { transform: translateY(-4px); border-color: rgba(118,185,0,.4); box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 0 0 1px rgba(118,185,0,.15); }
.model-card:hover::before { opacity: 1; }
.card-badge {
  display: inline-block; background: var(--accent-dim); border: 1px solid rgba(118,185,0,.3);
  color: var(--accent); border-radius: 6px; padding: .15rem .6rem; font-size: .72rem;
  font-weight: 600; margin-bottom: 1rem; width: fit-content;
}
.model-card h5 { font-size: 1rem; font-weight: 600; margin-bottom: .6rem; }
.model-card p { color: var(--text-muted); font-size: .87rem; line-height: 1.6; flex: 1; }
.btn-try {
  background: linear-gradient(135deg, var(--accent), #5a8f00); border: none;
  color: #000; font-weight: 600; padding: .55rem 1.4rem; border-radius: 8px;
  font-size: .85rem; transition: all .2s; text-decoration: none;
  display: inline-block; margin-top: 1rem; width: 100%; text-align: center;
}
.btn-try:hover { background: linear-gradient(135deg, #8fd400, var(--accent)); color: #000; transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }

/* Category divider */
.cat-divider {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; padding-top: 3rem;
}
.cat-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.cat-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-dim);
  border: 1px solid rgba(118,185,0,.3); display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 1rem; flex-shrink: 0;
}
.cat-name { font-size: 1rem; font-weight: 600; white-space: nowrap; }

/* ── Access section ──────────────────────────────────────── */
.access-section {
  padding: 5rem 0;
  background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(118,185,0,.07) 0%, transparent 70%);
}
.access-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
  padding: 3rem; text-align: center; max-width: 600px; margin: 0 auto;
}
.access-card h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: .75rem; }
.access-card p { color: var(--text-muted); margin-bottom: 2rem; line-height: 1.7; }
.input-group-access { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.input-email {
  background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: .75rem 1.2rem; font-size: .95rem; flex: 1; min-width: 240px;
  outline: none; transition: border-color .2s;
}
.input-email:focus { border-color: var(--accent); }
.input-email::placeholder { color: var(--text-muted); }
.btn-access {
  background: var(--accent); border: none; color: #000; font-weight: 600;
  padding: .75rem 2rem; border-radius: 10px; font-size: .95rem; cursor: pointer;
  transition: all .2s; white-space: nowrap;
}
.btn-access:hover { background: #8fd400; transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-access:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.success-msg { color: var(--accent); font-size: 1rem; margin-top: 1.25rem; display: none; }
.success-msg i { margin-right: .4rem; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { padding: 1.5rem 0; border-top: 1px solid var(--border); background: var(--bg-primary); }

/* ── Login page ──────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 60% 60% at 50% 40%, rgba(118,185,0,.1) 0%, transparent 70%);
}
.login-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
  padding: 2.5rem; width: 100%; max-width: 420px;
}
.login-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .4rem; }
.login-card .sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 2rem; }
.form-field { margin-bottom: 1.2rem; }
.form-field label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .5rem; color: var(--text-muted); }
.form-input {
  width: 100%; background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: .75rem 1rem; font-size: .95rem;
  outline: none; transition: border-color .2s;
}
.form-input:focus { border-color: var(--accent); }
.btn-login {
  width: 100%; background: linear-gradient(135deg, var(--accent), #5a8f00); border: none;
  color: #000; font-weight: 700; padding: .85rem; border-radius: 10px; font-size: 1rem;
  cursor: pointer; transition: all .2s; margin-top: .5rem;
}
.btn-login:hover { background: linear-gradient(135deg, #8fd400, var(--accent)); transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.alert-error {
  background: rgba(220,53,69,.15); border: 1px solid rgba(220,53,69,.4);
  color: #ff6b7a; border-radius: 10px; padding: .75rem 1rem; font-size: .87rem; margin-bottom: 1.2rem;
}

/* ── Playground page ─────────────────────────────────────── */
.pg-header {
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  padding: 1.2rem 0;
}
.pg-header .badge-model {
  background: var(--accent-dim); border: 1px solid rgba(118,185,0,.3);
  color: var(--accent); border-radius: 6px; padding: .2rem .7rem; font-size: .75rem; font-weight: 600;
}
.pg-body { padding: 2rem 0 4rem; min-height: calc(100vh - 200px); }
.pg-panel {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem;
}
.pg-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .75rem; }
.pg-textarea {
  width: 100%; background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 1rem; font-size: .95rem;
  font-family: 'Inter', sans-serif; resize: vertical; outline: none; transition: border-color .2s;
  min-height: 180px; line-height: 1.6;
}
.pg-textarea:focus { border-color: var(--accent); }
.btn-run {
  background: linear-gradient(135deg, var(--accent), #5a8f00); border: none;
  color: #000; font-weight: 700; padding: .8rem 2.5rem; border-radius: 10px;
  font-size: 1rem; cursor: pointer; transition: all .25s; margin-top: 1rem;
  display: flex; align-items: center; gap: .6rem;
}
.btn-run:hover:not(:disabled) { background: linear-gradient(135deg, #8fd400, var(--accent)); transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.btn-run:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.output-box {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.2rem; min-height: 180px; font-size: .92rem; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word; font-family: 'Inter', sans-serif;
}
.output-placeholder { color: var(--text-muted); font-style: italic; }
.output-image { max-width: 100%; border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,.6); margin-top: .5rem; }

/* Thinking block */
.thinking-block {
  background: var(--reasoning); border: 1px solid var(--reasoning-border);
  border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem;
  font-size: .85rem; color: #a89fd8; line-height: 1.7;
}
.thinking-toggle { cursor: pointer; user-select: none; color: #a89fd8; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.thinking-content { margin-top: .75rem; white-space: pre-wrap; font-family: 'JetBrains Mono', monospace; font-size: .8rem; }
.thinking-content.collapsed { display: none; }

/* Spinner */
.spinner-wrap { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 3rem; }
.ai-spinner { position: relative; width: 64px; height: 64px; }
.ai-spinner::before,.ai-spinner::after {
  content: ''; position: absolute; border-radius: 50%;
}
.ai-spinner::before {
  inset: 0; border: 3px solid var(--border);
}
.ai-spinner::after {
  inset: 0; border: 3px solid transparent; border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-dots { display: flex; gap: 6px; align-items: center; }
.spinner-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: dotbounce 1.2s ease-in-out infinite;
}
.spinner-dot:nth-child(2) { animation-delay: .2s; }
.spinner-dot:nth-child(3) { animation-delay: .4s; }
@keyframes dotbounce { 0%,80%,100% { transform: scale(.6); opacity:.4; } 40% { transform: scale(1.1); opacity:1; } }
.spinner-msg { color: var(--text-muted); font-size: .9rem; }

/* Token counter */
.retry-info { font-size: .78rem; color: var(--text-muted); margin-top: .5rem; }
