/* ---------- Tokens ---------- */
:root {
  --bg: #060606;
  --fg: #f3f2ee;
  --fg-dim: #8a8a86;
  --red: #c8402c;
  --line: rgba(243, 242, 238, 0.12);
  --gap: 8px;
  --margin: clamp(12px, 2.4vw, 32px);
  --radius: 2px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

a { color: inherit; text-decoration: none; }

/* ---------- Frame ---------- */
.frame {
  padding: var(--margin);
  display: flex;
  flex-direction: column;
  position: relative;
}

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  display: inline-block;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* ---------- Grid (masonry na kolumnach — bez dziur) ---------- */
.grid {
  columns: 6 160px;
  column-gap: var(--gap);
}

@media (max-width: 1000px) {
  .grid { columns: 4 140px; }
}

@media (max-width: 560px) {
  .grid { columns: 2 120px; }
}

.tile {
  position: relative;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  will-change: transform;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: var(--gap);
}

/* proporcje kafelków — decydują o zróżnicowanej wysokości w masonry */
.tile.ar-wide { aspect-ratio: 16 / 9; }
.tile.ar-landscape { aspect-ratio: 4 / 3; }
.tile.ar-square { aspect-ratio: 1 / 1; }
.tile.ar-portrait { aspect-ratio: 3 / 4; }
.tile.ar-tall { aspect-ratio: 2 / 3; }

.tile img,
.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 500ms var(--ease), filter 500ms var(--ease);
}

.tile:hover img,
.tile:hover video {
  transform: scale(1.045);
  filter: brightness(1.05);
}

.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}

.tile-mark {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--fg);
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 6px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 250ms var(--ease);
  pointer-events: none;
}

.tile:hover .tile-mark { opacity: 1; }

.tile-expand {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--fg);
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 250ms var(--ease);
  pointer-events: none;
}

.tile:hover .tile-expand { opacity: 1; }

/* ---------- Label (etykieta techniczna) ---------- */
/* jest zwykłym kafelkiem gridu (.tile) — szerokość kolumny, nigdy nie zasłania zdjęć/wideo */
.label {
  cursor: default;
  background: #0c0c0c;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--fg);
}

.label-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  text-transform: uppercase;
}

.label-row span:first-child { color: var(--fg-dim); }

.label-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.label-meta .rec { color: var(--red); display: flex; align-items: center; gap: 6px; }

.label-name {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 6px 0 4px;
}

.label-divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

.label-bottom {
  justify-content: space-between;
  color: var(--fg-dim);
  font-size: 9.5px;
}

.label-bottom span:nth-child(1) { color: var(--red); }

/* ---------- To be continued (kafelek na końcu gridu) ---------- */
.tbc {
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #0c0c0c;
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-dim);
  font-style: italic;
  aspect-ratio: 4 / 3;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 4, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease);
  padding: var(--margin);
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-stage {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: calc(100vh - var(--margin) * 4);
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: var(--margin);
  right: var(--margin);
  width: 40px;
  height: 40px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  font-size: 16px;
  cursor: pointer;
  transition: background 200ms var(--ease), transform 200ms var(--ease);
}

.lightbox-close:hover {
  background: var(--red);
  border-color: var(--red);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}

.lightbox-nav:hover {
  background: var(--red);
  border-color: var(--red);
}

.lightbox-prev { left: var(--margin); }
.lightbox-next { right: var(--margin); }

@media (max-width: 700px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 20px; }
}
