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

:root {
  --black: #000;
  --white: #fff;
  --muted: rgba(255, 255, 255, 0.45);
  --dim: rgba(255, 255, 255, 0.08);
  --dark: #0a0a0a;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Navigation ─────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
}

.nav::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 100%);
  pointer-events: none;
}

.nav-name {
  position: relative;
  z-index: 1;
}

.nav-name a {
  color: var(--white);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  gap: 40px;
  list-style: none;
  position: relative;
  z-index: 1;
}

.nav-menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.25s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--white);
}

/* ── Hero ───────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--black);
}

.hero-video {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 177.78vh;
  height: 100vh;
  min-width: 100vw;
  min-height: 56.25vw;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.hero-name {
  font-size: clamp(32px, 6.5vw, 100px);
  font-weight: 200;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
}

.hero-subtitle {
  margin-top: 20px;
  font-size: clamp(10px, 1.2vw, 15px);
  font-weight: 300;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.hero-scroll span {
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.35), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.35; transform: scaleY(1); }
  50%       { opacity: 0.7;  transform: scaleY(1.15); }
}

/* ── Sections ───────────────────────────────────────── */
.section {
  padding: 96px 48px;
}

.section + .section {
  padding-top: 0;
}

.section-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
}

/* ── Video Grid ─────────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.reels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

/* ── Video Card ─────────────────────────────────────── */
.video-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0d0d0d;
}

.video-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0d0d0d 25%, #161616 50%, #0d0d0d 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  z-index: 0;
  transition: opacity 0.4s ease;
}

.video-card.loaded::before {
  opacity: 0;
  pointer-events: none;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.video-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.7s ease;
  z-index: 1;
}

.video-card img.loaded {
  opacity: 1;
}

.video-card:hover img {
  transform: scale(1.04);
}

.video-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.video-card:hover .video-card-overlay {
  background: rgba(0, 0, 0, 0.38);
}

.play-btn {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.play-btn svg {
  width: 16px;
  height: 16px;
  fill: var(--white);
  margin-left: 3px;
}

.video-card:hover .play-btn {
  opacity: 1;
  transform: scale(1);
}

.video-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 18px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  z-index: 3;
}

.video-card-title {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

/* ── Contact ────────────────────────────────────────── */
#contacto {
  border-top: 1px solid var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 48px;
}

.contact-email {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-decoration: none;
  text-transform: lowercase;
  transition: color 0.25s ease;
}

.contact-email:hover {
  color: var(--white);
}

/* ── Footer ─────────────────────────────────────────── */
footer {
  padding: 24px 48px;
  border-top: 1px solid var(--dim);
  display: flex;
  justify-content: center;
}

footer p {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.18);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── Modal ──────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  cursor: pointer;
}

.modal-container {
  position: relative;
  width: 88vw;
  max-width: 1240px;
  z-index: 1;
  transform: scale(0.95);
  transition: transform 0.35s ease;
}

.modal.active .modal-container {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 6px;
}

.modal-close:hover {
  color: var(--white);
}

.modal-video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
}

.modal-video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Page header (trabajos.html) ────────────────────── */
.page-header {
  padding: 140px 48px 56px;
}

.page-header h1 {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .reels-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav {
    padding: 22px 24px;
  }

  .nav-menu {
    gap: 24px;
  }

  .section {
    padding: 72px 24px;
  }

  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reels-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-header {
    padding: 120px 24px 48px;
  }

  #contacto {
    padding: 60px 24px;
  }

  footer {
    padding: 20px 24px;
  }
}

@media (max-width: 480px) {
  .nav-name a {
    font-size: 10px;
    letter-spacing: 0.15em;
  }

  .nav-menu {
    gap: 16px;
  }

  .nav-menu a {
    font-size: 10px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .reels-grid {
    grid-template-columns: 1fr;
  }

  .hero-name {
    letter-spacing: 0.2em;
  }
}
