/* The three typefaces, served from this site so no page waits on, or tells, another server.
   Latin subsets of the Google Fonts files. Inter and Inter Tight are variable fonts: one file
   covers the weights listed. `swap` shows text in the fallback until the font arrives. */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("fonts/inter-tight.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/inter.woff2") format("woff2");
}

/* One theme across the whole site: warm bone paper, near-black ink, one vermilion accent
   taken from the fly agarics in Speulderbos. Dark mode is the same palette inverted. */
:root {
  --paper: #efebe4;
  --paper-deep: #e2ddd3;
  --ink: #151412;
  --ink-soft: #6d685f;
  --line: rgba(21, 20, 18, 0.14);
  --accent: #c8452a;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --gutter: clamp(16px, 2.4vw, 40px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f0e0c;
    --paper-deep: #1a1916;
    --ink: #ece6da;
    --ink-soft: #8f897d;
    --line: rgba(236, 230, 218, 0.14);
    --accent: #e2603d;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html.lenis {
  height: auto;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.label {
  font: 500 11px/1.4 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.photo {
  opacity: 0;
  transition: opacity 0.9s ease;
}

.photo.is-loaded {
  opacity: 1;
}

/* * === header: fixed, and inverts over photos so it stays readable without a bar */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px var(--gutter);
  color: #fff;
  mix-blend-mode: difference;
  font: 500 clamp(14px, 1.15vw, 17px) / 1 var(--sans);
}

/* Kept on one line: wrapped, the name touched the nav on the narrowest phones. */
.site-header #site-name {
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: clamp(16px, 3vw, 40px);
}

.site-header a {
  position: relative;
}

.site-header a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}

.site-header a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* * === section heads */

.section {
  padding: clamp(80px, 9vw, 136px) var(--gutter) 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(24px, 3vw, 44px);
}

.section-head h1,
.section-head h2 {
  font: 600 clamp(44px, 7vw, 112px) / 0.9 var(--display);
  letter-spacing: -0.045em;
}

.section-head h1 em,
.section-head h2 em {
  font: italic 400 1.05em/0.9 var(--serif);
  letter-spacing: -0.01em;
}

/* * === rows: justified photos, on the story page */

/* Every row is justified: its photos share one height and together fill the width, unless
   that would make them taller than the screen. Nothing is cropped. */
.gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 6vw, 112px);
  padding: 0 var(--gutter);
  --row-gap: clamp(16px, 2.4vw, 40px);
}

.row {
  display: flex;
  gap: var(--row-gap);
  width: min(100%, calc(88svh * var(--row-ratio) + var(--row-gap) * (var(--count) - 1)));
  margin-inline: auto;
}

/* A single photo running to the screen's edges; centring lets it spill past the gutters
   equally. Never taller than the screen. */
.row.full {
  align-self: center;
  width: min(calc(100% + 2 * var(--gutter)), 100svh * var(--row-ratio));
  /* Auto margins would win over the centring and pin it to the left gutter. */
  margin-inline: 0;
}

.shot {
  flex: var(--ratio) 1 0;
  min-width: 0;
}

.shot .frame {
  overflow: hidden;
}

.shot img {
  width: 100%;
}

/* * === collage: story covers, each whole, in columns that settle at different heights */

/* A narrow gap between columns leaves the width to the photos. */
.collage {
  display: flex;
  align-items: flex-start;
  gap: var(--collage-gap);
  --collage-gap: clamp(10px, 1.4vw, 24px);
}

.collage-column {
  flex: 1 1 0;
  min-width: 0;
}

.collage-item {
  display: block;
  margin-bottom: clamp(24px, 2.8vw, 44px);
}

/* A column's last card ends the collage, so it adds no space of its own below. */
.collage-item:last-child {
  margin-bottom: 0;
}

/* `scale`, not `transform`: the unveil animation owns the transform of the photo inside. */
.collage-item .frame {
  position: relative;
  overflow: hidden;
  transition: scale 0.7s var(--ease-out);
}

