:root {
  color-scheme: dark;
  --background: #050912;
  --surface: rgba(14, 22, 36, 0.78);
  --surface-strong: rgba(17, 27, 44, 0.96);
  --line: rgba(151, 170, 204, 0.16);
  --line-bright: rgba(126, 159, 214, 0.3);
  --text: #f7f9fd;
  --muted: #94a2b9;
  --muted-bright: #bec9da;
  --red: #ff5364;
  --red-soft: rgba(255, 83, 100, 0.14);
  --blue: #70a8ff;
  --green: #55e6ab;
  --amber: #ffc966;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(50, 88, 146, 0.28), transparent 42%),
    radial-gradient(circle at 100% 30%, rgba(129, 26, 45, 0.1), transparent 34%),
    linear-gradient(145deg, #070c16 0%, #04070d 58%, #070a12 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.page-shell {
  width: min(1800px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1rem, 2.4vw, 2.75rem) clamp(1rem, 3.4vw, 4rem) 1.5rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.identity {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.identity-mark {
  position: relative;
  display: grid;
  width: 3.2rem;
  height: 3.2rem;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background-color: #b22234;
  background-image: url("/us-flag.svg");
  background-position: left center;
  background-repeat: no-repeat;
  background-size: auto 100%;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.03),
    0 7px 20px rgba(0, 0, 0, 0.32);
}

.identity-mark::after {
  position: absolute;
  inset: 4px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: inherit;
  pointer-events: none;
}

.identity-mark span {
  z-index: 2;
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  color: #fff;
  background: rgba(4, 10, 22, 0.74);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-indent: 0.08em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.kicker,
.hero-label,
.hero-unit,
.metric-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.kicker {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

h1 {
  margin: 0.12rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 680;
  letter-spacing: -0.02em;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(85, 230, 171, 0.25);
  border-radius: 999px;
  color: #b8f7dc;
  background: rgba(28, 94, 71, 0.12);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.status-pill.is-cached {
  border-color: rgba(255, 201, 102, 0.3);
  color: #ffe1a8;
  background: rgba(115, 75, 10, 0.14);
}

.status-pill.is-cached .status-dot {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 201, 102, 0.11), 0 0 14px rgba(255, 201, 102, 0.5);
}

.status-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(85, 230, 171, 0.1), 0 0 14px rgba(85, 230, 171, 0.5);
  animation: status-pulse 2.4s ease-in-out infinite;
}

.hero {
  padding: clamp(3.2rem, 8vh, 7.5rem) 0 clamp(2.4rem, 5vh, 4.5rem);
  text-align: center;
}

.hero-topline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--muted-bright);
}

.hero-label,
.hero-unit {
  font-size: clamp(0.58rem, 0.85vw, 0.75rem);
  font-weight: 750;
}

.hero-unit {
  color: var(--muted);
}

.hero-unit::before {
  margin-right: 1rem;
  color: var(--red);
  content: "•";
}

.debt-counter {
  width: 100%;
  margin: clamp(0.7rem, 1.7vh, 1.3rem) auto 0;
  color: #fff9f6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: clamp(1.25rem, 7.55vw, 8.6rem);
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.067em;
  text-shadow:
    0 0 12px rgba(255, 83, 100, 0.24),
    0 0 54px rgba(255, 83, 100, 0.12);
  white-space: nowrap;
}

.estimate-note {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(760px, 100%);
  margin: clamp(1.1rem, 2.4vh, 1.8rem) auto 0;
  gap: 1rem;
}

.estimate-note p {
  flex: 0 1 auto;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.67rem, 1vw, 0.82rem);
  line-height: 1.5;
}

.estimate-rule {
  flex: 1 1 60px;
  max-width: 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-bright));
}

.estimate-rule:last-child {
  transform: rotate(180deg);
}

.baseline {
  margin: 0.6rem 0 0;
  color: #718198;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.notice {
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(255, 201, 102, 0.24);
  border-radius: 0.7rem;
  color: #ecd39e;
  background: rgba(91, 60, 11, 0.16);
  font-size: 0.78rem;
  line-height: 1.45;
}

.notice:not([hidden]) {
  display: flex;
}

.notice-icon {
  display: grid;
  width: 1.4rem;
  height: 1.4rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
}

.primary-metrics,
.metrics-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--line);
  box-shadow: var(--shadow);
}

.primary-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  position: relative;
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.7rem);
  background: var(--surface);
  backdrop-filter: blur(18px);
}

.metric-card-accent {
  padding-block: clamp(1.25rem, 2.5vw, 2rem);
  background:
    linear-gradient(110deg, var(--red-soft), transparent 48%),
    var(--surface-strong);
}

.metric-card-accent::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  content: "";
  background: linear-gradient(transparent, var(--red), transparent);
}

.metric-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 750;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value {
  margin: 0.65rem 0 0;
  overflow: hidden;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: clamp(1.15rem, 2.25vw, 2.15rem);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value-compact {
  font-size: clamp(0.93rem, 1.44vw, 1.34rem);
}

.metric-value-date {
  font-family: inherit;
  font-size: clamp(0.94rem, 1.4vw, 1.25rem);
  letter-spacing: -0.02em;
}

.metric-detail {
  margin: 0.46rem 0 0;
  overflow: hidden;
  color: #6e7c91;
  font-size: 0.66rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.25rem 0 0;
  color: #657288;
  font-size: 0.65rem;
  line-height: 1.55;
}

.site-footer p {
  max-width: 660px;
  margin: 0;
}

a {
  color: #91baff;
  text-decoration-color: rgba(145, 186, 255, 0.35);
  text-underline-offset: 0.18em;
}

a:hover {
  color: #c4d9ff;
}

@keyframes status-pulse {
  0%, 100% { opacity: 0.65; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 1050px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .page-shell {
    padding-inline: 0.8rem;
  }

  .identity-mark {
    width: 2.65rem;
    height: 2.65rem;
  }

  .status-pill {
    padding: 0.45rem 0.6rem;
    font-size: 0.58rem;
  }

  .hero {
    padding-block: 3.6rem 2.5rem;
  }

  .hero-topline {
    gap: 0;
  }

  .hero-unit {
    display: none;
  }

  .estimate-note {
    padding-inline: 0.4rem;
    gap: 0.55rem;
  }

  .primary-metrics,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.6rem;
  }
}

@media (min-width: 1800px) and (min-height: 900px) {
  .hero {
    padding-block: 7vh 5vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot {
    animation: none;
  }
}
