/* ============================================================
   FNX AI — "Own Your AI" (v2)
   Precision-engineering dark theme
   Type: Sora (display) / Inter (body) / JetBrains Mono (labels)
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #05070d;
  --bg-raised: #0a0e17;
  --bg-card: rgba(255, 255, 255, 0.025);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f8;
  --text-muted: #8b94ab;
  --text-faint: #5c6478;
  --accent: #4d7cff;
  --accent-2: #8a63ff;
  --accent-soft: rgba(77, 124, 255, 0.12);
  --ok: #3ddc97;
  --warn: #ffc857;
  --grad: linear-gradient(120deg, #4d7cff 0%, #8a63ff 100%);
  --radius: 14px;
  --radius-lg: 20px;
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --max-w: 1180px;
  --nav-h: 72px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #fff; }

img { max-width: 100%; height: auto; display: block; }

::selection { background: rgba(77, 124, 255, 0.35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.lead { font-size: 1.15rem; color: var(--text-muted); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.15em;
}

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

/* ---------- Layout ---------- */
section { padding: 110px 0; position: relative; }

.section-head {
  max-width: 640px;
  margin-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; align-items: center; }

.section-head .lead { margin-top: 4px; }

.band { background: var(--bg-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 24px rgba(77, 124, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(77, 124, 255, 0.45);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent-soft);
}

.btn-sm { padding: 9px 18px; font-size: 0.82rem; }

.btn-group { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(5, 7, 13, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: -0.01em;
}
.brand img { height: 30px; width: auto; }
.brand:hover { color: #fff; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
  list-style: none;
}
.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
}
.nav-links a:hover { color: #fff; }
.nav-links a[aria-current="page"] { color: #fff; }
.nav-links a[aria-current="page"]::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 4px;
  background: var(--grad);
  border-radius: 2px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: rgba(5, 7, 13, 0.97);
    border-bottom: 1px solid var(--line);
    padding: 16px 24px 24px;
    transform: translateY(-130%);
    transition: transform 0.3s ease;
    visibility: hidden;
  }
  .nav-links a { display: block; padding: 10px 0; font-size: 1rem; }
  .nav-links .btn { margin-top: 12px; }
  .nav-links.open { transform: translateY(0); visibility: visible; }
}

/* ---------- Hero ---------- */
.hero {
  padding: calc(var(--nav-h) + 90px) 0 110px;
  position: relative;
  overflow: hidden;
}

/* blueprint grid + glow */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(77, 124, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 124, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 45% at 50% -10%, rgba(77, 124, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.hero .container { position: relative; z-index: 2; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
}

.hero h1 { margin: 22px 0 24px; }
.hero .lead { max-width: 540px; }
.hero .btn-group { margin-top: 36px; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero .lead { max-width: 640px; }
}

/* terminal card */
.terminal {
  background: #090d16;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(77, 124, 255, 0.06);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.terminal-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #2a3244; }
.terminal-bar .dot:nth-child(1) { background: #ff5f57; }
.terminal-bar .dot:nth-child(2) { background: #febc2e; }
.terminal-bar .dot:nth-child(3) { background: #28c840; }
.terminal-title { margin-left: auto; color: var(--text-faint); font-size: 0.72rem; letter-spacing: 0.05em; }
.terminal-body { padding: 20px 20px 24px; }
.terminal-body .line { display: block; white-space: pre-wrap; word-break: break-word; }
.t-cmd { color: var(--text); }
.t-cmd::before { content: "$ "; color: var(--accent); }
.t-out { color: var(--text-muted); }
.t-ok { color: var(--ok); }
.t-warn { color: var(--warn); }
.t-dim { color: var(--text-faint); }

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* trust bar */
.trust-bar {
  margin-top: 88px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
  z-index: 2;
}
.trust-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.trust-item svg { width: 22px; height: 22px; color: var(--accent); }

@media (max-width: 860px) {
  .trust-bar { grid-template-columns: repeat(2, 1fr); margin-top: 64px; }
}
@media (max-width: 440px) {
  .trust-bar { grid-template-columns: 1fr; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  height: 100%;
}
.card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(77, 124, 255, 0.35);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid rgba(77, 124, 255, 0.25);
  margin-bottom: 22px;
}
.card-icon svg { width: 22px; height: 22px; color: var(--accent); }

.card h3 { margin-bottom: 10px; }
.card p { color: var(--text-muted); font-size: 0.95rem; }

.card ul {
  list-style: none;
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.card ul li {
  padding: 7px 0 7px 24px;
  position: relative;
  border-top: 1px solid var(--line);
}
.card ul li:first-child { border-top: none; }
.card ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

.card .outcome {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}

/* ---------- Grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

@media (max-width: 960px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat {
  background: var(--bg-raised);
  padding: 36px 28px;
  text-align: center;
}
.stat-number {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
@media (max-width: 860px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ---------- Process steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.step-num::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}
.step h4 { margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
@media (max-width: 960px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Split layout ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 40px; } }

.logo-panel {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(77, 124, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 124, 255, 0.06) 1px, transparent 1px),
    var(--bg-raised);
  background-size: 40px 40px, 40px 40px, auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.logo-panel img { width: 75%; opacity: 0.95; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding: calc(var(--nav-h) + 80px) 0 72px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 70% 90% at 50% -20%, rgba(77, 124, 255, 0.14), transparent 70%),
    var(--bg);
}
.page-hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  position: relative;
}
.page-hero .lead { max-width: 620px; margin-top: 8px; }

/* ---------- FAQ (native details/summary) ---------- */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  border-top: 1px solid var(--line);
}
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 4px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body {
  padding: 0 4px 26px;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 640px;
}

/* ---------- Contact form ---------- */
.form-grid { display: grid; gap: 18px; max-width: 560px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(77, 124, 255, 0.05);
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b94ab' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}
.field select option { background: var(--bg-raised); color: var(--text); }
.field textarea { min-height: 130px; resize: vertical; }

.form-status {
  display: none;
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(61, 220, 151, 0.35);
  background: rgba(61, 220, 151, 0.08);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--ok);
}
.form-status.show { display: block; }

/* checklist */
.checklist { list-style: none; }
.checklist li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.checklist li::before {
  content: "✓";
  font-family: var(--font-mono);
  color: var(--ok);
  flex-shrink: 0;
}

/* ---------- CTA banner ---------- */
.cta {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(77, 124, 255, 0.3);
  border-radius: 24px;
  padding: 72px 48px;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 120% at 50% -30%, rgba(77, 124, 255, 0.25), transparent 60%),
    var(--bg-raised);
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(77, 124, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 124, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, black, transparent 80%);
  pointer-events: none;
}
.cta > * { position: relative; }
.cta .lead { margin: 18px auto 0; max-width: 560px; }
.cta .btn-group { justify-content: center; margin-top: 36px; }

@media (max-width: 600px) { .cta { padding: 56px 28px; } }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
  background: var(--bg-raised);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.footer .brand { margin-bottom: 12px; }
.footer-tag { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); letter-spacing: 0.08em; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-links a { font-size: 0.85rem; color: var(--text-muted); }
.footer-links a:hover { color: #fff; }
.footer-contact a { font-size: 0.85rem; }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* ---------- 404 ---------- */
.notfound {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: calc(var(--nav-h) + 60px) 24px 60px;
}
.notfound .code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.notfound p { color: var(--text-muted); max-width: 420px; }

/* ---------- Scroll reveal (JS-gated, safe without JS) ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
html.js .reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
  .cursor { animation: none; }
}
