/* ---------------------------------------------------------------------
   Mel Explore Nature — dark, cinematic nature-photography portfolio.

   Full-bleed imagery, warm cream serif headlines, a restrained gold
   accent, and a slide-out nav drawer in place of a busy top bar.
   --------------------------------------------------------------------- */

:root {
  --bg: #191c16;
  --mat: #0c0c09;
  --ink: #f6f3ea;
  --ink-dim: #cdc8b8;
  --muted: #8d8f80;

  --accent: #b9925a;
  --gold: #c9a865;
  --success: #8fae7c;
  --danger: #d97a5f;

  --border: rgba(246, 243, 234, 0.14);
  --border-strong: rgba(246, 243, 234, 0.28);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

body.nav-open { overflow: hidden; }

p { text-align: justify; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}

a { color: inherit; }

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

/* A plain, traditional ampersand glyph — Fraunces' default "&" is a
   swashy alternate that doesn't suit every heading it lands in. */
.amp {
  font-family: Georgia, "Times New Roman", serif;
  font-style: normal;
}

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

/* Spam honeypot — off-screen rather than display:none, since some bots
   specifically skip hidden/display:none fields but still fill in any
   plain text input they find in the DOM. Real visitors never see or
   reach it (also aria-hidden + tabindex="-1" in the markup). */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

/* Logo — a normal part of the page, scrolls away with the content ------*/

.site-logo {
  position: relative;
  text-align: center;
  padding: 32px 24px 0;
}

.site-logo img {
  display: inline-block;
  height: 150px;
  width: auto;
}

.site-logo .bg-admin-edit,
.hero__logo-wrap .bg-admin-edit {
  top: 100%;
  bottom: auto;
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  padding: 5px 10px;
  font-size: 9px;
  white-space: nowrap;
}

/* Header — just the floating hamburger, always visible -----------------*/

.site-header {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 100;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  background: rgba(20, 21, 16, 0.4);
  backdrop-filter: blur(6px);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle__bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Nav drawer ------------------------------------------------------------*/

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(380px, 88vw);
  background: #100f0b;
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 90;
  display: flex;
  padding: 100px 40px 40px;
  overflow-y: auto;
}

.nav-drawer.is-open { transform: translateX(0); }

.nav-drawer__inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.nav-drawer__link {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 4px 0;
}

.nav-drawer__link.is-active { color: var(--gold); }

.nav-drawer__categories {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 14px;
}

.nav-drawer__categories a {
  color: var(--ink-dim);
  text-decoration: none;
}

.nav-drawer__categories a:hover { color: var(--ink); }

.nav-drawer__admin {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-drawer__admin a,
.nav-drawer__admin button {
  color: var(--muted);
  background: none;
  border: none;
  text-align: left;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.nav-drawer__admin a:hover,
.nav-drawer__admin button:hover { color: var(--ink); }

/* Flash messages ------------------------------------------------------ */

.flash-stack { padding-top: 24px; }

.flash {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 3px;
  margin-bottom: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
}

.flash--success { color: var(--success); border-color: rgba(143, 174, 124, 0.35); }
.flash--error { color: var(--danger); border-color: rgba(217, 122, 95, 0.35); }

/* Hero ------------------------------------------------------------------*/

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  padding-bottom: 70px;
}

.hero__logo-wrap {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
}

.hero__logo {
  display: block;
}

.hero__logo img {
  display: block;
  height: 150px;
  width: auto;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.4));
}

.hero__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  width: 100%;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4.2vw, 50px);
  line-height: 1.18;
  color: var(--ink);
  max-width: 560px;
  margin: 0;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

.hero__side {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero__tagline {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-dim);
  margin: 0;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.hero__tagline::first-line { font-weight: 700; }

/* Intro section -------------------------------------------------------- */

.intro {
  background: var(--bg);
  padding: 110px 0 90px;
  text-align: center;
}

.intro__lead {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.55;
  color: var(--ink);
  max-width: 820px;
  margin: 0 auto 70px;
}

.intro__note {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-dim);
  max-width: 760px;
  margin: 70px auto 34px;
}

