:root {
  color-scheme: light;

  --color-page: #faf8f3;
  --color-sheet: #ffffff;
  --color-text: #1f1813;
  --color-muted: #6e6258;
  --color-line: #e6e1d6;
  --color-field: #9a9082;
  --color-link: #022c63;
  --color-accent: #d6a227;
  --color-accent-light: #efcb63;
  --color-accent-shade: #b5831a;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --text-base: 1.0625rem;
  --text-small: 0.9375rem;
  --text-label: 0.8125rem;
  --text-title: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem);

  --sheet-width: 46rem;
  --sheet-width-narrow: 34rem;
  --radius-sheet: 14px;
  --radius-field: 10px;
  --duration-fast: 150ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* the form sets its own display, so hidden has to win */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--color-page);
  color: var(--color-text);
  font: var(--text-base) / 1.65 var(--font-body);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ---------- page links, centered above the sheet */
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.25rem 1rem;
  font-size: var(--text-small);
}

nav a {
  padding: 0.55rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--duration-fast), background-color var(--duration-fast);
}

nav a:hover {
  background: rgb(31 24 19 / 0.06);
  color: var(--color-text);
}

nav a[aria-current="page"] {
  border-color: var(--color-line);
  background: var(--color-sheet);
  color: var(--color-text);
  font-weight: 600;
}

/* ---------- the sheet: one centered column */
main {
  max-width: var(--sheet-width);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3rem;
  border-block: 1px solid var(--color-line);
  background: var(--color-sheet);
}

main > :last-child {
  margin-bottom: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: var(--text-title);
  letter-spacing: 0.02em;
  text-align: center;
}

h1::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin: 1.1rem auto 0;
  border-radius: 2px;
  background: var(--color-accent);
}

/* the line right under the title: dates on the legal pages, the lead on contact */
h1 + p {
  margin: 1.1rem 0 2.5rem;
  color: var(--color-muted);
  font-size: var(--text-small);
  text-align: center;
}

h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}

h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: var(--text-base);
  font-weight: 600;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1.1em;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.3em;
}

li::marker {
  color: var(--color-accent-shade);
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

main a {
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 3px;
}

/* ---------- contact: a narrower sheet, everything centered */
.contact {
  max-width: var(--sheet-width-narrow);
  text-align: center;
}

.contact h1 + p {
  font-size: var(--text-base);
}

dl {
  display: grid;
  gap: 1.1rem;
  margin: 0 0 2.25rem;
}

dt {
  color: var(--color-muted);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dd {
  margin: 0.1rem 0 0;
  font-size: 1.125rem;
  font-weight: 600;
}

form,
.sent {
  padding-top: 2.25rem;
  border-top: 1px solid var(--color-line);
}

form {
  display: grid;
  gap: 1.1rem;
  text-align: left;
}

form p {
  margin: 0;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: var(--text-small);
  font-weight: 600;
}

input,
textarea {
  display: block;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-field);
  border-radius: var(--radius-field);
  background: var(--color-sheet);
  color: inherit;
  font: inherit;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible {
  border-color: var(--color-link);
  outline-offset: 0;
}

button {
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--color-accent-shade);
  border-radius: var(--radius-field);
  background: var(--color-accent);
  color: var(--color-text);
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color var(--duration-fast), transform var(--duration-fast);
}

button:hover {
  background: var(--color-accent-light);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

form button {
  width: 100%;
}

/* focus lands here only so the confirmation is read out */
.sent:focus {
  outline: none;
}

/* ---------- wide screens: the sheet lifts off the page */
@media (min-width: 48rem) {
  body {
    padding: 0 1.5rem 4rem;
  }

  main {
    padding: 3.5rem 4rem 4rem;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sheet);
    box-shadow: 0 1px 2px rgb(31 24 19 / 0.04), 0 16px 40px -20px rgb(31 24 19 / 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