.collage-item img {
  width: 100%;
}

/* The hovered card comes forward a little. */
.collage-item:hover .frame {
  scale: 1.035;
}

/* More photos, laid over the first one of a card or a home page doorway; common.js shows
   them one after another. They fill the first photo's box, so one of a slightly different
   shape loses a sliver. */
.peek {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.6s ease;
}

/* Names `.photo` too, so it beats `.photo.is-loaded` wherever the two rules sit in the file. */
.photo.peek:not(.is-shown) {
  opacity: 0;
}

.collage-item .label {
  display: block;
  margin-top: 12px;
}

.collage-item strong {
  display: block;
  margin-top: 4px;
  font: 600 clamp(20px, 1.8vw, 28px) / 1.05 var(--display);
  letter-spacing: -0.03em;
}

/* Fills the space a shorter column leaves at its end, on the stories and specialties pages. It stretches to the
   height of the tallest column, so the collage ends level. */
.collage:has(.collage-doorway) {
  align-items: stretch;
}

.collage-column:has(.collage-doorway) {
  display: flex;
  flex-direction: column;
}

/* The previous card is no longer the column's last, so it keeps its space below. */
.collage-doorway {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: clamp(16px, 1.8vw, 28px);
  background: var(--paper-deep);
  transition: background 0.4s ease;
}

.collage-doorway strong {
  font: 600 clamp(32px, 3.6vw, 56px) / 0.9 var(--display);
  letter-spacing: -0.045em;
}

.collage-doorway em {
  font: italic 400 1.05em/0.9 var(--serif);
  letter-spacing: -0.01em;
}

.collage-doorway:hover strong {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent);
}

/* The title switches to the italic serif on hover. */
.collage-item:hover strong {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent);
}

/* * === footer */

/* The page closes on the forest floor, the same photo as behind the landing, lightly darkened
   so the white type reads. --background is set from site.yaml by common.js. */
.site-footer {
  margin-top: clamp(32px, 4vw, 64px);
  padding: clamp(140px, 18vw, 280px) var(--gutter) 24px;
  color: #f4efe6;
  background:
    linear-gradient(rgba(10, 12, 9, 0.42), rgba(10, 12, 9, 0.68)),
    #10130f var(--background) center / cover no-repeat;
}

.site-footer .label {
  color: rgba(244, 239, 230, 0.72);
}

/* The specialties, as one sentence above the call to action. */
.specialty-line {
  max-width: 30ch;
  margin-bottom: clamp(32px, 4vw, 56px);
  font: 500 clamp(22px, 2.4vw, 36px) / 1.15 var(--display);
  letter-spacing: -0.03em;
}

.specialty-line a {
  font: italic 400 1.08em/1 var(--serif);
  letter-spacing: -0.01em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  transition: color 0.3s ease;
}

.specialty-line a:hover {
  color: #ff8a65;
}

/* The hovered specialty's cover, following the pointer. */
.hover-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: clamp(180px, 18vw, 300px);
  height: auto;
  opacity: 0;
  scale: 0.92;
  pointer-events: none;
  transition: opacity 0.3s ease, scale 0.4s var(--ease-out);
}

.hover-preview.is-visible {
  opacity: 1;
  scale: 1;
}

.footer-cta {
  font: 600 clamp(48px, 9vw, 160px) / 0.9 var(--display);
  letter-spacing: -0.05em;
}

/* A lighter vermilion than --accent, which is too dark to read on the photo. */
.footer-cta em {
  font: italic 400 1.05em/0.9 var(--serif);
  letter-spacing: -0.01em;
  color: #ff8a65;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin-top: 40px;
  font: 500 clamp(18px, 1.8vw, 26px) / 1.2 var(--sans);
}