.intro__link {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.intro__link:hover { color: var(--ink); border-color: var(--ink); }

.filmstrip {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.filmstrip__item {
  display: block;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.filmstrip__item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.filmstrip__item--0 { width: 130px; aspect-ratio: 3 / 4; align-self: flex-end; }
.filmstrip__item--1 { width: 175px; aspect-ratio: 3 / 5; align-self: flex-start; }
.filmstrip__item--2 { width: 150px; aspect-ratio: 4 / 5; align-self: center; }

/* Portfolio teaser (homepage) --------------------------------------------*/

.portfolio-teaser { background: var(--bg); padding: 90px 0 130px; }

.portfolio-teaser__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "intro small"
    "large categories";
  gap: 44px 60px;
  align-items: start;
}

.portfolio-teaser__intro { grid-area: intro; }

.portfolio-teaser__intro h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 38px;
  margin: 0 0 14px;
  color: var(--ink);
}

.portfolio-teaser__intro p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-dim);
  max-width: 38ch;
  margin: 0;
}

.portfolio-teaser__small,
.portfolio-teaser__large {
  display: block;
  border-radius: 2px;
}

.portfolio-teaser__small { grid-area: small; justify-self: end; width: 72%; }
.portfolio-teaser__large { grid-area: large; }

.portfolio-teaser__small img,
.portfolio-teaser__large img {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.portfolio-teaser__categories {
  grid-area: categories;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding-top: 18px;
}

.portfolio-teaser__categories a {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.portfolio-teaser__categories a:hover { color: var(--ink); }

.portfolio-teaser__cta {
  margin-top: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
}

.portfolio-teaser__cta:hover { color: var(--ink); border-color: var(--ink); }

/* Closing image collage (homepage, before the footer) --------------------*/

.closing-gallery { padding: 60px 0 110px; }

.closing-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 40px;
  min-height: 380px;
}

.closing-gallery__photo {
  display: block;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  background: var(--mat);
}

.closing-gallery__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.closing-gallery__photo--0 { aspect-ratio: 4 / 5; }

.closing-gallery__photo--1 {
  aspect-ratio: 3 / 5;
  margin-top: 100px;
}

.closing-gallery__photo--2 { aspect-ratio: 4 / 5; }

/* Gallery head -----------------------------------------------------------*/

.gallery-head { padding: 40px 0 40px; }

.gallery-head__eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 10px;
}

.gallery-head h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 42px;
  margin: 10px 0 0;
  color: var(--ink);
}

.gallery-head__description {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-dim);
  max-width: 60ch;
  margin: 16px 0 0;
  overflow-wrap: break-word;
}

/* Collaboration descriptions tend to run much longer (client messages,
   usage notes) than a category's short tagline -- the 60ch cap that
   suits the latter just makes the former wrap into a narrow, unbalanced
   column next to the full-width grid below it. */
.gallery-head__description--wide { max-width: 100%; }

.featured-pick-clear { margin: 20px 0 0; }

.featured-upload { margin: 0 0 40px; }

.featured-upload__dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 140px;
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
  padding: 24px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.featured-upload__dropzone.is-dragover {
  border-color: var(--gold);
  background: rgba(201, 168, 101, 0.06);
}

.featured-upload__text {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  max-width: 32ch;
  pointer-events: none;
}

.featured-upload__dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.category-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.category-upload input[type="file"] {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-dim);
}

/* Portfolio landing — category rows --------------------------------------*/

.portfolio-rows { padding: 30px 0 10px; }

.portfolio-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 46px 0;
}

.portfolio-row__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 25px;
  color: var(--ink-dim);
  margin: 0;
}

.portfolio-row__photos {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  overflow-x: auto;
}

.portfolio-row__tile {
  position: relative;
  flex-shrink: 0;
}

.portfolio-row__photo {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 2px;
  background: var(--mat);
}

