/* Spike Detector — premium, restrained */
:root {
  --bg: #fafafa;
  --bg-muted: #f4f4f5;
  --ink: #18181b;
  --ink-soft: #3f3f46;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --dark: #0a0a0a;
  --dark-elev: #141414;
  --dark-line: #27272a;
  --dark-ink: #fafafa;
  --dark-muted: #a1a1aa;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.04), 0 24px 48px rgba(0,0,0,.10);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --max: 1120px;
  --pad: clamp(1.25rem, 4vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
code, .mono { font-family: var(--mono); font-size: 0.9em; }

/* Nav — dark over hero, light after scroll */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10,10,10,.78);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.nav.is-light {
  background: rgba(250,250,250,.92);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: #fafafa;
  text-decoration: none;
}
.logo:hover { color: #fff; }
.nav.is-light .logo { color: var(--ink); }
.nav.is-light .logo:hover { color: var(--ink); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}
.nav-links a {
  color: #a1a1aa;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-links a:hover { color: #fafafa; }
.nav.is-light .nav-links a { color: var(--ink-soft); }
.nav.is-light .nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: #fff !important;
  color: #0a0a0a !important;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem !important;
}
.nav-cta:hover { background: #e4e4e7 !important; color: #000 !important; }
.nav.is-light .nav-cta {
  background: var(--ink) !important;
  color: #fff !important;
}
.nav.is-light .nav-cta:hover { background: #000 !important; }
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 40px;
  height: 40px;
  padding: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: #fafafa;
  border-radius: 1px;
}
.nav.is-light .nav-toggle span { background: var(--ink); }

/* Hero — dark to match MT5 */
.hero {
  background: var(--dark);
  color: var(--dark-ink);
  padding: clamp(3rem, 8vw, 5.5rem) var(--pad) clamp(3.5rem, 9vw, 6rem);
  border-bottom: 1px solid var(--dark-line);
}
.hero-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.85rem;
}
.hero .eyebrow { color: #7dd3fc; }
.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0 0 1rem;
  max-width: 18ch;
}
.subhead {
  font-size: 1.05rem;
  color: var(--dark-muted);
  margin: 0 0 1.75rem;
  max-width: 38ch;
  line-height: 1.65;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.hero-note {
  font-size: 0.8rem;
  color: #71717a;
  margin: 0;
}
.hero-caption {
  font-size: 0.75rem;
  color: #71717a;
  margin: 0.85rem 0 0;
  max-width: 36ch;
  line-height: 1.45;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.925rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(37,99,235,.25);
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--dark-ink);
  border-color: var(--dark-line);
  box-shadow: none;
}
.btn-ghost:hover { background: #1a1a1a; color: #fff; border-color: #3f3f46; }
.section .btn { margin-top: 0.5rem; }

/* Device / chart frame */
.device-frame {
  background: var(--dark-elev);
  border: 1px solid var(--dark-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-frame { box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 32px 64px rgba(0,0,0,.45); }
.device-chrome {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  background: #0f0f0f;
  border-bottom: 1px solid var(--dark-line);
}
.dots {
  width: 42px;
  height: 8px;
  border-radius: 4px;
  background: radial-gradient(circle at 4px 50%, #3f3f46 3.5px, transparent 4px),
              radial-gradient(circle at 16px 50%, #3f3f46 3.5px, transparent 4px),
              radial-gradient(circle at 28px 50%, #3f3f46 3.5px, transparent 4px);
  flex-shrink: 0;
}
.device-title {
  font-size: 0.7rem;
  color: #a1a1aa;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.chart-wrap {
  position: relative;
  background: #000;
}
.chart-wrap img {
  width: 100%;
  aspect-ratio: 9 / 12;
  max-height: 520px;
  object-fit: cover;
  object-position: top center;
}
.hero-frame .chart-wrap img {
  max-height: 480px;
  aspect-ratio: 10 / 13;
}

/* Annotations */
.anno {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
  z-index: 2;
}
.anno-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.35), 0 0 0 1px rgba(255,255,255,.2);
  flex-shrink: 0;
}
.anno-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: rgba(10,10,10,.82);
  border: 1px solid rgba(255,255,255,.12);
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

/* Sections */
.section {
  padding: clamp(3.5rem, 8vw, 5.5rem) var(--pad);
}
.muted-bg { background: var(--bg-muted); }
.section-head {
  max-width: var(--max);
  margin: 0 auto 2.25rem;
}
.section-head h2 {
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  font-weight: 600;
}
.section-intro {
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0;
  font-size: 1.02rem;
}
.fine {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 1rem 0 0;
}
.center { text-align: center; }

/* Gallery */
.gallery {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 1.5rem;
}
.gallery-card h3 {
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  margin: 0.9rem 0 0.35rem;
  font-weight: 600;
}
.gallery-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  text-align: left;
  border-radius: 14px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.gallery-open:hover { transform: translateY(-2px); }
.gallery-open:hover .device-frame {
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
.gallery-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.gallery .device-frame {
  background: #111;
  box-shadow: var(--shadow);
}
.gallery .chart-wrap img {
  aspect-ratio: 4 / 5;
  max-height: 520px;
  width: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Steps */
.steps {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.steps li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  box-shadow: var(--shadow);
}
.steps .n {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.65rem;
}
.steps h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.steps p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.925rem;
}

/* Two col */
.two-col {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
.two-col h2 {
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  font-weight: 600;
}
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--bg-muted);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
tr:last-child td { border-bottom: 0; }
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.feature-list li {
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.feature-list li:first-child { padding-top: 0; }
.feature-list li:last-child { border-bottom: 0; }
.feature-list strong { color: var(--ink); font-weight: 600; }

/* Install */
.install {
  max-width: 40rem;
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--ink-soft);
}
.install li { margin-bottom: 0.55rem; }
#install .section-head,
#install .install-col {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}
.install-col .install {
  max-width: none;
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}
.install-col .btn { display: inline-flex; }
.install-col .fine { display: block; margin-top: 1rem; }

/* FAQ */
.faq {
  max-width: 40rem;
  margin: 0 auto;
}
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  margin-bottom: 0.65rem;
  padding: 0 1.1rem;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 1rem 0;
  list-style: none;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 400;
}
.faq details[open] summary::after { content: "–"; }
.faq details p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.925rem;
}

/* Risk */
.risk {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 2rem;
  padding-bottom: 3rem;
}
.risk h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.65rem;
  font-weight: 600;
}
.risk p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 72ch;
}

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--pad);
  background: #fff;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
}
.footer p { margin: 0 0 0.35rem; font-size: 0.9rem; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 0.85rem;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-height: min(82vh, 900px);
  max-width: min(92vw, 720px);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  object-fit: contain;
}
.lightbox p {
  color: #d4d4d8;
  font-size: 0.85rem;
  text-align: center;
  max-width: 40ch;
  margin: 0;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  width: 44px;
  height: 44px;
}

/* Mobile gallery swipe */
@media (max-width: 960px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    max-width: 340px;
    margin: 0 auto;
  }
  .hero h1 { max-width: none; }
  .steps { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: #0f0f0f;
    border-bottom: 1px solid var(--dark-line);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem var(--pad) 1rem;
    gap: 0.15rem;
  }
  .nav.is-light .nav-links {
    background: #fff;
    border-bottom-color: var(--line);
  }
  .nav-links[hidden] { display: none; }
  .nav-links:not([hidden]) { display: flex; }
  .nav-links a { padding: 0.65rem 0.25rem; }
  .nav-cta { text-align: center; margin-top: 0.35rem; }

  .gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .gallery-card {
    flex: 0 0 min(78vw, 300px);
    scroll-snap-align: start;
  }
  .hero { padding-top: 2.5rem; }
}

@media (max-width: 400px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
}

/* Install container alignment */
#install .section-head { margin-bottom: 1.5rem; }
.install-col .btn { margin-top: 0.25rem; }

/* Gallery captions: more breathing room */
.gallery-card h3 { margin-top: 1rem; }
.section-head .eyebrow { color: var(--accent); }
.hero .eyebrow { color: #7dd3fc; }

/* Soft divider under hero caption */
.hero-visual { justify-self: end; width: 100%; max-width: 420px; position: relative; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 10% 0% 0% 0%;
  background: radial-gradient(ellipse at 50% 35%, rgba(37,99,235,.2), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero { overflow: hidden; }
.hero-visual > * { position: relative; z-index: 1; }
@media (min-width: 961px) {
  .hero-visual { justify-self: end; }
}

.gallery-card p { max-width: 42ch; }
.faq { max-width: 42rem; margin-left: auto; margin-right: auto; }
#faq .section-head { text-align: center; }
#faq .section-head .section-intro,
#faq .section-head p { margin-left: auto; margin-right: auto; }
