:root {
  --ink: #0e0e0e;
  --muted: #666;
  --paper: #fff;
  --rule: #e6e6e6;
  --section-gap: 40px; /* vertical space between sections */
  --wrap-max: 1080px;
  --wrap-pad-x: clamp(20px, 6vw, 40px);
}

/* Base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-size: 1.0625rem; /* ~17px */
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

/* Layout container */
.section { padding: var(--section-gap) 0; }
.section--center { text-align: center; }

/* Layout container: unify max width and side padding across the site */
.wrap {
  max-width: var(--wrap-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: max(var(--wrap-pad-x), env(safe-area-inset-left));
  padding-right: max(var(--wrap-pad-x), env(safe-area-inset-right));
}

/* Header only: give nav/brand a little extra breathing room */
.header .wrap {
  --wrap-pad-x: clamp(24px, 5vw, 48px);
}

/* Type */
h1, h2, h3 { margin: 0 0 1rem; line-height: 1.2; }
h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 1.75rem; font-weight: 700; }
h3 { font-size: 1.375rem; font-weight: 600; }
p { margin: 0 0 .75rem; }

@media (max-width: 768px) {
  h1 { font-size: 2.125rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

/* Text helper */
.lede {
  font-size: 1.125rem;
  max-width: 60ch;
  margin: 0 auto 1rem;
  text-align: center;
}

/* Links */
a { color: inherit; }
a:hover { text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-block;
  padding: .6rem 1rem;
  border-radius: 999px;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .2px;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover {
  filter: brightness(.95);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

/* Strong, consistent keyboard focus */
a:focus-visible,
button:focus-visible {
  outline: 3px solid #111;
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip link (keyboard users) */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 8px; top: 8px;
  background: #fff;
  padding: .5rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

/* Generic button row (default behavior + responsive gap) */
.btn-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;   /* default: may wrap unless overridden */
  gap: 1rem;         /* comfortable on mobile */
}
@media (min-width: 768px) {
  .btn-row { gap: clamp(2.5rem, 6vw, 5rem); } /* roomy on desktop */
}

/* Header & nav */
.header { border-bottom: 0; background: var(--paper); }
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: .8rem;     /* vertical padding only (preserve .wrap side padding) */
  position: relative;       /* anchor for absolute-positioned mobile menu */
}
.brand { font-weight: 400; letter-spacing: .2px; color: var(--ink); font-size: 1.2rem; }
.brand strong { font-weight: 700; }
.nav__menu {
  list-style: none;
  margin-left: auto;
  display: flex;
  gap: .9rem;
  align-items: center;
  padding: 0;
}

/* Mobile nav toggle */
.nav__toggle {
  background: none;
  border: 0;
  padding: 0;
  width: 44px; height: 44px;
  display: none; /* shown only on mobile */
  cursor: pointer;
}
.nav__toggle .hamburger,
.nav__toggle .hamburger::before,
.nav__toggle .hamburger::after {
  content: "";
  display: block;
  width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  margin: 0 auto;
  position: relative;
}
.nav__toggle .hamburger::before { position: absolute; top: -7px; }
.nav__toggle .hamburger::after  { position: absolute; top:  7px; }

@media (max-width: 800px){
  .nav__toggle { display: inline-block; margin-left: auto; }
  .nav__menu {
    position: absolute;
    right: var(--wrap-pad-x); /* align with page padding */
    top: 58px;
    background: #fff;
    padding: 10px 12px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    display: none;
    flex-direction: column;
    gap: .5rem;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
  }
  .nav__menu.open { display: flex; }
}

/* Hero */
.hero { display: grid; gap: 20px; align-items: center; }
.hero__media { display: grid; place-items: center; }
.hero__copy {
  text-align: center;
  justify-self: center;
  max-width: 640px;
  margin: 0 auto;
}
.hero__media img { max-width: 100%; height: auto; display: block; }
@media (min-width: 900px){
  .hero { grid-template-columns: 1fr 1fr; }
}

/* Hero CTAs (equal width, never wrap, centered) */
.hero .btn-row {
  margin-top: 1.5rem;   /* space above the pair */
  max-width: 520px;     /* keeps them as a neat pair */
  margin-inline: auto;  /* center the pair */
  flex-wrap: nowrap;    /* never stack */
}
.hero .btn-row .btn {
  flex: 1 1 0;          /* equal width, allow shrinking */
  min-width: 0;         /* prevent overflow on very small screens */
  text-align: center;
}
/* Optional: tighter spacing on very small phones */
@media (max-width: 420px){
  .hero .btn-row { gap: .5rem; }
  .hero .btn-row .btn { padding-inline: .8rem; }
}

/* Services */
.cards.cards--fixed {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.cards.cards--fixed .card {
  text-align: center;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px;
  max-width: 320px;
  background: #fff;
  transition: transform .12s ease, box-shadow .12s ease;
  flex: 1 1 300px;
}
.cards.cards--fixed .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

/* About */
.about--grid {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Remove default figure margins so h2 → content gap matches other sections */
.about__pic { margin: 0; }

.about__pic .headshot {
  max-width: 280px;
  height: auto;
  border-radius: 8px;
}

.caption {
  margin-top: 4px; /* tighter gap between photo and caption */
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.about__copy {
  max-width: 700px;  /* keeps line length readable on desktop */
  text-align: left;
  margin-top: 16px;  /* space between caption and body text */
}

.ticks { padding-left: 3rem; }

/* Contact */
#contact p { margin: .5rem 0; }  /* a little more breathing room */

/* Contact CTAs (mirror hero behavior) */
.contact__cta {
  max-width: 520px;
  margin: 1rem auto 0;
  flex-wrap: nowrap;   /* never stack */
}
.contact__cta .btn {
  flex: 1 1 0;         /* equal width, allow shrinking */
  min-width: 0;
}

/* Footer */
.footer { border-top: 1px solid var(--rule); color: #555; }
.footer .wrap { padding-block: 14px; text-align: center; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .cards.cards--fixed .card { transition: none !important; }
  .cards.cards--fixed .card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
}

/* FINAL OVERRIDE: center the Contact intro line */
#contact .lede {
  text-align: center !important;
  margin-left: auto;
  margin-right: auto;
  max-width: 60ch;
}
