/*
 * gallery.css: public gallery. Editorial theme: white page, oversized grotesk headings,
 * grey body copy, black pill-free buttons with an arrow tile, numbered sections.
 * System font stack only (the CSP allows fonts from this site alone), no frameworks.
 */
:root {
  --accent: #0b5cad;           /* overridden by gallery.accentColor; used for focus and selection */
  --ink: #0d0d0d;              /* headings, buttons */
  --text: #6f6f6f;             /* body copy */
  --muted: #8c8c8c;
  --line: rgba(0, 0, 0, .1);
  --line-strong: rgba(0, 0, 0, .18);
  --soft: #f3f3f2;
  --bg: #ffffff;
  --radius: .5rem;
  --gap: 10px;
  --pad: clamp(16px, 4vw, 48px);
  --max: 88rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
  font-family: "Helvetica Neue", Helvetica, Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.45; font-size: 1rem; background: var(--bg); }
img { max-width: 100%; }
a { color: var(--ink); }
h1, h2, h3 { color: var(--ink); font-weight: 500; letter-spacing: -.035em; margin: 0; }
h1 { font-size: clamp(2.6rem, 7vw, 6rem); line-height: .92; }
h2 { font-size: clamp(2rem, 4.6vw, 4rem); line-height: .95; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--ink); color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.empty { color: var(--muted); padding: 64px 0; text-align: center; font-size: 1.1rem; }

