/* ==========================================================================
   11 Films · tema base
   Puerto fiel del diseño original (Index.html / Index2.html).
   Las tipografías se auto-alojan (sin Google Fonts): sin peticiones a
   terceros, sin salto de maquetación y con métricas de texto estables, que es
   lo que mantiene el titular del hero en dos líneas en cualquier pantalla.
   ========================================================================== */

/* --------------------------------------------------------------- FUENTES -- */
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/anton-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/dm-sans-latin-500-normal.woff2') format('woff2');
}

:root {
  --or: #ff9900;
  --bk: #000;
  --wh: #f5f0e8;
  --mute: #9a948a;
  --d: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --b: 'DM Sans', system-ui, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
  background: var(--bk);
}

body {
  background: var(--bk);
  color: var(--wh);
  font: 400 17px/1.6 var(--b);
  /* Evita barra horizontal si un titular customization se pasa de ancho */
  overflow-x: hidden;
}

body.loading { overflow: hidden; }

:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }

img, video { max-width: 100%; }

/* --------------------------------------------------------------- LOADER -- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bk);
  display: grid;
  place-items: center;
  transition: transform .9s cubic-bezier(.77, 0, .18, 1);
}
#loader.done { transform: translateY(-100%); }
#loader svg { width: min(78vw, 520px); height: auto; }
#pct {
  position: absolute;
  bottom: calc(8vh + env(safe-area-inset-bottom, 0px));
  font: 400 14px var(--b);
  letter-spacing: .2em;
  color: var(--mute);
}

/* ------------------------------------------------------------------ NAV -- */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 5vw 18px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0));
  transition: background-color .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
