/* ============================================================
   ALETHEIA Coverage Lattice — design tokens mirror geodesicnexus.com
   ============================================================ */

:root {
  --bg:            #030406;
  --surface:       rgba(5, 8, 12, 0.7);
  --border:        rgba(255, 255, 255, 0.04);
  --border-hover:  rgba(255, 255, 255, 0.10);
  --text:          rgba(255, 255, 255, 0.85);
  --text-muted:    rgba(255, 255, 255, 0.45);
  --text-subtle:   rgba(255, 255, 255, 0.20);
  --cyan:          #0891b2;
  --cyan-bright:   #22d3ee;
  --cyan-dim:      rgba(8, 145, 178, 0.12);
  --cyan-border:   rgba(8, 145, 178, 0.25);

  --c-pets:    #d97706;
  --c-baby:    #38bdf8;
  --c-home:    #a3e635;
  --c-water:   #06b6d4;
  --c-body:    #e879f9;
  --c-food:    #fb923c;
  --c-outdoor: #84cc16;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Syne', system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(8, 145, 178, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 80%, rgba(8, 145, 178, 0.04) 0%, transparent 50%);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
::selection { background: rgba(8, 145, 178, 0.25); }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 3px; }

body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

.hex-bg {
  position: fixed; inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52'%3E%3Cpath d='M30 0l26 15v22L30 52 4 37V15z' fill='none' stroke='%230891b2' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  pointer-events: none;
  z-index: 0;
}

/* ─── NAV ────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(3, 4, 6, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}

.nav-brand {
  font-size: 0.95rem; font-weight: 700; letter-spacing: 0.06em;
  text-decoration: none; color: var(--text);
}

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
  font-size: 0.82rem; color: var(--text-muted);
  text-decoration: none; letter-spacing: 0.04em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--cyan); }

main { position: relative; z-index: 1; padding-top: 56px; }

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  max-width: 920px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--cyan-border);
  background: var(--cyan-dim);
  border-radius: 20px;
  font-size: 0.72rem;
  color: rgba(8, 145, 178, 0.85);
  letter-spacing: 0.14em;
  margin-bottom: 1.75rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.55) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  letter-spacing: 0.03em;
}

.hero-desc {
  max-width: 640px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin: 0 auto;
}
.hero-desc em { color: var(--text); font-style: normal; }

/* ─── CONTAINER ─────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section { padding: 4rem 0; }

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: rgba(255,255,255,0.92);
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* ─── STAGE (lattice + panel) ───────────────────────────── */
.stage { padding-top: 1rem; }

.stage-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.stage-search { flex: 1 1 320px; max-width: 480px; }
.stage-search-input {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: 'Syne', system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}
.stage-search-input:focus { border-color: var(--cyan-border); }
.stage-search-input::placeholder { color: var(--text-muted); }

.stage-toggles { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.toggle-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.toggle-btn:hover { color: var(--text); border-color: var(--border-hover); }
.toggle-btn.active {
  color: var(--cyan); border-color: var(--cyan-border); background: var(--cyan-dim);
}

.toggle-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 5px rgba(8,145,178,0.6);
  animation: live-pulse 2.5s ease-in-out infinite;
}
.toggle-btn:not(.active) .toggle-dot { background: var(--text-subtle); animation: none; box-shadow: none; }

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(8,145,178,0.5); }
  50%      { box-shadow: 0 0 11px rgba(8,145,178,0.9); }
}

.lattice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 2rem;
  align-items: start;
}

.lattice-frame {
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.lattice-frame svg { width: 100%; height: 100%; display: block; }

/* lattice nodes — interaction states */
.lattice-frame .lattice-node { cursor: pointer; outline: none; }
.lattice-frame .lattice-node polygon { transition: fill 0.2s, stroke-width 0.2s; }
.lattice-frame .lattice-node:hover polygon,
.lattice-frame .lattice-node:focus-visible polygon { stroke-width: 2.4 !important; }
.lattice-frame .lattice-node[data-selected="true"] polygon {
  filter: drop-shadow(0 0 6px currentColor);
  stroke-width: 2.4 !important;
}
.lattice-frame.flow-paused .flow-line { animation: none !important; opacity: 0.4; }

.detail-panel {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  min-height: 480px;
  position: sticky;
  top: 80px;
}

.dp-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--text-subtle);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.dp-eyebrow .dp-pill {
  padding: 0.18rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: var(--cyan);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}

