/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* === VARIABLES === */
:root {
  --bg:      #080808;
  --surface: #101010;
  --line:    #1e1e1e;
  --txt:     #d4d4d4;
  --muted:   #545454;
  --white:   #ffffff;
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
  --font:    'DM Sans', system-ui, sans-serif;
}

/* === BASE === */
body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a    { color: inherit; text-decoration: none; }
img  { display: block; width: 100%; height: 100%; object-fit: cover; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }

/* === HEADER === */
#header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 52px;
  transition: background 0.5s var(--ease), border-color 0.5s;
  border-bottom: 1px solid transparent;
}

#header.scrolled {
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--line);
}

.logo {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--white);
  transition: opacity 0.2s;
}
.logo:hover { opacity: 0.6; }

nav { display: flex; gap: 36px; align-items: center; }
nav a {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
nav a:hover { color: var(--white); }

.nav-instagram {
  display: flex;
  align-items: center;
  color: var(--muted);
  padding: 6px;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  transition: color 0.2s, border-color 0.2s;
}
.nav-instagram:hover { color: var(--white); border-color: var(--muted); }
.nav-end    { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.nav-social { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.2em;
}

.lang-opt {
  color: var(--muted);
  transition: color 0.2s;
  cursor: pointer;
  padding: 2px 0;
}
.lang-opt:hover  { color: var(--white); }
.lang-opt.active { color: var(--white); }
.lang-sep        { color: #2a2a2a; font-size: 9px; }

/* === HERO === */
#hero {
  position: relative;
  height: 100svh;
  min-height: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 70% at 50% 110%, rgba(18,18,18,0.9) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 50% -10%,  rgba(18,18,18,0.6) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 1;
}

.hero-content h1 {
  font-size: clamp(52px, 11vw, 130px);
  font-weight: 300;
  letter-spacing: 0.38em;
  line-height: 1;
  color: var(--white);
  text-transform: uppercase;
}

.hero-tagline {
  margin-top: 28px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  color: var(--muted);
  z-index: 1;
  animation: bounce 2.5s ease-in-out infinite;
  transition: color 0.2s;
}
.scroll-cue:hover { color: var(--white); }

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}

/* === WORK SECTION === */
#work { padding-top: 80px; }

/* FILTER BAR */
.filter-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 0 52px 44px;
}

.filter {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.filter:hover  { color: var(--white); border-color: var(--line); }
.filter.active { color: var(--white); border-color: var(--muted); }

/* GRID */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

/* Cards */
.card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  aspect-ratio: 4/3;
  animation: fadeUp 0.55s var(--ease) both;
}

/* Wrapper que agrupa la tarjeta ancha + su barra de info */
.video-slot {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  margin-bottom: 197px;
  scroll-snap-align: start;
  scroll-margin-top: 84px;
}

.card.wide {
  grid-column: unset;
  aspect-ratio: 21/9;
  margin-bottom: 0;
  scroll-snap-align: unset;
  scroll-margin-top: unset;
}

.card-media {
  position: absolute;
  inset: 0;
}

.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
  will-change: transform;
}

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

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.12) 40%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 32px;
}
.card:hover .card-overlay { opacity: 1; }

.card-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.card-name {
  font-size: 16px;
  font-weight: 400;
  color: var(--white);
  line-height: 1.25;
}

/* Play icon for video cards */
.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  padding-left: 3px;
  color: rgba(255,255,255,0.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s, border-color 0.3s;
  z-index: 4;
  pointer-events: none;
}
.card:hover .play-icon          { opacity: 1; border-color: rgba(255,255,255,0.5); }
/* En cards anchas siempre visible (mobile no tiene hover) */
.card.wide .play-icon           { opacity: 0.65; }
.card.wide:hover .play-icon     { opacity: 1; border-color: rgba(255,255,255,0.5); }
/* Ocultar play icon cuando el video ya está corriendo */
.card.wide.is-playing .play-icon { opacity: 0; }

/* YouTube iframe embebido en tarjeta */
.card-media .card-yt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

/* Capa transparente que captura clicks en tarjetas de video */
.card-click-blocker {
  position: absolute;
  inset: 0;
  z-index: 5;
  cursor: pointer;
}

/* Barra debajo del video — sin overlap con UI de YouTube */
.card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 2px 0;
  gap: 12px;
}

