:root {
  --bg: #F7F2EA;
  --surface: #FFFCF7;
  --ink: #2A2420;
  --muted: #6E645B;
  --rule: #DCD2C4;
  --ring-a: #A4472F;
  --ring-b: #B98A2E;
  --ring-c: #36564F;
  --accent: #A4472F;
  --accent-ink: #FFFCF7;
  --error: #A12A1A;
  --serif: "Fraunces", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1A1714;
    --surface: #221E1A;
    --ink: #F1EAE0;
    --muted: #A89D90;
    --rule: #3A332D;
    --ring-a: #D9765C;
    --ring-b: #D9AE5B;
    --ring-c: #7FA89E;
    --accent: #D9765C;
    --accent-ink: #1A1714;
    --error: #F08A78;
  }
}
:root[data-theme="dark"] {
  --bg: #1A1714;
  --surface: #221E1A;
  --ink: #F1EAE0;
  --muted: #A89D90;
  --rule: #3A332D;
  --ring-a: #D9765C;
  --ring-b: #D9AE5B;
  --ring-c: #7FA89E;
  --accent: #D9765C;
  --accent-ink: #1A1714;
  --error: #F08A78;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  padding: 0 16px;
}

/* Logo */
.mark { display: block; width: min(240px, 60vw); height: auto; }
.mark .parent { fill: var(--ring-a); }
.mark .child { fill: var(--ring-b); }
.mark .bar { stroke: var(--ink); stroke-width: 3.5; }
h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  letter-spacing: 0.04em;
  line-height: 1;
  margin-top: 28px;
}
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 1rem/1 var(--sans);
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 16px 28px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.button:hover { opacity: 0.9; }
.button:active { transform: translateY(1px); }
.button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ring-c);
  outline-offset: 3px;
}

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 7vw, 3rem);
  line-height: 1.1;
  margin-bottom: 32px;
}
h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.75rem;
  margin: 56px 0 24px;
}

.values { list-style: none; display: grid; gap: 16px; }
@media (min-width: 640px) { .values { grid-template-columns: 1fr 1fr; } }
.values li {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 24px;
}
.letter {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 12px;
}
.letter.a { color: var(--ring-a); }
.letter.b { color: var(--ring-b); }
.letter.c { color: var(--ring-c); }

/* Form */
.lede { margin-bottom: 36px; }
form { display: grid; gap: 22px; }
label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; }
input, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 14px;
}
textarea { resize: vertical; }
input::placeholder { color: var(--muted); opacity: 0.7; }
[aria-invalid="true"] { border-color: var(--error); }
.error { color: var(--error); font-size: 0.9rem; margin-top: 6px; }
.error:empty { display: none; }
form .button { justify-self: start; }

.thanks {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
}
.thanks:focus { outline: none; }
.thanks-title { font-family: var(--serif); font-size: 2rem; font-weight: 600; }

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
.read-more { margin: -16px 0 32px; color: var(--muted); }

footer {
  line-height: 2;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 32px 0 40px;
  border-top: 1px solid var(--rule);
  max-width: 44rem;
  margin: 0 auto;
}

/* Site header on document pages */
.site-header {
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.6rem;
  text-decoration: none;
}
.brand .mark { width: 48px; }
.site-header nav { display: flex; gap: 20px; font-size: 0.95rem; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--ink); }

/* Document pages */
.doc { max-width: 44rem; margin: 0 auto; padding: 56px 0 72px; }
.doc h1 { margin-top: 0; font-size: clamp(2.6rem, 9vw, 3.8rem); letter-spacing: -0.02em; line-height: 1.05; font-weight: 400; }
.doc .meta { color: var(--muted); font-size: 0.9rem; margin: 12px 0 28px; }
.doc h2 { font-size: clamp(1.9rem, 6vw, 2.5rem); font-weight: 400; letter-spacing: -0.01em; margin: 64px 0 18px; }
.doc h3 { margin: 40px 0 14px; font-size: 1.5rem; font-weight: 400; }
.doc p { margin-bottom: 16px; }
.doc ul:not(.values), .doc ol { margin: 0 0 20px 1.3em; display: grid; gap: 8px; }
.doc .values { margin-bottom: 20px; }

.table-wrap { overflow-x: auto; margin: 8px 0 20px; border: 1px solid var(--rule); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
th { background: var(--surface); font-weight: 600; color: var(--muted); font-size: 0.85rem; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 500; min-width: 7rem; }

.doc .checklist { list-style: none; margin-left: 0; }
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--rule);
  border-radius: 4px;
}

.flow { margin: 8px 0 24px; }
.flow figcaption { font-weight: 600; margin-bottom: 14px; }
.doc .flow ol { list-style: none; margin: 0; display: grid; gap: 10px; }
@media (min-width: 640px) { .doc .flow ol { grid-template-columns: repeat(5, 1fr); } }
.flow li {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.35;
}
.flow li strong { display: block; }
.flow li span { color: var(--muted); font-size: 0.82rem; }
.flow li.gate { border: 2px solid var(--accent); }
.flow-note { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }
