/* ErgoAI — marketing, docs & auth pages */
:root {
  --bg: #08090c;
  --bg-2: #0e1015;
  --panel: #12151c;
  --panel-2: #181c25;
  --line: #222734;
  --line-2: #2d3343;
  --text: #e9ecf3;
  --muted: #9aa3b5;
  --dim: #6b7386;
  --accent: #5eead4;
  --accent-2: #a78bfa;
  --accent-ink: #04201c;
  --warn: #fbbf24;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 14px;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
code, pre, kbd { font-family: var(--mono); }
.wrap { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text); font: 600 14px var(--font); cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: #3a4256; background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 0 0 1px rgba(94, 234, 212, .25), 0 8px 30px -8px rgba(94, 234, 212, .55);
}
.btn.primary:hover { background: #7ff0de; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel); }
.btn.lg { height: 50px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(140%) blur(14px);
  background: rgba(8, 9, 12, .72); border-bottom: 1px solid rgba(34, 39, 52, .6);
}
.nav .wrap { display: flex; align-items: center; height: 64px; gap: 28px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; font-size: 18px; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent));
  color: #050608; font: 800 15px var(--mono);
}
.nav-links { display: flex; gap: 22px; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-cta { margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 760px) { .nav-links { display: none; } }

/* Hero */
.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -40% -20% auto; height: 900px; pointer-events: none;
  background:
    radial-gradient(600px 300px at 30% 30%, rgba(94, 234, 212, .13), transparent 70%),
    radial-gradient(500px 280px at 75% 20%, rgba(167, 139, 250, .12), transparent 70%);
}
.grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 30%, transparent 75%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 980px) { .hero-inner { grid-template-columns: 1fr; } }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(18, 21, 28, .8); color: var(--muted); font-size: 13px;
}
.pill b { background: rgba(94, 234, 212, .14); color: var(--accent); padding: 2px 8px; border-radius: 999px; font: 600 11px var(--mono); letter-spacing: .04em; }
h1 {
  font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -.045em; margin: 22px 0 20px; font-weight: 700;
}
h1 .grad { background: linear-gradient(100deg, var(--accent) 0%, #c4b5fd 60%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 19px; color: var(--muted); max-width: 560px; margin: 0 0 32px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; color: var(--dim); font-size: 13px; font-family: var(--mono); }

/* Hero demo card */
.demo {
  position: relative; border: 1px solid var(--line-2); border-radius: 18px; background: linear-gradient(180deg, #11141b, #0c0e13);
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .02) inset; overflow: hidden;
}
.demo-top { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--dim); }
.dots { display: flex; gap: 6px; } .dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a2f3c; }
.demo-top .speed { margin-left: auto; color: var(--accent); }
.demo-body { padding: 18px; display: grid; gap: 14px; font-size: 14px; }
.demo-user { align-self: end; justify-self: end; background: var(--panel-2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 12px 12px 4px 12px; max-width: 85%; }
.demo-think { border-left: 2px solid var(--accent-2); padding: 2px 0 2px 12px; color: var(--muted); font-size: 13px; font-style: italic; }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(255, 255, 255, .015); }
.plan h5 { margin: 0 0 8px; font: 600 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.plan li { list-style: none; display: flex; gap: 10px; align-items: center; padding: 3px 0; font-size: 13.5px; }
.plan ul { margin: 0; padding: 0; }
.chk { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--line-2); flex: none; display: grid; place-items: center; }
.chk.done { background: var(--accent); border-color: var(--accent); }
.chk.done::after { content: ''; width: 7px; height: 4px; border-left: 2px solid #042; border-bottom: 2px solid #042; transform: rotate(-45deg) translate(1px, -1px); }
.chk.run { border-color: var(--accent); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tool-line { display: flex; gap: 10px; align-items: center; font: 12.5px var(--mono); color: var(--muted); }
.tool-line .tag { color: var(--accent); background: rgba(94, 234, 212, .08); border: 1px solid rgba(94, 234, 212, .2); padding: 1px 7px; border-radius: 6px; }
.typing::after { content: '▍'; color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Sections */
section { padding: 88px 0; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.eyebrow { font: 600 12px var(--mono); color: var(--accent); letter-spacing: .12em; text-transform: uppercase; }
h2 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.035em; line-height: 1.08; margin: 12px 0 14px; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }

.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 28px 24px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 28px; letter-spacing: -.03em; font-family: var(--mono); }
.stat span { color: var(--muted); font-size: 14px; }
@media (max-width: 760px) { .stats .wrap { grid-template-columns: 1fr 1fr; } .stat:nth-child(3) { border-left: 0; } }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature { background: var(--bg-2); padding: 28px; }
.feature .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); margin-bottom: 18px; color: var(--accent); }
.feature h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.01em; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr; } }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mode { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); }
.mode .k { font: 600 12px var(--mono); color: var(--accent-2); }
.mode h3 { margin: 8px 0 10px; font-size: 22px; letter-spacing: -.02em; }
.mode p { color: var(--muted); margin: 0 0 16px; font-size: 14.5px; }
.mode .ex { font: 13px var(--mono); color: var(--text); background: var(--bg); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; }
@media (max-width: 900px) { .modes { grid-template-columns: 1fr; } }