header.solid {
  background: rgba(0, 0, 0, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: #262626;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  padding-bottom: 10px;
}
header.solid .logo svg { height: 38px; }
.logo { display: block; line-height: 0; }
.logo svg { height: 46px; width: auto; }
nav { display: flex; gap: 28px; }
/* El botón de menú sólo existe en móvil (ver @media max-width: 760px). */
.nav-toggle { display: none; }
nav a {
  color: var(--wh);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
nav a:hover { border-color: var(--or); }

/* ----------------------------------------------------------------- HERO -- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: radial-gradient(120% 90% at 70% 30%, #3a2200 0%, #000 65%);
}
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #000 4%, rgba(0, 0, 0, .15) 55%, rgba(0, 0, 0, .5));
}
.hero-c {
  position: relative;
  z-index: 2;
  /* width explícito: con container-type el tamaño ya no puede deducirse del
     contenido, y como elemento flexible se quedaría colapsado. */
  width: 100%;
  padding: 0 5vw 9vh;
  max-width: 1200px;
  /* Permite medir el titular contra el ancho real del bloque (cqw). */
  container-type: inline-size;
}

h1 {
  /* El tamaño se acota al contenedor (15.5cqw) además de a la ventana (10.5vw):
     así el titular nunca se parte en tres líneas, ni con la tipografía de
     respaldo ni en pantallas anchas. */
  font: 400 clamp(44px, min(10.5vw, 15.5cqw), 165px)/.95 var(--d);
  text-transform: uppercase;
}
h1 .l { display: block; }
h1 .y {
  display: inline-block;
  color: var(--or);
  clip-path: inset(-10% 100% -10% 0);
  transition: clip-path 1s cubic-bezier(.77, 0, .18, 1) .5s;
}
body.go h1 .y { clip-path: inset(-10% 0 -10% 0); }

.hero p {
  max-width: 52ch;
  margin: 24px 0 28px;
  color: #ddd5c8;
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.55;
}

.btn {
  display: inline-block;
  background: var(--or);
  color: var(--bk);
  font-weight: 500;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 2px;
}
.btn:hover { background: var(--wh); }

/* ------------------------------------------------------------- SECCIONES -- */
section.s { padding: 14vh 5vw; max-width: 1300px; margin: auto; }
h2 {
  font: 400 clamp(38px, 6vw, 84px)/1 var(--d);
  text-transform: uppercase;
  margin-bottom: 48px;
}

/* Proyectos */
.work {
  display: grid;
  /* auto-fill (y no auto-fit) para que una tarjeta suelta no se estire a todo
     el ancho de la fila: la rejilla mantiene siempre el aspecto de cartel. */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.work a {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 2/3;
  padding: 22px;
  color: var(--wh);
  text-decoration: none;
  background: linear-gradient(160deg, #1c1c1c, #050505);
  border: 1px solid #262626;
  overflow: hidden;
}
.work a::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0;
  background: var(--or);
  transition: height .35s;
}
.work a:hover::before, .work a:focus-visible::before { height: 100%; }
.work a > * { position: relative; }
.work a:hover { color: var(--bk); }
.work b { font: 400 30px/1.1 var(--d); text-transform: uppercase; }
.work em { font-style: normal; font-size: 14px; opacity: .75; }

/* Servicios */
.serv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px 56px;
}
.serv h3 { font: 400 26px var(--d); text-transform: uppercase; color: var(--or); margin-bottom: 8px; }
.serv p { color: #cfc8bb; max-width: 38ch; }

/* Ficha de proyecto */
.tag {
  display: inline-block;
  background: var(--or);
  color: var(--bk);
  font-weight: 500;
  font-size: 14px;
  padding: 4px 12px;
  margin-bottom: 18px;
}
.syn { display: grid; grid-template-columns: 1.4fr 1fr; gap: 6vw; }
.syn p + p { margin-top: 1.1em; }
.syn p { max-width: 60ch; }
dl { border-top: 3px solid var(--or); }
dl div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid #262626;
}
dt { color: var(--mute); }
dd { text-align: right; font-weight: 500; }

/* Vídeo embebido */
.embed {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #3a2200, #0a0a0a);
  border: 1px solid #262626;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--mute);
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed .pl {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--or);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}
.embed .pl::before {
  content: "";
  border-left: 26px solid var(--bk);
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  margin-left: 8px;
}

/* Siguiente proyecto */
.next {
  border-top: 1px solid #262626;
  display: flex;
  /* Sólo queda el enlace "Ver todos los proyectos": se centra. */
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.next a { font: 400 clamp(30px, 5vw, 64px)/1.1 var(--d); text-transform: uppercase; color: var(--or); text-decoration: none; }
.next a:hover { color: var(--wh); }

/* ------------------------------------------------------------------- CV -- */
.contact { border-top: 1px solid #262626; }
.me {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) 1.6fr;
  gap: 6vw;
  align-items: start;
}
.ph {
  aspect-ratio: 4/5;
  background: linear-gradient(160deg, #3a2200, #0a0a0a);
  border: 1px solid #262626;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  color: var(--mute);
  font-size: 14px;
  overflow: hidden;
}
.ph img { width: 100%; height: 100%; object-fit: cover; }
.me h3 { font: 400 clamp(34px, 4.5vw, 60px)/1 var(--d); text-transform: uppercase; }
.role { color: var(--or); font-weight: 500; margin: 6px 0 22px; }
.lang { display: inline-flex; margin-bottom: 26px; border: 1px solid #333; }
.lang button {
  background: none;
  border: 0;
  color: var(--wh);
  font: 500 14px var(--b);
  padding: 8px 18px;
  cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--or); color: var(--bk); }
.cvl .bio { max-width: 58ch; margin-bottom: 28px; }
.cvl h4 { font: 400 22px var(--d); text-transform: uppercase; color: var(--or); margin-bottom: 6px; }
.cvl ul { list-style: none; padding: 0; margin-bottom: 28px; border-top: 1px solid #262626; }
.cvl li {
  display: flex;
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid #262626;
}
.cvl li span { color: var(--mute); min-width: 96px; }
.cvl li .r { color: var(--wh); font-weight: 500; }
.cvl li .r small.pl {
  color: var(--mute);
  font-weight: 400;
  font-size: 13px;
  margin-left: 8px;
}
.cvl li .d { color: #ddd5c8; margin-top: 2px; max-width: 62ch; }

/* -------------------------------------------------------------- CONTACTO -- */
.yt {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 36px 32px 0 0;
  color: var(--wh);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid var(--or);
  padding-bottom: 4px;
}
.yt:hover { color: var(--or); }
.yt svg { width: 32px; height: auto; fill: var(--or); }
.yt:hover svg { fill: var(--wh); }
footer a { color: var(--wh); }
.contact a.big {
  display: block;
  font: 400 clamp(30px, 6vw, 84px)/1.1 var(--d);
  color: var(--or);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact a.big:hover { color: var(--wh); }
footer {
  padding: 30px 5vw;
  color: var(--mute);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ------------------------------------------------------- página genérica -- */
.page-title {
  font: 400 clamp(38px, 6vw, 84px)/1 var(--d);
  text-transform: uppercase;
  margin-bottom: 48px;
}

/* --------------------------------------------------------- ERROR (404) -- */
/* Pantalla de error: el mismo lenguaje visual que el resto del sitio
   (negro, naranja, tipografía condensada) pero sin loader ni contenido. */
.err {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 5vw 90px;
}
.err-code {
  font: 400 clamp(96px, 26vw, 280px)/.85 var(--d);
  color: var(--or);
  letter-spacing: .01em;
  text-shadow: 0 0 70px rgba(255, 153, 0, .22);
}
.err-title {
  font: 400 clamp(26px, 5vw, 52px)/1.05 var(--d);
  text-transform: uppercase;
  margin-top: 20px;
}
.err-text {
  color: var(--mute);
  max-width: 44ch;
  margin: 16px auto 32px;
  font-size: 16px;
}

/* ------------------------------------------------------------ RESPONSIVE -- */
/* Móvil: la navegación se recoge en un botón. Al pulsarlo se despliega bajo
   la cabecera, en vertical. Sin pulsarlo, la cabecera sólo ocupa una línea. */
@media (max-width: 760px) {
  header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    padding-bottom: 14px;
  }
  header.solid {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-bottom: 10px;
  }
  header.solid .logo svg { height: 32px; }

  /* Botón de menú (oculto en escritorio). */
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 11px;
    background: transparent;
    border: 1px solid #262626;
    border-radius: 2px;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--wh);
    transition: transform .25s, opacity .2s;
  }
  header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Menú: oculto hasta que se pulsa el botón. */
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 5vw 12px;
    background: rgba(0, 0, 0, .97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #262626;
  }
  header.nav-open nav { display: flex; }
  nav a {
    font-size: 15px;
    padding: 13px 0;
    width: 100%;
    border-bottom: 1px solid #1c1c1c;
  }
  nav a:last-child { border-bottom: 0; }
  /* La cabecera ya sólo ocupa una línea: el salto a un ancla la deja libre. */
  html { scroll-padding-top: 84px; }
}

@media (max-width: 760px) {
  .me { grid-template-columns: 1fr; }
  .syn { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  nav a { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  h1 .y { transition: none; }
  #loader { transition: none; }
  html { scroll-behavior: auto; }
  .work a::before { transition: none; }
}
