/* Mobile-first: base styles target phones, min-width queries add the wider layouts. */
:root {
  --ink: #1f2a24;
  --muted: #5b675f;
  --green: #2f5d3a;
  --green-dark: #1f4128;
  --accent: #d2502d;
  --accent-dark: #b33f20;
  --bg: #fbfaf7;
  --bg-alt: #f1efe8;
  --line: #e2ded3;
  --wrap: 68rem;
  --gutter: 1.25rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bar-h: 3.5rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7.5rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.7 var(--sans);
  overflow-wrap: break-word;
  /* Room for the fixed mobile contact bar. */
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
}

img { max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--green-dark); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 5vw, 2.25rem); margin: 0 0 1.25rem; }
h3 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px)); }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: 0.7rem 1.4rem; border-radius: 6px;
  background: var(--green); color: #fff; font-weight: 600; text-decoration: none;
}
.button:hover { background: var(--green-dark); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(251, 250, 247, 0.97);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 1rem;
  padding-top: 0.5rem;
}
.logo img { display: block; width: 132px; }
.header-call {
  font-size: 0.9rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  padding: 0.45rem 0.8rem; border: 1px solid var(--green); border-radius: 999px;
}

/* On phones the section links become one swipeable row under the logo. */
.site-header nav {
  grid-column: 1 / -1;
  display: flex; gap: 0.25rem;
  margin-inline: calc(var(--gutter) * -1);
  padding: 0.35rem var(--gutter) 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.site-header nav::-webkit-scrollbar { display: none; }
.site-header nav a {
  flex: none;
  padding: 0.4rem 0.75rem; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: 0.92rem; white-space: nowrap;
  background: var(--bg-alt);
}
.site-header nav a:hover { color: var(--accent); }
.site-header nav .nav-cta { background: var(--green); color: #fff; }
.site-header nav .nav-cta:hover { background: var(--green-dark); color: #fff; }

/* ---------- Hero ---------- */
.hero { padding-block: 2rem 2.5rem; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; gap: 1.75rem; }
.eyebrow { margin: 0 0 0.6rem; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.hero h1 { font-size: clamp(1.75rem, 7vw, 3rem); margin: 0 0 1rem; }
.lede { font-size: 1.1rem; color: var(--muted); margin: 0 0 1.5rem; max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin: 0; }
.hero-note { color: var(--muted); font-size: 0.95rem; }
.hero-img {
  width: 100%; max-height: 20rem; object-fit: cover; object-position: center 30%;
  border-radius: 8px; box-shadow: 0 10px 30px rgba(31, 42, 36, 0.15);
}

/* ---------- Sections ---------- */
.section { padding-block: 3rem; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-intro { margin: -0.5rem 0 1.5rem; color: var(--muted); }
.prose { max-width: 46rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }

.portrait { float: right; width: 108px; margin: 0.35rem 0 0.75rem 1rem; border-radius: 6px; }
.signature { margin-top: 2rem; }

.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Gallery ---------- */
.gallery {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 9.5rem;
  grid-auto-flow: dense;
  gap: 0.5rem;
}
.gallery .feature, .gallery .wide { grid-column: span 2; }
.gallery .feature { grid-row: span 2; }

.gallery a {
  position: relative; display: block; height: 100%;
  overflow: hidden; border-radius: 8px; background: var(--line);
  color: #fff; text-decoration: none;
}
.gallery img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-cap {
  position: absolute; inset: auto 0 0 0;
  padding: 1.6rem 0.7rem 0.5rem;
  font-size: 0.85rem; font-weight: 600; line-height: 1.3;
  background: linear-gradient(to top, rgba(10, 20, 14, 0.75), rgba(10, 20, 14, 0));
}
@media (hover: hover) {
  .gallery-cap { opacity: 0; transform: translateY(0.4rem); transition: opacity 0.25s, transform 0.25s; }
  .gallery a:hover img { transform: scale(1.05); }
  .gallery a:hover .gallery-cap, .gallery a:focus-visible .gallery-cap { opacity: 1; transform: none; }
}

/* Lightbox: pure CSS, opened by linking to #photo-N. */
.lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 100;
  place-items: center;
  padding: max(3.5rem, env(safe-area-inset-top, 0px)) 0.75rem max(4.5rem, env(safe-area-inset-bottom, 0px));
  background: rgba(8, 12, 10, 0.94);
}
.lightbox:target { display: grid; animation: lb-in 0.2s ease; }
@keyframes lb-in { from { opacity: 0; } }
.lb-backdrop { position: absolute; inset: 0; }
/* Set by gallery.js while a photo is open. */
html.lb-open { overflow: hidden; }
html.lb-open .lightbox { touch-action: pan-y pinch-zoom; }
.lightbox figure { position: relative; margin: 0; max-width: 100%; text-align: center; }
.lightbox img {
  display: block; margin: 0 auto;
  width: auto; max-width: 100%; max-height: calc(100vh - 10rem); max-height: calc(100dvh - 10rem);
  border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox figcaption { margin-top: 0.75rem; color: #eef3ef; font-size: 0.95rem; }
.lightbox figcaption span { margin-left: 0.5rem; color: #9fb1a4; font-size: 0.85rem; }

.lb-btn {
  position: absolute; z-index: 1;
  display: grid; place-items: center;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: #fff;
  font-size: 2rem; line-height: 1; text-decoration: none;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.25); color: #fff; }
.lb-close { top: max(0.6rem, env(safe-area-inset-top, 0px)); right: 0.75rem; font-size: 1.75rem; }
/* On phones prev/next sit below the photo, within thumb reach. */
.lb-prev, .lb-next { bottom: max(0.75rem, env(safe-area-inset-bottom, 0px)); }
.lb-prev { left: calc(50% - 3.5rem); }
.lb-next { right: calc(50% - 3.5rem); }

/* ---------- Press ---------- */
.press-item { padding-block: 1.25rem; border-top: 1px solid var(--line); }
.press-item:first-of-type { border-top: 0; padding-top: 0; }
.press-date { margin: 0 0 0.5rem; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.press-headline { font-family: var(--serif); font-size: 1.3rem; color: var(--green-dark); line-height: 1.3; }
.press-img { display: block; margin: 0.5rem 0 1rem; border-radius: 6px; }

/* ---------- Contact ---------- */
.contact { background: var(--green-dark); color: #eef3ef; }
.contact h2 { color: #fff; }
.contact a { color: #fff; }
.contact a:hover { color: #ffd9cc; }
.contact-inner { display: grid; gap: 2rem; }
.contact-list { margin: 0; display: grid; gap: 0.15rem; }
.contact-list dt { font-weight: 600; color: #b9cbbd; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.contact-list dd { margin: 0 0 0.9rem; }

.contact-form { display: grid; gap: 1rem; align-content: start; }
.contact-form label { display: grid; gap: 0.35rem; font-weight: 600; color: #fff; }
.contact-form .optional { font-weight: 400; color: #b9cbbd; }
.contact-form input, .contact-form textarea {
  width: 100%; min-height: 2.9rem; padding: 0.65rem 0.75rem;
  border: 1px solid #6f8f78; border-radius: 6px;
  background: #fff; color: var(--ink);
  font: inherit; font-size: max(16px, 1rem); font-weight: 400; /* 16px+ stops iOS zooming on focus */
}
.contact-form textarea { resize: vertical; min-height: 8rem; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.contact-form .button { width: 100%; background: var(--accent); border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.contact-form .button:hover { background: var(--accent-dark); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.site-footer { padding-block: 1.5rem; font-size: 0.9rem; color: var(--muted); }
.site-footer p { margin: 0; }

/* ---------- Mobile contact bar ---------- */
.mobile-bar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--green-dark);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
}
.mobile-bar a {
  display: grid; place-items: center; height: var(--bar-h);
  color: #fff; font-weight: 600; text-decoration: none;
}
.mobile-bar a + a { background: var(--accent); }

/* ---------- Tablet and up ---------- */
@media (min-width: 640px) {
  .gallery { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 11rem; gap: 0.75rem; }
  .portrait { width: 143px; margin-left: 1.5rem; }
  .contact-form .button { width: auto; justify-self: start; }
  .lb-prev, .lb-next { top: 50%; bottom: auto; transform: translateY(-50%); }
  .lb-prev { left: 1rem; }
  .lb-next { right: 1rem; }
  .lightbox { padding-inline: 5rem; padding-bottom: 3rem; }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  html { scroll-padding-top: 5.5rem; }
  body { padding-bottom: 0; }
  .mobile-bar { display: none; }

  .header-inner {
    grid-template-columns: auto 1fr;
    padding-block: 0.6rem;
  }
  .logo img { width: 170px; }
  .header-call { display: none; }
  .site-header nav {
    grid-column: auto; justify-content: flex-end;
    margin: 0; padding: 0; overflow: visible; gap: 0.25rem 1.25rem;
  }
  .site-header nav a { padding: 0; background: none; font-size: 0.95rem; }
  .site-header nav .nav-cta { background: none; color: var(--green); font-weight: 600; }
  .site-header nav .nav-cta:hover { background: none; color: var(--accent); }

  .hero { padding-block: 3.5rem; }
  .hero-inner { grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
  .hero-img { max-height: none; }

  .section { padding-block: 4rem; }

  .gallery { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 12rem; }

  .contact-inner { grid-template-columns: 1fr 1.2fr; gap: 2rem 3rem; }
  .contact-list { grid-template-columns: auto 1fr; gap: 0.75rem 1.5rem; }
  .contact-list dt { font-size: inherit; text-transform: none; letter-spacing: 0; }
  .contact-list dd { margin: 0; }
}
