:root {
  color-scheme: dark;
  --bg: #080a0d;
  --surface: #11151b;
  --surface-strong: #171c24;
  --line: #2a313b;
  --text: #f6f3ec;
  --muted: #a6adb7;
  --accent: #91e2d2;
  --orange: #ff9b5f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 3%, rgb(70 102 99 / 25%), transparent 34rem),
    radial-gradient(circle at 88% 26%, rgb(94 58 42 / 18%), transparent 36rem),
    var(--bg);
}

body:has(dialog[open]) { overflow: hidden; }

a { color: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: .35rem;
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-width: 0;
  padding: 1.55rem clamp(1.25rem, 4vw, 4.5rem);
  border-bottom: 1px solid rgb(255 255 255 / 9%);
  background: rgb(8 10 13 / 76%);
  backdrop-filter: blur(18px);
}

.brand {
  color: var(--text);
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 850;
  letter-spacing: -.045em;
  text-decoration: none;
  white-space: nowrap;
}

.brand span { color: var(--muted); font-weight: 520; }

.current-date {
  color: var(--muted);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .11em;
}

.gallery-home {
  width: 100%;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) clamp(1.5rem, 8vw, 7rem) 2rem;
}

.gallery-intro {
  width: 100%;
  max-width: 60rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(18rem, .75fr);
  gap: clamp(1.5rem, 7vw, 8rem);
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.eyebrow {
  grid-column: 1 / -1;
  margin: 0 0 -1rem;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.7rem, 6.7vw, 6.2rem);
  font-weight: 760;
  letter-spacing: -.065em;
  line-height: .94;
}

.gallery-intro > p:last-child {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.65;
}

.preview-grid {
  width: 100%;
  max-width: 58rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 15rem));
  justify-content: center;
  align-items: start;
  gap: clamp(1rem, 2vw, 1.75rem);
}

.preview-card {
  width: 100%;
  max-width: 15rem;
  justify-self: center;
  min-width: 0;
  text-decoration: none;
}

.preview-image {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: clamp(.5rem, 1vw, .8rem);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: clamp(.8rem, 1.6vw, 1.3rem);
  background: var(--surface);
  box-shadow: 0 1.25rem 4rem rgb(0 0 0 / 18%);
}

.preview-image::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgb(0 0 0 / 18%), transparent 45%);
  pointer-events: none;
}

.preview-image img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), filter .3s;
}

.preview-card:hover .preview-image img { transform: scale(1.015); filter: saturate(1.08); }

.preview-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  padding: .3rem .08rem .55rem;
}

.preview-meta > span:first-child {
  overflow: hidden;
  font-size: .72rem;
  font-weight: 620;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-meta > span:last-child {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .61rem;
  letter-spacing: .04em;
}

.gallery-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  background: rgb(8 10 13 / 97%);
}

.gallery-dialog::backdrop { background: rgb(0 0 0 / 76%); backdrop-filter: blur(14px); }

.dialog-shell {
  width: 100%;
  max-width: 68rem;
  min-height: 100%;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 5vw, 4rem) 2rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
}

.dialog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .12em;
}

.back-button {
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}

.back-button:hover { border-color: #586373; background: var(--surface-strong); }
.back-button span { margin-right: .35rem; color: var(--accent); }

.detail-stage {
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(16rem, 1fr) auto;
  gap: 1rem;
}

.detail-image-wrap {
  width: 100%;
  max-width: 54rem;
  margin-inline: auto;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(.4rem, 1.5vw, 1rem);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 1rem;
  background: #0c0f14;
}

.detail-image-wrap img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(52vh, 34rem);
  display: block;
  object-fit: contain;
}

.detail-copy {
  width: 100%;
  max-width: 54rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(10rem, .55fr) minmax(18rem, 1fr);
  gap: clamp(.75rem, 3vw, 3rem);
  align-items: start;
  padding: .2rem .2rem .45rem;
}

.detail-copy h2 {
  margin: 0;
  font-size: clamp(.88rem, 1.3vw, 1rem);
  line-height: 1.25;
}

.detail-copy p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}

.thumbnail-rail {
  width: 100%;
  max-width: 54rem;
  margin-inline: auto;
  display: flex;
  gap: .65rem;
  overflow-x: auto;
  padding: .4rem .25rem .8rem;
  scroll-snap-type: x proximity;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.thumbnail-rail a {
  flex: 0 0 clamp(5rem, 8vw, 7rem);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: .6rem;
  background: var(--surface);
  opacity: .55;
  scroll-snap-align: start;
  transition: opacity .18s, border-color .18s, transform .18s;
}

.thumbnail-rail a:hover { opacity: .85; transform: translateY(-2px); }
.thumbnail-rail a[aria-current="true"] { border-color: var(--accent); opacity: 1; }

.thumbnail-rail img { width: 100%; height: 100%; display: block; object-fit: cover; }

.empty-state,
.legal-page {
  width: min(100% - 2rem, 50rem);
  margin: clamp(4rem, 12vh, 9rem) auto;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.legal-page h1 { margin: .4rem 0 1rem; font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.05; }
.empty-state p:last-child, .legal-page p { color: var(--muted); line-height: 1.7; }
.legal-intro { margin: 0 0 2rem; }
.legal-section { padding-block: 1.3rem; border-top: 1px solid var(--line); }
.legal-section h2 { margin: 0 0 .65rem; font-size: 1.05rem; color: var(--text); }
.legal-section p { margin: 0; }
.legal-section p + p { margin-top: .35rem; }
.legal-section address { color: var(--muted); font-style: normal; line-height: 1.75; }
.legal-section a { color: var(--accent); text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .2em; }
.legal-section a:hover { color: var(--text); }
.placeholder { padding: 1rem; border-left: 3px solid var(--accent); background: #0b1918; color: var(--text) !important; }
.back-link { display: inline-block; margin-top: 1.25rem; color: var(--accent); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: clamp(3rem, 7vw, 7rem);
  padding: 1.75rem clamp(1.25rem, 4vw, 4.5rem) clamp(3.5rem, 7vw, 6rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
}

.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-footer a:hover { color: var(--text); }

@media (max-width: 900px) {
  .gallery-intro { grid-template-columns: 1fr; gap: 1.4rem; }
  .eyebrow { margin-bottom: -.35rem; }
}

@media (max-width: 620px) {
  .site-header { padding: 1.25rem; }
  .brand { font-size: 1.3rem; }
  .current-date { font-size: .68rem; }
  .gallery-home { padding: 3.4rem 1.25rem 2rem; }
  .preview-grid {
    grid-template-columns: minmax(0, 15rem);
    gap: 1.1rem;
  }
  .dialog-shell { width: 100%; padding: .65rem 1rem 1.5rem; }
  .dialog-toolbar { padding-inline: .1rem; }
  .detail-image-wrap { min-height: 14rem; }
  .detail-image-wrap img { max-height: 48vh; }
  .detail-copy { grid-template-columns: 1fr; gap: .65rem; padding-inline: .35rem; }
  .thumbnail-rail a { flex-basis: 5.25rem; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

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