:root {
  --bg: #f1efe8;
  --panel: rgba(255, 255, 255, 0.88);
  --ink: #10233f;
  --muted: #697386;
  --line: rgba(16, 35, 63, 0.12);
  --accent: #0c6f68;
  --accent-strong: #07504d;
  --navy: #0b1f38;
  --navy-soft: #17334f;
  --ok: #18715f;
  --watch: #b16a20;
  --stress: #ad3d39;
  --missing: #687386;
  --soft-ok: #dff2eb;
  --soft-watch: #faead6;
  --soft-stress: #f6dfdc;
  --soft-missing: #e9edf1;
  --shadow: 0 16px 42px rgba(16, 35, 63, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(12, 111, 104, 0.12), transparent 28rem),
    linear-gradient(rgba(16, 35, 63, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 35, 63, 0.032) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 28px 28px, 28px 28px, auto;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: -1;
  height: 340px;
  background: linear-gradient(135deg, var(--navy) 0%, #123957 56%, #0b5a59 100%);
}

header {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
}

header::after {
  content: "";
  position: absolute;
  top: -90px;
  right: 6%;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 46px rgba(255, 255, 255, 0.025),
    0 0 0 92px rgba(255, 255, 255, 0.018);
  pointer-events: none;
}

.header-shell {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  padding: 34px 30px 28px;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  color: #d6f0e9;
  background: rgba(255, 255, 255, 0.08);
  font-family: "Iowan Old Style", "Songti SC", serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.eyebrow {
  color: #8fd4ca;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

header h1 {
  max-width: 900px;
  margin: 0 0 10px;
  color: #fff;
  font-family: "Iowan Old Style", "STSong", "Songti SC", serif;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

header .subhead {
  color: rgba(234, 244, 247, 0.72);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.topline {
  align-items: flex-end;
}

.site-nav,
.nav {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.site-nav a,
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  font-weight: 680;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: 180ms ease;
}

.site-nav a:hover,
.nav a:hover {
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.site-nav a.active,
.nav a.active {
  border-color: #9dded4;
  color: var(--navy);
  background: #ccece5;
}

main {
  max-width: 1380px;
  padding: 28px 30px 64px;
}

h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 38px 0 14px;
  color: var(--ink);
  font-family: "Iowan Old Style", "STSong", "Songti SC", serif;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.015em;
}

h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 99px;
  background: var(--accent);
}

.summary {
  gap: 16px;
  margin: 0 0 26px;
}

.panel,
.metric-card,
.module,
.table-wrap,
.template-item {
  border: 1px solid rgba(16, 35, 63, 0.1);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel {
  padding: 22px;
}

.summary .panel {
  position: relative;
  overflow: hidden;
  min-height: 154px;
}

.summary .panel::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -44px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(12, 111, 104, 0.06);
}

.summary .subhead {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.score {
  position: relative;
  z-index: 1;
  margin-top: 18px;
}

.score strong {
  color: var(--navy);
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 52px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}

.score span {
  color: var(--muted);
}

.stance,
.headline {
  align-items: flex-end;
  color: #f4f8f8;
  background: linear-gradient(145deg, var(--navy), var(--navy-soft));
  font-family: "Iowan Old Style", "STSong", "Songti SC", serif;
  font-size: 19px;
  line-height: 1.5;
}

.headline {
  display: flex;
}

.toolbar {
  gap: 8px;
  margin: 22px 0 16px;
}

button {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid rgba(16, 35, 63, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-family: inherit;
  font-weight: 640;
  transition: 160ms ease;
}

button:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

button.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(12, 111, 104, 0.2);
}

.grid,
.modules,
.template {
  gap: 14px;
}

.metric-card,
.module,
.template-item {
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.metric-card:hover,
.module:hover,
.template-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 48px rgba(16, 35, 63, 0.12);
}

.metric-card {
  min-height: 194px;
  padding: 17px;
}

.metric-card::before,
.module::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--ok);
}

.metric-card.status-watch::before,
.module.status-watch::before {
  background: var(--watch);
}

.metric-card.status-stress::before,
.module.status-stress::before {
  background: var(--stress);
}

.metric-card.status-missing::before,
.module.status-missing::before {
  background: var(--missing);
}

.metric-title,
.module h3 {
  color: var(--ink);
  font-weight: 720;
}

.metric-value strong,
.module-score {
  color: var(--navy);
  font-family: "Iowan Old Style", Georgia, serif;
  font-variant-numeric: tabular-nums;
}

.metric-value strong {
  font-size: 30px;
}

.badge {
  border: 1px solid currentColor;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.spark {
  padding: 4px 0;
  border-bottom: 1px dashed rgba(16, 35, 63, 0.1);
}

.table-wrap {
  overflow: hidden;
}

table {
  font-size: 13px;
}

th {
  padding: 13px 14px;
  color: #566275;
  background: rgba(16, 35, 63, 0.045);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  padding: 13px 14px;
  border-bottom-color: rgba(16, 35, 63, 0.08);
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(12, 111, 104, 0.045);
}

.source-list,
.list {
  color: var(--muted);
}

.source-list {
  display: grid;
  gap: 9px;
}

.source-list a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.module {
  min-height: 350px;
  padding: 17px;
}

.module-score {
  font-size: 29px;
}

.metric {
  border-top-color: rgba(16, 35, 63, 0.09);
}

.template-item {
  min-height: 132px;
  padding: 18px;
}

.template-item strong {
  color: var(--accent-strong);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary > *,
.grid > *,
.modules > *,
.template > *,
.table-wrap,
.source-list {
  animation: rise-in 420ms both;
}

.grid > *:nth-child(2),
.modules > *:nth-child(2),
.template > *:nth-child(2) {
  animation-delay: 45ms;
}

.grid > *:nth-child(3),
.modules > *:nth-child(3),
.template > *:nth-child(3) {
  animation-delay: 90ms;
}

.grid > *:nth-child(4),
.modules > *:nth-child(4) {
  animation-delay: 135ms;
}

.grid > *:nth-child(5),
.modules > *:nth-child(5) {
  animation-delay: 180ms;
}

@media (max-width: 920px) {
  body::before {
    height: 380px;
  }

  .header-shell {
    padding: 26px 18px 24px;
  }

  main {
    padding: 20px 15px 46px;
  }

  .summary .panel {
    min-height: 132px;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 720px;
  }
}

@media (max-width: 640px) {
  header::after {
    right: -150px;
  }

  .brand-line {
    margin-bottom: 18px;
  }

  header h1 {
    font-size: 31px;
  }

  .site-nav,
  .nav {
    width: 100%;
  }

  .site-nav a,
  .nav a {
    flex: 1;
    justify-content: center;
  }

  .panel,
  .metric-card,
  .module,
  .table-wrap,
  .template-item {
    border-radius: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