.portfolio-row__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.portfolio-row__photo:hover img { transform: scale(1.05); }

.portfolio-row__tile--0 { width: 165px; aspect-ratio: 4 / 5; align-self: center; }
.portfolio-row__tile--1 { width: 190px; aspect-ratio: 3 / 5; align-self: flex-start; }
.portfolio-row__tile--2 { width: 165px; aspect-ratio: 4 / 5; align-self: center; }

.portfolio-row .portfolio-row__cta { flex-shrink: 0; align-self: center; }

/* Collaboration CTA (portfolio landing) ----------------------------------*/

.collab-cta { padding: 90px 0 130px; text-align: center; }

.collab-cta__grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  align-items: center;
  gap: 40px;
}

.collab-cta__inner { max-width: 620px; margin: 0 auto; }

.collab-cta__side { position: relative; }

.collab-cta__photo {
  display: block;
  aspect-ratio: 3 / 5;
  overflow: hidden;
  border-radius: 2px;
  background: var(--mat);
}

.collab-cta__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.collab-cta h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 34px);
  color: var(--ink);
  margin: 0 0 20px;
}

.collab-cta p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-dim);
  margin: 0 0 28px;
}

/* About page — top photo strip -------------------------------------------*/

.about-top { padding: 70px 0 50px; }

.about-top .wrap { max-width: 1600px; }

.about-top .filmstrip { justify-content: space-between; gap: 40px; }

.about-top .filmstrip__item--0 { width: 260px; }
.about-top .filmstrip__item--1 { width: 480px; aspect-ratio: 3 / 2; align-self: center; }
.about-top .filmstrip__item--2 { width: 300px; }

/* About page — two-column layout ---------------------------------------*/

.about {
  display: grid;
  grid-template-columns: minmax(280px, 46%) 1fr;
  min-height: 620px;
  background: var(--bg);
}

.about__portrait {
  position: relative;
  align-self: start;
  margin-left: max(28px, calc((100vw - 1600px) / 2 + 28px));
  background: var(--mat);
  overflow: hidden;
}
.about__portrait img { display: block; width: 100%; height: auto; }

.about__content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 80px 60px 80px 110px;
}

.about__eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 20px;
}

.about h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 28px;
  max-width: 30ch;
}

.about__body {
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.85;
  max-width: 46ch;
}

.about__body p { margin: 0; }

/* About page — "behind the lens" text + gallery --------------------------*/

.about-focus { padding: 90px 0 50px; text-align: center; }

.about-focus__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.3;
  color: var(--ink);
  text-align: left;
  max-width: 640px;
  margin: 0 auto 14px;
}

.about-focus__text {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-dim);
  text-align: justify;
  max-width: 640px;
  margin: 0 auto;
}

.about-gallery { padding: 50px 0 90px; }

.about-gallery .wrap { max-width: 1600px; }

.about-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.about-gallery__photo {
  display: block;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  background: var(--mat);
}

.about-gallery__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.about-gallery__photo--0 { grid-column: 1; grid-row: 1 / 3; }
.about-gallery__photo--1 { grid-column: 2; grid-row: 1; aspect-ratio: 4 / 3; }
.about-gallery__photo--2 { grid-column: 2; grid-row: 2; aspect-ratio: 4 / 3; }
.about-gallery__photo--3 { grid-column: 3; grid-row: 1 / 3; }

/* About page — "let's collaborate" section ------------------------------*/

.about-cta { padding: 20px 0 110px; }

.about-cta .wrap { max-width: 1600px; }

.about-cta__grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}

.about-cta__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
  text-align: right;
}

.about-cta__photo { display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 2px; background: var(--mat); }
.about-cta__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.about-cta__content p {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-dim);
  max-width: 40ch;
  margin: 0 0 24px;
}

/* Empty state ---------------------------------------------------------*/

.empty-roll { padding: 120px 28px; text-align: center; }

.empty-roll__eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.empty-roll h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  margin: 10px 0 12px;
  color: var(--ink);
}