.dp-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  color: rgba(255,255,255,0.95);
}
.dp-subtitle {
  font-size: 0.78rem;
  letter-spacing: 0.10em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.dp-body {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}
.dp-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.dp-stat {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
}
.dp-stat-num {
  font-size: 1.05rem; font-weight: 700;
  color: rgba(255,255,255,0.95);
}
.dp-stat-label {
  font-size: 0.62rem; letter-spacing: 0.14em;
  color: var(--text-subtle); text-transform: uppercase;
  margin-top: 0.15rem;
}

.dp-list {
  list-style: none;
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.dp-list li {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.45rem 0.7rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-left: 2px solid var(--cyan);
  border-radius: 4px;
  display: flex; gap: 0.6rem; align-items: flex-start;
}
.dp-list li b { color: var(--text); font-weight: 600; }
.dp-list li.is-pet { border-left-color: var(--c-pets); }
.dp-list li.is-baby { border-left-color: var(--c-baby); }
.dp-list li.is-home { border-left-color: var(--c-home); }
.dp-list li.is-water { border-left-color: var(--c-water); }
.dp-list li.is-body { border-left-color: var(--c-body); }
.dp-list li.is-food { border-left-color: var(--c-food); }
.dp-list li.is-outdoor { border-left-color: var(--c-outdoor); }

.dp-cta {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  background: var(--cyan-dim);
  border: 1px solid var(--cyan-border);
  border-radius: 6px;
  color: var(--cyan-bright);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: background 0.15s;
}
.dp-cta:hover { background: rgba(8,145,178,0.2); }

.stage-hint {
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--text-subtle);
  margin-top: 1.5rem;
  text-transform: uppercase;
}

/* ─── COVERAGE STRIP ─────────────────────────────────────── */
.strip { border-top: 1px solid var(--border); }

.strip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.strip-cell {
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid var(--border);
  border-top: 2px solid var(--cyan);
  border-radius: 10px;
  padding: 1.6rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.strip-cell:hover { background: rgba(255,255,255,0.025); transform: translateY(-2px); }
.strip-num {
  font-size: 2.1rem; font-weight: 800;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.96);
  display: flex; align-items: baseline; gap: 0.1rem;
}
.counter-suffix { font-size: 1.6rem; color: var(--cyan); }
.strip-label {
  font-size: 0.7rem; letter-spacing: 0.16em;
  color: var(--cyan); margin-top: 0.4rem; margin-bottom: 0.8rem;
}
.strip-desc {
  font-size: 0.85rem; color: var(--text-muted); line-height: 1.7;
}

/* ─── HOWTO ─────────────────────────────────────────────── */
.howto { border-top: 1px solid var(--border); }
.howto-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.howto-steps li {
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.6rem;
  display: flex;
  gap: 1rem;
}
.step-num {
  font-size: 0.9rem;
  color: var(--cyan);
  border: 1px solid var(--cyan-border);
  background: var(--cyan-dim);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.howto-steps h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; color: rgba(255,255,255,0.92); }
.howto-steps p  { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }

/* ─── COMPANION CTA ─────────────────────────────────────── */
.companion { border-top: 1px solid var(--border); }
.companion-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: rgba(8,145,178,0.04);
  border: 1px solid rgba(8,145,178,0.15);
  border-radius: 14px;
  padding: 2rem;
}
.companion-title {
  font-size: 1.4rem; font-weight: 700;
  color: rgba(255,255,255,0.95);
  margin: 0.25rem 0 0.4rem;
}
.companion-desc { color: var(--text-muted); font-size: 0.92rem; max-width: 560px; }
.companion-cta {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  background: var(--cyan-dim);
  border: 1px solid var(--cyan-border);
  border-radius: 8px;
  color: var(--cyan-bright);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: background 0.15s;
}
.companion-cta:hover { background: rgba(8,145,178,0.20); }

/* ─── FOOTER ────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
  position: relative; z-index: 1;
}
.footer-links {
  display: flex; gap: 1.6rem; justify-content: center;
  flex-wrap: wrap; margin-bottom: 1.5rem;
}
.footer-links a {
  font-size: 0.82rem; color: var(--text-subtle);
  text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-muted); }
.footer-copy { font-size: 0.7rem; color: var(--text-subtle); opacity: 0.7; }
.footer-copy a { color: inherit; }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 980px) {
  .lattice-grid { grid-template-columns: 1fr; }
  .detail-panel { position: static; min-height: 0; }
}
@media (max-width: 768px) {
  nav { padding: 0 1.25rem; gap: 0.75rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.75rem; }
  .container { padding: 0 1.25rem; }
  .hero { padding: 4rem 1.25rem 2rem; }
  .lattice-frame { padding: 0.5rem; }
}
@media (max-width: 520px) {
  .nav-links a:nth-child(n+3) { display: none; }
  .stage-controls { flex-direction: column; align-items: stretch; }
  .companion-box { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .flow-line, .glow, .toggle-dot { animation: none !important; }
  html { scroll-behavior: auto; }
}
