/* =========================================================
   Fifty Millimetre — site styles

   Colours, fonts and spacing are all set once, just below.
   Change a value here and it updates across the whole site.
   ========================================================= */

:root {
  --bg: #fbfaf8;          /* page background */
  --text: #1b1b1a;        /* main text */
  --muted: #6f6c67;       /* secondary text */
  --line: #e6e3dd;        /* thin divider lines */
  --placeholder: #ebe8e2; /* shown while a photo is loading */

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --max: 1320px;
  --gutter: clamp(16px, 4vw, 56px);
  --gap: clamp(8px, 1.1vw, 16px);
  --header-h: 76px;
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 3.8vw, 3rem); }
h3 { font-size: 1.6rem; }
p { margin: 0 0 1.1em; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  background: var(--text);
  color: var(--bg);
  padding: .6rem 1rem;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout helpers ---------- */

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.narrow { max-width: 820px; }
.center { text-align: center; }

.section { padding: clamp(64px, 10vw, 136px) 0; }
.section-flush-top { padding-top: 0; }
.page-top {
  padding-top: clamp(48px, 8vw, 112px);
  padding-bottom: clamp(64px, 10vw, 136px);
}

/* The one line of text on the home page */
.statement {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.3;
}

.text-link {
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  transition: opacity .2s ease;
}
.text-link:hover { opacity: .6; }

/* ---------- Header & navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  max-width: var(--max);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-list {
  display: flex;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list a {
  position: relative;
  padding: .5rem 0;
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color .2s ease;
}
.nav-list a:hover,
.nav-list a[aria-current="page"] { color: var(--text); }
.nav-list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }

  .logo { font-size: 1.35rem; }
  .nav-list { gap: 1.25rem; }
  .nav-list a { font-size: .7rem; letter-spacing: .12em; }
}

/* ---------- Home: hero ---------- */

.hero {
  position: relative;
  height: clamp(420px, calc(100vh - var(--header-h)), 960px);
  height: clamp(420px, calc(100svh - var(--header-h)), 960px);
  overflow: hidden;
  background: var(--placeholder);
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0) 55%);
}
.hero-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(28px, 6vw, 72px);
  z-index: 1;
  color: #fff;
}
.hero-text h1 { font-size: clamp(2.8rem, 7.5vw, 6rem); }

/* ---------- Section heading row ---------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(24px, 3.5vw, 48px);
}

/* ---------- Photo tiles (home + gallery) ---------- */

.tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--placeholder);
  overflow: hidden;
  cursor: zoom-in;
}
.tile img {
  width: 100%;
  opacity: 0;
  transition: opacity .6s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
}
.tile.is-loaded img { opacity: 1; }

.tile-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1.1rem 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
  color: #fff;
  font-size: .82rem;
  letter-spacing: .04em;
  text-align: left;
  opacity: 0;
  transition: opacity .3s ease;
}
.tile-caption small {
  display: block;
  margin-top: .15rem;
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .8;
}

@media (hover: hover) {
  .tile:hover img { transform: scale(1.03); }
  .tile:hover .tile-caption { opacity: 1; }
}
.tile:focus-visible .tile-caption { opacity: 1; }

/* Home: evenly cropped grid of featured photos */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.featured-grid .tile { aspect-ratio: 4 / 5; }
/* Crop towards the top of upright photos, where faces usually are */
.featured-grid .tile img { height: 100%; object-fit: cover; object-position: center 15%; }

@media (max-width: 900px) {
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Gallery: masonry columns that keep each photo's own shape */
.masonry {
  columns: 3 300px;
  column-gap: var(--gap);
}
.masonry .tile {
  margin-bottom: var(--gap);
  break-inside: avoid;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2rem;
  margin-bottom: clamp(24px, 3.5vw, 44px);
}
.filter {
  padding: .35rem 0;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font: inherit;
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.filter:hover { color: var(--text); }
.filter.is-active { color: var(--text); border-bottom-color: currentColor; }

.empty-note { color: var(--muted); }

/* ---------- Footer ---------- */

.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.footer-inner p { margin: 0; }

/* ---------- Lightbox (full-screen photo viewer) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 14, 13, .97);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox :focus-visible { outline-color: #fff; }

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(100vw - 160px);
}
.lightbox-img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  object-fit: contain;
}
.lightbox-caption {
  min-height: 1.4em;
  margin-top: 1rem;
  color: #cfccc6;
  font-size: .85rem;
  letter-spacing: .04em;
  text-align: center;
}
.lightbox-count {
  position: absolute;
  top: 26px;
  left: 28px;
  margin: 0;
  color: #9a978f;
  font-size: .76rem;
  letter-spacing: .16em;
}
.lightbox-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  background: none;
  border: 0;
  color: #fff;
  opacity: .7;
  cursor: pointer;
  transition: opacity .2s ease;
}
.lightbox-btn:hover { opacity: 1; }
.lightbox-close { top: 10px; right: 12px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }

@media (max-width: 760px) {
  .lightbox-figure { max-width: calc(100vw - 24px); }
  .lightbox-img {
    max-height: calc(100vh - 180px);
    max-height: calc(100dvh - 180px);
  }
  .lightbox-prev,
  .lightbox-next { top: auto; bottom: 14px; transform: none; }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
}

/* ---------- Respect "reduce motion" settings ---------- */

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