/* ============================================================
   DISPATCH — financial-terminal editorial design system
   Shared primitives for SEO pages. Default accent: cyan (brand).
   Override via .d-warning wrapper for amber (404/error pages).
   ============================================================ */

:root {
  --d-accent: #06b6d4;          /* brand cyan */
  --d-accent-bright: #22d3ee;
  --d-accent-dim: #0e7490;
  --d-rule: rgba(6, 182, 212, 0.18);
  --d-rule-strong: rgba(6, 182, 212, 0.42);
  --d-text: #e2e8f0;
  --d-muted: #94a3b8;
  --d-quiet: #64748b;
  --d-divider: rgba(100, 116, 139, 0.18);
  --d-surface: rgba(15, 23, 42, 0.45);
  --d-surface-deep: #0b1220;
  --d-mono: ui-monospace, "SF Mono", "Menlo", "Monaco", "Consolas", "Liberation Mono", monospace;
  --d-display: "Orbitron", ui-monospace, monospace;
}

/* Amber variant — for 404 / warning / not-found pages */
.d-warning {
  --d-accent: #f59e0b;
  --d-accent-bright: #fbbf24;
  --d-accent-dim: #b45309;
  --d-rule: rgba(245, 158, 11, 0.18);
  --d-rule-strong: rgba(245, 158, 11, 0.42);
}

/* === EYEBROW =========================================================== */
.d-eyebrow {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 40px 0 24px;
  font-family: var(--d-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.d-eyebrow .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--d-accent);
}
.d-eyebrow .dot {
  width: 8px; height: 8px;
  background: var(--d-accent);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.55);
}
.d-warning .d-eyebrow .dot {
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}
.d-eyebrow .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--d-rule-strong), transparent);
}
.d-eyebrow .code {
  color: var(--d-quiet);
  font-weight: 400;
  letter-spacing: 0.15em;
}

/* === MASTHEAD / DISPLAY TYPE =========================================== */
.d-masthead {
  margin: 8px 0 48px;
}
.d-display {
  font-family: var(--d-display);
  font-weight: 700;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--d-accent);
  margin: 0;
  text-shadow: 0 0 60px rgba(6, 182, 212, 0.16);
}
.d-warning .d-display { text-shadow: 0 0 60px rgba(245, 158, 11, 0.18); }
.d-display--xl {
  font-size: clamp(80px, 16vw, 180px);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.d-display .prefix {
  font-weight: 400;
  color: var(--d-accent-dim);
  font-size: 0.62em;
  letter-spacing: -0.04em;
}
.d-tagline {
  font-family: var(--d-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--d-quiet);
  margin: 16px 0 0;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.d-tagline strong { color: var(--d-text); font-weight: 500; }

/* === BODY COPY ========================================================= */
.d-body {
  max-width: 680px;
  margin: 0 0 48px;
  padding-left: 24px;
  border-left: 1px solid var(--d-rule);
  color: var(--d-text);
  font-size: 16px;
  line-height: 1.6;
}
.d-body p { margin: 0 0 12px; text-wrap: pretty; }
.d-body p:last-child { margin: 0; }
.d-body .quiet { color: var(--d-muted); font-size: 14.5px; }

/* === SECTION LABEL ===================================================== */
.d-label {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 56px 0 18px;
  font-family: var(--d-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--d-accent);
}
.d-label .count {
  color: var(--d-quiet);
  font-weight: 400;
  letter-spacing: 0.12em;
}
.d-label .rule {
  flex: 1;
  height: 1px;
  background: var(--d-rule);
  transform: translateY(-3px);
}

/* === STOCK TAPE — chip row with hairline dividers ====================== */
.d-tape {
  display: flex;
  flex-wrap: wrap;
  font-family: var(--d-mono);
  font-size: 15px;
  line-height: 1.4;
  margin: 0 -14px;
}
.d-tape a, .d-tape .item {
  color: var(--d-text);
  text-decoration: none;
  padding: 6px 14px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  position: relative;
  transition: color 120ms ease, background 120ms ease;
}
.d-tape a + a::before,
.d-tape .item + .item::before,
.d-tape a + .item::before,
.d-tape .item + a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background: var(--d-divider);
}
.d-tape a:hover {
  color: var(--d-accent);
  background: color-mix(in srgb, var(--d-accent) 8%, transparent);
}
.d-tape .count {
  color: var(--d-quiet);
  font-size: 12px;
  font-feature-settings: "tnum" 1;
}

/* === ROUTES — numbered editorial list ================================= */
.d-routes {
  list-style: none;
  padding: 0;
  margin: 0;
}
.d-routes li {
  display: grid;
  grid-template-columns: 48px 1fr 24px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--d-divider);
  transition: background 120ms ease;
}
.d-routes li:last-child { border-bottom: none; }
.d-routes li:hover {
  background: color-mix(in srgb, var(--d-accent) 5%, transparent);
}
.d-routes .num {
  font-family: var(--d-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--d-accent);
  font-weight: 600;
}
.d-routes a {
  color: var(--d-text);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
}
.d-routes li:hover a { color: var(--d-accent-bright); }
.d-routes .arrow {
  font-family: var(--d-mono);
  color: var(--d-quiet);
  transition: color 120ms ease, transform 180ms ease;
  text-align: right;
}
.d-routes li:hover .arrow {
  color: var(--d-accent);
  transform: translateX(4px);
}