.dev { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .dev { grid-template-columns: 1fr; } }
.check-list { list-style: none; padding: 0; margin: 24px 0 28px; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; color: var(--muted); }
.check-list li::before { content: '→'; color: var(--accent); font-family: var(--mono); }
.code {
  background: #0a0c10; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.code-tabs { display: flex; border-bottom: 1px solid var(--line); }
.code-tabs button { background: none; border: 0; color: var(--dim); font: 500 12.5px var(--mono); padding: 11px 16px; cursor: pointer; border-bottom: 2px solid transparent; }
.code-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.code pre { margin: 0; padding: 18px 20px; font-size: 13px; line-height: 1.65; overflow-x: auto; color: #cdd3df; }
.code .s { color: #86efac; } .code .k { color: #c4b5fd; } .code .c { color: #5b6478; } .code .n { color: #fbbf24; }

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.price { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: var(--bg-2); display: flex; flex-direction: column; }
.price.hot { border-color: rgba(94, 234, 212, .5); background: linear-gradient(180deg, rgba(94, 234, 212, .06), var(--bg-2) 40%); position: relative; }
.price.hot::before { content: 'Most popular'; position: absolute; top: -11px; left: 24px; background: var(--accent); color: var(--accent-ink); font: 700 11px var(--mono); padding: 3px 9px; border-radius: 6px; }
.price h3 { margin: 0; font-size: 18px; }
.price .amt { font-size: 44px; font-weight: 700; letter-spacing: -.04em; margin: 10px 0 2px; }
.price .amt small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.price .desc { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.price ul { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; font-size: 14.5px; flex: 1; }
.price li { display: flex; gap: 10px; }
.price li::before { content: '✓'; color: var(--accent); font-weight: 700; }
@media (max-width: 900px) { .pricing { grid-template-columns: 1fr; } }

.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 16.5px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: '+'; color: var(--dim); font: 20px var(--mono); }
.faq details[open] summary::after { content: '–'; }
.faq p { color: var(--muted); margin: 12px 0 0; }

.cta-band { text-align: center; border: 1px solid var(--line); border-radius: 22px; padding: 64px 24px; background: radial-gradient(500px 200px at 50% 0%, rgba(94, 234, 212, .12), transparent), var(--bg-2); }
.cta-band h2 { margin-top: 0; }
.cta-band p { color: var(--muted); margin: 0 0 28px; }

footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--dim); font-size: 13.5px; }
footer .wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
footer nav { display: flex; gap: 18px; margin-left: auto; }
footer a:hover { color: var(--text); }
.disclaimer { width: 100%; font-size: 12px; color: #555d6f; margin-top: 8px; }

/* Docs */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 48px; padding: 48px 0 96px; }
.docs aside { position: sticky; top: 88px; align-self: start; display: grid; gap: 4px; font-size: 14px; }
.docs aside a { color: var(--muted); padding: 6px 10px; border-radius: 8px; }
.docs aside a:hover { color: var(--text); background: var(--panel); }
.docs aside h6 { margin: 14px 10px 6px; font: 600 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.docs article { min-width: 0; max-width: 780px; }
.docs article h1 { font-size: 40px; margin-top: 0; }
.docs article h2 { font-size: 26px; margin-top: 52px; padding-top: 8px; }
.docs article h3 { font-size: 18px; margin-top: 32px; }
.docs article p, .docs article li { color: #c3c9d6; }
.docs article code:not(pre code) { background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
.docs article pre { background: #0a0c10; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.docs table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 16px 0; }
.docs th, .docs td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs th { color: var(--dim); font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.callout { border: 1px solid rgba(94, 234, 212, .3); background: rgba(94, 234, 212, .06); border-radius: 12px; padding: 14px 16px; font-size: 14.5px; }
@media (max-width: 860px) { .docs { grid-template-columns: 1fr; } .docs aside { position: static; } }

/* Auth & account */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 20px; }
.card { width: min(420px, 100%); border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); padding: 32px; }
.card.wide { width: min(760px, 100%); }
.card h1 { font-size: 28px; margin: 0 0 6px; }
.card .sub { color: var(--muted); margin: 0 0 24px; font-size: 14.5px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 8px; border-radius: 7px; font: 600 14px var(--font); cursor: pointer; }
.tabs button.on { background: var(--panel-2); color: var(--text); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); font: 15px var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94, 234, 212, .15); }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.keyrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.keyrow code { color: var(--muted); }
.keyrow .grow { flex: 1; min-width: 0; }
.secret { background: var(--bg); border: 1px dashed var(--accent); border-radius: 10px; padding: 12px 14px; font: 13px var(--mono); word-break: break-all; margin: 12px 0; }
.usage-bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin: 14px 0 6px; }
.usage-bars div { flex: 1; background: linear-gradient(180deg, var(--accent), rgba(94, 234, 212, .3)); border-radius: 3px 3px 0 0; min-height: 2px; }

/* SEO landing sections */
.what { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: start; }
.what h2 { margin-bottom: 0; }
.what-body p { color: #c3c9d6; font-size: 17px; margin: 0 0 16px; }
.what-body strong { color: var(--text); }
@media (max-width: 900px) { .what { grid-template-columns: 1fr; gap: 12px; } }
.usecases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.uc { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--bg-2); transition: border-color .15s, transform .15s, background .15s; }
.uc:hover { border-color: rgba(94, 234, 212, .45); background: var(--panel); transform: translateY(-2px); }
.uc h3 { margin: 0 0 8px; font-size: 16.5px; letter-spacing: -.01em; }
.uc h3::after { content: ' →'; color: var(--accent); opacity: 0; transition: opacity .15s; }
.uc:hover h3::after { opacity: 1; }
.uc p { margin: 0; color: var(--muted); font-size: 14px; }
@media (max-width: 1000px) { .usecases { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .usecases { grid-template-columns: 1fr; } }
.free-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid rgba(94, 234, 212, .35); border-radius: var(--radius); overflow: hidden; }
.free-card { background: linear-gradient(180deg, rgba(94, 234, 212, .05), var(--bg-2)); padding: 28px 24px; }
.free-card b { display: block; font-size: 32px; letter-spacing: -.03em; color: var(--text); }
.free-card span { color: var(--muted); font-size: 14.5px; }
@media (max-width: 900px) { .free-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1060px) { .nav-links { display: none; } }
.crumbs { font: 13px var(--mono); color: var(--dim); margin-bottom: 18px; }
.crumbs a:hover { color: var(--text); }
.compare td:first-child { color: var(--muted); white-space: nowrap; }
