:root {
  color-scheme: light dark;
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #171717;
  --muted: #626262;
  --border: #d9d9d4;
  --accent: #2457a7;
  --accent-hover: #17427f;
  --code-bg: #f2f3f5;
  --note-bg: #f7f5ee;
  --note-border: #c9b66e;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101112;
    --surface: #17191b;
    --text: #f1f1ef;
    --muted: #b1b3b5;
    --border: #34373a;
    --accent: #8cb4ff;
    --accent-hover: #b5ceff;
    --code-bg: #202326;
    --note-bg: #282419;
    --note-border: #86733a;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { color: var(--accent-hover); }
.container { width: min(940px, calc(100% - 40px)); margin: 0 auto; }
.site-nav {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 20px;
}
.brand { color: var(--text); font-weight: 650; text-decoration: none; letter-spacing: -0.01em; }
.nav-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 0.91rem; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--text); }
main { padding: 70px 0 90px; }
.hero { padding-bottom: 38px; border-bottom: 1px solid var(--border); }
.eyebrow { margin: 0 0 13px; color: var(--muted); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -0.025em; }
h1 { max-width: 870px; margin: 0 0 18px; font-size: clamp(2.35rem, 6.2vw, 4.5rem); line-height: 1.04; }
h2 { margin: 64px 0 19px; font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.15; }
h3 { margin: 30px 0 10px; font-size: 1.3rem; }
.lede { max-width: 780px; margin: 0; color: var(--muted); font-size: 1.17rem; }
.byline { margin: 18px 0 0; font-size: 0.95rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 29px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font-weight: 650;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.button.primary { color: white; background: #2457a7; border-color: #2457a7; }
.button:hover { transform: translateY(-1px); }
.result-card {
  margin: 38px 0 0;
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.result-card p { margin: 0; }
.math-display {
  margin: 13px 0;
  overflow-x: auto;
  font-family: "STIX Two Math", "Cambria Math", Georgia, serif;
  font-size: clamp(1.35rem, 4vw, 2rem);
  white-space: normal;
  overflow-wrap: anywhere;
}
.math-inline { font-family: "STIX Two Math", "Cambria Math", Georgia, serif; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.metric { padding: 18px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.metric strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.75rem; font-weight: 500; }
.metric span { color: var(--muted); font-size: 0.9rem; }
.notice { margin: 28px 0; padding: 17px 19px; border-left: 4px solid var(--note-border); background: var(--note-bg); }
.notice p { margin: 0; }
table { width: 100%; border-collapse: collapse; margin: 22px 0 12px; font-size: 0.95rem; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 0.79rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
td:last-child, th:last-child { text-align: right; white-space: nowrap; }
.artifact-list { margin: 20px 0 24px; padding-left: 1.35rem; }
.artifact-list li { margin: 0.65rem 0; padding-left: 0.15rem; }
.artifact-list a { font-weight: 650; }
.artifact-list span { display: block; margin-top: 0.08rem; color: var(--muted); font-size: 0.92rem; }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { overflow-x: auto; padding: 17px; border: 1px solid var(--border); border-radius: 8px; background: var(--code-bg); font-size: 0.86rem; line-height: 1.5; }
code { font-size: 0.9em; }
details { margin: 17px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
summary { cursor: pointer; font-weight: 650; }
.prose { max-width: 820px; }
.small { color: var(--muted); font-size: 0.88rem; }
footer { padding: 31px 0 45px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.87rem; }
footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .container { width: min(100% - 26px, 940px); }
  .site-nav .container { align-items: flex-start; flex-direction: column; padding: 14px 0; }
  .nav-links { gap: 12px; }
  main { padding-top: 45px; }
  .grid { grid-template-columns: 1fr; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tr { padding: 13px 0; border-bottom: 1px solid var(--border); }
  td { padding: 2px 0; border: 0; }
  td:last-child { text-align: left; }
  td::before { content: attr(data-label); display: inline-block; min-width: 94px; color: var(--muted); font-size: 0.77rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
}