/* === DISPATCH CARD — labeled boxed CTA ================================ */
.d-dispatch {
  margin: 64px 0 40px;
  padding: 32px;
  border: 1px solid var(--d-rule);
  border-left: 3px solid var(--d-accent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--d-accent) 5%, transparent), transparent 55%),
    var(--d-surface);
  border-radius: 2px;
  position: relative;
}
.d-dispatch::before {
  content: attr(data-label);
  position: absolute;
  top: -10px;
  left: 28px;
  background: #0f172a;
  padding: 0 10px;
  font-family: var(--d-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--d-accent);
  font-weight: 600;
}
.d-dispatch h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--d-text);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.d-dispatch .pitch {
  font-size: 15.5px;
  color: var(--d-muted);
  line-height: 1.55;
  margin: 0 0 20px;
  max-width: 560px;
  text-wrap: pretty;
}
.d-dispatch form { display: flex; gap: 10px; flex-wrap: wrap; }
.d-dispatch input[type="email"] {
  flex: 1;
  min-width: 240px;
  background: var(--d-surface-deep);
  border: 1px solid rgba(100, 116, 139, 0.4);
  color: var(--d-text);
  padding: 13px 16px;
  font-size: 15px;
  border-radius: 2px;
  outline: none;
  font-family: var(--d-mono);
  transition: border-color 120ms ease;
}
.d-dispatch input[type="email"]:focus { border-color: var(--d-accent); }
.d-dispatch button {
  background: var(--d-accent);
  color: var(--d-surface-deep);
  font-weight: 700;
  font-size: 13px;
  padding: 13px 24px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--d-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 120ms ease;
}
.d-dispatch button:hover { background: var(--d-accent-bright); }
.d-dispatch .msg {
  margin: 14px 0 0;
  min-height: 18px;
  font-family: var(--d-mono);
  font-size: 13px;
  font-weight: 600;
}
.d-dispatch .smallprint {
  font-size: 11.5px;
  color: var(--d-quiet);
  margin: 12px 0 0;
  font-family: var(--d-mono);
  letter-spacing: 0.04em;
}
.d-dispatch a.btn-outline {
  display: inline-block;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--d-accent);
  border-radius: 2px;
  color: var(--d-accent);
  text-decoration: none;
  font-family: var(--d-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 120ms ease, background 120ms ease;
}
.d-dispatch a.btn-outline:hover {
  background: color-mix(in srgb, var(--d-accent) 12%, transparent);
  color: var(--d-accent-bright);
}

/* === METRIC TILES — hero stat row ===================================== */
.d-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--d-divider);
  border: 1px solid var(--d-divider);
  border-radius: 2px;
  overflow: hidden;
  margin: 24px 0 40px;
}
.d-tile {
  background: var(--d-surface);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.d-tile .label {
  font-family: var(--d-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--d-quiet);
  font-weight: 600;
}
.d-tile .value {
  font-family: var(--d-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--d-text);
  line-height: 1.05;
  font-feature-settings: "tnum" 1;
}
.d-tile .value.accent { color: var(--d-accent); }
.d-tile .sub {
  font-family: var(--d-mono);
  font-size: 12px;
  color: var(--d-muted);
  margin-top: 2px;
}

/* === TABLE — editorial data table ===================================== */
.d-table-wrap {
  border: 1px solid var(--d-divider);
  border-radius: 2px;
  overflow-x: auto;
}
.d-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-family: var(--d-mono);
}
.d-table thead th {
  background: rgba(15, 23, 42, 0.6);
  color: var(--d-quiet);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--d-rule);
  white-space: nowrap;
}
.d-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--d-divider);
  color: var(--d-text);
  font-feature-settings: "tnum" 1;
  vertical-align: middle;
}
.d-table tbody tr:last-child td { border-bottom: none; }
.d-table tbody tr:hover { background: color-mix(in srgb, var(--d-accent) 4%, transparent); }
.d-table .ticker-cell strong a {
  color: var(--d-accent);
  text-decoration: none;
  font-weight: 600;
}
.d-table .ticker-cell strong a:hover { color: var(--d-accent-bright); }
.d-table .quiet { color: var(--d-quiet); font-size: 12px; }
.d-table .pos { color: #10b981; }
.d-table .neg { color: #ef4444; }

/* === STATUS BAR — live indicator ====================================== */
.d-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--d-surface);
  border: 1px solid var(--d-rule);
  border-left: 3px solid var(--d-accent);
  border-radius: 2px;
  font-family: var(--d-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--d-text);
  margin: 24px 0 32px;
}
.d-status .dot {
  width: 8px; height: 8px;
  background: var(--d-accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--d-accent);
  animation: d-pulse 2.4s ease-in-out infinite;
}
.d-status.frozen .dot { background: #facc15; box-shadow: 0 0 10px rgba(250, 204, 21, 0.6); animation: none; }
.d-status.outage .dot { background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); animation: none; }
.d-status strong { font-weight: 600; }
.d-status .quiet { color: var(--d-quiet); }
.d-status .warn { color: #facc15; margin-left: auto; }

@keyframes d-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* === REVEAL ANIMATION ================================================= */
@keyframes d-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.d-rise { animation: d-rise 420ms ease both; }
.d-rise.delay-1 { animation-delay: 80ms; }
.d-rise.delay-2 { animation-delay: 160ms; }
.d-rise.delay-3 { animation-delay: 240ms; }
.d-rise.delay-4 { animation-delay: 320ms; }
.d-rise.delay-5 { animation-delay: 400ms; }

/* === MOBILE =========================================================== */
@media (max-width: 640px) {
  .d-display--xl { font-size: 72px; }
  .d-body { font-size: 15px; padding-left: 16px; }
  .d-routes li { grid-template-columns: 36px 1fr 20px; }
  .d-tile .value { font-size: 24px; }
  .d-dispatch { padding: 24px 20px; }
}
