:root {
  --paper: #f2efe7;
  --paper-deep: #e8e1d4;
  --ink: #1e211d;
  --muted-ink: #66665f;
  --accent: #c75b3d;
  --olive: #697252;
  --line: rgba(30, 33, 29, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: linear-gradient(90deg, transparent 0 31px, rgba(30, 33, 29, .05) 32px, transparent 33px), var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
[hidden] { display: none !important; }

.button {
  align-items: center;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-size: .75rem;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  letter-spacing: .05em;
  min-height: 42px;
  padding: 11px 18px;
  text-decoration: none;
  text-transform: uppercase;
}
.button:hover { filter: brightness(.95); }
.button:focus-visible, input:focus-visible, textarea:focus-visible, .media-frame:focus-visible { outline: 3px solid rgba(199, 91, 61, .45); outline-offset: 3px; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-accent { background: var(--accent); border: 0; border-radius: 999px; color: white; }
.button-dark { background: var(--ink); color: white; }
.button-outline { background: transparent; border-color: rgba(255,255,255,.35); color: white; white-space: nowrap; }

.site-header { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; margin: 0 4vw; padding: 22px 0; }
.wordmark { align-items: center; color: inherit; display: inline-flex; font-size: .72rem; font-weight: 700; letter-spacing: .12em; line-height: 1.15; text-decoration: none; text-transform: uppercase; }
.mark { align-items: center; background: var(--ink); color: var(--paper); display: inline-flex; height: 42px; justify-content: center; margin-right: 12px; transform: rotate(-3deg); width: 42px; }
.mark svg, .empty-icon svg, .dropzone svg { fill: currentColor; width: 22px; }

.intro { display: grid; gap: 8vw; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr); margin: 0 4vw; padding: clamp(60px, 10vw, 150px) 0 clamp(70px, 9vw, 125px); }
.eyebrow { color: var(--olive); font-size: .68rem; font-weight: 800; letter-spacing: .19em; margin: 0 0 16px; text-transform: uppercase; }
.intro h1 { font-size: clamp(3rem, 7.3vw, 7.7rem); letter-spacing: -.065em; line-height: .91; margin: 0; max-width: 1100px; }
.intro-note { align-self: end; border-left: 1px solid var(--line); padding-left: 28px; }
.intro-note > p { color: var(--muted-ink); font-size: 1rem; line-height: 1.65; margin: 0; }
.collection-stats { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 26px; }
.collection-stats span { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.collection-stats b { color: var(--accent); font-family: Georgia, serif; font-size: 1rem; }

.gallery-section { background: #242720; color: #f5f0e5; min-height: 440px; padding: clamp(44px, 6vw, 82px) 4vw 7vw; }
.section-heading { align-items: end; border-bottom: 1px solid rgba(255,255,255,.18); display: flex; justify-content: space-between; margin-bottom: 40px; padding-bottom: 22px; }
.section-heading .eyebrow, .empty-state .eyebrow, .lightbox .eyebrow { color: #acb58d; margin-bottom: 8px; }
.section-heading h2 { font-size: clamp(2rem, 4vw, 4rem); letter-spacing: -.04em; line-height: 1; margin: 0; }
.section-heading > p { color: rgba(255,255,255,.58); font-size: .68rem; font-weight: 700; letter-spacing: .13em; margin: 0; text-transform: uppercase; }
.gallery-grid { column-gap: 18px; columns: 3 290px; }
.media-card { break-inside: avoid; display: inline-block; margin: 0 0 34px; width: 100%; }
.media-frame { background: #111; border: 0; color: white; cursor: zoom-in; display: block; min-height: 220px; overflow: hidden; padding: 0; position: relative; width: 100%; }
.gallery-media { display: block; height: auto; max-height: 680px; min-height: 220px; object-fit: cover; transition: transform .5s ease, opacity .35s ease; width: 100%; }
video.gallery-media { aspect-ratio: 16 / 10; }
.media-frame:hover .gallery-media { opacity: .82; transform: scale(1.015); }
.media-kind, .frame-number { position: absolute; z-index: 2; }
.media-kind { background: rgba(242,239,231,.92); bottom: 12px; color: var(--ink); font-size: .62rem; font-weight: 800; letter-spacing: .08em; padding: 7px 9px; right: 12px; text-transform: uppercase; }
.frame-number { background: var(--accent); color: white; font-family: ui-monospace, monospace; font-size: .65rem; left: 0; padding: 5px 8px; top: 0; }
.media-meta { align-items: start; display: flex; gap: 18px; justify-content: space-between; padding-top: 13px; }
.media-meta h3 { font-size: 1.2rem; margin: 0 0 4px; }
.media-meta p { color: rgba(255,255,255,.58); font-size: .78rem; line-height: 1.45; margin: 0; max-width: 50ch; }
.media-meta time { color: rgba(255,255,255,.5); font-family: ui-monospace, monospace; font-size: .62rem; padding-top: 4px; white-space: nowrap; }
.preview-unavailable { align-items: center; aspect-ratio: 4 / 3; background: #191b17; color: rgba(255,255,255,.68); display: flex; flex-direction: column; gap: 7px; justify-content: center; padding: 28px; text-align: center; }
.preview-unavailable span { color: #acb58d; font-size: 2rem; }
.preview-unavailable small { color: rgba(255,255,255,.48); line-height: 1.4; }
.preview-unavailable.expanded { min-height: 55vh; width: 100%; }

.status-state, .empty-state { border: 1px solid rgba(255,255,255,.18); min-height: 290px; }
.status-state { align-items: center; color: rgba(255,255,255,.65); display: flex; gap: 12px; justify-content: center; }
.spinner { animation: spin .8s linear infinite; border: 2px solid rgba(255,255,255,.25); border-radius: 50%; border-top-color: white; height: 18px; width: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { align-items: center; display: grid; gap: 32px; grid-template-columns: auto minmax(0, 1fr) auto; padding: clamp(28px, 5vw, 70px); }
.empty-icon { align-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; display: flex; height: 100px; justify-content: center; width: 100px; }
.empty-icon svg { width: 38px; }
.empty-state h3 { font-size: clamp(2rem, 4vw, 4rem); letter-spacing: -.04em; margin: 0 0 10px; }
.empty-state p:not(.eyebrow) { color: rgba(255,255,255,.6); line-height: 1.6; margin: 0; max-width: 540px; }

footer { background: #242720; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.5); display: flex; font-size: .61rem; font-weight: 700; justify-content: space-between; letter-spacing: .13em; padding: 22px 4vw; text-transform: uppercase; }

.dialog { background: #f8f4ea; border: 1px solid rgba(30,33,29,.22); color: var(--ink); margin: auto; max-height: 92vh; max-width: min(94vw, 980px); overflow: auto; padding: clamp(24px, 4vw, 38px); width: 100%; }
.dialog::backdrop { background: rgba(10,11,9,.78); backdrop-filter: blur(4px); }
.dialog-close { align-items: center; background: rgba(30,33,29,.08); border: 0; border-radius: 50%; cursor: pointer; display: flex; font-size: 1.5rem; height: 36px; justify-content: center; line-height: 1; position: absolute; right: 14px; top: 14px; width: 36px; z-index: 3; }
.upload-dialog { position: fixed; }
.upload-dialog header > h2 { font-size: clamp(2rem, 5vw, 3.3rem); letter-spacing: -.04em; margin: 0 0 8px; }
.upload-dialog header > p:last-child { color: var(--muted-ink); line-height: 1.5; margin: 0; }
.upload-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); margin-top: 26px; }
.dropzone { align-items: center; background: var(--paper-deep); border: 1px dashed rgba(30,33,29,.42); cursor: pointer; display: flex; justify-content: center; min-height: 320px; overflow: hidden; position: relative; }
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: #eee4d5; }
.dropzone > input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.dropzone-copy { align-items: center; color: var(--muted-ink); display: flex; flex-direction: column; font-size: .75rem; gap: 8px; text-align: center; }
.dropzone-copy svg { color: var(--accent); margin-bottom: 8px; width: 34px; }
.dropzone-copy strong { color: var(--ink); font-family: Georgia, serif; font-size: 1.25rem; font-weight: 500; }
.file-preview, .file-preview img, .file-preview video { height: 100%; inset: 0; position: absolute; width: 100%; }
.file-preview img, .file-preview video { object-fit: contain; }
.file-chip { background: rgba(30,33,29,.88); bottom: 10px; color: #fff; font-size: .64rem; left: 10px; max-width: calc(100% - 20px); overflow: hidden; padding: 8px 9px; position: absolute; text-overflow: ellipsis; white-space: nowrap; }
.field-stack { display: flex; flex-direction: column; gap: 17px; }
.field-stack label > span { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .11em; margin-bottom: 7px; text-transform: uppercase; }
.field-stack small { color: var(--muted-ink); font-size: .62rem; font-weight: 500; }
.field-stack input, .field-stack textarea { background: rgba(255,255,255,.55); border: 1px solid rgba(30,33,29,.24); border-radius: 0; color: var(--ink); display: block; font-size: .9rem; outline: none; padding: 11px 12px; resize: vertical; width: 100%; }
.upload-progress { margin-top: 22px; }
.upload-progress > div { background: rgba(30,33,29,.12); height: 7px; overflow: hidden; }
.upload-progress span { background: var(--accent); display: block; height: 100%; transition: width .2s; width: 0; }
.upload-progress p { color: var(--muted-ink); font-size: .7rem; font-weight: 700; letter-spacing: .05em; margin: 8px 0 0; text-transform: uppercase; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

.lightbox { background: #171916; border-color: rgba(255,255,255,.15); color: #f7f2e8; max-width: min(96vw, 1400px); padding: 0; position: fixed; }
.lightbox-close { background: rgba(0,0,0,.62); color: white; }
.lightbox-stage { align-items: center; background: #080908; display: flex; justify-content: center; min-height: min(68vh, 800px); }
.lightbox-media { display: block; max-height: 74vh; max-width: 100%; object-fit: contain; }
.lightbox-copy { align-items: center; display: flex; gap: 30px; justify-content: space-between; padding: 22px 26px 25px; }
.lightbox-copy h2 { font-size: 2rem; margin: 0; }
.lightbox-copy > div > p:last-child { color: rgba(255,255,255,.58); line-height: 1.5; margin: 8px 0 0; }

.toast { background: var(--ink); bottom: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.24); color: white; font-size: .82rem; left: 50%; max-width: min(90vw, 560px); padding: 14px 18px; position: fixed; transform: translateX(-50%); z-index: 20; }
.toast[data-type="error"] { background: #9c3528; }

@media (max-width: 780px) {
  body { background: var(--paper); }
  .site-header { margin: 0 20px; }
  .intro { gap: 42px; grid-template-columns: 1fr; margin: 0 20px; padding: 62px 0 72px; }
  .intro h1 { font-size: clamp(3.4rem, 16vw, 6rem); }
  .intro-note { padding-left: 20px; }
  .gallery-section { padding-left: 20px; padding-right: 20px; }
  .section-heading { align-items: start; flex-direction: column; gap: 14px; }
  .gallery-grid { columns: 1; }
  .empty-state { grid-template-columns: 1fr; }
  .empty-icon { height: 76px; width: 76px; }
  .upload-grid { grid-template-columns: 1fr; }
  .dropzone { min-height: 250px; }
  .dialog { max-width: calc(100vw - 20px); padding: 24px 18px; }
  .lightbox { padding: 0; }
  .lightbox-stage { min-height: 50vh; }
  .lightbox-copy { align-items: stretch; flex-direction: column; }
  footer { gap: 14px; flex-wrap: wrap; }
}

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