/* Small label: "(01)" section numbers, eyebrows, counters */
.num { display: inline-block; font-size: .9rem; font-weight: 500; color: var(--muted); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.eyebrow { margin: 0 0 14px; font-size: .95rem; color: var(--muted); }
.eyebrow a { color: var(--muted); text-decoration: none; }
.eyebrow a:hover { color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); font-size: .85rem; line-height: 1.2; text-decoration: none; background: #fff; }
a.pill:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #2fb45a; box-shadow: 0 0 0 3px rgba(47, 180, 90, .18); }

/* Header: brand left, quiet links right */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); }
.header-row { display: flex; align-items: center; gap: 28px; min-height: 76px; flex-wrap: wrap; }
.brand { font-weight: 600; font-size: 1.05rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; font-size: .98rem; transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.search input { width: 220px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); font: inherit; font-size: .95rem; color: var(--ink); transition: width .3s var(--ease), background .2s; }
.search input::placeholder { color: var(--muted); }
.search input:focus { background: #fff; width: 280px; outline: none; border-color: var(--ink); }

/* Home hero: oversized two-line name, intro and actions underneath */
.hero { padding: clamp(48px, 10vw, 140px) 0 clamp(40px, 6vw, 80px); }
.hero-title { font-size: clamp(3.4rem, 12.5vw, 11rem); line-height: .86; letter-spacing: -.055em; }
.hero-title span { display: block; }
.hero-title span + span { color: #c9c9c6; }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-top: clamp(28px, 4vw, 56px); padding-top: 24px; border-top: 1px solid var(--line); }
.hero-foot p { margin: 0; max-width: 34ch; font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.35; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: flex; gap: clamp(24px, 5vw, 72px); margin: clamp(36px, 5vw, 64px) 0 0; padding: 0; }
.stats div { display: flex; flex-direction: column-reverse; gap: 6px; }
.stats dt { font-size: .9rem; color: var(--muted); }
.stats dd { margin: 0; color: var(--ink); font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 500; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }

/* Sections */
.section { padding: clamp(40px, 7vw, 110px) var(--pad); }
.section + .section { padding-top: 0; }
.section-head, .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; margin-bottom: clamp(24px, 3.5vw, 48px); }
.section-head > div { display: flex; flex-direction: column; gap: 14px; }
.page-head { align-items: flex-end; padding-bottom: clamp(20px, 3vw, 36px); border-bottom: 1px solid var(--line); }
.page-head h1 { word-break: break-word; }
.lead { margin: 18px 0 0; max-width: 60ch; font-size: 1.1rem; }
.head-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.link { color: var(--ink); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }
.link:hover { border-color: var(--ink); }

/* Buttons: solid black with a white arrow tile, or a thin outline */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 8px 18px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--ink); font: inherit; font-size: .95rem; font-weight: 500; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; padding: 5px 20px 5px 5px; }
.btn-primary::before { content: "→"; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: calc(var(--radius) - 2px); background: #fff; color: var(--ink); font-size: 1rem; transition: transform .35s var(--ease); }
.btn-primary:hover { background: #262626; }
.btn-primary:hover::before { transform: translateX(3px); }
.btn-ghost { border-color: transparent; color: var(--text); }
.btn-ghost:hover { color: var(--ink); border-color: transparent; }
.btn-light { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; }
.btn-light:hover { border-color: rgba(255, 255, 255, .6); }
.viewer .btn-primary::before, .selectbar .btn-primary::before { content: none; }
.selectbar .btn-primary { padding: 8px 18px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1); color: #fff; font-size: 1.15rem; cursor: pointer; }

/* Filters */
.toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; color: var(--muted); }
.field select, .field input { min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); font: inherit; font-size: .95rem; color: var(--ink); }
.field select:focus, .field input:focus { background: #fff; border-color: var(--ink); outline: none; }
.toolbar [data-select-toggle] { margin-left: auto; }
.chip { display: inline-block; padding: 4px 12px; margin: 0 6px 6px 0; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .85rem; }
.chip:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Albums: numbered editorial cards */
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: clamp(36px, 4vw, 56px) clamp(16px, 2vw, 28px); counter-reset: album; }
.album { color: var(--ink); text-decoration: none; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 4px; counter-increment: album; }
.album-cover { grid-column: 1 / -1; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; background: var(--soft); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.001); transition: transform .9s var(--ease); }
.album:hover .album-cover img { transform: scale(1.045); }
.album::before { content: counter(album, decimal-leading-zero); grid-row: 2 / 4; grid-column: 1; font-size: .9rem; color: var(--muted); padding-top: .35em; font-variant-numeric: tabular-nums; }
.album-name { grid-column: 2; font-size: clamp(1.35rem, 2vw, 1.75rem); font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.album-meta { grid-column: 2; color: var(--muted); font-size: .92rem; }

/* Photo grid: each page is its own grid; off-screen pages skip rendering. */
.grid-page { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); content-visibility: auto; contain-intrinsic-size: auto 1400px; }
.tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s var(--ease); }
.tile:hover img { transform: scale(1.05); }
.tick { display: none; position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .25); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.selecting .tick { display: block; }
.selecting .tile:hover img { transform: none; }
.tile.selected { outline: 3px solid var(--ink); outline-offset: -3px; }
.tile.selected img { opacity: .78; }
.tile.selected .tick { background: var(--ink); border-color: #fff; }
.tile.selected .tick::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.grid-end { height: 1px; }

/* Photo page */
.photo-page { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.photo-figure { margin: 0; border-radius: var(--radius); overflow: hidden; }
.photo-figure img { display: block; width: 100%; height: auto; max-height: 84vh; object-fit: contain; background: #0f0f0f; }
.photo-side { position: sticky; top: 100px; }
.photo-side h1 { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1; margin-bottom: 28px; word-break: break-word; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0 0 28px; border-top: 1px solid var(--line); }
.facts dt, .facts dd { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); padding-right: 20px; font-size: .92rem; }
.facts dd { margin: 0; color: var(--ink); }
.photo-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Select bar */
.selectbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
.selectbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.selectbar-row strong { color: var(--ink); font-weight: 500; }
.selectbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.selecting main { padding-bottom: 90px; }

/* Viewer */
.viewer { position: fixed; inset: 0; z-index: 50; background: #0b0b0b; color: #fff; display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.viewing { overflow: hidden; }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; }
.viewer-title { margin: 0; font-weight: 500; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.viewer-actions a[hidden] { display: none; }
.viewer-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: pan-y pinch-zoom; }
#viewer-img { max-width: calc(100% - 24px); max-height: 100%; width: auto; height: auto; object-fit: contain; transition: transform .2s ease; cursor: zoom-in; border-radius: 4px; }
#viewer-img.zoomed { transform: scale(2.2); cursor: zoom-out; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; border-radius: var(--radius); background: rgba(255, 255, 255, .08); color: #fff; font-size: 2rem; cursor: pointer; }
.viewer-nav:hover { background: rgba(255, 255, 255, .16); }
.viewer-nav:disabled { opacity: .25; cursor: default; }
.viewer-nav.prev { left: 14px; }
.viewer-nav.next { right: 14px; }
.viewer-info { margin: 0; padding: 14px 18px 22px; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .9rem; border-top: 1px solid rgba(255, 255, 255, .12); }
.viewer-info[hidden] { display: none; }
.viewer-info dt { color: #a3a3a3; }
.viewer-info dd { margin: 0; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); max-width: calc(100vw - 32px); }
.selecting .toast { bottom: 96px; }

/* Footer: quiet row, then the name set huge */
.site-footer { margin-top: clamp(48px, 8vw, 120px); padding: clamp(32px, 4vw, 56px) 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; overflow: hidden; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.footer-row a { color: var(--muted); text-decoration: none; }
.footer-row a:hover { color: var(--ink); }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-mark { margin: clamp(28px, 5vw, 64px) 0 0; color: var(--ink); font-weight: 500; letter-spacing: -.06em; line-height: .8; font-size: clamp(3rem, 14vw, 13rem); white-space: nowrap; }
.notfound { padding: 120px 20px; text-align: center; }
.notfound h1 { margin-bottom: 16px; }

@media (max-width: 760px) {
  :root { --gap: 4px; }
  .header-row { gap: 10px 20px; min-height: 0; padding-top: 14px; padding-bottom: 14px; }
  .nav { gap: 18px; }
  .search { width: 100%; }
  .search input, .search input:focus { width: 100%; }
  .grid-page { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile { border-radius: 4px; }
  .albums { gap: 32px 12px; }
  .photo-page { grid-template-columns: 1fr; }
  .photo-side { position: static; }
  .viewer-nav { display: none; }
  .viewer-actions .btn { padding: 6px 10px; min-height: 36px; }
  .toolbar { gap: 8px; }
  .toolbar [data-select-toggle] { margin-left: 0; }
  .stats { gap: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
