/* Palette follows the framework's Ember theme (enferno/static/js/config.js) */
:root {
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', ui-monospace, monospace;

  --bg: #ffffff;
  --surface: #f8fafc;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;

  --amber: #facc15;
  --orange: #f97316;
  --ember: #ea580c;
  --red: #dc2626;
  --ok: #16a34a;
  --fire-soft: #fff7ed;
  --fire-line: #fed7aa;
  --gradient: linear-gradient(110deg, var(--amber) 0%, var(--orange) 38%, var(--ember) 62%, var(--red) 100%);

  --night: #0f172a;
  --night-2: #111a2e;
  --night-line: rgba(148, 163, 184, 0.16);
  --night-ink: #f1f5f9;
  --night-ink-2: #94a3b8;
  --code-bg: #0b1120;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 30px -14px rgba(15, 23, 42, 0.16);
  --glow: 0 30px 90px -24px rgba(234, 88, 12, 0.55);
  --container: 1232px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font-sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, h4, p, ul, pre { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
code, pre { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 6px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.fire {
  background: var(--gradient); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
p code {
  font-size: 0.88em; color: var(--ink); background: var(--line-soft);
  padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line);
}

/* Dark bands */
.night { position: relative; background: var(--night); color: var(--night-ink); overflow: hidden; isolation: isolate; }
.night .section-sub, .night .hero-sub { color: var(--night-ink-2); }
.night p code { color: var(--night-ink); background: rgba(148, 163, 184, 0.12); border-color: var(--night-line); }
.blaze { position: absolute; z-index: -1; border-radius: 50%; filter: blur(90px); opacity: 0.55; pointer-events: none; animation: drift 18s ease-in-out infinite alternate; }
.blaze-a { width: 620px; height: 620px; top: -240px; right: -120px; background: radial-gradient(circle, var(--orange), transparent 65%); }
.blaze-b { width: 520px; height: 520px; bottom: -280px; left: -160px; background: radial-gradient(circle, var(--red), transparent 65%); opacity: 0.4; animation-delay: -9s; }
.blaze-c { width: 380px; height: 380px; top: 30%; left: 38%; background: radial-gradient(circle, var(--amber), transparent 65%); opacity: 0.18; animation-duration: 24s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }
.grid-bg {
  position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--night-line) 1px, transparent 1px), linear-gradient(90deg, var(--night-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: transform 150ms, box-shadow 150ms, border-color 150ms, background 150ms;
}
.btn:hover { border-color: var(--ink-3); }
.btn-primary {
  border: 0; color: #fff; background: var(--gradient); background-size: 140% 100%;
  box-shadow: 0 10px 28px -10px rgba(234, 88, 12, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 14px 34px -10px rgba(220, 38, 38, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); border-color: var(--night-line); color: var(--night-ink); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(148, 163, 184, 0.4); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }

/* Nav */
.nav { position: sticky; top: 12px; z-index: 50; padding: 0 24px; margin-bottom: -72px; }
.nav-inner {
  max-width: var(--container); margin: 0 auto; display: flex; align-items: center; gap: 32px;
  height: 60px; padding: 0 12px 0 18px; border-radius: 14px;
  background: rgba(15, 23, 42, 0.72); border: 1px solid var(--night-line); color: var(--night-ink);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 10px 40px -16px rgba(0, 0, 0, 0.5);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--gradient); display: grid; place-items: center; box-shadow: 0 4px 14px -4px rgba(234, 88, 12, 0.8); }
.brand-mark img { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 24px; font-size: 15px; font-weight: 500; }
.nav-links a { color: var(--night-ink-2); transition: color 150ms; }
.nav-links a:hover { color: #fff; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-gh { display: flex; align-items: center; gap: 6px; color: var(--night-ink-2); font-size: 14px; }
.nav-gh:hover { color: #fff; }

/* Hero */
.hero { padding: 168px 0 128px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 64px; align-items: center; }
.agents { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 28px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--night-line); background: rgba(255, 255, 255, 0.04); font-size: 13px; color: var(--night-ink-2); }
.agents b { padding: 3px 10px; border-radius: 999px; background: var(--gradient); color: #fff; font-weight: 600; font-size: 12px; }
.hero-title { font-size: clamp(40px, 4.6vw, 62px); line-height: 1.02; font-weight: 600; letter-spacing: -0.045em; }
.hero-sub { margin-top: 26px; max-width: 540px; font-size: 19px; color: var(--ink-2); }
.hero-cta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 18px; font: 13px var(--font-mono); color: var(--night-ink-2); }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 10px #22c55e; }

/* Agent window */
.window {
  position: relative; border-radius: 18px; overflow: hidden;
  background: rgba(11, 17, 32, 0.88); border: 1px solid var(--night-line);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(249, 115, 22, 0.08), var(--glow);
}
.window::before { content: ''; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, var(--orange), transparent); }
.window-bar { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--night-line); font-size: 13px; }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(148, 163, 184, 0.25); }
.window-title { margin: 0 auto; font-weight: 500; }
.window-title span { color: var(--night-ink-2); font-family: var(--font-mono); font-weight: 400; }
.chat { height: 460px; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.msg { max-width: 90%; font-size: 14px; line-height: 1.55; opacity: 0; transform: translateY(6px); transition: opacity 300ms, transform 300ms; }
.msg.show { opacity: 1; transform: none; }
.msg-user { align-self: flex-end; padding: 10px 14px; border-radius: 12px 12px 4px 12px; background: rgba(249, 115, 22, 0.12); border: 1px solid rgba(249, 115, 22, 0.3); }
.msg-agent b { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--night-ink-2); }
.tool { font: 12.5px/1.9 var(--font-mono); color: #cbd5e1; }
.tool .ok { color: #4ade80; margin-right: 6px; }
.tool em { font-style: normal; color: #fdba74; }
.tool-pass { color: #4ade80; font-weight: 600; }
.chat-input { margin: 0 16px 16px; display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 8px 0 14px; border-radius: 10px; border: 1px solid var(--night-line); background: rgba(255, 255, 255, 0.03); font-size: 14px; color: var(--night-ink-2); }
.chat-input kbd { width: 28px; height: 28px; border-radius: 7px; background: var(--gradient); color: #fff; display: grid; place-items: center; font: 14px var(--font-sans); }

/* Sections */
.section { padding: 128px 0; }
.section-head { max-width: 760px; margin: 0 auto 60px; text-align: center; }
.eyebrow { display: inline-block; margin-bottom: 14px; font: 600 12.5px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ember); }
.night .eyebrow { color: #fb923c; }
.section-title { font-size: clamp(32px, 4.4vw, 54px); line-height: 1.06; font-weight: 600; letter-spacing: -0.038em; }
.section-sub { margin-top: 16px; font-size: 18px; color: var(--ink-2); }

/* Start: prompt + what the agent runs */
.start { max-width: 860px; margin: 0 auto; }
.prompt { padding: 2px; border-radius: 18px; background: var(--gradient); box-shadow: var(--glow); }
.prompt .code-block { border-radius: 16px; box-shadow: none; }
.prompt pre { font-size: 15.5px; white-space: pre-wrap; }
.start-alt { margin-top: 22px; text-align: center; color: var(--ink-2); font-size: 15px; }
.runs { margin-top: 28px; }
.runs summary { width: max-content; margin: 0 auto; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2); list-style: none; }
.runs summary::-webkit-details-marker { display: none; }
.runs summary::after { content: ' ▸'; color: var(--orange); }
.runs[open] summary::after { content: ' ▾'; }
.runs summary:hover { color: var(--ink); }
.runs .code-block { margin-top: 14px; }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; padding: 26px;
  border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line);
  box-shadow: var(--shadow); overflow: hidden; transition: border-color 200ms, box-shadow 200ms, transform 200ms;
}
.card::after { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--gradient); opacity: 0; transition: opacity 200ms; }
.card:hover { transform: translateY(-2px); border-color: var(--fire-line); box-shadow: var(--shadow), 0 26px 60px -30px rgba(234, 88, 12, 0.55); }
.card:hover::after { opacity: 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: 1 / -1; }
.card h3 { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--gradient); box-shadow: 0 6px 16px -6px rgba(234, 88, 12, 0.7); }
.card > p { margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.viz {
  margin-top: 24px; flex: 1; min-height: 170px; padding: 18px; border-radius: 12px;
  border: 1px solid var(--line-soft); background-color: var(--surface);
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 22px 22px; font: 12.5px/1.6 var(--font-mono); color: var(--ink-2);
}
.viz-dark { background: var(--code-bg); border-color: var(--code-bg); color: #cbd5e1; }
.viz-dark .c { color: #64748b; }
.viz-dark .k { color: #fb923c; }
.viz-dark .ok { color: #4ade80; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: 12.5px/1.4 var(--font-mono); white-space: nowrap;
}
.tag-fire { border-color: var(--fire-line); background: var(--fire-soft); color: var(--ember); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.card > .chips { margin-top: 16px; }
.rules li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.rules li:last-child { border: 0; }
.rules span { color: var(--orange); }

/* Auth gate viz */
.gate { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; height: 100%; }
.gate-col { display: flex; flex-direction: column; gap: 12px; }
.gate-col small { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.gate-wall { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gate-wall::after { content: ''; flex: 1; width: 2px; border-radius: 2px; background: var(--gradient); }
.gate-out b { color: var(--red); font-weight: 400; }
.gate-in b { color: var(--ok); font-weight: 400; }

/* Loop */
.loop { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; position: relative; }
.loop::before { content: ''; position: absolute; top: 28px; left: 12%; right: 12%; height: 2px; background: var(--gradient); opacity: 0.7; }
.loop-step { position: relative; padding: 0 8px; text-align: center; }
.loop-num {
  width: 56px; height: 56px; margin: 0 auto 22px; border-radius: 16px; display: grid; place-items: center;
  background: var(--night-2); border: 1px solid rgba(249, 115, 22, 0.45); color: #fdba74;
  font: 600 15px var(--font-mono); box-shadow: 0 0 0 6px var(--night), 0 10px 30px -8px rgba(249, 115, 22, 0.6);
}
.loop-step:last-child .loop-num { background: var(--gradient); color: #fff; border: 0; }
.loop-step h3 { font-size: 18px; font-weight: 600; }
.loop-step p { margin-top: 8px; font-size: 15px; color: var(--night-ink-2); }
.loop-step code { display: inline-block; margin-top: 12px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--night-line); background: rgba(255, 255, 255, 0.04); font-size: 12.5px; color: #fdba74; }

/* Demo */
.demo-frame { max-width: 1000px; margin: 0 auto; padding: 2px; border-radius: 20px; background: var(--gradient); box-shadow: var(--glow); }
.demo-frame video { width: 100%; border-radius: 18px; background: #000; }

/* Code blocks */
.code-block { text-align: left; background: var(--code-bg); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.code-header { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 14px; border-bottom: 1px solid #1e293b; font: 12px var(--font-mono); color: #64748b; }
.code-copy { font: 12px var(--font-mono); color: #94a3b8; padding: 4px 10px; border-radius: 6px; border: 1px solid #1e293b; }
.code-copy:hover { color: #fff; border-color: var(--orange); }
.code-block pre[class*='language-'], .code-block pre { margin: 0; padding: 18px 20px; background: transparent; font-size: 13.5px; line-height: 1.7; overflow-x: auto; color: #e2e8f0; }
.code-block code[class*='language-'] { font-family: var(--font-mono); text-shadow: none; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split > article { min-width: 0; display: flex; flex-direction: column; }
.split .code-block { flex: 1; }
.split h3 { margin-bottom: 12px; font-size: 15px; font-weight: 500; color: var(--ink-2); }

/* Stack */
.stack { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 940px; margin: 0 auto; }
.stack .tag { padding: 8px 14px; font-size: 14px; }

/* CTA */
.cta { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
.price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.price b { font-size: 76px; line-height: 1; font-weight: 600; letter-spacing: -0.05em; }
.price span { font: 14px var(--font-mono); color: var(--night-ink-2); }
.license { font: 14px/1.6 var(--font-mono); color: #cbd5e1; }
.license li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--night-line); }
.license li:last-child { border: 0; }
.license li::before { content: '✓'; color: #fb923c; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-question { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; font-size: 17px; font-weight: 500; text-align: left; }
.faq-icon { font: 22px var(--font-mono); color: var(--orange); transition: transform 200ms; }
.faq-item.active .faq-icon { transform: rotate(45deg); }
.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 250ms; }
.faq-answer p { overflow: hidden; color: var(--ink-2); }
.faq-item.active .faq-answer { grid-template-rows: 1fr; }
.faq-item.active .faq-answer p { padding-bottom: 22px; }

/* Footer */
.footer { padding: 72px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.footer-grid p { margin-top: 12px; max-width: 300px; font-size: 14px; color: var(--night-ink-2); }
.footer h4 { margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.footer-col a { display: block; padding: 4px 0; font-size: 14px; color: var(--night-ink-2); }
.footer-col a:hover { color: #fdba74; }
.footer-bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--night-line); display: flex; justify-content: space-between; font-size: 13px; color: var(--night-ink-2); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .msg { opacity: 1; transform: none; }
}

@media (max-width: 1024px) {
  .hero-grid, .cta { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .span-2, .span-3, .span-4, .span-6 { grid-column: span 2; }
  .loop { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .loop::before { display: none; }
  .nav-links { display: none; }
}
@media (max-width: 720px) {
  .nav { padding: 0 12px; }
  .nav-inner { gap: 12px; padding: 0 8px 0 14px; }
  .nav-gh span { display: none; }
  .agents { border-radius: 16px; }
  .hero { padding: 120px 0 88px; }
  .section { padding: 88px 0; }
  .container { padding: 0 16px; }
  .bento, .loop, .split, .footer-grid { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4, .span-6 { grid-column: auto; }
  .gate { grid-template-columns: 1fr; }
  .gate-wall { flex-direction: row; }
  .gate-wall::after { width: auto; height: 2px; }
  .chat { height: 400px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}
