/* ===== Custom properties ===== */
:root {
  /* brand */
  --color-blue: #1d6fd1;
  --color-blue-light: #4a95e8;   /* read by doppler.js for the spectrum */
  --color-red: #c8322e;          /* read by doppler.js for the pilot bar */
  --color-red-dark: #a52621;

  /* dark theme */
  --bg: #060b16;
  --bg-raised: #0a1224;
  --ink: #e8eefc;
  --muted: #93a4c3;
  --line: rgba(147, 164, 195, 0.16);
  --glass: rgba(255, 255, 255, 0.035);

  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.5);
  --container-width: 1160px;
}

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

html { scroll-behavior: smooth; }

section[id] { scroll-margin-top: 76px; }

body {
  font-family: var(--font-base);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* Author display rules must never resurrect elements hidden via the HTML
   `hidden` attribute (e.g. .sonar-diag is display:flex when shown). */
[hidden] { display: none !important; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-blue);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; border-radius: 6px; }

::selection { background: rgba(29, 111, 209, 0.45); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  font-family: var(--font-base);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-dark) 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(200, 50, 46, 0.35);
}
.btn-primary:hover, .btn-primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(200, 50, 46, 0.5);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  border-color: var(--color-blue-light);
  background: rgba(74, 149, 232, 0.08);
  transform: translateY(-1px);
}
.btn-lg { min-height: 56px; padding: 14px 36px; font-size: 1.1rem; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 11, 22, 0.75);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  position: relative;
}

.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-logo {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 8px rgba(74, 149, 232, 0.5));
}
.brand-name { font-weight: 800; font-size: 1.2rem; letter-spacing: 0.02em; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle .bar {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.is-open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 18, 36, 0.97);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.primary-nav.is-open { max-height: 320px; border-bottom: 1px solid var(--line); }
.primary-nav ul { display: flex; flex-direction: column; padding: 8px 20px 16px; }
.primary-nav li { width: 100%; }
.nav-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--muted);
  font-weight: 500;
}
.nav-link:hover, .nav-link:focus-visible { color: #fff; }
.nav-link--cta { color: var(--color-blue-light); font-weight: 700; }

/* ===== Hero ===== */
.hero {
  position: relative;
  text-align: center;
  padding: 84px 0 92px;
  overflow: hidden;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(74, 149, 232, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 149, 232, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; }

/* Logo embedded in the theme: transparent mark on a soft radial glow ring */
.hero-emblem {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 190px;
  height: 190px;
  margin-bottom: 26px;
}
.hero-emblem::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 35%, rgba(74, 149, 232, 0.28), transparent 60%),
    radial-gradient(circle at 66% 68%, rgba(200, 50, 46, 0.24), transparent 60%);
  filter: blur(6px);
}
.hero-emblem::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.hero-logo {
  position: relative;
  width: 124px;
  height: auto;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px rgba(74, 149, 232, 0.35));
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-blue-light);
  margin-bottom: 18px;
}
.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 18px;
}
.hero-title .grad {
  background: linear-gradient(100deg, var(--color-blue-light) 10%, #8ab8f0 45%, var(--color-red) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tagline {
  max-width: 44em;
  font-size: 1.06rem;
  color: var(--muted);
  margin-bottom: 32px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 36px; }

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.hero-chips li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--glass);
}

/* ===== Sections ===== */
section { padding: 72px 0; }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--color-red);
  text-align: center;
  margin-bottom: 10px;
}
.section-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  letter-spacing: -0.01em;
}
.section-subtitle {
  text-align: center;
  color: var(--muted);
  max-width: 46em;
  margin: 12px auto 0;
}

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== Services ===== */
.services {
  background:
    radial-gradient(ellipse 60% 40% at 85% 0%, rgba(29, 111, 209, 0.08), transparent 70%),
    var(--bg);
}
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 44px;
}
.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 149, 232, 0.45);
  background: rgba(74, 149, 232, 0.05);
  box-shadow: var(--shadow-lg);
}
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(29, 111, 209, 0.12);
  border: 1px solid rgba(74, 149, 232, 0.25);
  color: var(--color-blue-light);
  margin-bottom: 16px;
}
.card-icon svg { width: 24px; height: 24px; }
.card-title { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 14px; }
.card-list { display: flex; flex-direction: column; gap: 6px; }
.card-list li {
  position: relative;
  padding-left: 18px;
  font-size: 0.9rem;
  color: var(--ink);
}
.card-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-red);
}

