:root {
  --bg: #070b12;
  --bg-elevated: #0d1420;
  --bg-card: #111a28;
  --border: rgba(120, 180, 255, 0.12);
  --text: #e8edf5;
  --text-muted: #8b9cb3;
  --accent: #3ee8c5;
  --accent-2: #5b9dff;
  --accent-warm: #ffb347;
  --glow: rgba(62, 232, 197, 0.35);
  --radius: 14px;
  --font-sans: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(62, 232, 197, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(91, 157, 255, 0.1), transparent),
    radial-gradient(ellipse 50% 30% at 0% 100%, rgba(255, 179, 71, 0.06), transparent),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #6ff5d8; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(7, 11, 18, 0.85);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a:hover { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2bc4a8);
  color: #041210;
  box-shadow: 0 0 24px var(--glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 36px var(--glow);
  color: #041210;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero */
.hero {
  padding: 80px 0 64px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(62, 232, 197, 0.08);
  border: 1px solid rgba(62, 232, 197, 0.25);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 36px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.hero-img {
  width: 100%;
  max-width: 720px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  margin: 0 auto;
  display: block;
}

/* Quote strip */
.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 48px 0;
}

.quote-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.quote-card blockquote {
  font-size: 0.95rem;
  color: var(--text);
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.5;
}

.quote-card cite {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: normal;
}

/* Section */
section {
  padding: 64px 0;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-desc {
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 40px;
}

/* Flow diagram */
.flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 48px;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.flow-arrow {
  color: var(--accent);
  font-size: 1.2rem;
}

/* Primitives */
.primitives {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.primitive {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.primitive:hover {
  border-color: rgba(62, 232, 197, 0.4);
  transform: translateY(-2px);
}

.primitive .icon {
  font-size: 1.75rem;
  margin-bottom: 10px;
}

.primitive h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.primitive p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Pattern cards */
.patterns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.pattern-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pattern-card:hover {
  border-color: rgba(91, 157, 255, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pattern-card .tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 12px;
}

.pattern-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.pattern-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 16px;
}

.pattern-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pattern-card .link {
  font-weight: 600;
  font-size: 0.88rem;
}

/* Tools */
.tools {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.tool-pill {
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}

.tool-pill.grok { border-color: rgba(62, 232, 197, 0.3); color: var(--accent); }
.tool-pill.claude { border-color: rgba(255, 179, 71, 0.3); color: var(--accent-warm); }
.tool-pill.codex { border-color: rgba(91, 157, 255, 0.3); color: var(--accent-2); }

/* Code block */
.code-block {
  background: #050810;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 32px;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.code-dots span:first-child { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #febc2e; }
.code-dots span:nth-child(3) { background: #28c840; }

.code-block pre {
  padding: 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #c5d4e8;
}

.code-block .cmd { color: var(--accent); }
.code-block .flag { color: var(--accent-2); }
.code-block .comment { color: #5a6b82; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.stat {
  text-align: center;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* CTA */
.cta {
  text-align: center;
  padding: 80px 24px;
  margin: 64px 0 0;
  background: linear-gradient(180deg, transparent, rgba(62, 232, 197, 0.04));
  border-top: 1px solid var(--border);
}

.cta h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.cta p {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.footer {
  padding: 32px 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 48px 0 40px; }
  .flow-arrow { display: none; }
}

/* === Interactive widgets (v1.4 site upgrade) === */
.interactive {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 24px 0;
}

.symptom-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.symptom-pill {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.symptom-pill:hover { border-color: var(--accent); color: var(--text); }
.symptom-pill.active {
  background: rgba(62, 232, 197, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.reco-card {
  margin-top: 16px;
  padding: 16px 18px;
  background: #050810;
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-size: 0.9rem;
}

.reco-card .cmd {
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  margin: 16px 0;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.check-item input { accent-color: var(--accent); }

.live-score {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 10px;
}

.live-score .big {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.live-score .meta { font-size: 0.85rem; }

.copy-btn {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(62,232,197,0.1);
  color: var(--accent);
  border: 1px solid rgba(62,232,197,0.3);
  cursor: pointer;
  margin-left: 8px;
}

.copy-btn:hover { background: rgba(62,232,197,0.2); }