:root {
  color-scheme: dark;
  --ink: #f4f7f8;
  --muted: #91a4ad;
  --quiet: #6e838d;
  --surface: #0d1b22;
  --surface-raised: #12242c;
  --surface-soft: #102027;
  --line: #24404b;
  --line-bright: #315461;
  --green: #61e6a8;
  --green-deep: #143a2c;
  --cyan: #61d8eb;
  --amber: #ffc66d;
  --red: #ff7f79;
  --violet: #b9a7ff;
  --max: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #071219;
  color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 83% 9%, rgba(42, 158, 174, .13), transparent 30rem),
    radial-gradient(circle at 8% 27%, rgba(65, 214, 149, .06), transparent 24rem),
    linear-gradient(180deg, #071219 0%, #08141a 58%, #071117 100%);
  color: var(--ink);
}

a { color: inherit; }
.skip-link {
  position: fixed;
  z-index: 20;
  left: 12px;
  top: -60px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #071219;
  font-weight: 800;
}
.skip-link:focus { top: 12px; }

.emergency-strip {
  padding: 9px 20px;
  border-bottom: 1px solid rgba(255, 198, 109, .22);
  background: rgba(65, 44, 14, .48);
  color: #f2ddb9;
  text-align: center;
  font-size: 12px;
  letter-spacing: .015em;
}
.emergency-strip > span { margin-right: 7px; color: var(--amber); font-size: 8px; }

.site-header,
main,
footer {
  width: min(calc(100% - 36px), var(--max));
  margin-inline: auto;
}
.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  text-decoration: none;
}
.brand-mark {
  position: relative;
  width: 39px;
  height: 39px;
  border: 1px solid #387080;
  border-radius: 12px;
  background: linear-gradient(145deg, #17313b, #0a181f);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 12px 30px rgba(0,0,0,.25);
}
.brand-mark i {
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 4px;
  border-radius: 4px 4px 1px 1px;
  background: var(--green);
  transform-origin: bottom;
}
.brand-mark i:nth-child(1) { height: 8px; transform: translateX(-11px); opacity: .55; }
.brand-mark i:nth-child(2) { height: 15px; transform: translateX(-2px); opacity: .78; }
.brand-mark i:nth-child(3) { height: 22px; transform: translateX(7px); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.header-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--quiet); box-shadow: 0 0 0 5px rgba(110,131,141,.09); }
.header-meta.connected .live-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(97,230,168,.08), 0 0 20px rgba(97,230,168,.4); }
.header-meta.error .live-dot { background: var(--red); }

