* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.04em;
  color: #1a1a1a;
  overflow-x: hidden;
  text-rendering: optimizeSpeed;
}

/* ─── Splash ─── */

#splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  opacity: 1;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#splash.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#splash-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  opacity: 0;
  transform: translateY(6px);
  animation: splashIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

@keyframes splashIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Site Container ─── */

#site {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

#site.hidden {
  opacity: 0;
  transform: translateY(12px);
}

#site.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Nav ─── */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateZ(0);
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease;
}

#nav.hidden-nav {
  transform: translateY(-100%);
}

#nav.scrolled {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

#nav-logo img {
  height: 56px;
  width: auto;
  display: block;
}

#contact-btn {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: #1a1a1a;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

#contact-btn:hover {
  opacity: 0.5;
}

/* ─── Grid ─── */

#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 3px;
  padding: 72px 3px 3px;
}

.cell {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f5f5f5;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.97);
  contain: layout style paint;
  content-visibility: auto;
  contain-intrinsic-size: 360px 202px;
  transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.cell.revealed {
  opacity: 1;
  transform: scale(1);
}

.cell-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.cell-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cell:hover .cell-thumb,
.cell:hover .cell-video,
.cell:hover img {
  transform: scale(1.03);
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ─── Mobile Play Icon ─── */

.cell-play-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.cell-play-icon::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent #1a1a1a;
  margin-left: 2px;
}

/* ─── Contact Footer ─── */

#contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 100px 32px 60px;
  border-top: 1px solid #e8e8e8;
  margin-top: 80px;
}

.contact-heading {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.4;
  margin-bottom: 24px;
  max-width: 500px;
}

.contact-email {
  font-size: 15px;
  font-weight: 400;
  color: #aaa;
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: color 0.3s ease;
}

.contact-email:hover {
  color: #1a1a1a;
}

/* ─── Bottom Bar ─── */

#bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 32px;
  font-size: 13px;
  letter-spacing: -0.02em;
  color: #ccc;
}

/* ─── Lightbox ─── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
  cursor: pointer;
}

.lightbox.active {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox.active .lightbox-inner {
  opacity: 1;
  transform: scale(1);
}

.lightbox-inner video,
.lightbox-inner img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  display: block;
  cursor: default;
}

.lightbox-inner video {
  outline: none;
  transition: opacity 0.3s ease;
}

.lightbox-loader {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ─── Responsive ─── */

@media (max-width: 900px) {
  #grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  #nav {
    padding: 20px 24px;
  }

  #grid {
    padding-top: 76px;
  }
}

@media (max-width: 500px) {
  #grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    padding: 68px 2px 2px;
  }

  #nav {
    padding: 12px 16px;
  }

  #nav-logo img {
    height: 36px;
  }

  #contact {
    padding: 60px 24px 40px;
  }

  #bottom {
    padding: 20px 24px;
  }

  .lightbox-inner {
    max-width: 100vw;
    max-height: 100vh;
  }

  .lightbox-inner video,
  .lightbox-inner img {
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
}
