/* ===========================================================
   GridWatch — Design Tokens
   Control-room dashboard aesthetic. Dark base, three status
   colors carried over from the app itself, cyan as the one
   interactive/brand accent (kept separate from status colors
   so it never gets mistaken for a state).
=========================================================== */
:root {
  --bg: #0a0e12;
  --surface: #121820;
  --surface-2: #1a222b;
  --border: #232d38;
  --text: #e7edf1;
  --text-muted: #8592a0;
  --text-faint: #566270;

  --green: #34d399;   /* normal / online   */
  --amber: #fbbf24;   /* warning           */
  --red:   #f87171;   /* critical / offline*/
  --cyan:  #4fc3f7;   /* brand / interactive only */

  --nav-bg: rgba(10, 14, 18, 0.82);
  --grid-line: rgba(79, 195, 247, 0.035);
  --shadow-phone: 0 30px 60px -30px rgba(0,0,0,0.6);
  --btn-primary-bg: #4fc3f7;
  --btn-primary-hover: #7ad2f9;
  --btn-primary-text: #06121a;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --max-w: 1120px;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;

  --green: #10b981;
  --amber: #f59e0b;
  --red:   #ef4444;
  --cyan:  #0284c7;

  --nav-bg: rgba(255, 255, 255, 0.85);
  --grid-line: rgba(2, 132, 199, 0.05);
  --shadow-phone: 0 20px 40px -15px rgba(15, 23, 42, 0.12);
  --btn-primary-bg: #0284c7;
  --btn-primary-hover: #0369a1;
  --btn-primary-text: #ffffff;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a0e12;
  --surface: #121820;
  --surface-2: #1a222b;
  --border: #232d38;
  --text: #e7edf1;
  --text-muted: #8592a0;
  --text-faint: #566270;

  --green: #34d399;
  --amber: #fbbf24;
  --red:   #f87171;
  --cyan:  #4fc3f7;

  --nav-bg: rgba(10, 14, 18, 0.82);
  --grid-line: rgba(79, 195, 247, 0.035);
  --shadow-phone: 0 30px 60px -30px rgba(0,0,0,0.6);
  --btn-primary-bg: #4fc3f7;
  --btn-primary-hover: #7ad2f9;
  --btn-primary-text: #06121a;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #475569;
    --text-faint: #94a3b8;

    --green: #10b981;
    --amber: #f59e0b;
    --red:   #ef4444;
    --cyan:  #0284c7;

    --nav-bg: rgba(255, 255, 255, 0.85);
    --grid-line: rgba(2, 132, 199, 0.05);
    --shadow-phone: 0 20px 40px -15px rgba(15, 23, 42, 0.12);
    --btn-primary-bg: #0284c7;
    --btn-primary-hover: #0369a1;
    --btn-primary-text: #ffffff;

    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* faint schematic grid, sits behind everything */
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
  z-index: 0;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.2px;
  text-decoration: none;
}
.brand-mark {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav-cta:hover {
  background: var(--btn-primary-hover);
}
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-faint);
  background: var(--surface-2);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }
}

.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: inline-flex;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn-primary:hover { background: var(--btn-primary-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--text-faint); }

/* ---------- Status chips (mirrors in-app status language) ---------- */
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.dot-green { background: var(--green); box-shadow: 0 0 0 3px rgba(52,211,153,0.15); }
.dot-amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(251,191,36,0.15); }
.dot-red   { background: var(--red);   box-shadow: 0 0 0 3px rgba(248,113,113,0.15); }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 64px;
  text-align: left;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  text-transform: uppercase;
}
.eyebrow .dot-green { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .eyebrow .dot-green { animation: none; }
}

h1.hero-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  max-width: 15ch;
}
h1.hero-title .accent { color: var(--cyan); }

.hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 46ch;
  margin: 0 0 34px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }

/* ---------- Live strip (signature element) ---------- */
.live-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  position: relative;
}
.live-strip::before, .live-strip::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}
.live-strip::before { left: 0; background: linear-gradient(90deg, var(--surface), transparent); }
.live-strip::after  { right: 0; background: linear-gradient(270deg, var(--surface), transparent); }

