/* ════════════════════════════════════════════════════════════════════
   AnySignal site layer — shared polish for every page, loaded right after
   webui/common.css. Night mode only: the datasheet (light) mode used by the
   press releases is left exactly as designed.
   Homepage-only composition and motion live in home.css / motion.js.
   ════════════════════════════════════════════════════════════════════ */

/* ── Tonal ladder and ink ─────────────────────────────────────────────
   One step up from pure black for the page ground, visibly lighter panels,
   and brighter secondary text so the dark reads as depth, not murk. */
html:not(.light-mode) {
  --bg-void:      #060809;
  --bg-primary:   #0B0E11;
  --bg-secondary: #0E1215;
  --bg-surface:   #12171B;
  --bg-card:      #12171B;
  --bg-elevated:  #181E23;
  --text-secondary: #CFD6D2;
  --text-muted:     #A3ADA8;
  --text-dim:       #75807B;

  --site-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --site-emerald: #0F7A51;
  --site-emerald-hover: #11875A;
  --site-emerald-edge: rgba(43, 217, 143, 0.5);
}

body {
  font-kerning: normal;
  font-optical-sizing: auto;
  font-synthesis: none;
}

/* Film grain: a static, fixed noise layer (composited once, free to scroll). */
html:not(.light-mode) body:not(.home)::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Display type: a little air in the leading, balanced breaks. */
.section-title {
  line-height: 1.05;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

/* ── Buttons ──────────────────────────────────────────────────────────
   One geometry everywhere: 4px corners, sans 15/500, 48px (36px in the
   nav). Primary is dark emerald with a fine green edge; secondary is a
   hairline outline. No blur, shine or glow (DESIGN.md). */
html:not(.light-mode) body :is(.btn-primary, .btn.btn-primary, .nav-cta, .nav-links a.nav-cta, .cta-submit) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 4px;
  border: 1px solid var(--site-emerald-edge);
  background: var(--site-emerald);
  color: #F2FFF8;
  font: 500 15px/1 var(--font-sans);
  letter-spacing: -0.005em;
  text-transform: none;
  text-shadow: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: background-color 0.25s var(--site-ease), border-color 0.25s var(--site-ease), color 0.25s var(--site-ease), transform 0.2s var(--site-ease);
}
html:not(.light-mode) body :is(.btn-primary, .btn.btn-primary, .nav-cta, .nav-links a.nav-cta, .cta-submit):hover {
  background: var(--site-emerald-hover);
  border-color: var(--accent);
  color: #fff;
  transform: none;
}
html:not(.light-mode) body :is(.btn-primary, .btn-secondary, .btn-glass, .nav-cta, .cta-submit):active { transform: translateY(1px); }

html:not(.light-mode) body :is(.btn-secondary, .btn.btn-secondary, .btn-glass) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 4px;
  border: 1px solid rgba(242, 245, 243, 0.26);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font: 500 15px/1 var(--font-sans);
  letter-spacing: -0.005em;
  text-transform: none;
  box-shadow: none;
  transition: background-color 0.25s var(--site-ease), border-color 0.25s var(--site-ease), transform 0.2s var(--site-ease);
}
html:not(.light-mode) body :is(.btn-secondary, .btn.btn-secondary, .btn-glass):hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(242, 245, 243, 0.5);
  color: var(--text-primary);
}

/* Nav-sized action */
html:not(.light-mode) body nav :is(.nav-cta, .nav-links a.nav-cta) {
  min-height: 36px;
  padding: 0 14px;
  margin-left: 8px;
  font-size: 14px;
}
/* Mobile sheet action */
html:not(.light-mode) body .mobile-menu .nav-cta { min-height: 48px; padding: 0 28px; font-size: 15px; }

/* ── Navigation ───────────────────────────────────────────────────────
   Sans 14px links with a soft hover plate; the current page is marked
   by ink and a small phosphor dot rather than green text. */
html:not(.light-mode) nav .nav-links a:not(.nav-cta) {
  position: relative;
  padding: 8px 12px;
  border-radius: 6px;
  font: 400 14px/1 var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
  transition: color 0.2s var(--site-ease), background-color 0.2s var(--site-ease);
}
html:not(.light-mode) nav .nav-links a:not(.nav-cta):hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.06); }
html:not(.light-mode) nav .nav-links a.active:not(.nav-cta) { color: var(--text-primary); }
html:not(.light-mode) nav .nav-links a.active:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: var(--accent);
}
html:not(.light-mode) body.nav-compact nav .nav-links { gap: 4px; }

html:not(.light-mode) body.scrolled:not(.home) nav {
  background-color: rgba(16, 21, 25, 0.62);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 32px rgba(0, 0, 0, 0.28);
}

/* ── Smooth scrolling (site.js / Lenis) ───────────────────────────── */
html.lenis, html.lenis body { height: auto; }
html.lenis.lenis-smooth { scroll-behavior: auto !important; }
html.lenis.lenis-stopped { overflow: clip; }

@media (prefers-reduced-motion: reduce) {
  html:not(.light-mode) body :is(.btn-primary, .btn-secondary, .btn-glass, .nav-cta, .cta-submit) { transition: none; }
}
