/*
 * Falcon fft: landing page stylesheet
 * Dark theme with CSS tokens (sibling of openutv.com)
 */

:root {
  --bg-main: #0b0e14;
  --bg-card: #121721;
  --bg-card-hover: #171e2b;
  --bg-elevated: #1a2232;
  --border: #222d3d;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent: #38bdf8;
  --accent-2: #6366f1;
  --accent-ok: #10b981;
  --accent-warn: #f59e0b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
}

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

html {
  font-family: var(--font-sans);
  background: var(--bg-main);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body { line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
main { flex: 1; }

a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: #7dd3fc; }
code { font-family: var(--font-mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: .5rem 1rem; z-index: 200; }
.skip-link:focus { left: 1rem; top: 1rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container.narrow { max-width: 820px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: rgba(11, 14, 20, .85);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text-main); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand:hover { color: var(--text-main); }
.brand-icon { display: block; }
.brand-fft { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a:not(.btn) { color: var(--text-muted); font-size: .92rem; font-weight: 500; }
.nav-links a:not(.btn):hover { color: var(--text-main); }

.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-main); margin: 5px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 10px; font-weight: 600; font-size: .98rem;
  border: 1px solid transparent; transition: transform .15s ease, background .2s, border-color .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.btn-primary:hover { color: #fff; filter: brightness(1.08); }
.btn-secondary { background: var(--bg-card); border-color: var(--border); color: var(--text-main); }
.btn-secondary:hover { border-color: var(--accent); color: var(--text-main); }
.btn-small { padding: .45rem .9rem; font-size: .88rem; }
.btn-large { padding: 1rem 1.9rem; font-size: 1.05rem; }

/* Hero */
.hero {
  position: relative; padding: 5.5rem 0 4rem; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 75% 20%, rgba(99, 102, 241, .16), transparent 70%),
    radial-gradient(ellipse 50% 40% at 15% 10%, rgba(56, 189, 248, .14), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3.5rem; align-items: center; }
.hero-grid > *, .two-col > *, .stats-grid > * { min-width: 0; }
.badge-pill {
  display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .85rem; border-radius: 999px;
  background: rgba(56, 189, 248, .08); border: 1px solid rgba(56, 189, 248, .25);
  color: #bae6fd; font-size: .82rem; font-weight: 500; margin-bottom: 1.4rem;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-ok); box-shadow: 0 0 10px var(--accent-ok); }
.hero-title { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin-bottom: 1.3rem; }
.gradient-text { background: linear-gradient(135deg, var(--accent), #a5b4fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-subtitle { color: var(--text-muted); font-size: 1.15rem; max-width: 36rem; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-note { margin-top: 1.2rem; color: var(--text-dim); font-size: .88rem; letter-spacing: .02em; }

/* Terminal */
.terminal {
  background: #0d1119; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(56, 189, 248, .05);
  overflow: hidden; min-width: 0;
}
.terminal-bar { display: flex; align-items: center; gap: .45rem; padding: .7rem 1rem; background: #121722; border-bottom: 1px solid var(--border); }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ef4444; } .dot-y { background: #eab308; } .dot-g { background: #22c55e; }
.terminal-title { margin-left: .6rem; color: var(--text-dim); font-size: .78rem; font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.terminal-body { padding: 1.2rem 1.3rem 1.4rem; font-family: var(--font-mono); font-size: .86rem; line-height: 1.85; color: #cbd5e1; overflow-x: auto; }
.prompt { color: var(--accent-ok); user-select: none; }
.t-dim { color: var(--text-dim); }
.t-ok { color: var(--accent-ok); }
.t-ok strong { color: #6ee7b7; }
.progress { display: inline-flex; align-items: center; gap: .7rem; }
.progress .bar { display: inline-block; width: 15rem; max-width: 52vw; height: .55rem; background: #1e293b; border-radius: 4px; overflow: hidden; vertical-align: middle; }
.progress .fill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; }
.pct { color: var(--text-muted); min-width: 3.2em; display: inline-block; }
.js .progress .fill { transform: scaleX(0); }
.js .t-final { opacity: 0; transition: opacity .4s ease; }
.js .terminal.done .t-final { opacity: 1; }

/* Stats */
.stats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(18, 23, 33, .6); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 2rem 1.2rem; text-align: center; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat-num { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; color: var(--text-main); }
.stat-num small { font-size: 1rem; color: var(--accent); font-weight: 600; margin-left: .15rem; }
.stat-label { color: var(--text-muted); font-size: .88rem; margin-top: .2rem; }

/* Sections */
.section { padding: 5.5rem 0; }
.section-dark { background: #0e121a; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -.025em; line-height: 1.15; margin-bottom: 1rem; text-align: center; }
.two-col .section-title { text-align: left; }
.section-lead { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 1.2rem; }
.section-lead.center { text-align: center; max-width: 46rem; margin: 0 auto 2.5rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; }
.two-col p { color: var(--text-muted); }
.check-list { list-style: none; margin-top: 1.4rem; display: grid; gap: .6rem; }
.check-list li { padding-left: 1.7rem; position: relative; color: var(--text-main); }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-ok); font-weight: 700; }

/* Chart */
.chart-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.8rem; }
.chart-title { display: block; font-weight: 700; font-size: 1.1rem; }
.chart-sub { display: block; color: var(--text-dim); font-size: .85rem; margin-bottom: 1.6rem; }
.bars { display: grid; gap: 1.1rem; }
.bar-row { display: grid; grid-template-columns: 9.5rem 1fr 3.5rem; align-items: center; gap: .8rem; }
.bar-label { font-size: .88rem; color: var(--text-muted); }
.bar-track { height: 1.6rem; background: #0b0f17; border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: var(--w); min-width: 3px; border-radius: 6px; transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }
.js .bar-fill { width: 0; }
.js .chart-card.visible .bar-fill { width: var(--w); }
.fill-fft { --w: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.fill-bbr { --w: 8.8%; background: #475569; }
.fill-cubic { --w: 0.6%; background: #334155; }
.bar-val { font-family: var(--font-mono); font-size: .9rem; text-align: right; }
.chart-note { margin-top: 1.4rem; color: var(--text-dim); font-size: .8rem; }

/* Benchmarks table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.bench { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 640px; }
.bench th, .bench td { padding: .95rem 1.2rem; text-align: left; border-bottom: 1px solid var(--border); }
.bench thead th { background: var(--bg-elevated); color: var(--text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.bench tbody th { font-weight: 500; color: var(--text-main); }
.bench td { font-family: var(--font-mono); color: var(--text-muted); }
.bench td.win { color: #6ee7b7; font-weight: 700; }
.bench td.muted { font-family: var(--font-sans); color: var(--text-dim); font-size: .85rem; }
.bench tbody tr:last-child th, .bench tbody tr:last-child td { border-bottom: 0; }
.fine-print { color: var(--text-dim); font-size: .85rem; margin: 1.2rem auto 0; max-width: 60rem; text-align: center; }

.efficiency { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 3rem; }
.eff-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.eff-num { font-size: 1.7rem; font-weight: 800; color: var(--accent); letter-spacing: -.02em; }
.eff-label { color: var(--text-muted); font-size: .88rem; }

/* Features */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 2.5rem; }
.feature { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; transition: background .2s, border-color .2s, transform .2s; }
.feature:hover { background: var(--bg-card-hover); border-color: #2c3a50; transform: translateY(-2px); }
.f-icon { color: var(--accent); width: 2.8rem; height: 2.8rem; display: grid; place-items: center; border-radius: 10px; background: rgba(56, 189, 248, .08); border: 1px solid rgba(56, 189, 248, .2); margin-bottom: 1rem; }
.feature h3 { font-size: 1.08rem; margin-bottom: .45rem; }
.feature p { color: var(--text-muted); font-size: .94rem; }

/* Steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 2.5rem; counter-reset: none; }
.step { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; position: relative; min-width: 0; }
.step-num { position: absolute; top: -14px; left: 1.4rem; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-weight: 700; font-size: .9rem; }
.step h3 { margin: .4rem 0 .8rem; font-size: 1.1rem; }
.step pre { background: #0b0f17; border: 1px solid var(--border); border-radius: 8px; padding: .8rem 1rem; font-size: .8rem; line-height: 1.7; color: #cbd5e1; overflow-x: auto; margin-bottom: .8rem; }
.step p { color: var(--text-muted); font-size: .92rem; }

/* Use cases */
.use-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-top: 2.5rem; }
.use { border-left: 3px solid var(--accent); padding: .3rem 0 .3rem 1.1rem; }
.use h3 { font-size: 1.02rem; margin-bottom: .35rem; }
.use p { color: var(--text-muted); font-size: .92rem; }

/* FAQ */
details { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; margin-top: .8rem; }
details[open] { border-color: #2c3a50; }
summary { cursor: pointer; padding: 1.1rem 1.3rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 1.3rem 1.2rem; color: var(--text-muted); }

/* CTA */
.cta { text-align: center; background: radial-gradient(ellipse 50% 60% at 50% 40%, rgba(99, 102, 241, .16), transparent 70%); }
.cta-inner { max-width: 640px; }
.cta-logo { margin-bottom: 1.2rem; opacity: .95; }
.cta h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); letter-spacing: -.02em; margin-bottom: .8rem; }
.cta p { color: var(--text-muted); font-size: 1.08rem; margin-bottom: 2rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: .6rem; color: var(--text-dim); font-size: .88rem; }
.footer-links { display: flex; gap: 1.4rem; font-size: .88rem; }
.footer-links a { color: var(--text-muted); }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 1000px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; gap: 2.5rem; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .use-grid, .efficiency { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 2rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .mobile-nav { flex-direction: column; padding: .5rem 1.5rem 1rem; border-top: 1px solid var(--border); }
  .mobile-nav.open { display: flex; }
  .mobile-nav a { padding: .7rem 0; color: var(--text-main); border-bottom: 1px solid var(--border); }
  .mobile-nav a:last-child { border-bottom: 0; color: var(--accent); font-weight: 600; }
  .hero { padding: 3.5rem 0 3rem; }
  .section { padding: 4rem 0; }
  .container { padding: 0 1rem; }
  .feature-grid, .use-grid, .efficiency { grid-template-columns: 1fr; }
  .stat-num { font-size: 1.9rem; }
  .bar-row { grid-template-columns: 6.8rem 1fr 3rem; gap: .5rem; }
  .bar-label { font-size: .78rem; }
  .terminal-body { font-size: .76rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .bar-fill { width: var(--w); }
  .js .progress .fill { transform: none; }
  .js .t-final { opacity: 1; }
}
