:root {
  --bg: #0d0d0e;
  --surface: #161618;
  --text: #ecebe7;
  --muted: #9b9a96;
  --line: #2a2a2d;
  --accent: #d9b77e;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --row: 300px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: .01em; }
h2 { font-size: 1.7rem; margin-top: 1.8em; }

.button {
  display: inline-block;
  padding: .7em 1.4em;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: background .2s, color .2s;
}
.button:hover { background: var(--accent); color: var(--bg); }
.button-solid { background: var(--accent); color: var(--bg); }
.button-solid:hover { background: transparent; color: var(--accent); }
.choices { display: flex; flex-wrap: wrap; gap: 12px; }
.site-nav > a.nav-login { color: var(--accent); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-size: 1.45rem; text-decoration: none; letter-spacing: .03em; }
.site-nav { display: flex; align-items: center; gap: 1.6rem; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; }
.site-nav > a, .galleries-menu summary { text-decoration: none; color: var(--muted); cursor: pointer; }
.site-nav > a:hover, .galleries-menu summary:hover { color: var(--text); }
.galleries-menu { position: relative; }
.galleries-menu summary { list-style: none; }
.galleries-menu summary::-webkit-details-marker { display: none; }
.galleries-menu summary::after { content: " ▾"; }
.galleries-menu ul {
  position: absolute; right: 0; top: calc(100% + 12px);
  min-width: 240px; margin: 0; padding: 8px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--line);
  text-transform: none; letter-spacing: 0; font-size: .95rem;
}
.galleries-menu li a { display: block; padding: 7px 18px; text-decoration: none; color: var(--muted); }
.galleries-menu li a:hover, .galleries-menu li a[aria-current] { color: var(--text); }
.menu-toggle { display: none; }

@media (max-width: 760px) {
  .menu-toggle {
    display: block; background: none; border: 1px solid var(--line); color: var(--text);
    font: inherit; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; padding: 6px 12px;
  }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 1rem;
    padding: 18px var(--gutter) 24px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .galleries-menu ul { position: static; border: 0; background: none; padding: 8px 0 0; }
  .galleries-menu li a { padding: 5px 0; }
}

/* Home */
.hero { position: relative; height: calc(100svh - 64px); min-height: 420px; overflow: hidden; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.65)); }
.hero-text { position: absolute; z-index: 1; left: var(--gutter); right: var(--gutter); bottom: clamp(32px, 8vh, 80px); }
.hero-text h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); margin-bottom: .1em; }
.hero-text p { margin: 0 0 1.4rem; color: #d5d3cd; font-size: 1.05rem; }

.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 12px; padding: 12px var(--gutter) 80px;
  scroll-margin-top: 70px;
}
.card { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; text-decoration: none; background: var(--surface); }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-img { transform: scale(1.04); }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.7)); }
.card-label { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.card-title { font-family: var(--serif); font-size: 1.55rem; }
.card-count { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: #cfcdc7; white-space: nowrap; }

/* Gallery: justified rows, each tile grows by its aspect ratio */
.gallery-head { padding: 48px var(--gutter) 20px; }
.lede { color: var(--muted); max-width: 60ch; }
.justified { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 var(--gutter) 80px; }
.tile { flex: var(--r) 1 calc(var(--r) * var(--row)); aspect-ratio: var(--r); background: var(--surface); overflow: hidden; cursor: zoom-in; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.tile:hover img { opacity: .85; }
.justified-end { flex: 1000 1 0; }
@media (max-width: 700px) { :root { --row: 180px; } .justified { gap: 4px; } }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: none;
  background: rgba(8,8,9,.97); color: var(--text);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 100%; }
.lightbox img { max-width: calc(100vw - 150px); max-height: calc(100svh - 120px); width: auto; height: auto; object-fit: contain; }
@media (max-width: 700px) { .lightbox img { max-width: 100vw; } }
.lightbox figcaption { margin-top: 14px; min-height: 1.6em; text-align: center; font-family: var(--serif); font-size: 1.25rem; }
.lightbox figcaption small { display: block; font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.lightbox button {
  position: absolute; background: none; border: 0; color: var(--muted); cursor: pointer;
  font: 300 2.4rem/1 var(--sans); padding: 16px;
  text-shadow: 0 1px 6px rgba(0,0,0,.8);
}
.lightbox button:hover { color: var(--text); }
.lb-close { top: 8px; right: 8px; font-size: 2rem !important; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: 22px; left: 22px; font-size: .8rem; letter-spacing: .1em; color: var(--muted); }

/* Text pages */
.prose { max-width: 68ch; margin: 0 auto; padding: 56px var(--gutter) 96px; }
.prose p, .prose li { color: #cfcdc7; }
.prose a:not(.button) { color: var(--accent); }
.prose .button { margin-top: 1rem; }

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; justify-content: center;
  padding: 28px var(--gutter); border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
