@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-sans-3-400.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-sans-3-600.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/source-serif-4-500.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-serif-4-600.woff2") format("woff2");
}

:root {
  --ink: #1a2333;
  --navy: #1c2c48;
  --navy-2: #2c4066;
  --paper: #f4f0e7;
  --paper-2: #fbf8f3;
  --card: #fffdfb;
  --line: #e3d9cb;
  --line-strong: #cfc3b0;
  --burgundy: #7c2f3b;
  --burgundy-deep: #5c222b;
  --gold: #8d7046;
  --muted: #4e5866;
  --ok: #1d5c40;
  --warn: #8a4b12;
  --shadow: 0 18px 40px rgba(28, 44, 72, 0.08);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --max: 1120px;
  --header: 76px;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 100% -10%, rgba(125, 47, 59, 0.06), transparent 55%),
    linear-gradient(180deg, #f7f3ec 0%, var(--paper) 280px);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--burgundy-deep); text-underline-offset: 0.16em; }
a:hover { color: var(--burgundy); }
:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--navy);
  color: white;
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.wrap-wide { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.identity {
  background: var(--navy);
  color: #f6f1e8;
  font-size: 0.92rem;
  line-height: 1.45;
}
.identity .wrap {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}
.identity a { color: #f3d7c4; white-space: nowrap; }
.identity strong { font-weight: 600; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 248, 243, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header);
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy);
  min-width: 190px;
}
.brand:hover { color: var(--navy); }
.mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(160deg, var(--navy) 0 58%, var(--burgundy) 58% 100%);
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.03em;
  flex: none;
}
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name span:first-child {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-name span:last-child {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: 8px;
  min-width: 46px;
  min-height: 46px;
  padding: 0 12px;
  font: inherit;
  font-weight: 600;
  color: var(--navy);
}
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a.top,
.nav .nav-item > a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 8px;
  text-decoration: none;
  color: var(--navy);
  font-size: 0.94rem;
  font-weight: 600;
  border-radius: 6px;
}
.nav a.top:hover,
.nav .nav-item > a:hover,
.nav a.top[aria-current="page"],
.nav .nav-item > a[aria-current="page"] {
  background: rgba(28, 44, 72, 0.06);
  color: var(--burgundy-deep);
}
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > button {
  border: 0;
  background: transparent;
  width: 22px;
  height: 40px;
  color: var(--navy);
  cursor: pointer;
  border-radius: 6px;
}
.nav-item > button::after {
  content: "";
  display: block;
  margin: 0 auto;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
}
.submenu {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  min-width: 260px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  z-index: 40;
}
.nav-item:hover > .submenu,
.nav-item:focus-within > .submenu,
.nav-item.open > .submenu { display: grid; }
.submenu a {
  text-decoration: none;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.submenu a:hover { background: var(--paper); }

.hero {
  padding: 48px 0 28px;
  background:
    radial-gradient(520px 220px at 0% 0%, rgba(124, 47, 59, 0.08), transparent 70%),
    linear-gradient(180deg, #fbf8f3 0%, transparent 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr;
  gap: 36px;
  align-items: end;
}
.kicker {
  margin: 0 0 10px;
  color: var(--burgundy);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; line-height: 1.18; color: var(--navy); }
h1 { font-size: clamp(2.15rem, 4vw, 3.45rem); margin: 0 0 14px; }
h2 { font-size: clamp(1.55rem, 2.4vw, 2rem); margin: 1.6em 0 0.45em; }
h3 { font-size: 1.28rem; margin: 1.3em 0 0.35em; }
.lede { font-size: 1.18rem; color: var(--ink); margin: 0 0 18px; max-width: 46rem; }
.hero-actions, .cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
}
.btn-primary { background: var(--burgundy); color: white; }
.btn-primary:hover { background: var(--burgundy-deep); color: white; }
.btn-secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--navy); color: white; }
.btn-external::after { content: " ↗"; font-size: 0.85em; }

