:root {
  color-scheme: dark;

  --bg: #070a10;
  --surface: #0d1320;
  --surface-elevated: #11192b;
  --border: #1e293b;
  --border-strong: #334155;

  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-soft: #cbd5e1;

  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-bg: #052e22;
  --emerald-ink: #a7f3d0;

  --amber: #f59e0b;
  --amber-bg: #451a03;
  --amber-ink: #fde68a;

  --coral: #f43f5e;
  --coral-bg: #4c0519;
  --coral-ink: #fecdd3;

  --cyan: #38bdf8;
  --focus-ring: #38bdf8;

  --scrollbar-track: #0b101b;
  --scrollbar-thumb: #334155;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }
  ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

a {
  color: var(--cyan);
}

:where(a:any-link, button, input, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link:focus {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--emerald);
  color: #03150e;
  font-weight: 700;
  text-decoration: none;
}

.container {
  inline-size: min(1160px, 100% - 2rem);
  margin-inline: auto;
}

/* Header */
.site-header {
  border-block-end: 1px solid var(--border);
  background: #080c14;
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: safe center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  inline-size: 40px;
  block-size: 40px;
  border-radius: 0.5rem;
  border: 1px solid var(--border-strong);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.brand-tag {
  font-size: 0.78rem;
  color: var(--emerald-bright);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.65rem;
  border-radius: 0.45rem;
}

.nav-list a:hover {
  color: var(--text);
  background: var(--surface-elevated);
}

.nav-list .nav-cta {
  background: var(--emerald);
  color: #03150e;
  font-weight: 700;
  padding: 0.55rem 0.95rem;
}

.nav-list .nav-cta:hover {
  background: var(--emerald-bright);
  color: #03150e;
}

/* Hero */
.hero {
  padding-block: 2.5rem 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--emerald-bright);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  font-size: 1.05rem;
  max-inline-size: 62ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block-end: 1.75rem;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 48px;
  padding: 0.65rem 1.2rem;
  border-radius: 0.55rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

.btn-primary {
  background: var(--emerald);
  color: #03150e;
}

.btn-primary:hover {
  background: var(--emerald-bright);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--cyan);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stat-strip li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.8rem 0.9rem;
}

.stat-strip strong {
  display: block;
  font-size: 1.25rem;
  color: var(--text);
}

.stat-strip span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Subscribe Card & Accessible Form */
.subscribe-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 0.9rem;
  padding: 1.5rem;
}

.subscribe-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.card-sub {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  margin-block-end: 1.15rem;
}

.field label {
  font-weight: 700;
  font-size: 0.93rem;
}

.req-mark {
  color: var(--coral);
}

.hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.field input[type="email"] {
  font: inherit;
  font-size: max(1rem, 1em);
  min-block-size: 48px;
  padding: 0.7rem 0.85rem;
  border-radius: 0.5rem;
  border: 1.5px solid var(--border-strong);
  background: #070a10;
  color: var(--text);
}

.error-msg {
  display: none;
  color: var(--coral-ink);
  font-size: 0.86rem;
  font-weight: 600;
  margin-block-start: 0.15rem;
}

input:is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--coral);
  background-color: #1f0a12;
}

input:is(:user-invalid, .user-invalid-fallback) + .error-msg {
  display: block;
}

input:is(:user-valid, .user-valid-fallback) {
  border-color: var(--emerald);
}

.interest-group {
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  padding: 0.85rem 1rem;
  margin: 0 0 1.2rem;
}

.interest-group legend {
  padding-inline: 0.4rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-soft);
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-block-size: 48px;
}

.radio-row input[type="radio"] {
  accent-color: var(--emerald);
  inline-size: 1.15rem;
  block-size: 1.15rem;
  margin: 0;
}

.radio-row label {
  font-size: 0.9rem;
  color: var(--text-soft);
  cursor: pointer;
}

.btn-submit {
  inline-size: 100%;
  min-block-size: 48px;
  border: 0;
  border-radius: 0.55rem;
  background: var(--emerald);
  color: #03150e;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-submit:hover {
  background: var(--emerald-bright);
}

.btn-submit[aria-busy="true"] {
  opacity: 0.75;
  cursor: progress;
}

@media (pointer: coarse) {
  .field input[type="email"],
  .btn-submit,
  .btn-primary,
  .btn-secondary {
    min-block-size: 52px;
  }
}