.strip-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: scroll-strip 34s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .strip-track { animation: none; }
}
@keyframes scroll-strip {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.strip-node {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.strip-node .id { color: var(--text); }
.strip-node .val { color: var(--text-faint); }

/* ---------- Sections ---------- */
section { padding: 88px 0; position: relative; z-index: 1; }
.section-head { max-width: 56ch; margin-bottom: 48px; }
.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
  display: block;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 36px);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.section-sub { color: var(--text-muted); font-size: 15.5px; margin: 0; }

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feature-card {
  background: var(--surface);
  padding: 28px 24px;
}
.feature-card .icon {
  width: 34px; height: 34px;
  margin-bottom: 18px;
  color: var(--cyan);
}
.feature-card h3 {
  font-family: var(--font-display);
  font-size: 16.5px;
  margin: 0 0 8px;
  font-weight: 600;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}
@media (max-width: 860px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
}

/* ---------- Phone mockups ---------- */
.screens-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 860px) {
  .screens-row { grid-template-columns: 1fr; max-width: 320px; margin: 0 auto; }
}
.phone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 10px;
  box-shadow: var(--shadow-phone);
}
.phone-screen {
  background: var(--bg);
  border-radius: 18px;
  padding: 14px 12px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.phone-cap { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 14px; }

.mock-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.mock-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mock-id { font-family: var(--font-mono); font-size: 11px; color: var(--text); }
.mock-region { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }
.mock-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-green { background: rgba(52,211,153,0.12); color: var(--green); }
.badge-amber { background: rgba(251,191,36,0.12); color: var(--amber); }
.badge-red   { background: rgba(248,113,113,0.12); color: var(--red); }
.mock-metrics { display: flex; gap: 8px; margin-top: 8px; }
.mock-metric { flex: 1; background: var(--bg); border-radius: 6px; padding: 6px 8px; }
.mock-metric .n { font-family: var(--font-mono); font-size: 13px; }
.mock-metric .l { font-size: 9px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }

.mock-map {
  flex: 1;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 30% 30%, rgba(52,211,153,0.18), transparent 40%),
    radial-gradient(circle at 70% 55%, rgba(251,191,36,0.16), transparent 35%),
    radial-gradient(circle at 45% 75%, rgba(248,113,113,0.18), transparent 35%),
    var(--surface-2);
  position: relative;
  border: 1px solid var(--border);
}
.mock-pin {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}

.mock-chart {
  height: 74px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 8px;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.cta-band h2 { margin-bottom: 14px; }
.cta-band p { color: var(--text-muted); margin: 0 0 30px; }
.cta-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
footer {
  padding: 48px 0 60px;
  border-top: 1px solid var(--border);
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-links { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13.5px;
}
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text-faint); font-size: 13px; }

/* ---------- Simple content pages (privacy / support) ---------- */
.page-header {
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--border);
}
.page-header .section-label { margin-bottom: 14px; }
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.page-header .updated {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

.content {
  max-width: 74ch;
  padding: 56px 24px 100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.content h2 {
  font-size: 20px;
  margin: 40px 0 12px;
}
.content h2:first-child { margin-top: 0; }
.content p, .content li {
  color: var(--text-muted);
  font-size: 15px;
}
.content ul { padding-left: 20px; }
.content strong { color: var(--text); }
.content a.inline-link {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 32px 0 8px;
}
.toc-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 10px;
  display: block;
}
.toc ol { margin: 0; padding-left: 20px; }
.toc a { color: var(--text-muted); text-decoration: none; font-size: 14px; }
.toc a:hover { color: var(--cyan); }
.toc li { margin-bottom: 6px; }

/* ---------- Support page specifics ---------- */
.support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 8px 0 8px;
}
@media (max-width: 700px) { .support-grid { grid-template-columns: 1fr; } }
.support-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}
.support-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 6px;
}
.support-card p { margin: 0 0 14px; }
.support-card a.inline-link { font-size: 14px; }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.faq-item:first-child { padding-top: 0; }
.faq-item h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15.5px;
  color: var(--text);
  margin: 0 0 8px;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.faq-item h3 .dot { margin-top: 3px; }
.faq-item p { margin: 0; padding-left: 18px; }

.status-key {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}
.status-key span {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--text-muted);
}
