/* ==========================================================================
   Marc Urbano — Vídeo & Diseño
   ========================================================================== */

:root{
  --bg: #0a0a0a;
  --bg-soft: #121212;
  --fg: #f3f2ee;
  --fg-dim: #9a9994;
  --line: rgba(243,242,238,0.12);
  --accent: #c9c6bd;
  --chrome-1: #ffffff;
  --chrome-2: #8f8f8f;
  --chrome-3: #ffffff;

  --font-body: 'Inter', -apple-system, sans-serif;
  --font-display: 'Archivo', 'Inter', sans-serif;

  --container: 1240px;
  --gap: 24px;
  --header-h: 84px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, video{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ list-style: none; margin: 0; padding: 0; }
h1,h2,h3,p{ margin: 0; }
button{ font-family: inherit; cursor: pointer; }

.section-inner{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}

/* Defensive net for reveal — never let JS failure hide content */
.reveal[data-split]{ opacity: 1; transform: none; }
.reveal{
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.is-visible{ opacity: 1; transform: translateY(0); }

/* ============ HEADER / NAV ============ */
.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background .4s ease, border-color .4s ease, height .3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled{
  background: rgba(10,10,10,0.82);
  backdrop-filter: blur(10px);
  border-color: var(--line);
  height: 68px;
}
.header-inner{
  position: relative;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 20px;
}

.logo{ justify-self: center; display: flex; align-items: center; }
.logo-img{
  height: 40px;
  width: auto;
  display: block;
  transition: height .3s ease, filter .3s ease;
  filter: drop-shadow(0 0 14px rgba(255,255,255,0.08));
}
.site-header.scrolled .logo-img{ height: 32px; }

.nav-desktop{ display: flex; gap: 32px; }
.nav-desktop-left{ justify-self: end; }
.nav-desktop-right{ justify-self: start; }

.nav-toggle{
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
}

.main-nav{ display: none; }
.nav-link{
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  position: relative;
  padding: 4px 0;
  transition: color .3s ease;
}
.nav-link::after{
  content: '';
  position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 1px; background: var(--fg);
  transition: right .3s ease;
}
.nav-link:hover{ color: var(--fg); }
.nav-link:hover::after{ right: 0; }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px; height: 30px;
  background: none; border: none;
}
.nav-toggle span{
  display: block;
  width: 100%; height: 1px;
  background: var(--fg);
  transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle.open span:nth-child(1){ transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2){ opacity: 0; }
.nav-toggle.open span:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

/* ============ HERO ============ */
.hero{
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-video{
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-overlay{
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.55) 100%);
}
.visually-hidden{
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hero-role-wrap{
  position: absolute;
  z-index: 3;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.hero-role{
  font-size: clamp(18px, 2.6vw, 26px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(243,242,238,0.82);
  white-space: nowrap;
}

.scroll-cue{
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 1px; height: 44px;
  overflow: hidden;
}
.scroll-cue span{
  display: block;
  width: 1px; height: 44px;
  background: rgba(243,242,238,0.5);
  animation: cue-drop 1.8s ease-in-out infinite;
}
@keyframes cue-drop{
  0%{ transform: translateY(-100%); }
  60%, 100%{ transform: translateY(100%); }
}

/* ============ CLIENTS MARQUEE ============ */
.clients{
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 34px 0;
  overflow: hidden;
  background: var(--bg-soft);
}
.marquee{ display: flex; width: max-content; }
.marquee-track{
  display: flex;
  align-items: center;
  gap: 64px;
  padding-right: 64px;
  animation: marquee 32s linear infinite;
  white-space: nowrap;
}
.marquee-track img{
  height: 30px;
  width: auto;
  display: block;
  opacity: 0.55;
  transition: opacity .3s ease;
}
.marquee-track img:hover{ opacity: 0.95; }
.marquee:hover .marquee-track{ animation-play-state: paused; }
@keyframes marquee{
  from{ transform: translateX(0); }
  to{ transform: translateX(-100%); }
}

/* ============ SECTION LABEL ============ */
.section-label{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.01em;
}

/* ============ LAST WORK / PORTFOLIO GRIDS ============ */
.last-work, .portfolio{ padding: 120px 0; }
.last-work .section-label{ margin-bottom: 48px; }

.work-grid, .portfolio-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.portfolio .section-label{ margin-bottom: 48px; }

.work-card{ position: relative; }
.work-media{
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #1c1c1c 0%, #101010 100%);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .3s ease, transform .4s ease;
}
.work-card:hover .work-media{ border-color: rgba(243,242,238,0.4); transform: translateY(-4px); }
.work-media::after{
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
  z-index: 1;
  transition: opacity .3s ease;
}
.work-media.is-playing::after{ opacity: 0; }
.work-media video, .work-media img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* En pantalla completa, respeta el encuadre original (vertical u horizontal)
   en vez de recortarlo para rellenar una caja horizontal. */
.work-video:fullscreen,
.work-video:-webkit-full-screen{
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
}
.play-icon{
  width: 52px; height: 52px;
  color: var(--fg);
  opacity: 0.85;
  transition: opacity .3s ease, transform .3s ease;
}
.work-card:hover .play-icon{ opacity: 1; transform: scale(1.08); }
.play-btn{
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px; height: 52px;
  background: rgba(10,10,10,0.45);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  border: none;
  padding: 0;
  z-index: 2;
  transition: opacity .3s ease, background .3s ease;
}
.work-card:hover .play-btn{ background: rgba(10,10,10,0.6); }
.work-media.is-playing .play-btn{
  opacity: 0;
  pointer-events: none;
}
.placeholder-label{
  position: absolute;
  bottom: 16px; left: 18px;
  z-index: 2;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  transition: opacity .3s ease;
}
.work-media.is-playing .placeholder-label{ opacity: 0; }
.image-placeholder .placeholder-label{ position: static; }
.image-placeholder{ flex-direction: column; gap: 10px; }
.image-placeholder::before{
  content: '';
  width: 28px; height: 28px;
  border: 1px solid var(--fg-dim);
  border-radius: 4px;
}

/* ============ ABOUT ============ */
.about{ padding: 40px 0 130px; }
.about-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.about-text .section-label{ margin-bottom: 24px; }
.about-text p{
  font-size: 17px;
  line-height: 1.75;
  color: rgba(243,242,238,0.82);
  max-width: 46ch;
}
.about-collage{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  height: 420px;
}
.collage-img{
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #1c1c1c 0%, #101010 100%);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.collage-img img{
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.collage-img .placeholder-label{ position: static; }
.collage-img[data-slot="about-1"]{ grid-row: 1 / 3; }

/* ============ CONTACT ============ */
.contact{ padding: 100px 0 60px; border-top: 1px solid var(--line); }
.contact-grid{
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 70px;
}
.contact-intro .section-label{ margin-bottom: 18px; }
.contact-intro > p{
  color: rgba(243,242,238,0.75);
  font-size: 16px;
  max-width: 34ch;
}
.contact-list{ margin-top: 40px; display: flex; flex-direction: column; gap: 18px; }
.contact-list li{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.contact-list span{
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.contact-list a{
  font-size: 18px;
  font-family: var(--font-display);
  transition: color .3s ease;
}
.contact-list a:hover{ color: var(--accent); }

.contact-form{ display: flex; flex-direction: column; gap: 22px; }
.form-row{ display: flex; flex-direction: column; gap: 8px; }
.form-row label{
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.form-row input, .form-row textarea{
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 10px 2px;
  resize: vertical;
  transition: border-color .3s ease;
}
.form-row input:focus, .form-row textarea:focus{
  outline: none;
  border-color: var(--fg);
}
.btn-submit{
  align-self: flex-start;
  margin-top: 10px;
  padding: 15px 34px;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: background .3s ease, color .3s ease;
}
.btn-submit:hover{ background: var(--fg); color: var(--bg); }
.form-note{ font-size: 13px; color: var(--fg-dim); margin-top: 6px; }

/* ============ FOOTER ============ */
.site-footer{
  max-width: var(--container);
  margin: 0 auto;
  padding: 30px 40px 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--fg-dim);
}
.footer-top{ transition: color .3s ease; }
.footer-top:hover{ color: var(--fg); }

/* ============ RESPONSIVE ============ */
@media (max-width: 860px){
  .header-inner{
    display: flex;
    justify-content: space-between;
    padding: 0 22px;
  }
  .nav-desktop{ display: none; }
  .logo-img{ height: 32px; }
  .hero-role-wrap{ width: 100%; padding: 0 22px; }
  .hero-role{ white-space: normal; }
  .main-nav{
    display: flex;
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    background: rgba(10,10,10,0.97);
    backdrop-filter: blur(10px);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
    border-bottom: 1px solid var(--line);
  }
  .main-nav.open{ max-height: 320px; }
  .main-nav .nav-link{
    padding: 18px 22px;
    width: 100%;
    border-top: 1px solid var(--line);
  }
  .nav-toggle{ display: flex; }

  .section-inner{ padding: 0 22px; }
  .work-grid, .portfolio-grid{ grid-template-columns: 1fr; }
  .about-grid{ grid-template-columns: 1fr; gap: 40px; }
  .about-collage{ height: 320px; }
  .contact-grid{ grid-template-columns: 1fr; gap: 46px; }
  .last-work, .portfolio{ padding: 76px 0; }
  .site-footer{ padding: 24px 22px 40px; flex-direction: column; gap: 10px; align-items: flex-start; }
}

@media (prefers-reduced-motion: no-preference){
  .reveal{ will-change: transform, opacity; }
}
