/* Averbrook. One stylesheet for the whole site.
   No build step, no framework, no external resources of any kind.
   Colour tokens are defined once here and flipped for dark mode below. */

:root {
  color-scheme: light dark;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", Times, serif;

  --bg: #fbfbf9;
  --surface: #ffffff;
  --surface-2: #f2f2ed;
  --text: #191d24;
  --muted: #4c545f;
  --line: #d8d8cf;
  --line-strong: #b4b4a8;
  --accent: #1f4b6e;
  --accent-hover: #163852;
  --accent-ink: #ffffff;
  --accent-soft: #eaf0f5;
  --focus: #a8460f;
  --shadow: 0 1px 2px rgba(25, 29, 36, 0.06), 0 6px 18px rgba(25, 29, 36, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151a;
    --surface: #191d24;
    --surface-2: #1f242c;
    --text: #e9ecef;
    --muted: #a7b1bc;
    --line: #303742;
    --line-strong: #47505c;
    --accent: #8dbde3;
    --accent-hover: #a8cfef;
    --accent-ink: #0e1319;
    --accent-soft: #1b2530;
    --focus: #f0b357;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.28);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- shared layout ---------- */

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.prose { max-width: 40rem; }

main { display: block; }

section { padding: 2.75rem 0; }

section + section { border-top: 1px solid var(--line); }

/* ---------- typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 0.6em;
  letter-spacing: -0.005em;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; margin-top: 0; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

@media (min-width: 45rem) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.7rem; }
  h3 { font-size: 1.25rem; }
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin-bottom: 0.45em; }
li:last-child { margin-bottom: 0; }

strong { font-weight: 650; }

.lead {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--text);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.muted { color: var(--muted); }

.small { font-size: 0.9375rem; }

/* ---------- links and focus ---------- */

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

a:hover { color: var(--accent-hover); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 1rem;
  border: 2px solid var(--accent);
  z-index: 20;
}

.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---------- header ---------- */

.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

@media (min-width: 52rem) {
  .head-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }
}

.brand {
  display: inline-block;
  text-decoration: none;
  color: var(--text);
}

.brand:hover { color: var(--text); }

.brand-mark {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.brand-sub {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.15rem;
}

.site-head nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-head nav a {
  display: inline-block;
  padding: 0.25rem 0;
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-head nav a:hover {
  color: var(--text);
  border-bottom-color: var(--line-strong);
}

.site-head nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 650;
  border-bottom-color: var(--accent);
}

/* ---------- hero ---------- */

.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 3rem 0 3.25rem;
}

.hero h1 { max-width: 22ch; }
.hero .lead { max-width: 46ch; }

/* ---------- buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.35rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  border-radius: 3px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
}

.btn-ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* ---------- cards and grids ---------- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: 1.5rem;
}

@media (min-width: 40rem) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 58rem) {
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card h3 { margin-bottom: 0.4rem; }
.card p { font-size: 0.9375rem; color: var(--muted); }

/* ---------- numbered steps ---------- */

.steps {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  counter-reset: step;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 58rem) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.steps > li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 1.1rem 1.25rem 1.25rem;
  margin: 0;
}

.steps > li::before {
  content: "Step " counter(step);
  display: block;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.steps h3 { margin-bottom: 0.35rem; }
.steps p { font-size: 0.9375rem; color: var(--muted); }

/* ---------- tables ---------- */

.table-scroll {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 34rem;
}

caption {
  caption-side: top;
  text-align: left;
  padding: 0.85rem 1rem 0;
  font-size: 0.875rem;
  color: var(--muted);
}

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

thead th {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-strong);
}

tbody tr:last-child th,
tbody tr:last-child td { border-bottom: none; }

tbody th { font-weight: 650; white-space: nowrap; }

/* ---------- callouts ---------- */

.note {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

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

.note h3 { font-size: 1rem; margin-bottom: 0.35rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

/* ---------- definition lists ---------- */

.deflist { margin: 1.25rem 0 0; }

.deflist dt {
  font-weight: 650;
  margin-top: 1.1rem;
}

.deflist dt:first-child { margin-top: 0; }

.deflist dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

/* ---------- call to action band ---------- */

.cta {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ---------- form ---------- */

.form { margin-top: 1.5rem; max-width: 36rem; }

.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 650;
  margin-bottom: 0.35rem;
}

.field .hint {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.6rem 0.7rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
}

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

input::placeholder,
textarea::placeholder { color: var(--muted); opacity: 1; }

.req { font-weight: 400; color: var(--muted); }

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- footer ---------- */

.site-foot {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.site-foot nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.15rem;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.site-foot .disclaimer {
  max-width: 44rem;
  margin-bottom: 1.25rem;
}

.site-foot .fine {
  font-size: 0.875rem;
  max-width: 44rem;
}

/* ---------- utility ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.stack-gap { margin-top: 1.5rem; }

/* ---------- print ---------- */

@media print {
  .site-head nav,
  .site-foot nav,
  .actions,
  .cta,
  .skip { display: none; }

  body { background: #ffffff; color: #000000; font-size: 11pt; }
  .card, .panel, .table-scroll, .steps > li { box-shadow: none; }
  a { color: #000000; text-decoration: underline; }
}
