:root {
  color-scheme: dark;
  --bg: #0d0c0b;
  --ink: #eee8de;
  --soft: rgba(238, 232, 222, 0.76);
  --muted: rgba(238, 232, 222, 0.52);
  --line: rgba(238, 232, 222, 0.14);
  --accent: #c5a37f;
  --panel: rgba(18, 16, 14, 0.72);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.72;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("imgs/IMG_3081.JPG") center 34% / cover no-repeat;
  filter: grayscale(1);
  opacity: 0.28;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(13, 12, 11, 0.5), rgba(13, 12, 11, 0.86));
}

a {
  color: var(--accent);
  text-decoration-color: rgba(197, 163, 127, 0.48);
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-color: var(--accent);
}

img,
video {
  display: block;
  max-width: 100%;
}

.page {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: clamp(36px, 8vw, 92px) 0;
}

.memory {
  width: min(100%, 760px);
  margin: 0 auto;
}

.page-title {
  margin: 0 0 clamp(28px, 6vw, 58px);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.16;
  text-align: center;
}

.page-title__name,
.page-title__dates,
.page-title__official {
  display: block;
}

.page-title__name {
  font-size: clamp(44px, 8vw, 82px);
}

.page-title__dates {
  margin-top: 8px;
  color: var(--muted);
  font-size: clamp(18px, 3vw, 30px);
}

.page-title__official {
  margin-top: 10px;
  color: rgba(238, 232, 222, 0.36);
  font-size: clamp(12px, 1.8vw, 16px);
  font-weight: 400;
}

.text-block {
  color: var(--soft);
  font-size: clamp(18px, 2.1vw, 24px);
}

.text-block p {
  margin: 0 0 24px;
}

.text-block p:last-child {
  margin-bottom: 0;
}

.poem {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-top: clamp(44px, 8vw, 84px);
  padding-top: clamp(36px, 7vw, 68px);
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-align: center;
}

.memory-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: clamp(42px, 8vw, 78px) 0 0;
  background: #050505;
  box-shadow: var(--shadow);
}

.footer-link,
.top-link {
  margin-top: clamp(42px, 8vw, 76px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font: 15px/1.4 Arial, sans-serif;
}

.footer-link,
.top-link {
  text-align: center;
}

.footer-link a,
.top-link a {
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: 0.08em;
}

.top-link {
  width: min(100%, 760px);
  margin: 0 auto 28px;
}

.gallery-page {
  width: min(100% - 24px, 1180px);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.gallery__button {
  appearance: none;
  padding: 0;
  border: 1px solid rgba(238, 232, 222, 0.08);
  background: rgba(0, 0, 0, 0.22);
  cursor: zoom-in;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.gallery__button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.18) saturate(0.82) contrast(1.05);
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-composite: intersect;
  transition: transform 180ms ease, filter 180ms ease;
}

.gallery__button:is(:hover, :focus-visible) img {
  transform: scale(1.035);
  filter: grayscale(0) saturate(1) contrast(1.05);
}

.gallery__empty {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.lightbox {
  width: min(1180px, calc(100% - 24px));
  max-height: calc(100svh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.lightbox::backdrop {
  background: rgba(5, 5, 5, 0.9);
}

.lightbox__image {
  width: 100%;
  max-height: calc(100svh - 86px);
  object-fit: contain;
  background: #050505;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 3%, #000 97%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 3%, #000 97%, transparent 100%);
  mask-composite: intersect;
}

.lightbox__caption {
  margin: 10px 56px 0 0;
  color: var(--soft);
  font: 14px/1.4 Arial, sans-serif;
}

.lightbox__close,
.lightbox__zone {
  position: fixed;
  border: 1px solid rgba(238, 232, 222, 0.24);
  background: rgba(10, 9, 8, 0.74);
  color: var(--ink);
  cursor: pointer;
}

.lightbox__close {
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  font: 30px/1 Arial, sans-serif;
}

.lightbox__zone {
  top: 50%;
  width: min(34vw, 360px);
  height: 33svh;
  min-height: 180px;
  max-height: 360px;
  padding: 0;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  transform: translateY(-50%);
}

.lightbox__zone span {
  display: grid;
  width: 56px;
  height: 100%;
  place-items: center;
  border: 1px solid rgba(238, 232, 222, 0.24);
  border-radius: 999px;
  background: rgba(10, 9, 8, 0.74);
  font: 44px/0.9 Georgia, "Times New Roman", serif;
}

.lightbox__zone--prev {
  left: 0;
  padding-left: 18px;
}

.lightbox__zone--next {
  right: 0;
  padding-right: 18px;
}

.lightbox__zone--next span {
  margin-left: auto;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 24px, 980px);
    padding: 28px 0 54px;
  }

  .text-block {
    font-size: 18px;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .lightbox__zone {
    width: 42vw;
    height: 33svh;
    min-height: 150px;
    max-height: 300px;
  }

  .lightbox__zone span {
    width: 46px;
    font-size: 38px;
  }

  .lightbox__zone--prev {
    padding-left: 8px;
  }

  .lightbox__zone--next {
    padding-right: 8px;
  }
}
