/* ============================================================
   Patrick Mulder — Portfolio (static rebuild, Nov 2026)
   Plain CSS, no frameworks, no external requests.
   All text/background pairs verified WCAG 2.1 AA (>= 4.5:1).
   ============================================================ */

:root {
  --ink: #16232e;          /* body text on white: 15.98:1 */
  --ink-soft: #3d4f5e;     /* 8.47:1 */
  --muted: #55677a;        /* 5.82:1 on white, 5.17:1 on wash */
  --accent: #a63e1f;       /* 6.31:1 on white; white on accent 6.31:1 */
  --accent-hover: #8a3218; /* 8.24:1 */
  --navy: #122a3f;         /* white on navy 14.70:1 */
  --navy-soft: #c9d6de;    /* 9.91:1 on navy */
  --paper: #ffffff;
  --wash: #f4f1ec;
  --line: #d9dee3;
  --focus: #005fcc;
  --radius: 10px;
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

/* Visible, consistent keyboard focus */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 8px;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-wash { background: var(--wash); }
.section-navy { background: var(--navy); color: #fff; }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-navy p { color: var(--navy-soft); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: none;
}
.brand small {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.site-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
}
.site-nav a:hover { color: var(--accent); background: var(--wash); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--wash); }

/* ---------- Type ---------- */
h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  color: var(--ink);
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.15rem, 2.4vw, 1.35rem); line-height: 1.55; color: var(--ink-soft); }
.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.small { font-size: 0.92rem; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.35rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--accent);
  line-height: 1.3;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--accent);
}
.btn-secondary:hover { background: var(--wash); color: var(--accent-hover); }
.btn-light { background: #fff; border-color: #fff; color: var(--navy); }
.btn-light:hover { background: var(--navy-soft); border-color: var(--navy-soft); color: var(--navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 { margin-bottom: 0.5em; }
.hero-portrait {
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(18, 42, 63, 0.22);
  width: 100%;
}

/* ---------- Metrics strip ---------- */
.metrics {
  margin: 0;
  padding: 1.75rem 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  border-top: 1px solid var(--line);
}
.metrics div { padding-right: 1rem; }
.metrics dt {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1.1;
}
.metrics dd { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }

/* ---------- Case study cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
  margin-top: 2rem;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: 0.3em; font-size: 1.35rem; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body h3 a:hover { color: var(--accent); text-decoration: underline; }
.card-meta { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.7em; font-weight: 600; }
.card-body p { color: var(--ink-soft); }
.card-body .card-link { margin-top: auto; font-weight: 700; }
.flagship { border-top: 4px solid var(--accent); }
.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5em;
}

/* ---------- Two-column prose ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
.split h2, .split h3 { margin-top: 0; }
.checklist { list-style: none; padding: 0; margin: 0 0 1em; }
.checklist li { padding-left: 1.7rem; position: relative; margin-bottom: 0.55em; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.55em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Quote ---------- */
blockquote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.45;
  color: var(--ink);
}
blockquote footer { font-family: var(--font); font-size: 0.95rem; color: var(--muted); margin-top: 0.75rem; }
.quote-block { max-width: 780px; margin-inline: auto; text-align: center; }

/* ---------- Case study pages ---------- */
.case-hero img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(18, 42, 63, 0.18);
}
/* Narrow hero for the 400px-wide Minnesota screenshot: without this the
   image is stretched ~2.75x to full column width and looks soft. */
.case-hero-narrow {
  max-width: 640px;
  margin-inline: auto;
}
/* Text hero panel for case studies with no project image */
.case-hero-text {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  box-shadow: 0 14px 40px rgba(18, 42, 63, 0.18);
}
.case-hero-text p {
  color: var(--navy-soft);
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  line-height: 1.55;
}
.case-hero-text strong { color: #fff; }
.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin: 1.5rem 0 0;
  padding: 1.1rem 0;
  border-block: 1px solid var(--line);
  font-size: 0.95rem;
}
.case-meta dt { font-weight: 700; color: var(--ink); }
.case-meta dd { margin: 0; color: var(--muted); }
.case-meta div { display: flex; gap: 0.5rem; }
.case-section { margin-top: 2.5rem; }
.case-section h2 { font-size: 1.5rem; }
.narrow { max-width: 760px; }
.outcome-list { list-style: none; padding: 0; margin: 0; }
.outcome-list li {
  padding: 0.9rem 0 0.9rem 1.9rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.outcome-list li::before {
  content: "\2713";
  position: absolute;
  left: 0.15rem;
  top: 0.85rem;
  font-weight: 800;
  color: var(--accent);
}
.next-case {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.next-case a { font-weight: 700; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.gallery figcaption { margin-top: 0.6rem; font-size: 0.95rem; color: var(--ink-soft); }

/* Phone screenshots: keep their natural portrait aspect instead of the 3/2 crop */
.gallery--phones { align-items: start; }
.gallery--phones img { aspect-ratio: auto; }
.gallery--phones figure { max-width: 420px; margin-inline: auto; }

/* ---------- Resume ---------- */
.resume-block { margin-bottom: 2.5rem; }
.resume-block h2 {
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.5rem;
}
.job { margin-bottom: 2rem; }
.job h3 { margin-bottom: 0.15em; }
.job .role-line { font-weight: 700; color: var(--ink-soft); margin-bottom: 0.5em; }
.job ul, .resume-block ul { margin: 0 0 1em; padding-left: 1.25rem; }
.job li, .resume-block li { margin-bottom: 0.4em; }
.tag-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-list li {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Contact ---------- */
.contact-list { list-style: none; padding: 0; margin: 0 0 1.5rem; font-size: 1.1rem; }
.contact-list li { margin-bottom: 0.8em; }
.contact-list a { font-weight: 700; }

/* ---------- CTA band / footer ---------- */
.cta-band {
  background: var(--navy);
  color: #fff;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--navy-soft); max-width: 560px; margin-inline: auto; }
.cta-band .btn-row { justify-content: center; }
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-portrait { max-width: 420px; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
  .card-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(18, 42, 63, 0.12);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 0.5rem 1rem 1rem; }
  .site-nav a { padding: 0.75rem 0.6rem; }
}

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

@media print {
  .site-header, .cta-band, .site-footer, .skip-link, .btn-row { display: none; }
  body { font-size: 11pt; }
  a { color: var(--ink); }
}
