/* Layout: a single reading column with a left margin for statute citations,
   the way annotated codes print the article number beside the text.
   Margin notes fold into the text flow on narrow screens. */
:root {
  --paper: #FBFAF7;
  --paper-2: #F2EFE8;
  --ink: #14213D;
  --muted: #5B6474;
  --rule: #DFD9CD;
  --accent: #B5402A;
  --accent-ink: #FFFFFF;
  --focus: #2F5AA8;
  --display: "Inter Display", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.25rem, 5.2vw, 3.75rem);
  --measure: 40rem;
  --margin: 9.5rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1524; --paper-2: #161E31; --ink: #E8E4DC; --muted: #9AA3B3;
    --rule: #2A3348; --accent: #E2775F; --accent-ink: #0F1524; --focus: #8FB0F0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1524; --paper-2: #161E31; --ink: #E8E4DC; --muted: #9AA3B3;
  --rule: #2A3348; --accent: #E2775F; --accent-ink: #0F1524; --focus: #8FB0F0;
  color-scheme: dark;
}

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/inter-400i.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Inter Display"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/interdisplay-700.woff") format("woff"); }
@font-face { font-family: "Inter Display"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/interdisplay-800.woff") format("woff"); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem 2rem; padding-block: 1.25rem; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.2; }
.brand strong { font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand span { font-size: var(--step--1); color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-weight: 500; font-size: 0.975rem; }
.nav a { text-decoration: none; padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* Type */
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; }
.eyebrow { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink); max-width: var(--measure); }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }

/* Sections */
main { display: block; }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section + .section { border-top: 1px solid var(--rule); }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.stack-lg { display: flex; flex-direction: column; gap: 2.5rem; }

.hero { padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { max-width: 16ch; }
.hero .lead { margin-top: 1.5rem; }
.hero .actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 1rem 1.75rem; align-items: center; }

.link-arrow { font-weight: 600; text-decoration: none; display: inline-flex; gap: 0.4em; align-items: baseline; }
.link-arrow::after { content: "→"; transition: transform .15s ease; }
.link-arrow:hover::after { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .link-arrow::after { transition: none; } }

/* Annotated layout: citation in the margin */
.annotated { display: grid; grid-template-columns: var(--margin) minmax(0, var(--measure)); column-gap: 2.5rem; row-gap: 0; }
.annotated > * { grid-column: 2; min-width: 0; }
.annotated > .cite { grid-column: 1; text-align: right; font-size: var(--step--1); font-weight: 600; color: var(--muted); padding-top: 0.2rem; font-variant-numeric: tabular-nums; }
.annotated > h2, .annotated > h3 { grid-column: 2; }
@media (max-width: 760px) {
  .annotated { grid-template-columns: minmax(0, 1fr); }
  .annotated > *, .annotated > .cite { grid-column: 1; text-align: left; }
  .annotated > .cite { padding-top: 0; margin-bottom: -0.25rem; }
}

/* The five elements */
.elements { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.elements li { display: grid; grid-template-columns: var(--margin) minmax(0, var(--measure)); column-gap: 2.5rem; padding-block: 1.1rem; border-bottom: 1px solid var(--rule); }
.elements .cite { text-align: right; font-size: var(--step--1); font-weight: 600; color: var(--muted); padding-top: 0.15rem; }
.elements h3 { font-size: var(--step-1); }
.elements p { color: var(--muted); margin-top: 0.25rem; }
.elements li.key h3 { color: var(--accent); }
@media (max-width: 760px) {
  .elements li { grid-template-columns: minmax(0, 1fr); row-gap: 0.25rem; }
  .elements .cite { text-align: left; }
}

/* Services */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 2.5rem 3rem; }
.service h3 { margin-bottom: 0.5rem; }
.service p { color: var(--muted); }

/* Article list */
.articles { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.articles li { padding-block: 1.5rem; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 0.4rem; }
.articles a { text-decoration: none; }
.articles h3 { font-size: var(--step-2); }
.articles a:hover h3 { color: var(--accent); }

/* Article body */
.article-head { padding-block: clamp(3rem, 7vw, 5rem) 2rem; }
.article-head h1 { max-width: 20ch; font-size: clamp(2rem, 4.6vw, 3.25rem); }
.article-head .meta { margin-top: 1rem; font-size: var(--step--1); color: var(--muted); }
.prose { padding-bottom: clamp(3rem, 7vw, 5rem); }
.prose .annotated { row-gap: 1.1rem; }
.prose h2 { font-size: var(--step-2); margin-top: 2rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.prose li::marker { color: var(--accent); }
.flag-list { list-style: none; padding: 0 !important; counter-reset: flag; }
.flag-list li { counter-increment: flag; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0 0.75rem; }
.flag-list li::before { content: counter(flag); font-family: var(--display); font-weight: 800; color: var(--accent); font-size: var(--step-1); line-height: 1.3; grid-row: span 2; }
.flag-list strong { display: block; }

.note { background: var(--paper-2); border-radius: 4px; padding: 1.25rem 1.5rem; font-size: var(--step--1); color: var(--muted); }
.status { border: 1px solid var(--rule); padding: 1.25rem 1.5rem; border-radius: 4px; }
.status .eyebrow { display: block; margin-bottom: 0.4rem; }

/* About */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.6rem 2rem; margin: 0; }
.facts dt { font-weight: 600; color: var(--muted); font-size: var(--step--1); padding-top: 0.15rem; }
.facts dd { margin: 0; }
@media (max-width: 560px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; } .facts dd { margin-bottom: 0.75rem; } }

/* Contact form */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 3rem 4rem; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
.email { font-family: var(--display); font-weight: 700; font-size: var(--step-2); word-break: break-word; user-select: all; }
form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1.1rem; }
label { font-weight: 600; font-size: 0.95rem; }
label .opt { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], textarea, select {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 4px; padding: 0.7rem 0.8rem; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
textarea { min-height: 9rem; resize: vertical; }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.75rem; align-items: start; font-weight: 400; font-size: var(--step--1); }
.check input { margin-top: 0.3rem; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.button {
  font: inherit; font-weight: 600; cursor: pointer; align-self: flex-start;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 4px; padding: 0.8rem 1.4rem;
}
.button:hover { filter: brightness(1.06); }
.form-status { font-size: var(--step--1); color: var(--muted); }
.hp { position: absolute; left: -9999px; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); background: var(--paper-2); font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { padding-block: 2.5rem; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem 3rem; }
.site-footer strong { color: var(--ink); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-content: start; justify-content: flex-end; }
.site-footer .disclaimer { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 1.25rem; max-width: 60rem; }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: minmax(0, 1fr); } .site-footer nav { justify-content: flex-start; } }

/* Language switch */
.nav a.lang { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.02em; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.15rem 0.7rem; align-self: center; }
.nav a.lang:hover { color: var(--accent); border-color: var(--accent); }
