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

:root {
  --bg: #FAF9F6;
  --text: #131311;
  --muted: #6E6D66;
  --border: rgba(19,19,17,0.12);
  --lb-bg: #0A0A0A;
  --lb-text: #F1EFE9;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  --gutter: clamp(20px, 5vw, 64px);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ── HEADER ── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
  background: rgba(250,249,246,0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; }
.brand-logo {
  height: 26px;
  width: auto;
  display: block;
}

#main-nav { display: flex; gap: 28px; }
#main-nav a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.15s ease;
}
#main-nav a:hover,
#main-nav a[aria-current="page"] { color: var(--text); }

#nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.hamburger-line {
  display: block;
  width: 20px;
  height: 1px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
#nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
#nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}
#nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

#mobile-nav {
  display: none;
  flex-direction: column;
  position: sticky; top: 61px; z-index: 199;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
#mobile-nav a {
  padding: 14px var(--gutter);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  color: var(--muted);
}
#mobile-nav.open { display: flex; }

/* ── HERO ── */
#hero {
  padding: 48px var(--gutter) 72px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 20px;
  max-width: 640px;
}
.hero-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  max-width: 900px;
}
.hero-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  margin-top: 28px;
  margin-bottom: 28px;
  max-width: 640px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
}
.hero-cta:hover { color: var(--muted); border-color: var(--muted); }

/* ── HERO CAROUSEL (aligned to the same edges as the header — logo to nav) ── */
.hero-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  margin: 28px 0;
}
.hero-slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}
.hero-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-slide img,
.hero-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%; /* overridden per-image via inline style using each photo's focal point */
  display: block;
  pointer-events: none;
}
.hero-dots {
  position: absolute;
  bottom: 16px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.hero-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #F1EFE9;
  opacity: 0.45;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.hero-dot.active { opacity: 1; transform: scale(1.3); }

@media (max-width: 720px) {
  #hero { padding: 32px var(--gutter) 56px; }
  .hero-carousel { aspect-ratio: 5 / 7; }
}

/* ── ENTRIES (categories, about, commission) ── */
/* ── GALLERY SEARCH ── */
.gallery-search-bar {
  padding: 0 var(--gutter) 26px;
}
#gallery-search {
  width: 100%;
  max-width: 480px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 16px 0 10px;
  outline: none;
}
#gallery-search::placeholder { color: var(--muted); }
#gallery-search:focus { border-color: var(--text); }
#gallery-search::-webkit-search-cancel-button { cursor: pointer; }

.search-hidden { display: none; }

.entry {
  padding: 26px var(--gutter);
  border-top: 1px solid var(--border);
}
.entry-head {
  display: grid;
  grid-template-columns: 48px 1fr;
  column-gap: 16px;
  max-width: 900px;
}
.entry-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  padding-top: 6px;
}
.entry-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.01em;
  grid-column: 2;
}
.entry-sub {
  grid-column: 2;
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.entry-head[role="button"] { cursor: pointer; }
.entry-head[role="button"]:hover .entry-title { color: var(--muted); }

/* ── IMAGE GRID (hidden until the entry header is clicked) ── */
.grid {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 20px;
  animation: reveal 0.3s ease;
}
.entry.open .grid { display: grid; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tile {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #EAE8E1;
  cursor: pointer;
}
.tile img,
.tile video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.tile:hover img,
.tile:hover video { transform: scale(1.03); }
.tile-video-badge {
  position: absolute;
  top: 10px; right: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #F1EFE9;
  background: rgba(19,19,17,0.55);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
}
.tile-cap {
  position: absolute;
  left: 10px; bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #F1EFE9;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.tile:hover .tile-cap { opacity: 1; }

@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── ABOUT ── */
.about-body {
  max-width: 640px;
  margin-left: 64px;
  color: var(--text);
}
.about-body p { margin-bottom: 16px; }
.about-contacts {
  margin-left: 64px;
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.about-contacts a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
.about-contacts a:hover { color: var(--text); border-color: var(--border); }

/* Quiet, low-profile link to the admin CMS — tucked at the bottom of About */
.admin-access {
  margin-left: 64px;
  margin-top: 56px;
}
.admin-access a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--border);
  transition: color 0.2s ease;
}
.admin-access a:hover { color: var(--muted); }

@media (max-width: 720px) {
  .about-body, .about-contacts, .admin-access { margin-left: 0; }
}

/* ── FORM ── */
.form {
  max-width: 480px;
  margin-left: 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-hint {
  text-transform: none;
  letter-spacing: normal;
  opacity: 0.75;
}
.form-row input, .form-row select {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 8px 0;
  outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--text); }
.form-row select option { background: var(--bg); }
#submit-btn {
  align-self: flex-start;
  background: none;
  border: 1px solid var(--text);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
#submit-btn:hover { background: var(--text); color: var(--bg); }
#form-success {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.field-error {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #B3413A;
  margin-top: -8px;
}
.form-row input[aria-invalid="true"] {
  border-color: #B3413A;
}

@media (max-width: 720px) {
  .form { margin-left: 0; }
}

/* ── GALLERY LOADING / EMPTY STATES ── */
#gallery-root .gallery-status {
  padding: 8px var(--gutter) 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* ── FOOTER ── */
footer {
  padding: 28px var(--gutter);
  border-top: 1px solid var(--border);
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: var(--text); }

/* ── LIGHTBOX (kept dark regardless of page theme, for image contrast) ── */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.97);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}
#lightbox.open { display: flex; }
#lightbox img,
#lightbox video {
  max-width: 84vw; max-height: 74vh;
  object-fit: contain;
}
#lb-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none; color: var(--lb-text);
  font-size: 24px; cursor: pointer; line-height: 1;
}
.lb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--lb-text);
  font-size: 32px; cursor: pointer; padding: 12px;
  opacity: 0.6; transition: opacity 0.15s ease;
}
.lb-arrow:hover { opacity: 1; }
#lb-prev { left: 12px; }
#lb-next { right: 12px; }
#lb-controls {
  position: absolute; bottom: 20px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
#lb-filmstrip { display: flex; gap: 6px; max-width: 90vw; overflow-x: auto; }
#lb-filmstrip img,
#lb-filmstrip video {
  width: 48px; height: 60px; object-fit: cover;
  opacity: 0.4; cursor: pointer; transition: opacity 0.15s ease;
}
#lb-filmstrip img.active, #lb-filmstrip img:hover,
#lb-filmstrip video.active, #lb-filmstrip video:hover { opacity: 1; }
#lb-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* ── RESPONSIVE HEADER ── */
@media (max-width: 860px) {
  #main-nav { display: none; }
  #nav-toggle { display: block; }
}