.card-bar-audio,
.card-bar-no-audio {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}

.card-bar-audio    { color: var(--muted); }
.card-bar-no-audio { color: #2e2e2e; }

/* Botón "Ver info" */
.card-bar-info-btn {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 8px 18px;
  border-radius: 1px;
  background: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.card-bar-info-btn:hover { color: var(--white); border-color: var(--muted); }

/* Snap scroll TikTok-style — activo solo en filtro 3D/UE5 */
html[data-snap] { scroll-snap-type: y mandatory; }

/* Empty state */
.empty-msg {
  padding: 80px 52px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: center;
}

/* === ABOUT === */
#about { padding: 140px 52px; }

.about-wrap { max-width: 700px; }

.label {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

#about h2 {
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 300;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 20px;
}

#about p {
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 40px;
  max-width: 540px;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.skill-list li {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 7px 16px;
  border-radius: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.skill-list li:hover { color: var(--white); border-color: #3a3a3a; }

/* === FOOTER / CONTACT === */
#contact {
  border-top: 1px solid var(--line);
  padding: 100px 52px 60px;
}

.footer-wrap {
  max-width: 700px;
  margin-bottom: 80px;
}

#contact h2 {
  font-size: clamp(24px, 3.2vw, 46px);
  font-weight: 300;
  color: var(--white);
  margin-bottom: 16px;
  line-height: 1.2;
}

#contact p {
  color: var(--muted);
  max-width: 460px;
  margin-bottom: 40px;
}

.contact-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  padding: 13px 26px;
  border: 1px solid var(--white);
  color: var(--white);
  border-radius: 1px;
  transition: background 0.25s, color 0.25s;
}
.btn-cta:hover { background: var(--white); color: var(--bg); }
.btn-cta.ghost { border-color: var(--line); color: var(--muted); }
.btn-cta.ghost:hover { border-color: var(--white); color: var(--white); background: transparent; }

.footer-meta {
  border-top: 1px solid var(--line);
  padding-top: 32px;
  font-size: 11px;
  color: #2e2e2e;
  letter-spacing: 0.06em;
}

/* === LIGHTBOX === */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5,5,5,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

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

.lb-btn {
  position: absolute;
  z-index: 10;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.2s;
}
.lb-btn:hover { color: var(--white); }

#lb-close { top: 28px; right: 52px; font-size: 15px; }

.lb-nav { top: 50%; transform: translateY(-50%); padding: 20px; font-size: 18px; left: 20px; }
.lb-nav-r { left: auto; right: 20px; }

.lb-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 52px;
  width: min(1240px, 90vw);
  max-height: 90vh;
  align-items: center;
}

.lb-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c0c0c;
  min-height: 260px;
  max-height: 80vh;
  overflow: hidden;
  position: relative;
}

.lb-media img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.lb-media iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  display: block;
}

.lb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #444;
}

.lb-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#lb-cat { margin-bottom: 16px; }

#lb-title {
  font-size: 20px;
  font-weight: 300;
  color: var(--white);
  margin-bottom: 18px;
  line-height: 1.3;
}

#lb-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 24px;
}

.lb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.lb-tags span {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 1px;
}

.lb-year {
  font-size: 11px;
  color: #282828;
  letter-spacing: 0.1em;
  margin-top: auto;
  display: block;
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  #header    { padding: 20px 28px; }
  .filter-bar { padding: 0 28px 36px; }
  #about     { padding: 100px 28px; }
  #contact   { padding: 80px 28px 48px; }

  .lb-content {
    grid-template-columns: 1fr;
    max-height: 92vh;
    overflow-y: auto;
    gap: 28px;
    width: 92vw;
  }
  .lb-nav      { left: 8px; }
  .lb-nav-r    { right: 8px; }
  #lb-close    { top: 16px; right: 28px; }
}

@media (max-width: 640px) {
  #header  { padding: 16px 20px; }
  nav      { gap: 20px; }

  .grid    { grid-template-columns: 1fr; }
  .card.wide { grid-column: span 1; aspect-ratio: 4/3; }

  .filter-bar { padding: 0 20px 28px; }
  #about   { padding: 80px 20px; }
  #contact { padding: 80px 20px 40px; }

  .hero-content h1 { letter-spacing: 0.15em; }
  .hero-tagline    { font-size: 10px; letter-spacing: 0.14em; }
}
