/* fah — GitHub Pages landing. Hand-rolled, no frameworks. */

:root {
  --bg: #070a10;
  --bg-2: #0a0f18;
  --panel: #0d1420;
  --panel-2: #101928;
  --border: #1c2637;
  --border-bright: #2b3a52;
  --text: #e8eef7;
  --dim: #93a1b5;
  --accent: #5eead4;
  --accent-2: #818cf8;
  --grad: linear-gradient(120deg, var(--accent-2), var(--accent));
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* Backdrop: grid + two glows */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(720px 480px at 12% -6%, rgba(129, 140, 248, 0.16), transparent 70%),
    radial-gradient(820px 560px at 95% 30%, rgba(94, 234, 212, 0.10), transparent 70%),
    var(--bg);
}
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px; }
h1 { font-size: clamp(2.5rem, 6vw, 4.3rem); font-weight: 750; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.06rem; font-weight: 650; margin-bottom: 8px; }
p { margin: 0 0 14px; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 6px;
  padding: 0.08em 0.34em;
  white-space: nowrap;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted { color: var(--dim); font-weight: 400; }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 20;
  background: rgba(7, 10, 16, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(28, 38, 55, 0.7);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: flex; align-items: baseline; gap: 9px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.06em;
}
.brand-name { font-weight: 750; font-size: 1.06rem; letter-spacing: -0.02em; }
.brand-sub { color: var(--dim); font-size: 0.82rem; font-family: var(--mono); }
.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-ext { display: flex; gap: 20px; }
.nav a { color: var(--dim); font-size: 0.92rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav .brand { color: var(--text); }

/* ── Layout ──────────────────────────────────────────────────────────── */
main { display: block; }
section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px 24px 24px;
}
.kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-lede { max-width: 720px; color: var(--dim); }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  padding-top: 84px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--dim);
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.lede { color: var(--dim); max-width: 560px; font-size: 1.05rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 26px; }
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--border-bright);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.btn-primary {
  background: var(--grad);
  border: none;
  color: #06121a;
}
.btn-primary:hover { box-shadow: 0 8px 30px rgba(94, 234, 212, 0.22); }
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pills li {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}

/* ── Terminal card ───────────────────────────────────────────────────── */
.term {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(129, 140, 248, 0.06);
  overflow: hidden;
}
.term-bar, .frame-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.04);
}
.dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: #26334a;
}
.dot:nth-child(1) { background: #ff5f57; }
.dot:nth-child(2) { background: #febc2e; }
.dot:nth-child(3) { background: #28c840; }
.term-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--dim);
}
.term-body {
  margin: 0;
  padding: 20px 20px 24px;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.75;
  min-height: 240px;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-body .cmd { color: var(--text); }
.term-body .cmd::before { content: "$ "; color: var(--accent); }
.term-body .tool { color: var(--accent-2); }
.term-body .out { color: var(--dim); }
.term-body .ok { color: var(--accent); }
.caret {
  display: inline-block;
  width: 8px;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Demo frame ──────────────────────────────────────────────────────── */
.demo .frame {
  margin-top: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.frame-url {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--dim);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 12px;
  margin-left: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.frame-open {
  margin-left: auto;
  font-size: 0.82rem;
  white-space: nowrap;
}
.demo iframe {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: #0b0f16;
}
.fineprint { margin-top: 14px; color: var(--dim); font-size: 0.88rem; }

/* ── Install ─────────────────────────────────────────────────────────── */
.install-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-top: 30px; }
.install-term { margin-top: 0; }
.install-term .term-body { min-height: 0; padding: 16px 20px; font-size: 0.92rem; }
.term-bar .copy-btn { margin-left: auto; }
.copy-btn {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border-bright);
  border-radius: 7px;
  padding: 4px 11px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }
.install-alts { margin-top: 18px; }

.install-picker {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 18px;
  align-items: center;
  margin-top: 30px;
  padding: 20px;
  background: rgba(148, 163, 184, 0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.install-label {
  color: var(--dim);
  font-size: 0.88rem;
}
.install-select-wrap {
  position: relative;
}
.install-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
}
.install-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--panel);
  background-color: var(--panel);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  padding: 11px 38px 11px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  cursor: pointer;
}
.install-select:focus {
  outline: none;
  border-color: var(--accent);
}
.install-command {
  grid-column: 1 / -1;
}
@media (max-width: 560px) {
  .install-picker { grid-template-columns: 1fr; }
}
.cmdline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
}
.cmdline code,
.cmdline .cmdpre {
  flex: 1;
  min-width: 0;
  margin: 0;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Feature grid ────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 34px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: linear-gradient(180deg, rgba(16, 25, 40, 0.75), rgba(13, 20, 32, 0.75));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.card:hover { border-color: var(--border-bright); transform: translateY(-2px); }
.card p { color: var(--dim); font-size: 0.93rem; margin: 0; }
.card h3 { color: var(--text); }
.card-glyph {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ── Platform matrix ─────────────────────────────────────────────────── */
.matrix-wrap {
  margin-top: 30px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 760px;
}
.matrix th, .matrix td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.matrix th {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  background: rgba(148, 163, 184, 0.04);
}
.matrix tbody tr:last-child td { border-bottom: none; }
.matrix td { color: var(--dim); }
.matrix td:first-child { color: var(--text); font-weight: 600; }
.matrix .yes { color: var(--accent); font-weight: 700; }
.matrix .part { color: #febc2e; font-weight: 700; }
.matrix .no { color: var(--dim); opacity: 0.75; }
.matrix-caps th:not(:first-child),
.matrix-caps td:not(:first-child) { text-align: center; }
.matrix-notes {
  margin-top: 16px;
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--dim);
  max-width: 76ch;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer {
  max-width: var(--max);
  margin: 90px auto 0;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  color: var(--dim);
  font-size: 0.88rem;
}
.footer p { margin: 0; }
.footer nav { display: flex; gap: 20px; }
.footer a { color: var(--dim); }
.footer a:hover { color: var(--text); }

/* ── Reveal on scroll ────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .caret { animation: none; }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; }
  .grid, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav-inner { flex-wrap: wrap; gap: 10px 18px; padding: 12px 18px; }
  .brand-sub { display: none; }
  .nav-links { margin-left: 0; order: 3; width: 100%; }
  .nav-ext { margin-left: auto; }
  section { padding: 72px 18px 12px; }
  .grid, .grid-3 { grid-template-columns: 1fr; }
  .demo iframe { height: 560px; }
  .term-body { min-height: 210px; font-size: 0.78rem; }
}
