:root {
  color-scheme: light;

  /* the app's card stock on snow: royal ink, steel small print */
  --color-page: #f4f8fc;
  --color-glow: #dce9f7;
  --color-sheet: #ffffff;
  --color-text: #061034;
  --color-muted: #6b768a;
  --color-line: #dce9f7;
  --color-field: #a4adbc;
  --color-link: #2248e4;
  --color-link-deep: #14288c;
  --color-perf: #a4adbc;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Ultra", "Rockwell", "Roboto Slab", Georgia, serif;

  --text-base: 1.0625rem;
  --text-small: 0.9375rem;
  --text-label: 0.8125rem;
  --text-title: clamp(1.45rem, 1.05rem + 2vw, 2.05rem);

  --sheet-width: 46rem;
  --sheet-width-narrow: 34rem;
  --radius-sheet: 18px;
  --radius-field: 10px;
  --radius-pill: 999px;
  --perf-dot: 0.3rem;
  --perf-step: 0.8rem;
  --duration-fast: 150ms;
}

@font-face {
  font-family: "Ultra";
  src: url("assets/fonts/Ultra-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*,
*::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) radial-gradient(ellipse 60% 18rem at 50% 0, var(--color-glow), transparent) no-repeat;
  color: var(--color-text);
  font: var(--text-base) / 1.65 var(--font-body);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

nav a {
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--duration-fast), background-color var(--duration-fast);
}

nav a:hover {
  background: var(--color-line);
  color: var(--color-text);
}

nav a[aria-current="page"] {
  background: var(--color-link);
  color: var(--color-sheet);
}

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

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

h1,
h2 {
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin: 0;
  color: var(--color-link);
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-align: center;
}

/* a short tear line under the title, one hole punched royal */
h1::after {
  content: "";
  display: block;
  width: calc(var(--perf-step) * 9);
  height: var(--perf-dot);
  margin: 1.2rem auto 0;
  background:
    radial-gradient(circle closest-side, var(--color-link) 90%, transparent)
      center / var(--perf-step) 100% no-repeat,
    radial-gradient(circle closest-side, var(--color-perf) 90%, transparent)
      0 0 / var(--perf-step) 100% repeat-x;
}

/* the line right under the title: the dates on the legal pages, the lead on contact */
h1 + p {
  margin: 1.2rem 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.125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

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

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-link);
}

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

a:hover {
  color: var(--color-link-deep);
  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.1em;
  text-transform: uppercase;
}

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

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.85rem 1.75rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-link);
  color: var(--color-sheet);
  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-link-deep);
}

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(6 16 52 / 0.04), 0 18px 44px -22px rgb(6 16 52 / 0.22);
  }
}

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