/* ==========================================================================
   LoRa-Comms Design System
   Palette:
     --navy      #0B1220  base background
     --navy-2    #121B2E  panel background
     --teal      #2F80ED  mesh / tech accent (matches logo blue)
     --amber     #F59E0B  SAR / rescue / CTA accent
     --alert     #EF4444  emergency accent (sparing)
     --mist      #F1F5F9  primary text
     --slate     #7C8BA3  secondary text / borders
   Type: 'Space Grotesk' (display), 'Inter' (body), 'JetBrains Mono' (data)
   ========================================================================== */

:root {
  --navy: #0B1220;
  --navy-2: #121B2E;
  --navy-3: #1A2540;
  --teal: #2F80ED;
  --teal-dim: rgba(47, 128, 237, 0.16);
  --amber: #F59E0B;
  --amber-dim: rgba(245, 158, 11, 0.14);
  --alert: #EF4444;
  --mist: #F1F5F9;
  --slate: #7C8BA3;
  --border: rgba(241, 245, 249, 0.09);
  --radius: 14px;
  --max: 1180px;
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
}

/* Site-wide animated technical / SAR-radar background */
body { position: relative; }
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(47,128,237,.06) 0, rgba(47,128,237,.06) 1px, transparent 1px, transparent 46px),
    repeating-linear-gradient(90deg, rgba(47,128,237,.06) 0, rgba(47,128,237,.06) 1px, transparent 1px, transparent 46px);
  animation: gridDrift 34s linear infinite;
}
body::after {
  content: '';
  position: fixed; top: 50%; left: 50%;
  width: 170vmax; height: 170vmax;
  margin-left: -85vmax; margin-top: -85vmax;
  z-index: 0; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(47,128,237,.18), transparent 16%, transparent 100%);
  animation: radarSpin 7s linear infinite;
  opacity: .5;
  mix-blend-mode: screen;
}
@keyframes gridDrift { to { background-position: 46px 46px, -46px 46px; } }
@keyframes radarSpin { to { transform: rotate(360deg); } }
body > nav, body > header, body > section, body > footer, body > button, body > div {
  position: relative; z-index: 1;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.no-scroll { overflow: hidden; }
body {
  margin: 0;
  background: var(--navy);
  color: var(--mist);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--slate); }
a { color: var(--teal); text-decoration: none; }
img, svg { max-width: 100%; display: block; }
.mono { font-family: 'JetBrains Mono', monospace; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
section { padding: 88px 0; position: relative; }
.section-tight { padding: 56px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--teal-dim);
}
.eyebrow.amber { color: var(--amber); }
.eyebrow.amber::before { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-dim); }

.lede { font-size: 1.15rem; color: var(--slate); max-width: 640px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 10px;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  text-decoration: none;
}
.btn-primary { background: var(--amber); color: #1A1200; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(245,158,11,.3); }
.btn-ghost { background: transparent; color: var(--mist); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(45,212,191,.28); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 18px; font-size: .85rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,18,32,0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--teal), #6FB1FF, var(--teal));
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 10px 24px; max-width: 1700px; margin: 0 auto; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--mist); flex-shrink: 0; }
.brand .dot-logo { width: 30px; height: 30px; }
.brand-logo {
  height: 68px; width: auto;
  background: #fff;
  padding: 8px 16px;
  border-radius: 10px;
}
footer .brand-logo { height: 60px; }
.nav-links { display: flex; align-items: center; gap: 8px; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; }
.nav-links a {
  color: var(--slate); font-size: .85rem; font-weight: 600;
  padding: 12px 18px; border-radius: 9px;
  background: var(--navy-2); border: 1px solid var(--border);
  transition: all .15s ease; white-space: nowrap;
}
.nav-links a:hover { color: var(--mist); border-color: rgba(47,128,237,.45); background: var(--navy-3); transform: translateY(-1px); }
.nav-links a.active { color: #fff; background: var(--teal); border-color: var(--teal); }
.nav-cta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; background: var(--navy-2); border: 1px solid var(--border);
  border-radius: 9px; color: var(--mist); font-size: 1.3rem; cursor: pointer; flex-shrink: 0;
}
.nav-scrim {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: rgba(5,9,18,.55); backdrop-filter: blur(2px);
}
.nav-scrim.open { display: block; }

@media (max-width: 1580px) {
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 95;
    background: var(--navy-2); flex-direction: column; align-items: stretch;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); gap: 8px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: transform .2s ease, opacity .2s ease, visibility .2s;
    max-height: calc(100vh - 100%); overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,.4);
  }
  .nav-links a { width: 100%; padding: 15px 18px; font-size: .98rem; text-align: center; }
  .nav-links.open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-toggle { display: flex; }
}

@media (max-width: 640px) {
  .nav-inner { padding: 8px 16px; gap: 10px; }
  .brand-logo { height: 42px; padding: 6px 10px; border-radius: 8px; }
  .nav-cta { gap: 8px; }
  .nav-cta .btn-primary.btn-sm { padding: 9px 14px; font-size: .8rem; }
}

