:root {
  --bg: #0d0d0d;
  --bg-2: #151514;
  --fg: #ece9e4;
  --muted: #9b968e;
  --line: #2a2825;
  --accent: #c8b68e;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --pad: clamp(16px, 4vw, 48px);
  --row-h: 300px;
  color-scheme: dark;
}
@media (max-width: 700px) { :root { --row-h: 170px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: .01em; line-height: 1.15; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--fg); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- header / footer ---------- */
.site-header {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 28px;
  padding: 22px var(--pad);
  position: sticky; top: 0; z-index: 10;
  background: rgba(13, 13, 13, .88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}
.brand {
  font-family: var(--serif); font-size: 1.25rem; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.site-header nav a {
  color: var(--muted); text-decoration: none; font-size: .86rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--fg); border-color: var(--accent); }

.site-footer { padding: 40px var(--pad) 48px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); margin-top: 72px; }
.site-footer p { margin: 0; max-width: 70ch; }

/* ---------- image protection ---------- */
.protected img, .lb img {
  -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.shield { position: absolute; inset: 0; z-index: 1; background: transparent; -webkit-touch-callout: none; }

/* ---------- hero ---------- */
.hero { position: relative; height: min(82vh, 900px); min-height: 380px; overflow: hidden; background: var(--bg-2); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.15) 45%, rgba(0,0,0,0) 70%);
}
.hero-text { position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(24px, 6vh, 64px); z-index: 2; }
.hero-text h1 { font-size: clamp(2.2rem, 6vw, 4.6rem); margin: 0 0 6px; letter-spacing: .04em; }
.hero-text p { margin: 0; color: #d6d1c9; font-size: clamp(.95rem, 1.6vw, 1.15rem); letter-spacing: .06em; }
.hero-empty { display: grid; place-items: center; text-align: center; background:
  radial-gradient(ellipse at 50% 35%, #1d1b18 0%, var(--bg) 70%); }
.hero-empty::after { display: none; }
.hero-empty .hero-text { position: static; }
.hero-empty .soon { margin-top: 28px; color: var(--muted); font-size: .9rem; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- gallery cards (home) ---------- */
.galleries { padding: 64px var(--pad) 0; }
.galleries h2 { font-size: 1rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .2em; color: var(--muted); margin: 0 0 28px; }
.gallery-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 36px 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { display: block; text-decoration: none; }
.card-img { display: block; position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1), opacity .4s; }
.card:hover .card-img img { transform: scale(1.035); }
.card-name { display: block; font-family: var(--serif); font-size: 1.45rem; margin-top: 14px; }
.card-count { display: block; color: var(--muted); font-size: .82rem; letter-spacing: .06em; }

/* ---------- gallery page ---------- */
.page-head { padding: 56px var(--pad) 28px; max-width: 900px; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 65ch; margin: 14px 0 0; }
.lede a { color: var(--fg); }

.justified { list-style: none; margin: 0; padding: 0 var(--pad); display: flex; flex-wrap: wrap; gap: 8px; }
.justified li { position: relative; flex-grow: calc(var(--r) * 100); flex-basis: calc(var(--r) * var(--row-h)); }
.justified li.filler { flex-grow: 1000000; flex-basis: 0; height: 0; }
.justified a { display: block; position: relative; aspect-ratio: var(--r); background: var(--bg-2); overflow: hidden; cursor: zoom-in; }
.justified img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s, transform .6s cubic-bezier(.2,.7,.2,1); }
.justified a:hover img { transform: scale(1.02); opacity: .92; }

/* ---------- photo page ---------- */
.photo-page { padding: 24px var(--pad) 0; }
.photo-figure { position: relative; margin: 0 auto; max-width: 1600px; display: flex; justify-content: center; }
.photo-figure img { max-height: calc(100vh - 140px); width: auto; object-fit: contain; }
.photo-figure .shield { left: 50%; transform: translateX(-50%); width: 100%; }
.photo-meta { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); gap: 40px 64px; max-width: 1200px; margin: 40px auto 0; }
@media (max-width: 860px) { .photo-meta { grid-template-columns: 1fr; } }
.crumb { margin: 0 0 6px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.crumb a { color: var(--accent); text-decoration: none; }
.photo-text h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0; }
.subject { color: var(--muted); margin: 6px 0 0; letter-spacing: .06em; }
.description { font-size: 1.08rem; line-height: 1.75; color: #d8d3cb; max-width: 62ch; margin: 22px 0 0; }
.exif h2 { font: 600 .74rem/1 var(--sans); text-transform: uppercase; letter-spacing: .2em; color: var(--muted); margin: 6px 0 16px; }
.exif dl, .lb-exif { margin: 0; display: grid; gap: 0; }
.exif dl > div, .lb-exif > div { display: grid; grid-template-columns: 11em 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.exif dt, .lb-exif dt { color: var(--muted); font-size: .86rem; }
.exif dd, .lb-exif dd { margin: 0; font-size: .92rem; font-variant-numeric: tabular-nums; }
.photo-nav { display: flex; justify-content: space-between; gap: 16px; max-width: 1200px; margin: 56px auto 0; padding-top: 22px; border-top: 1px solid var(--line); }
.photo-nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.photo-nav a:hover { color: var(--fg); }

/* ---------- lightbox ---------- */
html.lb-open { overflow: hidden; }
.lb {
  position: fixed; inset: 0; z-index: 50; background: rgba(6, 6, 6, .975);
  display: grid; grid-template-columns: minmax(0, 1fr) 0; transition: grid-template-columns .3s;
}
.lb[hidden] { display: none; }
.lb.show-info { grid-template-columns: minmax(0, 1fr) 360px; }
.lb-stage { position: relative; display: grid; place-items: center; padding: 56px 72px; min-width: 0; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 112px); width: auto; height: auto; object-fit: contain; opacity: 0; transition: opacity .35s; }
.lb-stage img.loaded { opacity: 1; }
.lb-stage .shield { z-index: 2; }
.lb-spinner { position: absolute; width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.lb-stage img.loaded + .shield + .lb-spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.lb button {
  position: absolute; z-index: 3; background: rgba(20, 20, 20, .55); color: var(--fg); border: 1px solid rgba(255,255,255,.08);
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; font: 300 22px/1 var(--sans);
  transition: background .2s, border-color .2s;
}
.lb button:hover { background: rgba(40, 40, 40, .9); border-color: rgba(255,255,255,.2); }
.lb-close { top: 16px; right: 16px; }
.lb-info-toggle { top: 16px; right: 72px; font: italic 600 18px/1 var(--serif) !important; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb.show-info .lb-close, .lb.show-info .lb-info-toggle { right: calc(360px + 16px); }
.lb.show-info .lb-info-toggle { right: calc(360px + 72px); }
.lb.show-info .lb-next { right: calc(360px + 16px); }
.lb-info { overflow-y: auto; background: var(--bg-2); border-left: 1px solid var(--line); padding: 64px 28px 32px; visibility: hidden; }
.lb.show-info .lb-info { visibility: visible; }
.lb-count { color: var(--muted); font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 14px; }
.lb-title { font-size: 1.7rem; margin: 0; }
.lb-subject { color: var(--accent); margin: 4px 0 0; font-size: .9rem; letter-spacing: .06em; }
.lb-desc { color: #d3cec6; line-height: 1.7; margin: 18px 0 26px; font-size: .96rem; }
.lb-exif > div { grid-template-columns: 9.5em 1fr; }
.lb-link { display: inline-block; margin-top: 26px; color: var(--accent); font-size: .88rem; text-decoration: none; }
.lb-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .lb, .lb.show-info { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .lb-stage { padding: 64px 8px 72px; }
  .lb-stage img { max-height: calc(100vh - 140px); }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .lb.show-info .lb-close { right: 16px; }
  .lb.show-info .lb-info-toggle { right: 72px; }
  .lb.show-info .lb-next { right: 16px; }
  .lb-info {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 62vh; z-index: 4;
    border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 26px 22px 36px;
    transform: translateY(100%); transition: transform .3s, visibility .3s;
  }
  .lb.show-info .lb-info { transform: none; }
  .lb.show-info .lb-close { z-index: 5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print { img { display: none !important; } }

/* ---------- footer links ---------- */
.site-footer .footer-links { margin-bottom: 10px; }
.site-footer a, .linklike { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover, .linklike:hover { color: var(--fg); }
.linklike { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* ---------- buttons / forms ---------- */
.btn {
  display: inline-block; font: 600 .86rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  background: var(--accent); color: #111; border: 1px solid var(--accent); border-radius: 2px;
  padding: 14px 26px; cursor: pointer; transition: background .2s, color .2s;
}
.btn:hover { background: #d8c8a3; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); }

.page-intro { max-width: 760px; margin: 56px auto 0; padding: 0 var(--pad); }
.page-intro h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 14px; }
.page-intro > p { color: var(--muted); margin: 0; }
.prose h2 { font-size: 1.4rem; margin: 40px 0 10px; }
.prose p, .prose li { color: var(--fg); opacity: .88; }
.prose a { color: var(--accent); }

.form-wrap { max-width: 760px; margin: 36px auto 0; padding: 0 var(--pad); }
.collab-form { display: grid; gap: 22px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }
.field { display: grid; gap: 7px; }
.field label { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.req { color: var(--accent); }
.opt { text-transform: none; letter-spacing: 0; opacity: .7; }
.field input, .field select, .field textarea {
  width: 100%; font: 16px/1.5 var(--sans); color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px;
  transition: border-color .2s;
}
.field textarea { resize: vertical; min-height: 160px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field [aria-invalid="true"] { border-color: #c96a5a; }
.field-error { margin: 0; color: #e08a7a; font-size: .86rem; }
.form-note { margin: 0; color: var(--muted); font-size: .86rem; }
.form-note a { color: var(--accent); }
.notice { border: 1px solid var(--line); background: var(--bg-2); padding: 22px 24px; margin: 0 0 24px; }
.notice h2 { margin: 0 0 8px; }
.notice p { margin: 6px 0 0; color: var(--muted); }
.notice a { color: var(--accent); }
.notice-error { border-color: #6b3a32; color: #e8b2a7; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- bottom ad banner ---------- */
.ad-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  background: rgba(13, 13, 13, .94); border-top: 1px solid var(--line);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
}
.ad-bar ins { display: block; width: 320px; height: 50px; }
@media (min-width: 760px) { .ad-bar ins { width: 728px; height: 90px; } }
.ad-bar:has(ins[data-ad-status="unfilled"]) { display: none; }
body.has-ad-bar { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
@media (min-width: 760px) { body.has-ad-bar { padding-bottom: 98px; } }

/* ---------- cookie consent ---------- */
.consent {
  position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; margin: 0 auto; max-width: 560px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap;
  background: #1b1a18; border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,.5);
  padding: 16px 18px; font-size: .9rem;
}
.consent p { margin: 0; color: var(--fg); }
.consent a { color: var(--accent); }
.consent-actions { display: flex; gap: 10px; }
.consent .btn { padding: 10px 18px; }

/* ---------- about / gallery story / sharing ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px 64px; max-width: 1200px; margin: 0 auto; padding: 56px var(--pad) 0; align-items: start; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }
.about-photo { margin: 0; position: relative; }
.about-photo img { width: 100%; height: auto; display: block; border-radius: 4px; }
.about-text h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 8px; }
.about-text p { line-height: 1.75; max-width: 62ch; }
.about-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.story { max-width: 68ch; margin-top: 18px; }
.story p { color: #d8d3cb; line-height: 1.75; margin: 0 0 14px; }
.share { margin: 22px 0 0; }
.pin-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--fg); text-decoration: none; font-size: .88rem; }
.pin-btn:hover { background: var(--bg-2); }
.site-footer .footer-social { margin-bottom: 10px; display: flex; gap: 16px; flex-wrap: wrap; }