.empty-roll p:not(.empty-roll__eyebrow) {
  color: var(--ink-dim);
  margin: 0 0 26px;
}

.empty-roll__categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Gallery grid ----------------------------------------------------------*/

.film-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 36px;
  padding: 40px 0 90px;
}

/* Masonry-style grid — dense CSS Grid packing. Every photo gets the same
   2-column-wide tile (so two land side by side per row — portrait or
   landscape, it doesn't matter, a wide photo never gets squeezed into one
   narrow column) and each photo's row-span is precomputed server-side
   from its real aspect ratio (see compute_masonry_layout in app.py) into
   fine-grained row tracks. Dense auto-flow then backfills later, shorter
   photos into whatever gaps are left instead of leaving big empty spaces.
   Used for the public portfolio category pages; admin pickers keep the
   uniform .film-grid above since quick scanning matters more there than
   showing full compositions. */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 10px;
  grid-auto-flow: dense;
  gap: 10px;
  padding: 40px 0 90px;
}

.masonry-grid .frame { grid-column: span 2; }

.masonry-grid .frame__img-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.masonry-grid .frame__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame { display: block; position: relative; text-decoration: none; color: inherit; }

.frame__link { display: block; height: 100%; text-decoration: none; color: inherit; }

.frame__img-wrap {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--mat);
  border-radius: 2px;
}

.frame__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.frame:hover .frame__img-wrap img { transform: scale(1.045); }

/* Small, deliberately understated marker — enough to tell a visitor
   this tile is a video before they click, without it competing with
   the photo or implying the grid itself plays anything. */
.frame__video-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(10, 11, 8, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.frame__video-badge svg { width: 11px; height: 11px; fill: #fff; }

/* Admin-only control (see photo_tile macro) for flagging a photo in a
   collaboration's private gallery for the public Collaborations
   showcase — sits opposite the video badge so the two never collide. */
.frame__showcase-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.frame__showcase-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 11, 8, 0.55);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.frame__showcase-btn.is-active { background: var(--gold); color: var(--mat); }

.frame__caption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 14px;
}

.frame__meta {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
}

/* Public Collaborations showcase — jump nav + per-collaboration
   dividers grouping the masonry grid below into sections ---------------*/

.collab-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.collab-jump-nav a { padding: 10px 18px; font-size: 11px; }

.collab-group__divider {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 50px 0 0;
  scroll-margin-top: 30px;
}

.collab-group__line { flex: 1; height: 1px; background: var(--border); }

.collab-group__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  color: var(--gold);
  margin: 0;
  white-space: nowrap;
}

/* Detail page -----------------------------------------------------------*/

.detail { padding: 40px 0 100px; max-width: 900px; }

.detail__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 13px;
  margin-bottom: 24px;
}

.detail__back { text-decoration: none; color: var(--ink-dim); }
.detail__back:hover { color: var(--ink); }

.detail__figure {
  margin: 0 0 34px;
  background: var(--mat);
  border-radius: 3px;
  overflow: hidden;
}

.detail__figure img,
.detail__figure video {
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  background: var(--mat);
}

.detail__body h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 38px;
  margin: 0 0 16px;
  color: var(--ink);
}

.detail__description {
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.75;
  max-width: 64ch;
  margin: 0 0 26px;
}

.detail__meta {
  display: flex;
  gap: 40px;
  margin: 0 0 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.detail__meta dt {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

.detail__meta dd { margin: 0; font-size: 15px; color: var(--ink); }

.detail__actions { display: flex; gap: 12px; margin-bottom: 50px; }

.detail__pager {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-family: var(--font-body);
  font-size: 13px;
}

.detail__pager-link { text-decoration: none; color: var(--ink-dim); max-width: 45%; }
.detail__pager-link:hover { color: var(--ink); }
.detail__pager-link--next { text-align: right; margin-left: auto; }

/* Contact page — full-bleed like the hero --------------------------------*/

.contact-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  padding: 60px 0 80px;
}

.contact-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
  margin-top: 200px;
}

