:root {
  color-scheme: light;
  --ink: #20261f;
  --muted: #667064;
  --paper: #f7f5ef;
  --soft: #e7e5db;
  --line: #d7d4c7;
  --forest: #263027;
  --forest-light: #3d4a3d;
  --gold: #c4a45f;
  --cream: #fffdf7;
  --white: #ffffff;
  --shadow: 0 22px 70px rgba(12, 18, 12, 0.24);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }

.site-header {
  min-height: 68svh;
  display: grid;
  align-items: end;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  padding: clamp(28px, 6vw, 78px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(90deg, rgba(12, 18, 13, 0.82), rgba(12, 18, 13, 0.24) 54%, rgba(12, 18, 13, 0.08)),
    linear-gradient(0deg, rgba(12, 18, 13, 0.58), transparent 45%),
    url("/cover.jpg");
  background-size: cover;
  background-position: center 38%;
}

.header-copy { max-width: 900px; }

.eyebrow {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.4rem, 15vw, 11rem);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.055em;
  color: var(--white);
  text-shadow: 0 3px 28px rgba(0, 0, 0, 0.36);
}

h1 span {
  color: var(--gold);
  font-style: italic;
}

.subtitle {
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  font-style: italic;
}

.actions, .tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--gold);
  color: #171b16;
  font-size: 0.92rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease;
}

.button:hover, .button:focus-visible { transform: translateY(-2px); }

.button.secondary {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  backdrop-filter: blur(12px);
}

.button small { font-size: 0.7rem; opacity: 0.7; }

.button.small {
  min-height: 40px;
  padding: 0 15px;
  font-size: 0.84rem;
}

main {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 28px clamp(14px, 3vw, 42px) 72px;
}

.intro {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 16px 0;
  background: rgba(247, 245, 239, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.gallery-meta span { display: block; font-weight: 900; }
.gallery-meta p { margin: 4px 0 0; color: var(--muted); }

.search-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input {
  width: 150px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 15px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  outline: none;
}

input:focus { border-color: var(--forest-light); box-shadow: 0 0 0 3px rgba(61, 74, 61, 0.12); }

.gallery { display: flex; flex-direction: column; gap: 6px; }
.gallery-row { display: flex; width: 100%; overflow: hidden; }
.gallery-row-last { justify-content: flex-start; }

.photo {
  position: relative;
  display: block;
  flex: 0 0 auto;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--soft);
  transition: transform 300ms ease, filter 300ms ease;
}

.photo:hover img, .photo:focus-visible img { transform: scale(1.018); filter: brightness(0.88); }

.photo span {
  position: absolute;
  left: 9px;
  bottom: 9px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(20, 27, 21, 0.7);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 800;
  opacity: 0;
  transition: opacity 160ms ease;
}

.photo:hover span, .photo:focus-visible span { opacity: 1; }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 5vw, 72px);
  background: var(--forest);
  color: rgba(255, 255, 255, 0.75);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

footer a { color: var(--gold); font-family: Inter, sans-serif; font-style: normal; font-size: 0.82rem; font-weight: 800; text-decoration: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 8px;
  padding: 24px;
  background: rgba(10, 13, 10, 0.96);
}

.lightbox[hidden] { display: none; }

.lightbox figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  min-width: 0;
  height: min(88vh, 980px);
  margin: 0;
}

.lightbox img {
  align-self: center;
  justify-self: center;
  max-width: 100%;
  max-height: 100%;
  border-radius: 3px;
  box-shadow: var(--shadow);
  transform: translate3d(var(--swipe-x, 0), 0, 0);
  transition: transform 160ms ease;
  will-change: transform;
}

.lightbox img.is-dragging { transition: none; }
.lightbox figcaption { display: flex; align-items: center; justify-content: center; gap: 16px; color: var(--white); font-weight: 800; }

.icon {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.close { position: absolute; top: 22px; right: 22px; }

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr;
    align-content: end;
    min-height: 62svh;
    gap: 22px;
    padding: 28px 18px 22px;
    background-position: 42% center;
  }

  .eyebrow { margin-bottom: 12px; font-size: 0.66rem; }
  h1 { font-size: clamp(4.2rem, 24vw, 6.8rem); }
  .subtitle { margin-top: 16px; font-size: 1rem; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .button { min-height: 44px; padding: 0 11px; font-size: 0.8rem; }
  .button small { display: none; }

  .intro {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin: 0 -14px 18px;
    padding: 10px 14px 12px;
  }

  .tools { width: 100%; gap: 6px; }
  .search-label { width: 100%; font-size: 0.78rem; }
  input { width: 100%; }
  .gallery { gap: 4px; }
  .photo span { opacity: 1; left: 5px; bottom: 5px; padding: 4px 6px; font-size: 0.64rem; }

  .lightbox { display: flex; align-items: center; justify-content: center; padding: 0; }
  .lightbox figure { width: 100vw; height: 100svh; padding: 52px 0 10px; gap: 8px; }
  .lightbox img { max-width: 100vw; max-height: calc(100svh - 112px); border-radius: 0; box-shadow: none; }
  .lightbox img.is-landscape { width: 100vw; height: auto; }
  .lightbox img.is-portrait { width: auto; max-width: calc(100vw - 18px); }
  .lightbox figcaption { flex-wrap: wrap; gap: 8px; min-height: 42px; padding: 0 10px; font-size: 0.86rem; }
  .icon { width: 42px; height: 42px; }
  .prev, .next { position: fixed; top: 50%; z-index: 1; transform: translateY(-50%); }
  .prev { left: 6px; }
  .next { right: 6px; }
  .close { top: 12px; right: 12px; }
  footer { flex-direction: column; gap: 8px; }
}

@media (max-width: 390px) { .actions { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .photo img, .lightbox img { transition: none; }
}