.fact-panel {
  background: var(--navy);
  color: #f7f2ea;
  border-radius: 18px;
  padding: 22px 22px 8px;
  box-shadow: var(--shadow);
}
.fact-panel h2 { color: white; font-size: 1.35rem; margin: 0 0 8px; }
.fact-panel p { color: #e6dfd4; margin-top: 0; }
.fact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 12px 0;
}
.fact b { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; display: block; }
.fact span { color: #d9cfc2; font-size: 0.92rem; }

.section { padding: 28px 0 18px; }
.section + .section { border-top: 1px solid transparent; }
main > .section:nth-of-type(even) {
  background: linear-gradient(180deg, rgba(255,253,251,0.65), rgba(243,236,224,0.55));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); max-width: 36rem; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 28px rgba(28, 44, 72, 0.05);
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--navy), var(--burgundy));
}
.card h3 { margin: 8px 0; font-size: 1.3rem; }
.card p { margin: 0 0 12px; color: var(--ink); }
.card .meta { color: var(--gold); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.card a.more { font-weight: 600; }

.crumbs { padding: 18px 0 0; font-size: 0.92rem; color: var(--muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--line-strong); }

.article { padding-bottom: 28px; }
.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 36px;
  align-items: start;
}
.prose p { margin: 0 0 0.95em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.2em; }
.prose li { margin: 0.25em 0; }
.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px 14px;
  margin: 0 0 1.3em;
}
.toc p { margin: 0; font-weight: 600; color: var(--navy); }
.toc ol { margin: 8px 0 0; padding-left: 1.2em; }
.toc li { margin: 0.2em 0; }
.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 8px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.callout {
  background: #f8f1e6;
  border-left: 4px solid var(--burgundy);
  padding: 14px 16px;
  border-radius: 0 12px 12px 0;
  margin: 0 0 1.1em;
}
.callout p:last-child { margin-bottom: 0; }
.figure { margin: 0 0 1.2em; }
.figure img { border-radius: 14px; border: 1px solid var(--line); background: white; }
.figure figcaption { color: var(--muted); font-size: 0.92rem; margin-top: 8px; }

.table-wrap { overflow-x: auto; margin: 0 0 1.15em; border: 1px solid var(--line); border-radius: 12px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
caption { text-align: left; font-weight: 600; padding: 12px 14px 0; color: var(--navy); }
th, td { text-align: left; padding: 10px 14px; vertical-align: top; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { white-space: nowrap; }
th { background: #f6f1e8; font-size: 0.92rem; color: var(--navy); }
tr:last-child td { border-bottom: 0; }

.side {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 12px;
}
.side .card h2 { font-size: 1.15rem; margin: 0 0 8px; }
.side ol, .side ul { margin: 0; padding-left: 1.1em; }
.side a { font-weight: 600; }

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  margin: 0 0 10px;
}
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; color: var(--navy); }
.faq details p { margin-top: 0; }

.sources { font-size: 0.98rem; }
.sources li { margin: 0.35em 0; }

.catalog { display: grid; gap: 14px; }
.catalog a.row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 16px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.catalog a.row:hover { border-color: var(--burgundy); }
.catalog .tag { color: var(--burgundy); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; }
.catalog h2, .catalog h3 { margin: 0 0 4px; font-size: 1.25rem; }
.catalog p { margin: 0; color: var(--muted); }

.calc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin: 8px 0 18px;
  box-shadow: var(--shadow);
}
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span { grid-column: 1 / -1; }
label { font-weight: 600; color: var(--navy); }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 46px;
  width: 100%;
}
textarea { min-height: 140px; resize: vertical; }
.hint { color: var(--muted); font-size: 0.9rem; font-weight: 400; }
.check { flex-direction: row; align-items: center; gap: 8px; }
.check input { width: auto; min-height: 0; }
.results {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.result {
  background: var(--paper);
  border-radius: 12px;
  padding: 12px;
}
.result b { display: block; font-family: var(--serif); font-size: 1.45rem; color: var(--navy); }
.result span { color: var(--muted); font-size: 0.92rem; }
.calc-error { color: var(--burgundy-deep); font-weight: 600; min-height: 1.4em; }
canvas.chart { width: 100%; height: auto; background: white; border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status { min-height: 1.5em; font-weight: 600; }
.form-status.ok { color: var(--ok); }
.form-status.bad { color: var(--burgundy-deep); }

.site-footer {
  margin-top: 36px;
  background: var(--navy);
  color: #efe8dc;
  padding: 36px 0 18px;
}
.site-footer a { color: #f3d7c4; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 22px; }
.site-footer h2 { color: white; font-size: 1.05rem; margin: 0 0 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.legal-note { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 22px; padding-top: 14px; color: #d9cfc2; font-size: 0.92rem; }
.missing, .notice { background: #fff6ea; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; }

@media (max-width: 1280px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
    flex-direction: column;
    align-items: stretch;
    max-height: calc(100vh - 84px);
    overflow: auto;
  }
  .nav.open { display: flex; }
  .nav-item { flex-direction: column; align-items: stretch; }
  .nav-item > a, .nav a.top { padding: 8px; }
  .submenu {
    position: static;
    display: none;
    box-shadow: none;
    border: 0;
    padding: 0 0 8px 12px;
    background: transparent;
    min-width: 0;
  }
  .nav-item.open > .submenu { display: grid; }
  .hero-grid, .article-grid, .cards, .cards.four, .cards.two, .foot-grid, .calc-grid, .results {
    grid-template-columns: 1fr;
  }
  .catalog a.row { grid-template-columns: 1fr; }
  .side { position: static; }
  .identity .wrap { align-items: flex-start; }
}

@media (max-width: 720px) {
  .wrap, .wrap-wide { width: min(var(--max), calc(100% - 24px)); }
  .identity { font-size: 0.86rem; }
  h1 { font-size: 2rem; }
  .header-row { min-height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
