/* kevinfoxcroft.com — single stylesheet, no JS dependencies.
   Palette: high-desert + infrastructure — deep navy, slate, muted sage, warm sand. */

:root {
  --ink:    #16202e;
  --navy:   #1c3557;
  --navy-2: #2a4a75;
  --slate:  #56657a;
  --sage:   #6f8878;
  --sand:   #efe8db;
  --paper:  #fcfbf8;
  --card:   #ffffff;
  --line:   #e3dcce;
  --focus:  #b4531a;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --measure: 68ch;
  --wrap: 68rem;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:   #e8e5de;
    --navy:  #a8c2e4;
    --navy-2:#c2d5ef;
    --slate: #a1adbc;
    --sage:  #9fb8a6;
    --sand:  #1b2534;
    --paper: #121a25;
    --card:  #182231;
    --line:  #2b3849;
    --focus: #ffb27a;
  }
}

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

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}

main { display: block; }

section { margin-block: clamp(3rem, 7vw, 5.5rem); }

/* ---------- Typography ---------- */

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

h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); letter-spacing: -0.022em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.05rem); margin-top: 0; }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.35rem); }

p, li { max-width: var(--measure); text-wrap: pretty; }
p { margin: 0 0 1.15em; }

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

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

.lede {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  line-height: 1.55;
  color: var(--slate);
  max-width: 58ch;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--sage);
  font-family: var(--sans);
  margin: 0 0 1rem;
}

.muted { color: var(--slate); }
.small { font-size: 0.9rem; }

/* ---------- Header / nav ---------- */

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

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.1rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--navy); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li { max-width: none; }

.site-nav a {
  display: inline-block;
  padding: 0.4rem 0.1rem;
  font-size: 0.95rem;
  color: var(--slate);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--line); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--sage); font-weight: 500; }

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(180deg, var(--sand) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
  margin-block: 0;
  padding-block: clamp(3rem, 8vw, 6rem);
}

/* Two columns once a portrait exists; until then the hero runs full width
   rather than leaving a hole where the photo will go. Add the portrait block in
   content/index.html and swap this class to .hero-grid--split. */
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }

.hero-grid--split { align-items: center; }

@media (min-width: 46rem) {
  .hero-grid--split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}

.hero h1 { margin-bottom: 0.35em; }

.hero .role {
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--sand);
  border: 1px solid var(--line);
}

/* Single-column hero: a full-bleed portrait would push the opening copy off the
   fold, so cap it below the split breakpoint. */
@media (max-width: 45.999rem) {
  .portrait { max-width: 15rem; }
}

/* ---------- Page header (interior pages) ---------- */

.page-head {
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2.25rem, 5vw, 3.5rem);
  margin-block: 0;
  background: var(--paper);
}

/* ---------- Breadcrumbs ---------- */

.crumbs { font-size: 0.875rem; color: var(--slate); margin-bottom: 1.1rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.crumbs li { max-width: none; }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--line); }
.crumbs a { color: var(--slate); }

/* ---------- Credibility strip ---------- */

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.75rem;
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
}
.strip li { max-width: none; }
.strip a, .strip span {
  display: inline-block;
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--ink);
}
.strip a:hover { border-color: var(--sage); color: var(--navy); }

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}
.cards li { max-width: none; }

/* Four cards: 1 up, then 2x2, then a single row of 4. auto-fit would leave an
   orphan on a third row at common desktop widths. */
@media (min-width: 34rem) { .cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 66rem) { .cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  display: block;
  height: 100%;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--sage); transform: translateY(-2px); }
.card h3 { margin-bottom: 0.4rem; }
.card p { margin-bottom: 0; color: var(--slate); font-size: 0.96rem; }

/* ---------- Prose blocks ---------- */

.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 2rem; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }

/* ---------- Experience / timeline ---------- */

.entry {
  padding-block: 1.75rem;
  border-top: 1px solid var(--line);
}
.entry:first-of-type { border-top: 0; padding-top: 0; }
.entry h3 { margin-bottom: 0.25rem; }
.entry .meta {
  font-size: 0.9rem;
  color: var(--slate);
  margin-bottom: 0.9rem;
}

.tags {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  list-style: none; margin: 1rem 0 0; padding: 0;
}
.tags li {
  max-width: none;
  font-size: 0.82rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--slate);
  margin-bottom: 0;
}

/* ---------- Photo gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}
.gallery li { max-width: none; }

.gallery figure { margin: 0; }

/* Natural proportions. A uniform crop was tried and rejected: these are candid
   field photos, and cropping to a common ratio cut heads off. The width/height
   attributes on each <img> reserve space, so CLS stays at zero regardless. */
.gallery img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--sand);
  display: block;
}


.gallery figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--slate);
}

/* Single inline portrait — capped so it sits beside the prose measure rather
   than spanning it. */
.figure-portrait {
  margin: 1.75rem 0 0;
  max-width: 20rem;
}
.figure-portrait img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--sand);
  display: block;
}
.figure-portrait figcaption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: var(--slate);
}

/* ---------- Callout ---------- */

.note {
  border-left: 3px solid var(--sage);
  background: var(--sand);
  padding: 1.15rem 1.35rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 2rem 0;
}
.note > :last-child { margin-bottom: 0; }
.note p { max-width: 62ch; }

/* ---------- Definition list ---------- */

.facts { margin: 1.5rem 0 0; }
.facts div {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.5rem 1.5rem;
  padding-block: 0.7rem;
  border-top: 1px solid var(--line);
}
@media (max-width: 34rem) { .facts div { grid-template-columns: 1fr; gap: 0.15rem; } }
.facts dt { color: var(--slate); font-size: 0.92rem; }
.facts dd { margin: 0; }

.disclosure { margin-top: 1.5rem; }

.note code {
  font-size: 0.9em;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.05em 0.35em;
}

/* ---------- CTA ---------- */

.cta {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.7rem 1.4rem;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
}
.cta:hover { background: var(--navy-2); color: #fff; }

@media (prefers-color-scheme: dark) {
  .cta { color: #101822; }
  .cta:hover { color: #101822; }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--sand);
  margin-top: clamp(3rem, 8vw, 6rem);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  font-size: 0.94rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 2rem;
}

.site-footer h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.9rem;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; max-width: none; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--navy); }

.colophon {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--slate);
  font-size: 0.875rem;
}
.colophon p { margin: 0; max-width: none; }

/* ---------- Article ---------- */

.article-meta {
  font-size: 0.9rem;
  color: var(--slate);
  margin-bottom: 1.5rem;
}

/* ---------- 404 ---------- */

.center-page {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 4rem;
}