/* ===== Service groups ===== */
.service-group { margin-top: 48px; }
.service-group + .service-group { margin-top: 64px; }
.service-group-title {
  text-align: center;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.service-group-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-blue-light);
  border: 1px solid rgba(74, 149, 232, 0.35);
  background: rgba(29, 111, 209, 0.1);
  border-radius: 999px;
  padding: 4px 12px;
}
.service-group-desc {
  text-align: center;
  color: var(--muted);
  max-width: 46em;
  margin: 10px auto 0;
  font-size: 0.97rem;
}
.service-group .card-grid { margin-top: 28px; }

.services-cta {
  text-align: center;
  color: var(--muted);
  margin-top: 48px;
}

/* Inline emphasis & links inside muted copy */
.hero-tagline strong, .section-subtitle strong, .service-group-desc strong,
.card p strong, .approach-item p strong, .pricing-copy strong, .about p strong {
  color: var(--ink);
  font-weight: 600;
}
.services-cta a, .pricing-copy a, .about a {
  color: var(--color-blue-light);
  border-bottom: 1px solid rgba(74, 149, 232, 0.4);
}
.services-cta a:hover, .pricing-copy a:hover, .about a:hover { color: #fff; border-bottom-color: #fff; }

/* ===== Pricing strip ===== */
.pricing-strip {
  margin-top: 52px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  text-align: center;
}
.pricing-formula {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-blue-light);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}
.pricing-copy {
  color: var(--muted);
  max-width: 52em;
  margin: 16px auto 0;
  font-size: 0.95rem;
}

/* ===== Approach ===== */
.approach { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-raised); }
.approach-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 40px;
}
.approach-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-red);
  display: block;
  margin-bottom: 8px;
}
.approach-item h3 { color: #fff; font-size: 1.1rem; margin-bottom: 8px; }
.approach-item p { color: var(--muted); font-size: 0.95rem; }

/* ===== About ===== */
.about .container { max-width: 820px; }
.about p { color: var(--muted); margin-top: 18px; }
.about p:first-of-type { margin-top: 32px; color: var(--ink); }

/* ===== Motion Lab (Doppler presence sensing) ===== */
.motion-lab {
  background:
    radial-gradient(ellipse 55% 45% at 15% 100%, rgba(200, 50, 46, 0.07), transparent 70%),
    var(--bg-raised);
  border-top: 1px solid var(--line);
}

.sonar-panel {
  max-width: 760px;
  margin: 40px auto 0;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.sonar-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.sonar-orb {
  --sonar-intensity: 0;
  position: relative;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #101c38, var(--bg) 78%);
  border: 2px solid rgba(74, 149, 232, 0.45);
  box-shadow:
    0 0 calc(12px + var(--sonar-intensity) * 70px) rgba(200, 50, 46, calc(var(--sonar-intensity) * 0.9)),
    inset 0 0 30px rgba(29, 111, 209, 0.3);
  transition: box-shadow 0.12s linear, border-color 0.2s ease;
  flex-shrink: 0;
}
.sonar-orb[data-state='motion'] { border-color: var(--color-red); }
.sonar-orb[data-state='monitoring'] .sonar-ring,
.sonar-orb[data-state='motion'] .sonar-ring {
  animation: sonar-ping 2.4s cubic-bezier(0, 0.4, 0.6, 1) infinite;
}
.sonar-orb[data-state='motion'] .sonar-ring { animation-duration: 1s; }
.sonar-orb[data-state='calibrating'] { border-style: dashed; }

.sonar-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--color-blue-light);
  opacity: 0;
  pointer-events: none;
}
.sonar-ring--2 { animation-delay: 1.2s !important; }
.sonar-orb[data-state='motion'] .sonar-ring { border-color: var(--color-red); }
.sonar-orb[data-state='motion'] .sonar-ring--2 { animation-delay: 0.5s !important; }

@keyframes sonar-ping {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.65); opacity: 0; }
}

