:root {
  --bg: #0b0b0c;
  --fg: #e8e6e3;
  --dim: #6d6b68;
  --line: #1c1c1e;
  --tile: #151517;
  --gap: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font: 15px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 28px clamp(16px, 4vw, 48px) 22px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.logo { font-size: 17px; font-weight: 500; letter-spacing: .08em; }
nav { display: flex; gap: 28px; }
nav a { color: var(--dim); transition: color .2s; position: relative; }
nav a:hover, nav a.on { color: var(--fg); }
nav a.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: var(--fg);
}

main { flex: 1; padding: 8px clamp(16px, 4vw, 48px) 48px; }

/* столбцы раскладывает app.js; пропорции кадров сохраняются */
.grid { display: flex; gap: var(--gap); align-items: flex-start; }
.grid[hidden] { display: none; }
.col { flex: 1; min-width: 0; }
.tile {
  display: block; width: 100%; margin: 0 0 var(--gap); padding: 0; border: 0;
  break-inside: avoid; position: relative; overflow: hidden;
  background: var(--tile); cursor: zoom-in;
}
.tile img { display: block; width: 100%; height: auto; opacity: 0; transition: opacity .5s, transform .6s; }
.tile img.ok { opacity: 1; }
.tile:hover img { transform: scale(1.02); }
.tile.vid { cursor: pointer; }
.tile.vid::before {
  content: ""; position: absolute; z-index: 1; left: 50%; top: 50%;
  width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.5);
  transition: background .2s;
}
.tile.vid::after {
  content: ""; position: absolute; z-index: 2; left: 50%; top: 50%;
  margin: -8px 0 0 -4px;
  border-style: solid; border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #fff;
}
.tile.vid:hover::before { background: rgba(0,0,0,.7); }
.tile .dur {
  position: absolute; z-index: 1; right: 8px; bottom: 7px;
  font-size: 12px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

.bottom {
  padding: 24px clamp(16px, 4vw, 48px) 32px;
  color: var(--dim); font-size: 12px; letter-spacing: .08em;
}

/* просмотр */
.box {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(5,5,6,.97);
  display: flex; align-items: center; justify-content: center;
}
.box[hidden] { display: none; }
.box-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 64px; }
.box-stage img, .box-stage video { max-width: 100%; max-height: 100%; display: block; background: #000; }
.box-close, .box-prev, .box-next {
  position: absolute; z-index: 2; color: var(--dim); font-size: 34px; line-height: 1;
  padding: 12px 18px; transition: color .2s;
}
.box-close:hover, .box-prev:hover, .box-next:hover { color: var(--fg); }
.box-close { top: 8px; right: 8px; }
.box-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.box-next { right: 4px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  .top { padding-top: 20px; padding-bottom: 16px; }
  nav { gap: 20px; }
  :root { --gap: 4px; }
  .box-stage { padding: 52px 0; }
  .box-prev, .box-next { display: none; }
}
