/* ===========================================================
   Shauna Kenworthy Photography
   Hand-built static site. No framework, no build step.
   =========================================================== */

:root {
  /* Warm neutral palette, deliberately quiet so the photographs carry the colour */
  --bg:         #faf8f5;
  --bg-sink:    #f2efe9;
  --surface:    #ffffff;
  --ink:        #191815;
  --ink-soft:   #5f5b53;
  --ink-faint:  #938d82;
  --line:       #e3ded4;
  --accent:     #8a6a45;
  --accent-ink: #6d5235;

  --shadow-sm: 0 1px 2px rgba(25, 24, 21, .05), 0 2px 8px rgba(25, 24, 21, .04);
  --shadow-md: 0 4px 12px rgba(25, 24, 21, .07), 0 16px 40px rgba(25, 24, 21, .07);

  --font-display: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --maxw: 1480px;
  --header-h: 164px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

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

img { display: block; max-width: 100%; height: auto; }
svg { width: 1em; height: 1em; }
a { color: inherit; }

.icon-ext {
  width: .62em; height: .62em; flex: none;
  margin-left: .34em; vertical-align: baseline;
}

::selection { background: var(--accent); color: #fff; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: .75rem 1.25rem;
  font-size: .875rem; text-decoration: none;
}
.skip-link:focus { left: .5rem; top: .5rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Typography ---------- */

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -.01em; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header[data-scrolled="true"] {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}
.site-header__inner {
  min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}

.brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand img {
  height: clamp(74px, 13vw, 132px); width: auto;
  transition: height .3s var(--ease);
}
.site-header[data-scrolled="true"] .brand img { height: clamp(46px, 7vw, 62px); }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.25rem); }
.nav a {
  text-decoration: none;
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding-block: .35rem;
  transition: color .2s var(--ease);
  white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a.is-ext { color: var(--accent); }
.nav a.is-ext::after { display: none; }


.nav-toggle {
  display: none; background: none; border: 0; padding: .5rem; margin-right: -.5rem;
  cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 760px) {
  :root { --header-h: 108px; }
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .5rem var(--gutter) 1.25rem;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding-block: .9rem; font-size: .9375rem; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { display: none; }
}

/* ---------- Page head ---------- */

.page-head { padding-block: clamp(2.75rem, 7vw, 5.5rem) clamp(1.75rem, 4vw, 3rem); }
.page-head h1 { font-size: clamp(2.25rem, 5.6vw, 3.875rem); text-wrap: balance; }
.page-head p { margin: 1.125rem 0 0; max-width: 60ch; }

.backlink {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .75rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-faint); text-decoration: none; margin-bottom: 1.5rem;
  transition: color .2s var(--ease), gap .2s var(--ease);
}
.backlink:hover { color: var(--accent); gap: .75rem; }
.backlink svg { width: 1em; height: 1em; }

/* ---------- Gallery index cards ---------- */

/* There are nine galleries, so the only column counts that leave no empty slot
   are 1, 3 and 9. auto-fill used to give 2 or 4 at some widths, which orphaned
   the last card. Pin it to 3, dropping to 1 when 3 would be too cramped.
   If the number of galleries stops being a multiple of 3, build.py warns. */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 2.2vw, 1.75rem);
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 8vw, 6rem);
  list-style: none; margin: 0; padding-inline: 0;
}
@media (max-width: 640px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
}
.card a {
  display: block; text-decoration: none; color: var(--ink);
}
.card a > img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  /* Faces sit high in a portrait frame, so a centred crop beheads them.
     Bias the crop toward the top third. */
  object-position: 50% 28%;
  background: var(--bg-sink);
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .4s var(--ease), filter .5s var(--ease);
  filter: saturate(.97);
}
.card a:hover > img { box-shadow: var(--shadow-md); filter: saturate(1.03); }
.card__title {
  display: block;
  margin-top: .875rem;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.1vw, 1.375rem);
  line-height: 1.2;
  color: var(--ink);
}
.card a:hover .card__title { color: var(--accent-ink); }

/* ---------- Stacked photo scroll ----------
   One photograph per row, scrolled through. Capping the HEIGHT rather than
   setting a width is what keeps the scale even: a tall portrait and a wide
   landscape then read at the same magnitude instead of the portrait towering
   over everything. */

