/* Four Mile Genealogy
   Palette pulled from a USGS topographic quad:
   map paper, woodland tint, contour brown, water blue, black lettering. */

@font-face {
  font-family: "Vollkorn";
  src: url("../fonts/vollkorn-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vollkorn";
  src: url("../fonts/vollkorn-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #232323;
  --muted: #57534c;
  --woods: #dcebd2;
  --contour: #a06a3c;
  --contour-light: #dcc2a6;
  --water: #1f5c85;
  --water-dark: #15435f;
  --serif: "Vollkorn", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --measure: 36rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.62;
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--water); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--water-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--water); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 1.35rem + 1vw, 2rem); margin-top: 2.2em; }
h3 { font-size: 1.3rem; margin-top: 1.6em; }
p { margin: 0 0 1em; }
p, li, dd { text-wrap: pretty; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem;
  font-family: var(--sans); font-size: 0.95rem; z-index: 10;
}
.skip:focus { top: 1rem; color: #fff; }

.wrap { width: min(100% - 2.5rem, 70rem); margin-inline: auto; }
.measure { max-width: var(--measure); }

/* Header */
.site-header { border-bottom: 2px solid var(--ink); background: var(--paper); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.25rem;
}
.wordmark {
  font-family: var(--serif); font-weight: 600; font-size: 1.35rem;
  color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 0.6rem;
}
.wordmark img { width: 30px; height: 30px; }
.wordmark:hover { color: var(--ink); }

.nav-inline { display: none; }
.nav-inline ul, .menu ul { list-style: none; margin: 0; padding: 0; }
.nav-inline ul { display: flex; align-items: center; gap: 1.4rem; }
.nav-inline a, .menu a {
  font-family: var(--sans); font-size: 0.95rem; color: var(--ink); text-decoration: none;
}
.nav-inline a:hover, .menu a:hover { color: var(--water); text-decoration: underline; }
.nav-inline a[aria-current="page"], .menu a[aria-current="page"] {
  text-decoration: underline; text-decoration-color: var(--contour); text-decoration-thickness: 2px;
}

.menu summary {
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600; cursor: pointer;
  list-style: none; padding: 0.5rem 0.8rem; border: 1.5px solid var(--ink); border-radius: 3px;
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--ink); color: #fff; }
.menu nav {
  position: absolute; left: 0; right: 0; top: 4.35rem; z-index: 5;
  background: var(--paper); border-bottom: 2px solid var(--ink);
  padding: 0.5rem 1.25rem 1.25rem;
}
.menu li a { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--contour-light); font-size: 1.05rem; }
.site-header { position: relative; }

@media (min-width: 62rem) {
  .nav-inline { display: block; }
  .menu { display: none; }
}

/* Buttons */
.button {
  display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 1rem;
  line-height: 1.2; color: #fff; background: var(--water);
  padding: 0.85rem 1.35rem; border-radius: 3px; text-decoration: none; border: 0; cursor: pointer;
}
.button:hover { background: var(--water-dark); color: #fff; }
.nav-inline .button { color: #fff; padding: 0.6rem 1rem; font-size: 0.95rem; }
.nav-inline .button:hover { text-decoration: none; color: #fff; }

/* The map: a quad sheet behind every page title */
.map {
  background-color: var(--woods);
  background-image: url("../img/topo.svg");
  background-size: 1600px auto;
  background-position: 40% 35%;
  border-bottom: 2px solid var(--ink);
  padding: 2.5rem 0;
}
.map--home { padding: clamp(3rem, 8vw, 7rem) 0; background-position: 55% 60%; }

.title-block {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--ink);
  padding: 1.6rem 1.5rem 1.4rem;
  max-width: 34rem;
  margin: 6px;
}
.title-block h1 { margin-bottom: 0.35em; }
.title-block p { margin-bottom: 0; color: var(--muted); }
.map--home .title-block { max-width: 36rem; padding: 2rem 1.75rem 1.8rem; }
.map--home .title-block p { color: var(--ink); font-size: 1.25rem; }
.title-block .actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.9rem 1.4rem; align-items: center; }
.title-block .aside { font-family: var(--sans); font-size: 0.92rem; color: var(--muted); }

@media (min-width: 48rem) {
  .title-block { padding: 2rem 2.25rem 1.8rem; }
  .map--home .title-block { padding: 2.6rem 2.75rem 2.4rem; }
}

/* Page body */
main { padding-bottom: 4rem; }
.page { padding-top: 1rem; }
.page > .measure > :first-child { margin-top: 1.6em; }

.lede { font-size: 1.3rem; line-height: 1.5; }

/* Client questions are always set in italic: their words, not mine */
.q { font-style: italic; font-size: 1.4rem; line-height: 1.35; margin: 0 0 0.6em; color: var(--ink); }

/* Home: what I work on */
.services-brief { list-style: none; padding: 0; margin: 1.5rem 0 1.5rem; display: grid; gap: 0 3rem; }
.services-brief li { border-top: 1px solid var(--contour-light); padding: 1.4rem 0 0.4rem; }
.services-brief h3 { margin: 0 0 0.4em; font-size: 1.05rem; font-family: var(--sans); font-weight: 600; color: var(--muted); }
@media (min-width: 48rem) { .services-brief { grid-template-columns: 1fr 1fr; } }

.home-section { margin-top: 3.5rem; }
.home-section h2 { margin-top: 0; }
.split { display: grid; gap: 1rem 4rem; }
@media (min-width: 56rem) { .split { grid-template-columns: 1fr 1fr; } }

.story-hook { border-top: 2px solid var(--ink); padding-top: 2rem; }

/* Services page */
.service { border-top: 1px solid var(--contour-light); margin-top: 2.5rem; padding-top: 0.6rem; }
.service h2 { margin-top: 0.8em; }
.service dl { margin: 1.2rem 0 0; }
.service dt { font-family: var(--sans); font-weight: 600; font-size: 0.95rem; color: var(--muted); margin-top: 1rem; }
.service dd { margin: 0.2rem 0 0; }
.note { font-size: 1.05rem; color: var(--muted); margin-top: 1rem; }

.boundary { background: var(--woods); padding: 1.4rem 1.5rem 0.6rem; margin-top: 2.5rem; border-radius: 3px; }
.boundary h2 { margin-top: 0; font-size: 1.5rem; }

/* How it works: a real sequence, so it gets numbers */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 2rem 0 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.6rem 3.4rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -0.15rem;
  width: 2.3rem; height: 2.3rem; border: 2px solid var(--contour); border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; font-size: 1.15rem; color: var(--contour);
  font-variant-numeric: lining-nums; background: var(--paper);
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: calc(1.15rem - 1px); top: 2.3rem; bottom: 0.2rem;
  border-left: 2px dotted var(--contour-light);
}
.steps h2 { font-size: 1.3rem; margin: 0 0 0.3em; }
.steps p { margin: 0; }

