:root {
  --bg: #f4f1ea;
  --paper: #ffffff;
  --paper-soft: #fbfaf7;
  --ink: #172127;
  --muted: #5b6570;
  --line: #d8d1c5;
  --accent: #1d5a58;
  --accent-soft: #eaf3f1;
  --warn: #87502c;
  --warn-soft: #f6ede7;
  --max: 1180px;
  --measure: 760px;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(23, 33, 39, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.7 Georgia, "Times New Roman", serif;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #143f3d;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 234, 0.95);
  backdrop-filter: saturate(140%) blur(8px);
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px 28px;
}

.brand {
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
  font: 700 18px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
}

.brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  justify-content: flex-end;
  gap: 10px 16px;
  flex-wrap: wrap;
  font: 600 13px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a[aria-current="page"],
.nav-links a:hover {
  color: var(--ink);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.hero {
  max-width: 940px;
  padding: 26px 0 28px;
}

.page-meta,
.eyebrow,
.note-date,
.badge,
.meta-label {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.eyebrow,
.note-date {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

h1 {
  margin-bottom: 20px;
  font-size: 52px;
}

h2 {
  margin: 52px 0 16px;
  font-size: 31px;
}

h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

h4 {
  margin: 0 0 8px;
  font-size: 17px;
}

p,
li {
  max-width: var(--measure);
}

p {
  margin: 0 0 18px;
}

.lead {
  max-width: 880px;
  font-size: 23px;
  line-height: 1.55;
  color: #263138;
}

.kicker,
.small,
.doc-meta,
.meta-value,
.section-note {
  color: var(--muted);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.kicker {
  font-size: 16px;
}

.small,
.doc-meta,
.meta-value,
.section-note {
  font-size: 14px;
  line-height: 1.5;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 22px;
  margin: 28px 0;
}

.card {
  grid-column: span 6;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.card.full {
  grid-column: 1 / -1;
}

.card.third,
.card.quarter {
  grid-column: span 4;
}

.card p:last-child,
.card li:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.doc-card,
.media-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.button {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  font: 700 14px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.muted {
  border-color: var(--line);
  color: var(--muted);
}

.button.soft {
  border-color: transparent;
  background: var(--accent-soft);
}

.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  background: #efebe3;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.callout {
  max-width: var(--measure);
  margin: 28px 0;
  padding: 18px 22px;
  border-left: 4px solid var(--accent);
  border-radius: 0 14px 14px 0;
  background: var(--accent-soft);
}

.callout.warning {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.callout.tight p:last-child {
  margin-bottom: 0;
}

.list-clean {
  max-width: var(--measure);
  padding-left: 1.2rem;
}

.list-clean li {
  margin: 0.38rem 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.pill-list li,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.warning {
  background: var(--warn-soft);
  color: var(--warn);
}

.page-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 26px 0 18px;
}

.meta-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-soft);
}

.meta-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-value {
  color: var(--ink);
  font-size: 14px;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.related-links a {
  display: inline-block;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  text-decoration: none;
  font: 600 13px/1.1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.doc-group {
  margin-top: 42px;
}

.doc-grid,
.section-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-top: 18px;
}

.doc-grid .card,
.section-grid .card {
  grid-column: span 6;
}

.doc-grid .card h3,
.section-grid .card h3 {
  margin-bottom: 12px;
}

.meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font: 600 12px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prose-columns {
  column-width: 320px;
  column-gap: 32px;
}

.prose-columns p,
.prose-columns ul {
  break-inside: avoid;
}

.video-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 56.25%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
  box-shadow: var(--shadow);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.subtitle-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.subtitle-panel[open] {
  padding-bottom: 12px;
}

.subtitle-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 20px;
  font: 700 16px/1.3 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.subtitle-panel summary::-webkit-details-marker {
  display: none;
}

.subtitle-body {
  padding: 0 20px 18px;
}

.search-label {
  display: block;
  margin: 14px 0 10px;
  color: var(--muted);
  font: 600 13px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.search-label input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.subtitle-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  max-height: 420px;
  overflow: auto;
}

.subtitle-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.subtitle-item:last-child {
  border-bottom: 0;
}

.subtitle-time {
  font: 700 13px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.subtitle-text {
  font-size: 16px;
  line-height: 1.55;
}

.subtitle-empty {
  margin-top: 14px;
  color: var(--muted);
  font: 600 13px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.quote-block {
  margin: 28px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.quote-block p:last-child {
  margin-bottom: 0;
}

.site-footer {
  padding: 30px 24px 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 14px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-footer .inner {
  max-width: var(--max);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.footer-title {
  margin: 0 0 6px;
  color: var(--ink);
  font-weight: 700;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--ink);
}

article {
  max-width: var(--measure);
}

article.wide,
section.wide {
  max-width: 980px;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  padding: 0.1em 0.25em;
  border-radius: 4px;
  background: #f1eee8;
}

pre {
  overflow: auto;
  padding: 16px;
  border-radius: 12px;
  background: #f1eee8;
  font-size: 14px;
}

.hide {
  display: none !important;
}

@media (max-width: 920px) {
  .split,
  .footer-grid,
  .doc-card,
  .media-card {
    display: block;
  }
}

@media (max-width: 780px) {
  body {
    font-size: 17px;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    gap: 10px 12px;
  }

  main {
    padding-top: 34px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 28px;
  }

  .lead {
    font-size: 20px;
  }

  .card,
  .card.third,
  .card.full,
  .card.quarter,
  .doc-grid .card,
  .section-grid .card {
    grid-column: 1 / -1;
  }

  .page-meta {
    grid-template-columns: 1fr;
  }

  .subtitle-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
