:root {
  color-scheme: light dark;
  --paper: #f4f1e9;
  --surface: #fffdf7;
  --ink: #1c2a2d;
  --muted: #607076;
  --line: #cdd4cf;
  --accent: #0c675f;
  --accent-ink: #ffffff;
  --measure: 760px;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans SC", "Segoe UI", ui-sans-serif, sans-serif;
  line-height: 1.72;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.site-header {
  min-height: 72px;
  padding: 0 5vw;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--ink);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 1.08rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
}

nav { display: flex; gap: 24px; }
nav a { color: var(--muted); text-decoration: none; }
nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }

.status, .meta { color: var(--muted); font-size: 0.88rem; }

.shell {
  width: min(var(--measure), 90vw);
  margin: 0 auto;
  padding: 88px 0 96px;
}

.intro { padding-bottom: 68px; }
.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1, h2, h3 {
  font-family: Georgia, "Noto Serif SC", serif;
  line-height: 1.2;
  text-wrap: balance;
}

h1 { margin: 0 0 26px; font-size: clamp(2.35rem, 6vw, 4.6rem); letter-spacing: -0.035em; }
h2 { margin: 2.8rem 0 0.8rem; font-size: 1.45rem; }
h3 { margin: 0 0 0.4rem; font-size: 1.16rem; }
p, li { text-wrap: pretty; }
.lede { max-width: 680px; margin: 0; color: var(--muted); font-size: 1.18rem; }

.service-row {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
}
.service-row p { margin: 0; color: var(--muted); }

.button {
  display: inline-flex;
  min-height: 44px;
  padding: 9px 17px;
  border: 1px solid var(--accent);
  align-items: center;
  justify-content: center;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 3px;
  font-weight: 700;
  text-decoration: none;
}
.button:hover { filter: brightness(0.92); }

.document > section { margin-top: 3.2rem; }
.document > section:first-of-type { margin-top: 4rem; }
.document p, .document li { max-width: 72ch; }
.document code { overflow-wrap: anywhere; }

.facts { margin: 1.4rem 0; border-top: 1px solid var(--line); }
.facts div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
}
.facts dt { font-weight: 750; }
.facts dd { margin: 0; color: var(--muted); }

.notice { padding: 24px 28px; border: 1px solid var(--line); background: var(--surface); }
.notice h2 { margin-top: 0; }
.next { margin-top: 3.5rem; }
hr { margin: 4rem 0; border: 0; border-top: 1px solid var(--line); }

.snapshot {
  margin: 2.2rem 0 3rem;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}
.snapshot a { display: inline-block; margin-left: 0.5rem; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 1.4rem 0 3rem;
}
.metric { padding: 20px; border: 1px solid var(--line); background: var(--surface); }
.metric strong { display: block; font-family: Georgia, "Noto Serif SC", serif; font-size: 2rem; line-height: 1; }
.metric span { display: block; margin-top: 9px; color: var(--muted); font-size: 0.88rem; }
.project-card {
  margin: 1.25rem 0;
  padding: 26px 28px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.project-card h3 { margin: 0; font-size: 1.28rem; }
.project-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.project-kicker { margin: 0 0 6px; color: var(--muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; }
.project-watch { border-color: #b27a17; }
.compact-card { padding-top: 22px; padding-bottom: 22px; }
.compact-card p:last-child { margin-bottom: 0; }
.status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.status-ok { color: #16745b; }
.status-watch { color: #9a650d; }
.status-plan { color: #7356a8; }
.status-research { color: #476b89; }
.references, .note { color: var(--muted); font-size: 0.9rem; }
.table-wrap { overflow-x: auto; margin: 1.4rem 0; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.9rem; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.projects-page code { font-size: 0.88em; }

footer {
  padding: 28px 5vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
footer p { width: min(var(--measure), 90vw); margin: 0 auto; }

@media (max-width: 620px) {
  html { font-size: 16px; }
  .site-header { padding: 18px 5vw; align-items: flex-start; flex-direction: column; gap: 10px; }
  nav { width: 100%; gap: 18px; }
  .shell { padding: 60px 0 72px; }
  .service-row { grid-template-columns: 1fr; }
  .button { width: 100%; }
  .facts div { grid-template-columns: 1fr; gap: 4px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card { padding: 22px 18px; }
  .project-heading { flex-direction: column; gap: 10px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #142023;
    --surface: #1b2a2e;
    --ink: #edf3ef;
    --muted: #aebebb;
    --line: #3c4e50;
    --accent: #74d5c8;
    --accent-ink: #0d2926;
  }
  .status-ok { color: #76d6b9; }
  .status-watch { color: #e6b45c; }
  .status-plan { color: #c1a8ed; }
  .status-research { color: #9fc7e6; }
}
