/* ferroacs landing page — clean, zero-dependency, responsive light/dark styling */
:root {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0f766e;
  --accent-strong: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --amber: #d97706;
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 28px 80px rgba(15, 23, 42, 0.14);
  --radius: 14px;
  --max: 1160px;
}

:root[data-theme="dark"] {
  --bg: #080d17;
  --bg-alt: #0d1525;
  --surface: #111b2e;
  --surface-2: #17233b;
  --border: #1f2e4a;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --amber: #f59e0b;
  --code-bg: #050911;
  --code-fg: #e2e8f0;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080d17;
    --bg-alt: #0d1525;
    --surface: #111b2e;
    --surface-2: #17233b;
    --border: #1f2e4a;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #2dd4bf;
    --accent-strong: #14b8a6;
    --accent-soft: rgba(45, 212, 191, 0.14);
    --amber: #f59e0b;
    --code-bg: #050911;
    --code-fg: #e2e8f0;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.55);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

/* Header */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.14);
}
.brand-mark svg {
  width: 18px;
  height: 18px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-links a { color: var(--muted); white-space: nowrap; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--accent); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-strong), #0284c7);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(13, 148, 136, 0.28);
}
.btn-primary:hover { color: #ffffff; box-shadow: 0 14px 34px rgba(13, 148, 136, 0.38); }
.btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 12px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 64px;
  background:
    radial-gradient(900px 420px at 50% -10%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-copy { text-align: center; max-width: 820px; margin: 0 auto; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.hero p.lead {
  margin: 0 auto 30px;
  max-width: 680px;
  font-size: clamp(1.04rem, 1.8vw, 1.2rem);
  color: var(--muted);
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}
.hero-sub { font-size: 0.86rem; color: var(--muted); margin-bottom: 42px; }

/* Metric strip */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0 auto 42px;
  max-width: 920px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.metric strong {
  display: block;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.metric span { font-size: 0.84rem; color: var(--muted); }

/* Hero frame */
.browser-frame {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.dot.r { background: #ef4444; }
.dot.y { background: #f59e0b; }
.dot.g { background: #10b981; }
.browser-url {
  margin-left: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

/* Sections */
section { padding: 80px 0; }
section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sec-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.sec-head h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  letter-spacing: -0.03em;
}
.sec-head p { margin: 0; color: var(--muted); font-size: 1.04rem; }

/* Videos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.video-card video {
  width: 100%;
  aspect-ratio: 16 / 9.5;
  background: #0b1120;
  object-fit: cover;
}
.video-meta { padding: 20px 22px; }
.video-meta h3 { margin: 0 0 8px; font-size: 1.12rem; }
.video-meta p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* Feature cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  font-weight: 800;
  font-size: 1.05rem;
}
.card h3 { margin: 0 0 8px; font-size: 1.08rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* Architecture diagram */
.arch-box {
  margin-top: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.arch-box svg { width: 100%; height: auto; }

/* Gallery */
.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}
.tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.tab-btn.active, .tab-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.shot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.shot-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.shot-card.hidden { display: none; }
.shot-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-bottom: 1px solid var(--border); }
.shot-card figcaption { padding: 14px 16px; }
.shot-card strong { display: block; font-size: 0.95rem; margin-bottom: 4px; }
.shot-card span { font-size: 0.85rem; color: var(--muted); }

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Quickstart CTA */
.cta-box {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-strong) 14%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 20px;
  padding: 40px 34px;
  box-shadow: var(--shadow-lg);
}
.cta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.cta-top h2 { margin: 0 0 6px; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.03em; }
.cta-top p { margin: 0; color: var(--muted); }
.code-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.code-panel {
  position: relative;
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 12px;
  padding: 20px 22px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  display: none;
}
.code-panel.active { display: block; }
.code-panel pre { margin: 0; }
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  cursor: pointer;
}
.copy-btn:hover { border-color: #2dd4bf; color: #2dd4bf; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox-inner {
  max-width: 1180px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.lightbox img { width: 100%; max-height: 82vh; object-fit: contain; background: var(--bg-alt); }

/* Footer */
footer {
  padding: 46px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }

@media (max-width: 960px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: 1fr; }
  .cards, .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}
@media (max-width: 620px) {
  .cards, .gallery-grid { grid-template-columns: 1fr; }
  .cta-box { padding: 26px 20px; }
}