.contact-hero__intro h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 20px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.contact-hero__intro p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-dim);
  max-width: 44ch;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.contact-hero__form {
  background: rgba(20, 21, 16, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
}

.contact-hero__alt {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 4px 0 0;
}

.contact-hero__alt a { color: var(--ink-dim); }

/* Forms -------------------------------------------------------------- */

.form-page { padding: 40px 0 110px; max-width: 640px; }
.form-page--narrow { max-width: 420px; }
.form-page--text { max-width: 720px; }

.text-editor__section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 30px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
}

.text-editor__section:first-child { padding-top: 0; margin-top: 0; border-top: none; }

.text-editor__section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  color: var(--gold);
  margin: 0 0 20px;
}

.form-page h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 34px;
  margin: 6px 0 16px;
  color: var(--ink);
}

.form-page__intro { color: var(--ink-dim); font-size: 15px; margin: 0 0 30px; }
.form-page__alt { margin-top: 30px; font-size: 13px; color: var(--muted); }
.form-page__alt a { color: var(--ink-dim); }

.photo-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
}

.field__hint { font-size: 12px; color: var(--muted); }

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  resize: vertical;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(185, 146, 90, 0.16);
}

input[type="file"] { font-family: var(--font-body); font-size: 13px; color: var(--ink-dim); }

.form-actions { display: flex; gap: 12px; margin-top: 10px; }

.field--checkbox { flex-direction: row; align-items: center; gap: 10px; }
.field--checkbox input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.field--checkbox span { font-family: var(--font-body); font-size: 14px; color: var(--ink-dim); }

/* Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 12px 20px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn:hover { border-color: var(--ink-dim); }

.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--primary:hover { background: #ffffff; border-color: #ffffff; }

.btn--danger { color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); }

.btn--pill {
  border-radius: 999px;
  padding: 14px 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  align-self: flex-start;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn--pill:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Admin — inline "pick a photo" affordances on the live pages ------------*/

.bg-admin-edit {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 5;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(20, 21, 16, 0.55);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 9px 16px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.bg-admin-edit:hover { border-color: var(--ink); }

.admin-empty-slot {
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  text-decoration: none;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.admin-empty-slot:hover { border-color: var(--ink-dim); color: var(--ink-dim); }

.text-edit-link {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  opacity: 0.9;
}

.text-edit-link:hover { opacity: 1; text-decoration: underline; }

.text-edit-link--pencil {
  margin-top: 0;
  margin-left: 10px;
  font-size: 0.6em;
  vertical-align: middle;
  opacity: 0.5;
}

.text-edit-link--pencil:hover { opacity: 1; text-decoration: none; }

.inline-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 1em;
  max-width: 640px;
}

.inline-edit__input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
}

.inline-edit__input:focus { outline: none; border-color: var(--gold); }

.inline-edit__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-edit__actions .btn {
  padding: 8px 16px;
  font-size: 11px;
}

/* Admin — featured photo picker ------------------------------------------*/

.featured-list { display: flex; flex-direction: column; gap: 16px; padding: 10px 0 100px; }

.featured-row {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
}

.featured-row__thumb {
  display: block;
  flex-shrink: 0;
  width: 100px;
  aspect-ratio: 4 / 3;
  background: var(--mat);
  border-radius: 3px;
  overflow: hidden;
}

.featured-row__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.featured-row__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 4px;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.featured-row__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.featured-row__label {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
}

.featured-row__actions { display: flex; gap: 10px; }

.featured-pick-form { display: block; margin: 0; }

.featured-pick-form__btn {
  all: unset;
  display: block;
  width: 100%;
  cursor: pointer;
}

.featured-pick-form__btn.is-current .frame__img-wrap {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

/* Admin messages inbox ---------------------------------------------------*/

.message-list { display: flex; flex-direction: column; gap: 18px; padding-bottom: 90px; }

.message-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.03);
}