.form-status {
  margin-block-start: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-status.is-success {
  background: var(--emerald-bg);
  border: 1px solid var(--emerald);
  color: var(--emerald-ink);
}

.form-status.is-error {
  background: var(--coral-bg);
  border: 1px solid var(--coral);
  color: var(--coral-ink);
}

/* Sections */
.section {
  padding-block: 2.25rem;
  border-block-start: 1px solid var(--border);
}

.section-head h2 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
}

.section-desc {
  margin: 0 0 1.4rem;
  color: var(--text-muted);
  max-inline-size: 72ch;
}

/* Gauges Grid */
.gauges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.gauge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.gauge-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.gauge-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}

.tone-green {
  background: var(--emerald-bg);
  border-color: var(--emerald);
  color: var(--emerald-ink);
}

.tone-amber {
  background: var(--amber-bg);
  border-color: var(--amber);
  color: var(--amber-ink);
}

.tone-red {
  background: var(--coral-bg);
  border-color: var(--coral);
  color: var(--coral-ink);
}

.gauge-metric {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--cyan);
}

.gauge-summary {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.gauge-source {
  margin-block-start: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-preview {
  margin: 1.75rem 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.9rem;
}

.weather-img {
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
}

.card-preview figcaption {
  margin-block-start: 0.65rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive Semantic Table */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  container-type: inline-size;
}

.receipts-table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: start;
  --label-1: "Channel";
  --label-2: "Resolved Calls";
  --label-3: "Direct Hits";
  --label-4: "Weighted Accuracy";
}

.receipts-table caption {
  padding: 0.9rem 1rem;
  text-align: start;
  font-size: 0.86rem;
  color: var(--text-muted);
  border-block-end: 1px solid var(--border);
}

.receipts-table th,
.receipts-table td {
  padding: 0.8rem 1rem;
  border-block-end: 1px solid var(--border);
  white-space: nowrap;
}

.receipts-table thead th {
  position: sticky;
  inset-block-start: 0;
  background: var(--surface-elevated);
  color: var(--text-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 1;
}

.receipts-table tbody th {
  font-weight: 700;
  color: var(--text);
}

@container (width < 600px) {
  .receipts-table,
  .receipts-table thead,
  .receipts-table tbody,
  .receipts-table tr,
  .receipts-table th,
  .receipts-table td {
    display: block;
  }

  .receipts-table thead {
    display: none;
  }

  .receipts-table tbody tr {
    margin: 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.55rem;
    overflow: clip;
  }

  .receipts-table tbody th {
    background: var(--surface-elevated);
  }

  .receipts-table td {
    white-space: normal;
  }

  .receipts-table td:nth-child(2)::before {
    content: var(--label-2) ": ";
    color: var(--text-muted);
    font-weight: 600;
  }

  .receipts-table td:nth-child(3)::before {
    content: var(--label-3) ": ";
    color: var(--text-muted);
    font-weight: 600;
  }

  .receipts-table td:nth-child(4)::before {
    content: var(--label-4) ": ";
    color: var(--text-muted);
    font-weight: 600;
  }
}

/* Two-Column Signals */
.two-col-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.panel-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.panel-block h3 {
  margin: 0 0 0.35rem;
  font-size: 1.12rem;
}

.panel-desc {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.signal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.signal-item {
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  padding: 0.75rem 0.9rem;
  background: #090e18;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.signal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.signal-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}

.signal-val {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--emerald-bright);
  white-space: nowrap;
}

.signal-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-block-start: 1px solid var(--border);
  padding-block: 2rem 3rem;
  margin-block-start: 1rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-brand {
  margin: 0 0 0.5rem;
  color: var(--text);
}

.disclaimer {
  margin: 0;
  max-inline-size: 74ch;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.footer-links a {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Forced Colors Mode Support */
@media (forced-colors: active) {
  .gauge-card,
  .subscribe-card,
  .panel-block,
  .table-wrapper,
  .signal-item,
  .stat-strip li,
  .status-pill,
  .btn-primary,
  .btn-secondary,
  .btn-submit {
    border: 1px solid CanvasText;
  }

  .btn-primary,
  .btn-submit,
  .nav-list .nav-cta {
    background: ButtonFace;
    color: ButtonText;
    border: 2px solid ButtonText;
  }

  :where(a:any-link, button, input, [tabindex]):focus-visible {
    outline: 3px solid Highlight;
  }
}
