:root {
  --background: #09060d;
  --text: #f2edf4;
  --muted: #a99ead;
  --purple: #82569a;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: radial-gradient(circle at 16% 10%, rgba(83, 41, 101, .22), transparent 34%), var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button { font: inherit; }

.gallery-page { width: min(1440px, 90vw); margin: 0 auto; padding: 48px 0 90px; }
.gallery-header { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr 1fr; align-items: end; margin-bottom: 34px; padding-bottom: 18px; border-bottom: 1px solid var(--purple); }
.back { align-self: start; color: var(--muted); font-size: 12px; text-decoration: none; }
.back:hover, .back:focus-visible { color: white; }
.chapter-number { margin: 0 0 6px; color: #c6b5cd; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(29px, 4vw, 58px); letter-spacing: -.045em; }
.gallery-count { margin: 9px 0 0; color: #756c79; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }

.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.5vw, 22px); }
.video-card { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #120e16; color: white; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); }
.video-card::after { content: ''; position: absolute; inset: 0; border-left: 3px solid var(--purple); background: linear-gradient(to top, rgba(5, 3, 7, .48), transparent 48%); pointer-events: none; }
.video-card img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .3s ease, filter .3s ease; }
.video-card span { position: absolute; z-index: 1; left: 15px; bottom: 12px; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.video-card:hover img, .video-card:focus-visible img { transform: scale(1.025); filter: brightness(1.12); }
.video-card:focus-visible { outline: 2px solid #b98bcf; outline-offset: 3px; }

.modal[hidden] { display: none; }
.modal { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 34px; background: rgba(4, 2, 6, .93); backdrop-filter: blur(7px); }
.modal-content { width: min(1180px, 92vw); }
.modal-topline { display: flex; justify-content: space-between; margin-bottom: 9px; padding-bottom: 8px; border-bottom: 1px solid var(--purple); color: #a99ead; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.modal-video { width: 100%; max-height: 75vh; display: block; background: black; }
.close { position: fixed; top: 19px; right: 25px; width: 42px; height: 42px; padding: 0; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; background: rgba(0, 0, 0, .25); color: white; font-size: 28px; line-height: 1; cursor: pointer; }
.close:hover, .close:focus-visible { background: rgba(255, 255, 255, .12); outline: none; }
.modal-nav { display: flex; justify-content: space-between; margin-top: 12px; }
.modal-nav button { padding: 8px 0; border: 0; background: transparent; color: #a99ead; font-size: 11px; cursor: pointer; }
.modal-nav button:hover, .modal-nav button:focus-visible { color: white; outline: none; }

@media (max-width: 800px) {
  .gallery-page { width: calc(100% - 28px); padding-top: 26px; }
  .gallery-header { grid-template-columns: 1fr; gap: 28px; margin-bottom: 22px; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .video-card span { left: 11px; bottom: 9px; font-size: 10px; }
  .modal { padding: 52px 10px 20px; }
  .modal-content { width: 100%; }
  .close { top: 9px; right: 11px; }
}

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