:root {
  --bg: #131211;
  --card-bg: #1c1a18;
  --fg: #f5f3ee;
  --muted: #9a978f;
  --line: rgba(245, 243, 238, 0.08);
  --gap: 10px;
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes softPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 24px;
  background: linear-gradient(to bottom, rgba(19, 18, 17, 0.9) 40%, rgba(19, 18, 17, 0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  transition: background 0.4s var(--ease-out), backdrop-filter 0.4s var(--ease-out);
  animation: fadeDown 0.7s var(--ease) both;
}

.site-header.scrolled {
  background: rgba(19, 18, 17, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.wordmark {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  transition: letter-spacing 0.4s var(--ease-out);
}

.header-meta {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: opacity 0.3s var(--ease-out);
}

/* ---------- hero ---------- */

.hero {
  padding: 9vh 20px 5vh;
  text-align: center;
}

.hero-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--muted);
  text-transform: uppercase;
  animation: fadeUp 0.8s var(--ease) both;
  animation-delay: 0.05s;
}

.hero-title {
  margin: 0;
  font-size: 12vw;
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  animation: fadeUp 0.9s var(--ease) both;
  animation-delay: 0.14s;
}

.hero-sub {
  margin: 14px 0 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
  animation: fadeUp 0.8s var(--ease) both;
  animation-delay: 0.26s;
}

/* ---------- gallery: pinterest-style masonry ---------- */

.day {
  padding: 0 var(--gap);
  margin-top: 26px;
}

.day:first-child {
  margin-top: 6px;
}

.day-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

.day-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.grid {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}

.col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #201e1b, #171615);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 0 0 1px var(--line);
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease),
    box-shadow 0.3s var(--ease-out);
  will-change: transform, opacity;
}

.tile.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tile img,
.tile video {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s var(--ease-out);
}

.tile:active {
  transform: scale(0.96);
  transition-duration: 0.18s;
}

.tile:active img,
.tile:active video {
  transform: scale(1.02);
}

@media (hover: hover) {
  .tile:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 0 0 1px var(--line);
  }
  .tile:hover img,
  .tile:hover video {
    transform: scale(1.035);
  }
}

.tile .play-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--fg);
  backdrop-filter: blur(3px);
  animation: softPulse 2.6s ease-in-out infinite;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 50px 22px calc(env(safe-area-inset-bottom, 0px) + 40px);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 7, 7, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s var(--ease);
}

.lb-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}

.lb-stage img,
.lb-stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.22s var(--ease-out), transform 0.35s var(--ease);
}

.lightbox:not(.open) .lb-stage img,
.lightbox:not(.open) .lb-stage video {
  transform: scale(0.94);
}

.lb-stage.switching img,
.lb-stage.switching video {
  opacity: 0;
  transform: scale(0.97);
}

.lb-close,
.lb-nav {
  position: absolute;
  z-index: 101;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s var(--ease-out), transform 0.2s var(--ease-out);
}

.lb-close:active {
  transform: scale(0.88);
  background: rgba(255, 255, 255, 0.16);
}

@media (hover: hover) {
  .lb-close:hover,
  .lb-nav:hover {
    background: rgba(255, 255, 255, 0.16);
  }
}

.lb-close {
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: 16px;
  width: 36px;
  height: 36px;
  font-size: 22px;
  line-height: 1;
}

.lb-nav {
  top: 50%;
  width: 42px;
  height: 42px;
  font-size: 26px;
  transform: translateY(-50%) scale(1);
}

.lb-prev { left: 10px; }
.lb-next { right: 10px; }

.lb-nav:active {
  transform: translateY(-50%) scale(0.88);
  background: rgba(255, 255, 255, 0.16);
}

.lb-counter {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  left: 0;
  right: 0;
  text-align: center;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  opacity: 1;
  transition: opacity 0.2s var(--ease-out);
}

.lb-stage.switching ~ .lb-counter {
  opacity: 0.4;
}

/* ---------- larger screens ---------- */
/* column COUNT is computed in JS (getColCount) to match; these just tune spacing/type */

@media (min-width: 900px) {
  :root { --gap: 14px; }
  .hero-title { font-size: 84px; }
  .hero { padding: 12vh 22px 6vh; }
}

@media (min-width: 1280px) {
  .day { max-width: 1400px; margin-left: auto; margin-right: auto; }
  .site-header { padding-left: 28px; padding-right: 28px; }
}