.hero {
  position: relative;
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  align-items: center;
  overflow: hidden;
  margin-top: 12px;
  padding: 58px 64px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(105deg, rgba(16, 39, 47, .96), rgba(8, 22, 28, .84)),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255,255,255,.025) 80px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(97,230,168,.08), transparent 35%, transparent 70%, rgba(97,216,235,.05));
}
.hero-copy { position: relative; z-index: 2; max-width: 720px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 13px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px rgba(97,216,235,.08); }
h1, h2, p { text-wrap: pretty; }
h1 { max-width: 760px; margin: 0; font-size: clamp(37px, 5.4vw, 68px); line-height: .99; letter-spacing: -.055em; }
h2 { margin: 0; font-size: clamp(25px, 3vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.hero-detail { max-width: 680px; margin: 24px 0 28px; color: #bfd0d6; font-size: clamp(16px, 1.9vw, 20px); line-height: 1.55; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; color: var(--muted); font-size: 12px; }
.heartbeat-meter {
  --meter-color: var(--quiet);
  --current-cutoff: 20%;
  max-width: 690px;
  margin-top: 26px;
  padding: 18px 19px 15px;
  border: 1px solid rgba(49, 84, 97, .78);
  border-radius: 16px;
  background: rgba(5, 17, 23, .68);
  box-shadow: inset 0 1px rgba(255, 255, 255, .035);
}
.heartbeat-meter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.heartbeat-meter-head > div { min-width: 0; }
.heartbeat-meter-kicker,
.heartbeat-meter-head strong,
.heartbeat-meter-head span { display: block; }
.heartbeat-meter-kicker { margin-bottom: 4px; color: var(--quiet); font-size: 9px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.heartbeat-meter-head strong { color: var(--meter-color); font-size: 16px; letter-spacing: -.01em; }
#heartbeat-source { margin-top: 3px; color: var(--muted); font-size: 11px; }
#heartbeat-age { flex: 0 0 auto; color: var(--ink); font: 750 19px/1.15 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.04em; }
.heartbeat-progress {
  position: relative;
  height: 10px;
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid rgba(78, 109, 120, .56);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(97, 230, 168, .09) 0 var(--current-cutoff), rgba(255, 198, 109, .08) var(--current-cutoff) 100%),
    #08171d;
}
.heartbeat-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--meter-color);
  box-shadow: 0 0 16px color-mix(in srgb, var(--meter-color) 55%, transparent);
  transition: width .4s linear, background-color .25s ease;
}
.heartbeat-current-cutoff { position: absolute; z-index: 2; left: var(--current-cutoff); top: -3px; bottom: -3px; width: 1px; background: rgba(244, 247, 248, .42); }
.heartbeat-scale { position: relative; height: 15px; margin-top: 5px; color: var(--quiet); font-size: 9px; }
.heartbeat-scale span { position: absolute; top: 0; }
.heartbeat-scale span:first-child { left: 0; }
.heartbeat-scale span:nth-child(2) { left: var(--current-cutoff); transform: translateX(-50%); }
.heartbeat-scale span:last-child { right: 0; }
.heartbeat-state-guide { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.heartbeat-state-guide span { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 7px; border: 1px solid transparent; border-radius: 7px; color: var(--quiet); font-size: 9px; line-height: 1.2; }
.heartbeat-state-guide i { flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.heartbeat-state-guide span.active { border-color: color-mix(in srgb, var(--meter-color) 38%, transparent); color: var(--meter-color); background: color-mix(in srgb, var(--meter-color) 8%, transparent); }
.heartbeat-primary { --meter-color: var(--green); }
.heartbeat-delayed { --meter-color: var(--amber); }
.heartbeat-missing { --meter-color: var(--red); }
.heartbeat-continuity { --meter-color: var(--violet); }
.heartbeat-waiting { --meter-color: #afc1c9; }
.status-badge, .count-pill, .freshness-pill, .service-state, .category-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.status-badge { padding: 7px 11px; }
.tone-operational, .tone-current { color: var(--green); background: rgba(16, 71, 49, .35); }
.tone-delayed, .tone-degraded, .tone-maintenance, .tone-continuity { color: var(--amber); background: rgba(81, 57, 17, .35); }
.tone-unavailable { color: var(--red); background: rgba(89, 35, 32, .34); }
.tone-unknown, .tone-initializing, .tone-never, .tone-no_recent_contact { color: #afc1c9; background: rgba(49, 71, 81, .32); }

.signal-orbit { position: relative; z-index: 1; width: 280px; height: 280px; justify-self: end; }
.orbit, .signal-core { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.orbit { border: 1px solid rgba(97,216,235,.19); }
.orbit-one { width: 90px; height: 90px; }
.orbit-two { width: 170px; height: 170px; border-style: dashed; }
.orbit-three { width: 260px; height: 260px; opacity: .58; }
.signal-core { width: 62px; height: 62px; display: grid; place-items: center; border: 1px solid rgba(97,230,168,.55); background: radial-gradient(circle, rgba(97,230,168,.36), rgba(18,56,45,.36)); box-shadow: 0 0 50px rgba(97,230,168,.15); }
.signal-core span { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 24px var(--green); }

.section { padding: 88px 0 4px; }
.section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr); align-items: end; gap: 40px; margin-bottom: 28px; }
.section-heading.compact { grid-template-columns: minmax(0, 1fr) auto; }
.section-heading > p { max-width: 510px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.count-pill { padding: 6px 10px; color: var(--muted); border-color: var(--line-bright); background: var(--surface); }

.source-grid, .service-grid { display: grid; gap: 15px; }
.source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.source-card, .service-card, .notice-card, .empty-state {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 36, 44, .94), rgba(12, 27, 34, .94));
  box-shadow: 0 18px 55px rgba(0, 0, 0, .12);
}
.source-card { position: relative; overflow: hidden; padding: 25px; }
.source-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--quiet); }
.source-card.tone-current::before { background: var(--green); }
.source-card.tone-delayed::before { background: var(--amber); }
.source-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.source-card h3, .service-card h3, .notice-card h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.source-role { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.freshness-pill { flex: 0 0 auto; padding: 5px 8px; }
.source-summary { min-height: 48px; margin: 24px 0; color: #c6d4d9; line-height: 1.5; }
.source-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.source-facts div { padding: 11px; border: 1px solid rgba(49,84,97,.55); border-radius: 10px; background: rgba(7,18,25,.38); }
.source-facts span, .source-facts strong { display: block; }
.source-facts span { color: var(--quiet); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.source-facts strong { overflow: hidden; margin-top: 5px; color: #dfe8eb; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.service-card { min-height: 175px; display: flex; flex-direction: column; padding: 22px; }
.service-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.service-state { padding: 5px 8px; }
.service-card p { margin: 18px 0 auto; color: var(--muted); font-size: 13px; line-height: 1.55; }
.reported-by { margin-top: 17px; color: var(--quiet); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }

.notice-list { display: grid; gap: 11px; }
.notice-card { display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; align-items: start; gap: 22px; padding: 20px 22px; }
.category-pill { justify-content: center; padding: 6px 9px; color: var(--cyan); border-color: currentColor; }
.category-power { color: var(--amber); }
.category-weather { color: var(--cyan); }
.category-fire { color: #ff806f; }
.category-road { color: #f4ac72; }
.category-recovery { color: var(--green); }
.category-network { color: var(--violet); }
.notice-card p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.notice-meta { color: var(--quiet); font-size: 11px; text-align: right; }
.notice-link { display: inline-block; margin-top: 8px; color: var(--cyan); font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.severity-critical { border-color: rgba(255,127,121,.48); }
.severity-warning { border-color: rgba(255,198,109,.42); }

.empty-state { grid-column: 1 / -1; min-height: 190px; display: grid; place-items: center; align-content: center; padding: 30px; text-align: center; }
.empty-state strong { font-size: 17px; }
.empty-state p { max-width: 610px; margin: 8px auto 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.empty-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 13px; border: 1px solid var(--line-bright); border-radius: 50%; color: var(--cyan); background: rgba(97,216,235,.05); }

.history-section { padding-bottom: 80px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: rgba(11,25,31,.7); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 17px; border-bottom: 1px solid rgba(36,64,75,.66); text-align: left; }
th { color: var(--quiet); font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
td { color: #b9c9cf; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }

.boundary { display: grid; grid-template-columns: .85fr 1.15fr; gap: 60px; padding: 50px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(135deg, rgba(24,49,57,.72), rgba(10,23,29,.72)); }
.boundary > p { margin: 0; color: #afc1c8; font-size: 14px; line-height: 1.75; }

footer { min-height: 160px; display: flex; align-items: center; justify-content: space-between; gap: 40px; color: var(--quiet); }
footer strong, footer span { display: block; }
footer strong { color: #c9d5d9; font-size: 13px; }
footer span, footer p { margin: 5px 0 0; font-size: 11px; line-height: 1.5; }
footer p { max-width: 480px; text-align: right; }

.skeleton { height: 13px; margin: 15px 0; border-radius: 10px; background: linear-gradient(90deg, #183039, #213d47, #183039); background-size: 200% 100%; animation: shimmer 1.8s linear infinite; }
.skeleton.wide { width: 66%; height: 19px; }
.skeleton.short { width: 38%; }

@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: no-preference) {
  .orbit-two { animation: spin 28s linear infinite; }
  .signal-core span { animation: breathe 2.4s ease-in-out infinite; }
  @keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
  @keyframes breathe { 50% { transform: scale(.78); opacity: .7; } }
}

@media (max-width: 880px) {
  .hero { min-height: 410px; grid-template-columns: 1fr; padding: 46px 38px; }
  .signal-orbit { position: absolute; right: -80px; bottom: -80px; opacity: .55; }
  .hero-copy { padding-right: 80px; }
  .section-heading { grid-template-columns: 1fr; align-items: start; gap: 16px; }
  .section-heading.compact { grid-template-columns: 1fr auto; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notice-card { grid-template-columns: 100px minmax(0, 1fr); }
  .notice-meta { grid-column: 2; text-align: left; }
  .boundary { grid-template-columns: 1fr; gap: 22px; padding: 36px; }
}

@media (max-width: 640px) {
  .emergency-strip { padding-inline: 14px; }
  .site-header, main, footer { width: min(calc(100% - 24px), var(--max)); }
  .site-header { min-height: 76px; }
  .header-meta { max-width: 135px; text-align: right; }
  .brand small { display: none; }
  .hero { min-height: 440px; padding: 34px 24px; border-radius: 20px; }
  .hero-copy { padding-right: 0; }
  .hero-detail { font-size: 16px; }
  .heartbeat-meter { padding: 16px 15px 13px; }
  .heartbeat-meter-head { gap: 10px; }
  .heartbeat-meter-head strong { font-size: 14px; }
  #heartbeat-age { font-size: 16px; }
  .heartbeat-state-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal-orbit { right: -120px; bottom: -105px; }
  .section { padding-top: 66px; }
  .section-heading.compact { grid-template-columns: 1fr; }
  .source-grid, .service-grid { grid-template-columns: 1fr; }
  .source-card { padding: 21px; }
  .source-card-head { display: block; }
  .freshness-pill { margin-top: 12px; }
  .source-facts { grid-template-columns: 1fr; }
  .notice-card { grid-template-columns: 1fr; gap: 14px; padding: 19px; }
  .notice-meta { grid-column: auto; }
  .category-pill { justify-content: flex-start; }
  .history-section { padding-bottom: 58px; }
  th, td { min-width: 110px; padding: 13px; }
  th:nth-child(3), td:nth-child(3) { min-width: 230px; }
  .boundary { padding: 28px 22px; }
  footer { min-height: 190px; display: block; padding-top: 55px; }
  footer p { margin-top: 24px; text-align: left; }
}
