:root {
  --paper: #fbfaf7;
  --ink: #1e1c19;
  --muted: #6c675f;
  --rule: #dcd8d0;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --edge: clamp(1.25rem, 4vw, 3.5rem);
  --gap: clamp(.5rem, 1.1vw, 1rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.125rem/1.65 var(--serif); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-weight: 400; line-height: 1.15; margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--paper); padding: .5rem 1rem; }

/* Header and footer */
.site-head, .site-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: .5rem 2rem; padding: 1.5rem var(--edge);
}
.brand { font-size: 1.35rem; text-decoration: none; letter-spacing: .01em; }
.site-head nav, .site-foot nav { display: flex; gap: clamp(1rem, 2.5vw, 2.25rem); }
.site-head nav a, .site-foot nav a, .site-foot span {
  font: 400 .8rem/1.5 var(--sans); letter-spacing: .06em; text-decoration: none; color: var(--muted);
}
.site-head nav a:hover, .site-foot nav a:hover, .site-head nav a[aria-current] { color: var(--ink); }
.site-head nav a[aria-current] { border-bottom: 1px solid var(--ink); }
.site-head nav a.lang-switch { padding-left: clamp(1rem, 2.5vw, 2.25rem); border-left: 1px solid var(--rule); }
.site-foot { margin-top: clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--rule); }

/* Home */
/* The headline is for search engines and screen readers; the photo opens the page. */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hero-img { width: 100%; height: min(calc(100vh - 6rem), 66.6vw); object-fit: cover; object-position: 50% 62%; }
.lede { padding: clamp(3.5rem, 10vw, 8rem) var(--edge); }
.lede p { margin: 0 auto; max-width: 34em; font-size: clamp(1.3rem, 2.3vw, 1.75rem); line-height: 1.45; text-align: center; }
.selection { padding: 0 var(--edge); }

/* Justified rows: every photo in a row gets the same height, none is cropped. */
.row { display: flex; gap: var(--gap); margin-bottom: var(--gap); }
.shot { flex: var(--ar) 1 0; min-width: 0; cursor: zoom-in; overflow: hidden; background: #ece9e2; }
.shot img { width: 100%; transition: transform .6s ease; }
.shot:hover img { transform: scale(1.015); }

/* Portfolio */
.page-head { padding: clamp(2rem, 6vw, 5rem) var(--edge) clamp(1.5rem, 3vw, 2.5rem); }
.page-head h1 { font-size: clamp(2.3rem, 5.5vw, 4.5rem); letter-spacing: -.015em; }
.story-nav { display: flex; flex-wrap: wrap; gap: .4rem 1.75rem; margin-top: 1.25rem; }
.story-nav a { font: 400 .85rem/1.6 var(--sans); color: var(--muted); text-decoration: none; }
.story-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .25em; }
.story { padding: 0 var(--edge); margin-bottom: clamp(3.5rem, 9vw, 7rem); scroll-margin-top: 1.5rem; }
.story-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem 2rem;
  align-items: baseline; padding: 1.25rem 0 clamp(1.25rem, 3vw, 2.25rem); border-top: 1px solid var(--rule);
}
.story-head h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.story-head p { margin: 0; max-width: 30em; color: var(--muted); }

/* Calls to action */
.cta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem clamp(2rem, 6vw, 5rem);
  padding: clamp(3rem, 8vw, 6rem) var(--edge) 0;
}
.link-big {
  font-size: clamp(1.3rem, 2.5vw, 1.9rem); text-decoration: none;
  border-bottom: 1px solid var(--ink); padding-bottom: .15em;
}
.link-big:hover { color: var(--muted); border-color: var(--muted); }

/* About */
.about-wide { padding: clamp(3rem, 7vw, 5.5rem) var(--edge) 0; }
.about-wide p { margin: 0 0 1rem; font-size: clamp(1.3rem, 2.3vw, 1.75rem); line-height: 1.3; }
.about {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(2rem, 6vw, 5rem);
  align-items: center; padding: 0 var(--edge);
}
.prose { max-width: 36em; }
.prose p { margin: 0 0 1.1em; }
.prose .intro { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; }
.steps { padding: clamp(4rem, 9vw, 7rem) var(--edge) 0; }
.steps > h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.steps ol {
  list-style: none; counter-reset: step; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem;
}
.steps li { counter-increment: step; border-top: 1px solid var(--rule); padding-top: 1rem; }
.steps li::before {
  content: counter(step); display: block; margin-bottom: .75rem;
  font: 400 .8rem/1.5 var(--sans); color: var(--muted);
}
.steps h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.steps p { margin: 0; font-size: 1.02rem; color: var(--muted); }

/* Contact */
.contact {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(2rem, 6vw, 5rem);
  align-items: start; padding: 0 var(--edge);
}
form { display: grid; gap: 1.4rem; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
label { display: grid; gap: .35rem; font: 400 .8rem/1.5 var(--sans); letter-spacing: .04em; color: var(--muted); }
input, textarea {
  width: 100%; padding: .55rem 0; border: 0; border-bottom: 1px solid #8d877d; border-radius: 0;
  background: transparent; color: var(--ink); font: 400 1.1rem/1.5 var(--serif);
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-bottom: 2px solid var(--ink); margin-bottom: -1px; }
button {
  justify-self: start; padding: .85rem 1.9rem; border: 1px solid var(--ink); border-radius: 0;
  background: var(--ink); color: var(--paper); font: 400 .85rem/1.4 var(--sans); letter-spacing: .05em; cursor: pointer;
}
button:hover { background: transparent; color: var(--ink); }
.form-note { margin: 0; font: 400 .8rem/1.6 var(--sans); color: var(--muted); max-width: 44em; }
.form-status { margin: 0; padding: .75rem 1rem; background: #f4efe2; font: 400 .9rem/1.5 var(--sans); }
.contact-img { margin-bottom: 1.25rem; }
.contact-side p { margin: 0; }

/* Legal */
.legal { padding: 0 var(--edge); }
.legal h2 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
.todo { background: #ffe9a8; padding: 0 .2em; }

/* Lightbox */
dialog.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(20, 18, 16, .97); color: #f3f1ec;
}
dialog.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100vw; max-height: 100dvh; width: auto; height: auto; object-fit: contain; }
.lightbox button {
  position: absolute; padding: .75rem 1.1rem; border: 0; background: rgba(20, 18, 16, .55);
  color: #f3f1ec; font: 400 1.5rem/1 var(--sans); letter-spacing: 0;
}
.lightbox button:hover { background: rgba(20, 18, 16, .85); color: #fff; }
.lightbox .lb-close { top: .75rem; right: .75rem; }
.lightbox .lb-prev { left: .75rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: .75rem; top: 50%; transform: translateY(-50%); }
.lightbox :focus-visible { outline-color: #f3f1ec; }

@media (max-width: 800px) {
  .about, .contact, .story-head { grid-template-columns: minmax(0, 1fr); }
  .steps ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .row { flex-direction: column; }
  .shot { flex: none; }
  .hero-img { height: 68vh; }
}
@media (max-width: 480px) {
  .form-pair, .steps ol { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shot img { transition: none; }
}