.footer-links a {
  border-bottom: 1px solid rgba(244, 239, 230, 0.4);
  padding-bottom: 4px;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.footer-links a:hover {
  color: #ff8a65;
  border-color: #ff8a65;
}

.footer-base {
  display: flex;
  justify-content: space-between;
  margin-top: clamp(80px, 10vw, 160px);
}

/* * === lightbox */

/* The page behind an open lightbox must not move. The dialog covers the screen, but the wheel
   and touch still scrolled the document under it. */
html:has(.lightbox[open]) {
  overflow: hidden;
}

.lightbox {
  border: 0;
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100svh;
  background: var(--paper);
  color: var(--ink);
}

.lightbox::backdrop {
  background: var(--paper);
}

/* More room below than above, for the frame number and exposure line. */
.lightbox-inner {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 56px var(--gutter) 84px;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100svh - 140px);
  width: auto;
}

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: var(--ink);
  font: 500 13px/1 var(--sans);
  padding: 20px var(--gutter);
  cursor: pointer;
}

.lightbox button:hover {
  color: var(--accent);
}

.lightbox .close {
  top: 0;
  right: 0;
}

.lightbox .previous {
  bottom: 0;
  left: 0;
}

.lightbox .next {
  bottom: 0;
  right: 0;
}

/* The frame number, and under it the settings it was shot at, when the file has them. */
.lightbox-info {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  white-space: nowrap;
}

/* Kept in its own case, since "mm" and "f/" mean something different in capitals. */
.lightbox-info .exposure {
  color: var(--ink-soft);
  text-transform: none;
}

/* * === plain pages: the 404 page, and the note shown when JavaScript is off */

/* Without JavaScript the pages have no photos, so this sentence is all there is. The top
   padding clears the fixed header. */
.noscript,
.not-found {
  padding: clamp(96px, 12vw, 160px) var(--gutter) clamp(48px, 6vw, 96px);
}

.noscript,
.not-found p {
  max-width: 44ch;
  font: 500 clamp(18px, 1.8vw, 26px) / 1.3 var(--sans);
}

.not-found .section-head {
  margin-bottom: clamp(24px, 3vw, 44px);
}

.not-found p + p {
  margin-top: 24px;
}

.noscript a,
.not-found p a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.noscript a:hover,
.not-found p a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* The hover scale on cards is motion too, so it changes at once instead of easing. */
@media (prefers-reduced-motion: reduce) {
  .photo,
  .collage-item .frame {
    transition: none;
  }
}

/* * === small screens */

/* Rows stack: side by side, two photos would be too small to see on a phone. */
@media (max-width: 760px) {
  /* Smaller type on a phone: at desktop scale the titles crowded the photos they sit by. */
  .section-head h1,
  .section-head h2 {
    font-size: 28px;
  }

  .collage-item strong {
    font-size: 16px;
  }

  .collage-doorway strong {
    font-size: 22px;
  }

  .specialty-line {
    font-size: 16px;
  }

  .footer-cta {
    font-size: 28px;
  }

  .footer-links {
    font-size: 15px;
  }

  .row {
    flex-direction: column;
    width: 100%;
  }

  /* Six links and the name do not fit one line on a phone, so the links take their own line.
     Contact is left out there: the footer with the email and Instagram is on every page. */
  .site-header {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .site-nav a[href$="#contact"] {
    display: none;
  }
}

/* On the narrowest phones the links do not fit at the usual size. */
@media (max-width: 380px) {
  .site-header {
    font-size: 12px;
  }

  .site-nav {
    gap: 8px;
  }
}

/* * === bare collage: photos only, as in the home gallery and the gallery page */

/* No captions, so photos sit as far apart down a column as across. */
.collage.is-bare .collage-item {
  margin-bottom: var(--collage-gap);
}

/* Whatever follows a bare collage adds its own gap, so a column's last photo adds none. This rule
   is needed because the one above out-specifies the zero every collage item gets. */
.collage.is-bare .collage-item:last-child {
  margin-bottom: 0;
}

/* One wider column gives the gallery a lead size, so the photos are not all one scale. Phones
   keep two even columns. */
@media (min-width: 761px) {
  .collage.is-bare .collage-column:first-child {
    flex-grow: 1.5;
  }
}