.sonar-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.sonar-orb[data-state='motion'] .sonar-status { color: #ff8a86; }

.sonar-readout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 340px;
}
.sonar-metric { display: flex; flex-direction: column; gap: 6px; align-items: stretch; text-align: left; }
.sonar-metric-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.sonar-meter {
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.sonar-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--color-blue-light), var(--color-red));
  transition: width 0.1s linear;
}
.sonar-meter--mic .sonar-meter-fill {
  background: linear-gradient(90deg, #3fbf7f, var(--color-blue-light));
}
.sonar-direction { font-size: 1.05rem; color: #fff; min-height: 1.6em; }
.sonar-pilot { font-size: 0.95rem; color: #fff; font-family: var(--font-mono); }
.sonar-pilot[data-quality='weak'] { color: #ff8a86; }
.sonar-pilot[data-quality='fair'] { color: #f2c14e; }
.sonar-pilot[data-quality='strong'] { color: #3fbf7f; }

#sonarSpectrum {
  width: 100%;
  max-width: 640px;
  height: 110px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
}

.sonar-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 340px;
  text-align: left;
}
.sonar-mic-select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: #fff;
  font-family: var(--font-base);
  font-size: 0.95rem;
  cursor: pointer;
}
.sonar-mic-select:focus-visible { outline: 2px solid var(--color-blue-light); outline-offset: 2px; }

.sonar-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.sonar-diag {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 0.9rem;
  color: var(--ink);
}
.sonar-diag li { display: flex; gap: 10px; align-items: baseline; }
.sonar-diag-icon { font-weight: 700; flex-shrink: 0; }
.sonar-diag li[data-icon='✔'] .sonar-diag-icon { color: #3fbf7f; }
.sonar-diag li[data-icon='✘'] .sonar-diag-icon { color: #ff8a86; }
.sonar-diag li[data-icon='△'] .sonar-diag-icon { color: #f2c14e; }
.sonar-diag li[data-icon='ℹ'] .sonar-diag-icon,
.sonar-diag li[data-icon='…'] .sonar-diag-icon { color: var(--color-blue-light); }

.sonar-note { font-size: 0.85rem; color: var(--muted); max-width: 46em; }
.sonar-hint { font-size: 0.9rem; font-weight: 600; color: #f2c14e; max-width: 42em; }
.sonar-error { font-size: 0.9rem; font-weight: 600; color: #ff8a86; }

/* ===== Contact ===== */
.contact {
  background:
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(29, 111, 209, 0.14), transparent 75%),
    var(--bg);
  text-align: center;
}
.contact .section-subtitle { margin-bottom: 32px; }

/* ===== Footer ===== */
.site-footer { background: var(--bg-raised); border-top: 1px solid var(--line); color: var(--muted); padding: 32px 0; }
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.brand--footer { color: #fff; }
.footer-logo { width: 26px; height: 26px; filter: drop-shadow(0 0 6px rgba(74, 149, 232, 0.4)); }
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: var(--muted); font-size: 0.92rem; min-height: 44px; display: flex; align-items: center; }
.footer-nav a:hover, .footer-nav a:focus-visible { color: #fff; }
.footer-copy { font-size: 0.85rem; color: #6a7d9e; }

/* ===== Tablet ===== */
@media (min-width: 768px) {
  .header-inner { min-height: 72px; }
  .nav-toggle { display: none; }
  .primary-nav { position: static; max-height: none; overflow: visible; background: none; }
  .primary-nav ul { flex-direction: row; align-items: center; gap: 8px; padding: 0; }
  .primary-nav li { width: auto; }
  .nav-link { padding: 0 14px; min-height: 44px; }

  .hero { padding: 110px 0 120px; }
  .hero-title { font-size: 3.4rem; }
  .hero-tagline { font-size: 1.15rem; }

  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .approach-grid { grid-template-columns: repeat(3, 1fr); }
  .service-group-title { font-size: 1.25rem; }

  .section-title { font-size: 2.2rem; }

  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }

  .sonar-display { flex-direction: row; justify-content: center; gap: 48px; }
  .sonar-readout { justify-content: center; }
}

/* ===== Desktop ===== */
@media (min-width: 1024px) {
  section { padding: 92px 0; }
  .card-grid { grid-template-columns: repeat(4, 1fr); }
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
}