/* Cards */
.card {
  background: var(--navy-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(47,128,237,.4); box-shadow: 0 14px 40px rgba(47,128,237,.14); }
.card-icon {
  width: 46px; height: 46px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal-dim); color: var(--teal); margin-bottom: 16px;
}
.card-icon.amber { background: var(--amber-dim); color: var(--amber); }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Hero */
.hero { padding: 120px 0 90px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.mesh-bg { position: absolute; inset: 0; opacity: .5; pointer-events: none; z-index: 0; }

/* Stats */
.stat { text-align: center; }
.stat-num { font-family: 'JetBrains Mono', monospace; font-size: 2.1rem; font-weight: 700; color: var(--teal); }
.stat-label { font-size: .82rem; color: var(--slate); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }

/* Tags / badges */
.tag { display: inline-block; font-size: .72rem; font-family: 'JetBrains Mono', monospace; padding: 4px 10px; border-radius: 100px; background: var(--teal-dim); color: var(--teal); border: 1px solid rgba(45,212,191,.25); }
.tag.amber { background: var(--amber-dim); color: var(--amber); border-color: rgba(245,158,11,.25); }
.tag.alert { background: rgba(239,68,68,.12); color: var(--alert); border-color: rgba(239,68,68,.25); }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); }
th { font-family: 'JetBrains Mono', monospace; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--slate); }
td { color: var(--mist); }

/* Forms */
.field { margin-bottom: 18px; }
label { display: block; font-size: .85rem; color: var(--slate); margin-bottom: 6px; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: 12px 14px; background: var(--navy);
  border: 1px solid var(--border); border-radius: 9px; color: var(--mist);
  font-family: 'Inter', sans-serif; font-size: .95rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); }
.form-panel { background: var(--navy-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.confirm-msg { display: none; padding: 16px 18px; background: var(--teal-dim); border: 1px solid rgba(47,128,237,.35); border-radius: 10px; color: var(--teal); font-size: .9rem; margin-top: 16px; }
.confirm-msg.show { display: block; }
.confirm-msg.confirm-error { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: var(--alert); }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 56px 0 32px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--slate); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--mist); font-size: .9rem; margin-bottom: 10px; opacity: .85; }
.footer-col a:hover { color: var(--teal); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--slate); flex-wrap: wrap; gap: 10px; }

/* Page header (interior pages) */
.page-head {
  padding: 150px 0 60px; border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse 900px 400px at 20% 0%, rgba(47,128,237,.16), transparent 70%);
}

/* Motto */
.motto {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: .95rem;
  color: var(--teal); letter-spacing: .02em;
}
.motto::before, .motto::after { content: ''; width: 22px; height: 1px; background: rgba(47,128,237,.5); }

/* Utility */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-10 { gap: 10px; }
.mt-0 { margin-top: 0; }
.small { font-size: .85rem; }
.divider { height: 1px; background: var(--border); margin: 40px 0; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* AI Assistant widget */
#assistant-toggle {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--teal); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 12px 30px rgba(47,128,237,.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
#assistant-toggle:hover { transform: scale(1.06); }
#assistant-panel {
  position: fixed; bottom: 94px; right: 24px; z-index: 200;
  width: 340px; max-width: calc(100vw - 40px); max-height: 460px;
  background: var(--navy-2); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); display: none; flex-direction: column; overflow: hidden;
}
#assistant-panel.open { display: flex; }
.a-head { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.a-head strong { font-size: .92rem; }
.a-head span { display: block; font-size: .74rem; color: var(--slate); margin-top: 2px; }
.a-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.a-msg { font-size: .87rem; padding: 10px 13px; border-radius: 10px; max-width: 85%; line-height: 1.45; }
.a-msg.bot { background: var(--navy); color: var(--mist); align-self: flex-start; border: 1px solid var(--border); }
.a-msg.user { background: var(--teal-dim); color: var(--teal); align-self: flex-end; }
.a-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.a-chip { font-size: .74rem; padding: 6px 10px; border-radius: 100px; border: 1px solid var(--border); color: var(--slate); background: transparent; cursor: pointer; }
.a-chip:hover { border-color: var(--teal); color: var(--teal); }
.a-input-row { display: flex; border-top: 1px solid var(--border); }
.a-input-row input { border: none; border-radius: 0; background: transparent; }
.a-input-row button { background: none; border: none; color: var(--teal); padding: 0 16px; cursor: pointer; font-weight: 600; }

/* Device photo panel */
.device-photo { background: #fff; border-radius: 16px; padding: 18px; }
.device-photo img { border-radius: 10px; width: 100%; }

/* Pin-drop route planner */
.route-strip {
  position: relative; height: 100px;
  background: linear-gradient(180deg, var(--navy-3), var(--navy-2));
  border: 1px dashed rgba(47,128,237,.45); border-radius: 12px;
  cursor: crosshair; overflow: hidden; margin-top: 10px;
}
.route-strip::before {
  content: ''; position: absolute; left: 16px; right: 16px; top: 50%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--teal) 0 10px, transparent 10px 22px);
  transform: translateY(-50%); opacity: .55;
}
.route-strip .hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--slate); font-size: .82rem; pointer-events: none; }
.route-pin {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--teal); color: #fff; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 4px 14px rgba(47,128,237,.55); cursor: pointer;
}
.route-pin.pin-amber { background: var(--amber); box-shadow: 0 4px 14px rgba(245,158,11,.5); }
.stop-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--navy); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px; font-size: .87rem;
}
.stop-list-item .remove-stop { background: none; border: none; color: var(--alert); cursor: pointer; font-size: 1rem; line-height: 1; padding: 4px; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