.stack {
  display: grid;
  justify-items: center;
  gap: clamp(2rem, 6vw, 4.5rem);
  max-width: 1150px;
  margin-inline: auto;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.shot {
  display: block; width: auto; max-width: 100%;
  padding: 0; border: 0; margin: 0;
  background: none;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  line-height: 0;
}

.shot img {
  max-height: 84vh;
  max-width: 100%;
  width: auto; height: auto;
  background: var(--bg-sink);
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .35s var(--ease), opacity .6s var(--ease);
}
.shot:hover img { box-shadow: var(--shadow-md); }
.shot img[data-loaded="false"] { opacity: 0; }

@media (max-width: 700px) {
  .shot img { max-height: none; }      /* on a phone, full width reads better */
}

/* ---------- Prose / About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

.about-grid figure { margin: 0; }
.about-grid img {
  width: 100%; border-radius: 3px; box-shadow: var(--shadow-md);
}
.about-grid figcaption {
  margin-top: .875rem; font-size: .8125rem; color: var(--ink-faint); font-style: italic;
}

.prose p { margin: 0 0 1.25rem; font-size: 1.0625rem; line-height: 1.8; color: var(--ink-soft); }
.prose p:first-of-type { font-size: clamp(1.125rem, 1.9vw, 1.3125rem); color: var(--ink); line-height: 1.68; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.prose a:hover { color: var(--ink); }

/* ---------- Other galleries strip ----------
   A fixed 4-column grid, so it can never wrap to a second line at any width.
   The squares shrink on a phone instead. */

.more { border-top: 1px solid var(--line); background: var(--bg-sink); }
.more .wrap { padding-block: clamp(2rem, 5vw, 3.5rem); }
.more h2 {
  font-family: var(--font-body);
  font-size: .6875rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.25rem;
}
.more__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.5rem, 1.6vw, 1.25rem);
  list-style: none; margin: 0; padding: 0;
}
.more__row a { display: block; text-decoration: none; color: var(--ink); }
.more__row img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  object-position: 50% 26%;   /* a 1:1 crop of a portrait is harsher still */
  background: var(--bg);
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .35s var(--ease), filter .4s var(--ease);
  filter: saturate(.97);
}
.more__row a:hover img { box-shadow: var(--shadow-md); filter: saturate(1.03); }
.more__row span {
  display: block;
  margin-top: .5rem;
  font-family: var(--font-display);
  font-size: clamp(.875rem, 1.9vw, 1.125rem);
  line-height: 1.25;
}
.more__row a:hover span { color: var(--accent-ink); }

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

.site-footer { border-top: 1px solid var(--line); margin-top: auto; }
.site-footer__inner {
  display: flex; flex-wrap: wrap; gap: .25rem 2rem;
  justify-content: space-between; align-items: baseline;
  padding-block: clamp(2rem, 4vw, 3rem);
}
.site-footer p { margin: 0; font-size: .8125rem; color: var(--ink-faint); }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent-ink); text-decoration: underline; }

/* ---------- Lightbox ---------- */

.lb {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(13, 12, 11, .96);
  display: none;
  opacity: 0;
  transition: opacity .28s var(--ease);
}
.lb[data-open="true"] { display: block; opacity: 1; }

/* The stage is positioned against the fixed overlay so it has a DEFINITE
   height. It used to be a centred grid item, where the auto-sized row made
   height:100% resolve to auto, so max-height:100% on the photograph measured
   against the photograph's own natural height and it opened zoomed in.
   Insets leave room for the counter, the caption and the arrows. */
.lb__stage {
  position: absolute;
  top: clamp(3rem, 7vh, 4.5rem);
  bottom: clamp(3rem, 7vh, 4.5rem);
  left: clamp(3.25rem, 9vw, 6rem);
  right: clamp(3.25rem, 9vw, 6rem);
  display: flex; align-items: center; justify-content: center;
}
.lb__img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  transition: opacity .2s var(--ease);
  border-radius: 2px;
}
.lb[data-loading="true"] .lb__img { opacity: .35; }

.lb__bar {
  position: absolute; inset-inline: 0; top: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: clamp(.75rem, 2vw, 1.5rem) clamp(1rem, 3vw, 2rem);
  color: rgba(255,255,255,.82); z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,.45), transparent);
  pointer-events: none;
}
.lb__count { font-size: .8125rem; letter-spacing: .1em; font-variant-numeric: tabular-nums; }

.lb__caption {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 2;
  padding: clamp(1rem, 3vw, 2rem);
  text-align: center;
  color: rgba(255,255,255,.88);
  font-size: .9375rem; line-height: 1.6;
  background: linear-gradient(0deg, rgba(0,0,0,.5), transparent);
  pointer-events: none;
}
.lb__caption:empty { display: none; }

.lb button {
  position: absolute; z-index: 3;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff; cursor: pointer;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  backdrop-filter: blur(8px);
  transition: background .2s var(--ease), transform .2s var(--ease), opacity .2s var(--ease);
}
.lb button:hover { background: rgba(255,255,255,.2); transform: scale(1.06); }
.lb button svg { width: 20px; height: 20px; }
.lb__close { top: clamp(.75rem, 2vw, 1.5rem); right: clamp(.75rem, 2vw, 1.5rem); }
.lb__prev { left: clamp(.5rem, 2vw, 1.75rem); top: 50%; transform: translateY(-50%); }
.lb__next { right: clamp(.5rem, 2vw, 1.75rem); top: 50%; transform: translateY(-50%); }
.lb__prev:hover, .lb__next:hover { transform: translateY(-50%) scale(1.06); }
.lb button[disabled] { opacity: .25; pointer-events: none; }

body[data-lb-open="true"] { overflow: hidden; }

/* ---------- Layout shell ---------- */

.page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
main { flex: 1 0 auto; }

/* ---------- Reveal on scroll ---------- */

html.js [data-reveal] {
  opacity: 0; transform: translateY(12px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
html.js [data-reveal][data-shown="true"] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

@media print {
  .site-header, .site-footer, .lb, .nav-toggle { display: none !important; }
  body { background: #fff; }
}