/* Stories */
.story h2 { font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.3rem); }
.story .byline { font-family: var(--sans); font-size: 0.95rem; color: var(--muted); margin-top: -0.4rem; }

/* FAQ */
.faq details { border-top: 1px solid var(--contour-light); padding: 0.2rem 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--contour-light); }
.faq summary {
  cursor: pointer; list-style: none; font-weight: 600; font-size: 1.25rem; line-height: 1.3;
  padding: 1rem 2.5rem 1rem 0; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.3rem; top: 0.85rem;
  font-family: var(--sans); font-weight: 400; font-size: 1.5rem; color: var(--contour);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 0.6rem; }

/* Contact form */
form { margin-top: 2rem; }
.field { margin-bottom: 1.6rem; }
label, legend { display: block; font-family: var(--sans); font-weight: 600; font-size: 1rem; margin-bottom: 0.35rem; }
.hint { display: block; font-family: var(--sans); font-size: 0.92rem; color: var(--muted); margin: -0.15rem 0 0.5rem; line-height: 1.45; }
.optional { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], textarea {
  width: 100%; font: inherit; font-size: 1.1rem; color: var(--ink); background: #fff;
  border: 1.5px solid #8b857b; border-radius: 3px; padding: 0.65rem 0.75rem;
}
textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--water); outline-offset: 1px; border-color: var(--water); }
fieldset { border: 0; padding: 0; margin: 0 0 1.6rem; }
.checks { display: grid; gap: 0.5rem 1.5rem; margin-top: 0.4rem; }
@media (min-width: 36rem) { .checks { grid-template-columns: 1fr 1fr; } }
.checks label { font-family: var(--sans); font-weight: 400; font-size: 1rem; display: flex; gap: 0.6rem; align-items: center; margin: 0; }
.checks input { width: 1.15rem; height: 1.15rem; accent-color: var(--water); }
.warning { background: var(--woods); padding: 1rem 1.2rem; border-radius: 3px; font-size: 1.05rem; }
.hp { position: absolute; left: -9999px; }

/* Fill-ins Ian still owes. Delete these before launch. */
.todo { background: #fff3a8; outline: 1px dashed #b39500; padding: 0 0.2em; color: #4a3d00; }

/* Footer */
.site-footer { border-top: 2px solid var(--ink); }
.site-footer .strip {
  height: 3rem; background: var(--woods) url("../img/topo.svg") 70% 80% / 1600px auto;
  border-bottom: 2px solid var(--ink);
}
.site-footer .wrap { padding: 2rem 0 2.5rem; font-family: var(--sans); font-size: 0.92rem; color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.site-footer a { color: var(--ink); }
.site-footer p { margin: 0 0 0.4rem; max-width: 44rem; }

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

@media print {
  .site-header nav, .menu, .map, .site-footer .strip { display: none; }
  .title-block { box-shadow: none; border: 0; padding: 0; }
}
