/* terranalytics hub — one dark stylesheet, zero frameworks */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0c0a07;
  --bg-card:  #151210;
  --bg-raise: #1c1814;
  --border:   #2a2318;
  --border-hi:#4a3d22;
  --text:     #e8e0d0;
  --muted:    #8a7e6b;
  --dim:      #5c5347;
  --gold:     #c9a84c;
  --gold-hi:  #e5c76b;
  --green:    #34d399;
  --radius:   12px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

.glow-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 700px 420px at 50% 12%, rgba(201,168,76,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 82% 85%, rgba(201,168,76,0.025) 0%, transparent 70%),
    var(--bg);
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 28px; }

a { color: inherit; text-decoration: none; }

/* ===== Hero ===== */
.hero { padding: 68px 0 8px; text-align: center; }
.hero-mark {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: var(--gold);
  opacity: 0.75;
}
.hero-tagline {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.1rem);
  font-weight: 400;
  margin-top: 14px;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-tagline span { color: var(--gold); }
.hero-sub {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 300;
  color: var(--muted);
  margin: 14px auto 0;
  max-width: 480px;
}

/* ===== Network pulse ===== */
.pulse {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  min-height: 38px;
}
.pulse-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color .15s ease, transform .15s ease;
  white-space: nowrap;
}
.pulse-chip:hover { border-color: var(--gold); transform: translateY(-1px); }
.pulse-chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
  box-shadow: 0 0 6px rgba(201,168,76,0.6);
}
.pulse-chip.is-alert .dot { background: var(--green); box-shadow: 0 0 6px rgba(52,211,153,0.6); }
.pulse-chip.is-static { color: var(--muted); }
.pulse-chip.is-static .dot { background: var(--dim); box-shadow: none; }

/* ===== Search ===== */
.search-sec { padding: 30px 0 8px; }
.search-wrap { position: relative; max-width: 640px; margin: 0 auto; }
.search-icon {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--dim);
  pointer-events: none;
}
#q {
  width: 100%;
  padding: 15px 20px 15px 48px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
#q::placeholder { color: var(--dim); }
#q:focus { border-color: var(--border-hi); box-shadow: 0 0 0 3px rgba(201,168,76,0.08); }
#q::-webkit-search-cancel-button { display: none; }

.results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  z-index: 50;
  max-height: 380px;
  overflow-y: auto;
  background: var(--bg-raise);
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
  padding: 6px;
}
.res-group {
  padding: 8px 12px 3px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.res-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.9rem;
  cursor: pointer;
}
.res-item .res-dest { font-size: 0.72rem; color: var(--dim); white-space: nowrap; }
.res-item.is-active,
.res-item:hover { background: rgba(201,168,76,0.1); }
.res-item.is-active .res-dest { color: var(--muted); }
.res-empty { padding: 12px; font-size: 0.85rem; color: var(--muted); }
.res-fallback {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  color: var(--gold);
  font-size: 0.82rem;
}

/* ===== Sections ===== */
.section { padding: 56px 0 0; }
.sec-head { text-align: center; margin-bottom: 30px; }
.sec-title {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sec-title span { color: var(--gold); }
.sec-sub {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--muted);
  max-width: 620px;
  margin: 10px auto 0;
}

/* ===== Honest Numbers ===== */
.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.score-card {
  display: block;
  padding: 26px 24px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s ease, transform .15s ease;
  position: relative;
  overflow: hidden;
}
.score-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.55;
}
.score-card:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.score-league {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.score-num {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 3.6rem;
  line-height: 1.1;
  color: var(--gold-hi);
  margin-top: 6px;
}
.score-num span { font-size: 2rem; color: var(--gold); }
.score-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-top: 2px;
}
.score-note {
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.55;
}
.score-method {
  font-size: 0.68rem;
  color: var(--dim);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  letter-spacing: 0.03em;
}

.live-record {
  margin-top: 16px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.live-record-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(52,211,153,0.7);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.live-record-body {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 10px;
  font-size: 0.9rem;
}
.live-record-body strong { color: var(--gold-hi); font-weight: 600; }

/* ===== Site cards ===== */
.site-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.site-card {
  display: flex;
  flex-direction: column;
  padding: 24px 22px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s ease, transform .15s ease;
}
.site-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.site-icon { font-size: 1.5rem; line-height: 1; }
.site-name {
  font-size: 1.02rem;
  font-weight: 600;
  margin-top: 12px;
  letter-spacing: 0.01em;
}
.site-pitch {
  font-size: 0.83rem;
  font-weight: 300;
  color: var(--muted);
  margin-top: 6px;
  flex: 1;
}
.site-link {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gold);
  margin-top: 16px;
  letter-spacing: 0.04em;
}

/* ===== Footer ===== */
.footer {
  margin-top: 72px;
  padding: 30px 0 44px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-links { font-size: 0.85rem; }
.footer-links a { color: var(--gold); transition: color .15s ease; }
.footer-links a:hover { color: var(--gold-hi); }
.footer-links .sep { color: var(--dim); margin: 0 10px; }
.footer-honest { font-size: 0.78rem; color: var(--muted); margin-top: 10px; }
.footer-legal {
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--dim);
  margin-top: 14px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Mobile ===== */
@media (max-width: 860px) {
  .score-grid, .site-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .hero { padding-top: 52px; }
  .score-grid, .site-grid { grid-template-columns: 1fr; }
  .score-num { font-size: 3.1rem; }
  .pulse { gap: 8px; }
  .pulse-chip { font-size: 0.74rem; padding: 6px 12px; }
  #q { font-size: 16px; } /* prevent iOS zoom */
  .results { max-height: 300px; }
  .section { padding-top: 44px; }
}