.message-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.message-card__name { font-family: var(--font-display); font-size: 18px; color: var(--ink); }
.message-card__date { font-family: var(--font-body); font-size: 12px; color: var(--muted); flex-shrink: 0; }

.message-card__email {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 10px;
}

.message-card__body {
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
  white-space: pre-wrap;
}

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

.site-footer {
  padding: 40px 0 60px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.site-footer__social {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.site-footer__social a {
  color: var(--ink-dim);
  transition: color 0.15s ease;
}

.site-footer__social a:hover { color: var(--ink); }

.site-footer__social svg { width: 18px; height: 18px; display: block; }

.site-footer__row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-footer__legal {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 480px;
  margin: 8px auto 0;
}

.site-footer__nav {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: 10px;
}

.site-footer__nav a { color: var(--muted); text-decoration: none; }
.site-footer__nav a:hover { color: var(--ink-dim); }

.site-footer__support {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(calc(-50% - 15px));
  display: inline-block;
  opacity: 0.9;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.site-footer__support img {
  display: block;
  width: 200px;
  height: auto;
  border-radius: 8px;
}

.site-footer__support:hover { opacity: 1; transform: translateY(calc(-50% - 15px)) scale(1.03); }

.site-footer__top {
  position: absolute;
  right: 0;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer__top:hover { color: var(--ink); }

/* Responsive ------------------------------------------------------------*/

@media (max-width: 780px) {
  .site-logo { padding: 24px 24px 0; }
  .site-logo img { height: 100px; }

  .hero { min-height: 86vh; padding-bottom: 50px; }
  .hero__logo-wrap { top: 24px; }
  .hero__logo img { height: 100px; }
  .hero__inner { flex-direction: column; align-items: flex-start; gap: 26px; }
  .hero__side { max-width: 100%; }

  .portfolio-teaser__grid {
    grid-template-columns: 1fr;
    grid-template-areas: "intro" "large" "small" "categories";
  }
  .portfolio-teaser__small { justify-self: stretch; width: 100%; }

  .closing-gallery__grid {
    display: block;
    column-count: 2;
    column-gap: 10px;
    min-height: 0;
  }
  .closing-gallery__photo--0,
  .closing-gallery__photo--1,
  .closing-gallery__photo--2 {
    display: block;
    justify-self: auto;
    width: 100%;
    aspect-ratio: auto;
    break-inside: avoid;
    margin: 0 0 10px;
  }
  .closing-gallery__photo--0 img,
  .closing-gallery__photo--1 img,
  .closing-gallery__photo--2 img {
    height: auto;
    object-fit: initial;
  }

  .portfolio-row { grid-template-columns: 1fr; gap: 18px; padding: 34px 0; }
  .portfolio-row__tile--0,
  .portfolio-row__tile--2 { width: 100px !important; }
  .portfolio-row__tile--1 { width: 118px !important; }

  .collab-cta__grid { grid-template-columns: 1fr; gap: 28px; }
  .collab-cta__side { justify-self: center; width: 60%; }

  .about { grid-template-columns: 1fr; }
  .about__portrait { min-height: 320px; margin-left: 28px; margin-right: 28px; }
  .about__content { padding: 60px 28px 90px; }

  /* These photos are portrait-oriented — forcing them into a 4:3 crop
     (fine for the desktop grid's landscape slots) chops off a lot of
     each shot. Switch to a 2-column masonry showing their natural
     aspect ratio instead, like the other photo strips on mobile. */
  .about-gallery__grid {
    display: block;
    column-count: 2;
    column-gap: 10px;
  }
  .about-gallery__photo--0,
  .about-gallery__photo--1,
  .about-gallery__photo--2,
  .about-gallery__photo--3 {
    display: block;
    width: 100%;
    aspect-ratio: auto;
    break-inside: avoid;
    margin-bottom: 10px;
  }
  .about-gallery__photo--0 img,
  .about-gallery__photo--1 img,
  .about-gallery__photo--2 img,
  .about-gallery__photo--3 img { height: auto; object-fit: initial; }

  .about-cta__grid { grid-template-columns: 1fr; text-align: center; }
  .about-cta__title { text-align: center; }

  .contact-hero__grid { grid-template-columns: 1fr; }

  .gallery-head h1 { font-size: 32px; }
  .detail__body h1 { font-size: 28px; }

  /* Below, the masonry grid switches from CSS Grid to a plain
     column-count layout. The desktop version's row-span per photo is
     computed server-side against a *desktop* column width (see
     compute_masonry_layout in app.py) — on a much narrower phone
     column that math no longer holds, so photos cropped to those
     heights would look wrong. A column-count layout instead sizes
     each photo from its own real aspect ratio via plain CSS, so it's
     correct at any width with no server-side calibration needed. The
     `!important`s are required because the per-photo row-span is set
     as an inline style, which normal stylesheet rules can't override. */
  .masonry-grid {
    display: block;
    column-count: 2;
    column-gap: 8px;
    padding: 24px 0 60px;
  }
  .masonry-grid .frame {
    grid-column: auto !important;
    grid-row: auto !important;
    display: block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 8px;
  }
  .masonry-grid .frame__img-wrap {
    height: auto !important;
  }
  .masonry-grid .frame__img-wrap img {
    height: auto !important;
    object-fit: initial;
  }

  .field-row { grid-template-columns: 1fr; }
  .detail__meta { flex-wrap: wrap; gap: 20px; }

  /* A row of small thumbnails reads as cramped on a phone — switch to
     a 2-column masonry instead, showing each photo at real size and
     its own natural aspect ratio (like the portfolio grid above). */
  .filmstrip {
    display: block;
    column-count: 2;
    column-gap: 10px;
  }
  .filmstrip__item {
    display: block;
    width: 100% !important;
    aspect-ratio: auto !important;
    align-self: auto !important;
    break-inside: avoid;
    margin-bottom: 10px;
  }
  .filmstrip__item img { height: auto; object-fit: initial; }

  /* Give the first photo of the homepage intro strip a wide "feature"
     banner treatment instead of just being another masonry tile — an
     even 2-column grid of 5 same-ish rectangles reads as a plain
     thumbnail grid. One full-width photo on top, with the remaining
     four settling into the masonry below, breaks that up. */
  .intro .filmstrip__item:first-child {
    column-span: all;
    aspect-ratio: 16 / 10 !important;
    margin-bottom: 10px;
  }
  .intro .filmstrip__item:first-child img {
    height: 100%;
    object-fit: cover;
  }

  /* The about-top strip is sized for a wide desktop layout (up to
     480px per photo) with fixed pixel widths — those would overflow a
     phone screen. Switch to proportional flex sizing instead of more
     fixed pixel widths, so it always fits any phone width exactly,
     rather than needing to guess-and-check a pixel budget per device.
     Needs display:flex explicitly since the generic .filmstrip rule
     above switches to a column-count masonry on mobile instead. */
  .about-top .filmstrip { display: flex; justify-content: center; align-items: center; gap: 10px; }
  .about-top .filmstrip__item--0,
  .about-top .filmstrip__item--1,
  .about-top .filmstrip__item--2 {
    width: auto !important;
    flex: 1 1 0;
  }
  .about-top .filmstrip__item--1 { flex-grow: 1.6; }

  .site-footer__top { position: static; margin-top: 14px; }
  .site-footer__support { position: static; transform: none; margin-top: 14px; }
  .site-footer__support:hover { transform: scale(1.03); }
  .site-footer__row { flex-direction: column; }

  .featured-row { flex-wrap: wrap; }
  .featured-row__body { min-width: 200px; }
}

@media (max-width: 480px) {
  .nav-drawer { width: 100vw; padding: 90px 28px 32px; }
}

/* Reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .nav-drawer,
  .nav-toggle__bar,
  .frame__img-wrap img,
  .portfolio-row__photo img,
  .btn,
  .btn--pill {
    transition: none;
  }
  .frame:hover .frame__img-wrap img { transform: none; }
}
