/* Flames, flames.ai.id
   Dark slate + teal. Editorial, no gradients except a single low-opacity glow. */

:root {
  color-scheme: dark;
  --bg: #090d16;
  --bg-alt: #0f172a;
  --card: #131c2e;
  --card-raised: #1e293b;
  --line: rgba(20, 184, 166, 0.18);
  --line-soft: rgba(148, 163, 184, 0.14);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --dim: #64748b;
  --teal: #14b8a6;
  --teal-deep: #008080;
  --teal-wash: rgba(20, 184, 166, 0.08);
  --green: #10b981;

  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;

  --max: 1120px;
  --max-prose: 760px;
  --radius: 14px;
  --radius-sm: 8px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 7rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--teal); text-decoration: none; transition: color .18s ease, border-color .18s ease; }
a:hover { color: #5eead4; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--teal); color: #04201d; padding: .75rem 1rem; font-weight: 700;
}
.skip-link:focus { left: 1rem; top: 1rem; color: #04201d; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(9, 13, 22, .88);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: .875rem var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.logo-link { display: flex; align-items: center; gap: .7rem; color: var(--text); }
.logo-link:hover { color: var(--text); }
.logo-img { width: 34px; height: 34px; border-radius: 8px; }
.logo-text { font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.02em; }
.logo-text span { color: var(--dim); font-weight: 500; }

.nav { display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.5rem); }
.nav a { color: var(--muted); font-size: .875rem; font-weight: 600; }
.nav a:hover { color: var(--text); }
.nav .nav-github { color: var(--text); border: 1px solid var(--line); padding: .4rem .8rem; border-radius: 999px; }
.nav .nav-github:hover { border-color: var(--teal); color: var(--teal); }
@media (max-width: 760px) {
  .nav a:not(.nav-github) { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: .9375rem; font-weight: 700; letter-spacing: .01em;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .15s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--teal); color: #04211e; border-color: var(--teal); }
.btn-primary:hover { background: #2dd4bf; border-color: #2dd4bf; color: #04211e; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: rgba(148,163,184,.38); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-wash); }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem); }
.hero::before {
  content: ""; position: absolute; top: -30%; left: -10%;
  width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
  background: radial-gradient(circle, rgba(20,184,166,.13) 0%, transparent 65%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(148,163,184,.06) 1px, transparent 1px);
  background-size: 100% 72px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.hero-copy { max-width: 36rem; }
.hero-grid > * { min-width: 0; }
.terminal { max-width: 100%; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 1.4rem;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 0 4px rgba(20,184,166,.14);
}
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 3.7rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; }
.hero h1 em { font-style: normal; color: var(--teal); }
.hero-sub {
  margin-top: 1.4rem; max-width: 34rem;
  font-size: clamp(1rem, 1.4vw, 1.125rem); color: var(--muted); line-height: 1.7;
}
.hero-tagline {
  margin-top: 1.5rem; padding-left: 1rem; border-left: 2px solid rgba(20,184,166,.5);
  font-family: var(--mono); font-size: .8125rem; color: #94a3b8; line-height: 1.7;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.25rem; }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem;
  margin-top: 2.5rem; padding-top: 1.5rem; max-width: 34rem;
  border-top: 1px solid var(--line-soft);
}
.hero-stats div { display: flex; flex-direction: column; gap: .1rem; }
.hero-stats b { font-family: var(--mono); font-size: 1.25rem; font-weight: 500; color: var(--text); }
.hero-stats span { font-size: .75rem; color: #94a3b8; letter-spacing: .04em; text-transform: uppercase; }

/* Terminal panel */
.terminal {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, #101a2c 0%, #0c1424 100%);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.02) inset;
  overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--line-soft); background: rgba(9,13,22,.5);
}
.terminal-bar i { width: 9px; height: 9px; border-radius: 50%; background: #334155; }
.terminal-bar i:first-child { background: #475569; }
.terminal-bar span {
  margin-left: auto; font-family: var(--mono); font-size: .6875rem; color: var(--dim); letter-spacing: .06em;
}
.terminal-body { padding: 1.25rem 1.15rem; font-family: var(--mono); font-size: .78125rem; line-height: 1.95; color: #cbd5e1; overflow-x: auto; }
.terminal-body p { white-space: pre; }
.terminal-body .prompt { color: var(--teal); }
.terminal-body .ok { color: var(--green); }
.terminal-body .dim { color: var(--dim); }
.terminal-body .arrow { color: var(--teal); }
.terminal-body .gap { height: .9rem; }
.terminal-caption {
  padding: .7rem 1.15rem .8rem; border-top: 1px solid var(--line-soft);
  font-size: .75rem; color: #94a3b8; line-height: 1.5;
}
.caret {
  display: inline-block; width: 7px; height: 1em; vertical-align: -2px;
  background: var(--teal); animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}

/* ---------- Sections ---------- */

section { scroll-margin-top: 84px; }
.section { padding: var(--section-y) 0; border-top: 1px solid var(--line-soft); }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-index {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal); margin-bottom: .9rem;
}
.section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 800; }
.section-lead { margin-top: 1rem; color: var(--muted); font-size: 1.0625rem; line-height: 1.7; max-width: 40rem; }

/* Modes */
.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.mode-card {
  border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--card);
  padding: clamp(1.5rem, 3vw, 2rem); display: flex; flex-direction: column; gap: 1rem;
  transition: border-color .2s ease, background-color .2s ease;
}
.mode-card:hover { border-color: var(--line); background: #162033; }
.mode-label { font-family: var(--mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.mode-card h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.mode-card p { color: var(--muted); font-size: .9375rem; line-height: 1.7; }
.mode-list { display: flex; flex-direction: column; gap: .55rem; margin-top: auto; padding-top: .5rem; }
.mode-list li { display: flex; gap: .6rem; font-size: .875rem; color: #cbd5e1; }
.mode-list li::before { content: ""; width: 5px; height: 5px; margin-top: .55rem; flex: none; background: var(--teal); }
.code-chip {
  display: inline-block; font-family: var(--mono); font-size: .75rem; color: #99f6e4;
  background: rgba(20,184,166,.08); border: 1px solid var(--line); border-radius: 6px;
  padding: .25rem .55rem; margin-top: 1rem; align-self: flex-start;
}

/* Tools */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.tool-card {
  border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--card);
  padding: 1.5rem; transition: border-color .2s ease;
}
.tool-card:hover { border-color: var(--line); }
.tool-num { font-family: var(--mono); font-size: .6875rem; color: var(--dim); letter-spacing: .1em; }
.tool-card h3 { margin-top: .55rem; font-size: 1.0625rem; letter-spacing: -0.015em; }
.tool-list { margin-top: 1rem; border-top: 1px solid var(--line-soft); }
.tool-list li {
  padding: .55rem 0 .55rem 1rem; position: relative;
  font-size: .875rem; color: var(--muted); border-bottom: 1px solid var(--line-soft); line-height: 1.45;
}
.tool-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.tool-list li::before {
  content: ""; position: absolute; left: 0; top: .95rem; width: 5px; height: 5px;
  background: var(--teal); opacity: .7;
}
.tool-list b { color: #e2e8f0; font-weight: 600; }

/* Beta / steps */
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; align-items: stretch; }
.step-card {
  border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--card);
  padding: clamp(1.5rem, 3vw, 2rem); display: flex; flex-direction: column;
}
.step-card .beta-form, .step-card > .step-actions, .step-card > .step-note { margin-top: 0; }
.step-card--accent { border-color: var(--line); background: linear-gradient(180deg, rgba(20,184,166,.06), rgba(20,184,166,0) 55%), var(--card); }
.step-head { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .75rem; }
.step-num {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .1em; color: var(--teal);
  border: 1px solid var(--line); border-radius: 999px; padding: .15rem .55rem; white-space: nowrap;
}
.step-head h3 { font-size: 1.125rem; letter-spacing: -0.015em; }
.step-desc { color: var(--muted); font-size: .9375rem; line-height: 1.65; }
.step-actions { display: flex; flex-direction: column; gap: .625rem; margin-top: 1.25rem; }
.step-note {
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line-soft);
  font-size: .8125rem; color: var(--muted);
}
#beta-form { display: flex; flex-direction: column; flex: 1; }
#beta-form[hidden] { display: none; }
#beta-form .step-note { margin-top: auto; }
.step-card--accent .step-note { margin-top: auto; }

.field { margin-top: 1.25rem; display: flex; flex-direction: column; gap: .45rem; }
.field label { font-size: .8125rem; font-weight: 600; color: #cbd5e1; }
.field input[type="email"] {
  width: 100%; padding: .75rem .875rem; font-family: var(--sans); font-size: .9375rem;
  color: var(--text); background: #0b1322; border: 1px solid rgba(148,163,184,.24);
  border-radius: var(--radius-sm); transition: border-color .18s ease, box-shadow .18s ease;
}
.field input::placeholder { color: #526178; }
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20,184,166,.16); }

.consent { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1rem; font-size: .8125rem; color: var(--muted); line-height: 1.55; }
.consent input { margin-top: .18rem; accent-color: var(--teal); width: 15px; height: 15px; flex: none; }

.form-status { margin-top: .75rem; font-size: .8125rem; color: var(--muted); min-height: 1.25rem; }
.form-status.is-error { color: #fca5a5; }

.beta-result { margin-top: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(20,184,166,.06); padding: 1.25rem; }
.beta-result[hidden] { display: none; }
.beta-result-head { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: .9375rem; }
.beta-result-head svg { width: 18px; height: 18px; color: var(--teal); flex: none; }
.beta-result p { margin-top: .6rem; font-size: .875rem; color: var(--muted); line-height: 1.6; }
.beta-result .beta-email { font-family: var(--mono); font-size: .8125rem; color: #e2e8f0; word-break: break-all; }
.beta-result-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.beta-result-actions .btn { padding: .55rem .9rem; font-size: .8125rem; }
.fallback { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.fallback[hidden] { display: none; }
.link-button {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--sans); font-size: .8125rem; font-weight: 600; color: var(--teal);
  text-decoration: underline; text-underline-offset: 3px;
}
.link-button:hover { color: #5eead4; }

/* Quick start */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.quick-card {
  border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--card);
  padding: 1.5rem; min-width: 0;
}
.quick-top { display: flex; align-items: center; gap: .7rem; }
.quick-num {
  font-family: var(--mono); font-size: .75rem; color: var(--teal);
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
}
.quick-card h3 { font-size: 1rem; letter-spacing: -0.01em; }
.quick-card p { margin-top: .75rem; color: var(--muted); font-size: .875rem; line-height: 1.6; }
pre {
  margin: 1rem 0 0; padding: .875rem 1rem; overflow-x: auto; max-width: 100%;
  background: #060b14; border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: .78125rem; line-height: 1.8; color: #d1fae5;
}
pre code { display: block; overflow-x: auto; }
pre .c { color: var(--dim); }
.quick-foot { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.quick-foot p { font-size: .875rem; color: var(--dim); }

/* Footer */
.site-footer { border-top: 1px solid var(--line-soft); padding: 2.5rem 0; background: var(--bg); }
.footer-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: .6rem; color: var(--dim); font-size: .8125rem; }
.footer-brand img { width: 22px; height: 22px; border-radius: 5px; opacity: .9; }
.footer-links { display: flex; align-items: center; gap: .75rem; font-size: .8125rem; color: var(--dim); }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--teal); }

/* ---------- Privacy page ---------- */

.page-head { padding: clamp(3rem, 6vw, 4.5rem) 0 1rem; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; letter-spacing: -0.04em; }
.page-head .updated { margin-top: .75rem; font-family: var(--mono); font-size: .75rem; color: var(--dim); letter-spacing: .05em; }
.prose { max-width: var(--max-prose); padding-bottom: clamp(3rem, 6vw, 5rem); }
.prose h2 { font-size: 1.25rem; margin: 2.5rem 0 .75rem; letter-spacing: -0.02em; }
.prose h3 { font-size: 1rem; margin: 1.5rem 0 .5rem; color: #e2e8f0; }
.prose p { color: var(--muted); font-size: .9375rem; line-height: 1.8; }
.prose p + p { margin-top: .75rem; }
.prose ul { margin: .75rem 0 0; padding-left: 1.1rem; list-style: disc; }
.prose li { color: var(--muted); font-size: .9375rem; line-height: 1.8; margin-bottom: .35rem; }
.prose strong { color: #e2e8f0; font-weight: 600; }
.prose code { font-family: var(--mono); font-size: .8125rem; color: #99f6e4; background: rgba(20,184,166,.08); padding: .1rem .35rem; border-radius: 4px; }
.prose .callout {
  margin-top: 2rem; border: 1px solid var(--line); border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm); background: var(--card); padding: 1.25rem 1.35rem;
}
.prose .callout p { color: #cbd5e1; font-size: .875rem; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .terminal { max-width: 560px; }
  .tool-grid, .quick-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .mode-grid, .steps, .tool-grid, .quick-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.25rem; }
  .hero-stats b { font-size: 1.05rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
