/* Colores tomados de FirmaCorreo_Relation.ai.
   Poppins y DM Serif Text sustituyen a Elza y Roca, que no están en este equipo. */
@font-face { font-family: "DM Serif Text"; src: url("fonts/DMSerifText-Italic.ttf") format("truetype"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --noche: #151632;
  --noche-2: #1c1d40;
  --menta: #66efbb;
  --papel: #f5f3ee;
  --suave: rgba(245, 243, 238, .62);
  --linea: rgba(245, 243, 238, .2);
  --serif: "DM Serif Text", Georgia, serif;
  --sans: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --margen: max(clamp(20px, 5vw, 75px), calc((100vw - 1290px) / 2));
  --alto-header: 76px;
  --espacio: clamp(72px, 10vw, 150px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--alto-header); -webkit-text-size-adjust: 100%; }
body { background: var(--noche); color: var(--papel); font-family: var(--sans); font-size: 16px; line-height: 1.6; }
img, video { display: block; max-width: 100%; }
ol, ul { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--menta); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 40; padding: 8px 14px; background: var(--menta); color: var(--noche); }
.skip:focus { left: 8px; }

/* Títulos en mayúsculas gruesas */
h1, h2, h3, .hero-line, .tile-label strong {
  font-family: var(--sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.012em;
  line-height: 1.08;
}
h2 { font-size: clamp(30px, 4.2vw, 60px); }
.kicker { font-size: 14px; line-height: 1.3; letter-spacing: .01em; text-transform: uppercase; }

/* Encabezado */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--alto-header);
  padding: 0 var(--margen);
  transition: background-color .3s ease;
}
.site-header.is-scrolled { background: var(--noche); }
.brand img { width: 118px; height: auto; }
.site-nav { display: flex; gap: clamp(22px, 3vw, 44px); font-size: 13px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { color: var(--menta); }
.menu-btn { display: none; }

/* Degradado con grano, en los colores de la marca */
.aura { position: absolute; inset: 0; overflow: hidden; background: var(--noche); }
.aura span { position: absolute; display: block; border-radius: 50%; filter: blur(clamp(50px, 7vw, 110px)); will-change: transform; }
.aura span:nth-child(1) { width: 58vmax; height: 58vmax; left: -14%; top: 8%; background: #2546dc; animation: deriva-a 26s ease-in-out infinite alternate; }
.aura span:nth-child(2) { width: 42vmax; height: 42vmax; left: 34%; top: -22%; background: var(--menta); opacity: .9; animation: deriva-b 22s ease-in-out infinite alternate; }
.aura span:nth-child(3) { width: 40vmax; height: 40vmax; right: -10%; bottom: -24%; background: #18a8a0; opacity: .85; animation: deriva-c 30s ease-in-out infinite alternate; }
.aura span:nth-child(4) { width: 34vmax; height: 34vmax; left: 20%; bottom: -30%; background: #3a1fa3; animation: deriva-b 28s ease-in-out infinite alternate-reverse; }
@keyframes deriva-a { to { transform: translate(14vw, -6vh) scale(1.12); } }
@keyframes deriva-b { to { transform: translate(-12vw, 12vh) scale(.9); } }
@keyframes deriva-c { to { transform: translate(-16vw, -14vh) scale(1.15); } }
.grano {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  mix-blend-mode: overlay;
  opacity: .72;
  pointer-events: none;
}

/* Portada */
.hero { position: relative; display: grid; place-items: center; min-height: 100svh; padding: var(--alto-header) var(--margen); overflow: hidden; text-align: center; }
.hero-copy { position: relative; }
.hero .kicker { margin-bottom: 12px; font-size: clamp(14px, 1.5vw, 20px); font-weight: 500; }
.hero-line { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 0 .32em; font-size: clamp(36px, 5.4vw, 80px); }
.words { display: inline-grid; text-align: left; }
.word { grid-area: 1 / 1; opacity: 0; transform: translateY(.42em); transition: opacity .45s ease, transform .55s cubic-bezier(.2, .7, .2, 1); }
.word.is-active { opacity: 1; transform: none; }
.word.is-leaving { opacity: 0; transform: translateY(-.42em); }

/* Franja de transición */
.franja { height: 10px; background: linear-gradient(90deg, #2546dc, #18a8a0 55%, var(--menta)); }

/* Presentación */
.intro { padding: var(--espacio) var(--margen) clamp(48px, 6vw, 84px); text-align: center; }
.intro .kicker { margin-bottom: 14px; }
.intro h2 { max-width: 15.5em; margin: 0 auto; }
.intro-sub { margin-top: 18px; color: var(--suave); font-size: clamp(16px, 1.5vw, 20px); font-weight: 300; }

/* Cuadrícula de trabajos */
.work { padding: 0 var(--margen) var(--espacio); }
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: "a a b" "c e e" "d e e";
  gap: clamp(12px, 2vw, 30px);
}
.tile { position: relative; display: block; overflow: hidden; text-decoration: none; background: var(--noche-2); }
.tile-a { grid-area: a; aspect-ratio: 16 / 10; }
.tile-b { grid-area: b; }
.tile-c { grid-area: c; aspect-ratio: 16 / 10; }
.tile-d { grid-area: d; aspect-ratio: 16 / 10; }
.tile-e { grid-area: e; }
.tile-media { position: absolute; inset: 0; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.tile-d .tile-media img { object-position: 50% 42%; }
.tile-b .tile-media img { object-position: 50% 30%; }
.tile-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  padding: clamp(16px, 2vw, 28px);
  background: linear-gradient(to top, rgba(21, 22, 50, .86), rgba(21, 22, 50, .1) 62%);
  opacity: 0;
  transition: opacity .35s ease;
}
.tile-label strong { font-size: clamp(20px, 2.2vw, 32px); }
.tile-label small { font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }
.tile:hover .tile-label, .tile:focus-visible .tile-label { opacity: 1; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.04); }

/* Reels */
.reels-section { padding: 0 var(--margen) var(--espacio); text-align: center; }
.reels-section .kicker { margin-bottom: 14px; }
.reels-section > h2 { max-width: 19em; margin: 0 auto; }
.reels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 30px); margin-top: clamp(40px, 5vw, 72px); text-align: left; }
.reel video { width: 100%; aspect-ratio: 9 / 16; background: #000; object-fit: cover; }
.reel h3 { margin: 16px 0 4px; font-size: clamp(19px, 1.8vw, 24px); }
.reel p { color: var(--suave); font-size: 15px; }

/* Sobre mí */
.about { padding: 0 var(--margen) var(--espacio); }
.about-label { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; font-size: 13px; font-weight: 500; text-transform: uppercase; }
.about-label::after { content: ""; width: 72px; height: 1px; background: var(--papel); }
.about-text { max-width: 25em; color: var(--suave); font-size: clamp(25px, 3.5vw, 50px); line-height: 1.24; font-weight: 500; letter-spacing: -.012em; }
.about-text em { color: var(--menta); font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }

/* Qué hago */
.services { padding: 0 var(--margen) var(--espacio); text-align: center; }
.pillars { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 44px); margin-top: 26px; }
.pillars li { position: relative; display: flex; flex-direction: column; align-items: center; }
.pillars h3 { font-size: clamp(24px, 2.7vw, 38px); }
.dot { position: relative; z-index: 1; width: 14px; height: 14px; margin: 22px 0; border-radius: 50%; background: var(--menta); }
/* Línea entre los puntos */
.pillars li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(clamp(24px, 2.7vw, 38px) * 1.08 + 28px);
  left: 50%;
  width: calc(100% + clamp(24px, 3vw, 44px));
  height: 1px;
  background: var(--linea);
}
.pillars p { max-width: 24em; color: var(--suave); font-size: 15px; }

/* Cierre */
.closing { position: relative; display: grid; place-items: center; min-height: clamp(460px, 62vw, 760px); padding: 64px var(--margen); overflow: hidden; text-align: center; }
.closing-copy { position: relative; }
.closing-ask { margin-bottom: 14px; font-size: clamp(15px, 1.5vw, 20px); font-weight: 500; }
.closing h2 { font-size: clamp(38px, 7.4vw, 108px); line-height: 1; }
.closing-mail { display: inline-block; margin-top: 26px; font-size: clamp(17px, 2vw, 26px); font-weight: 500; text-underline-offset: 6px; overflow-wrap: anywhere; }

/* Pie */
.site-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding: clamp(40px, 5vw, 72px) var(--margen); }
.site-footer nav { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; text-transform: uppercase; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { color: var(--menta); }
.footer-brand { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; color: var(--suave); }
.footer-brand img { width: 112px; height: auto; }
.footer-brand small { font-size: 12px; }

/* Página de proyecto */
.case-hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; min-height: 100svh; padding: var(--alto-header) var(--margen) clamp(24px, 3.4vw, 48px); overflow: hidden; }
.case-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.case-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(21, 22, 50, .78), rgba(21, 22, 50, 0) 46%), linear-gradient(to bottom, rgba(21, 22, 50, .62), rgba(21, 22, 50, 0) 20%); }
.case-hero h1 { position: relative; z-index: 2; font-size: clamp(44px, 9.4vw, 138px); line-height: .96; }
.case-tags { position: relative; z-index: 2; flex: none; font-size: 12px; letter-spacing: .1em; text-align: right; text-transform: uppercase; }
.case-body { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(0, 3fr); align-items: start; gap: clamp(24px, 3vw, 44px); padding: clamp(32px, 4vw, 56px) var(--margen) var(--espacio); }
.case-side { position: sticky; top: calc(var(--alto-header) + 16px); }
.case-side h2 { font-size: clamp(20px, 1.9vw, 26px); }
.case-side > p { margin-top: 14px; color: var(--suave); font-size: 15px; }
.case-side li { padding: 9px 0; border-top: 1px solid var(--linea); font-size: 14px; }
.case-side ul { margin-top: 20px; }
.case-gallery { display: grid; gap: clamp(8px, 1.2vw, 16px); }
.case-gallery.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-gallery img { width: 100%; height: auto; }
.case-gallery.two .full { grid-column: 1 / -1; aspect-ratio: 16 / 10; object-fit: cover; }
.case-next { display: block; padding: clamp(48px, 7vw, 96px) var(--margen); border-top: 1px solid var(--linea); text-align: center; text-decoration: none; }
.case-next small { display: block; margin-bottom: 8px; font-size: 13px; text-transform: uppercase; }
.case-next strong { font-weight: 800; font-size: clamp(32px, 6vw, 88px); line-height: 1.02; letter-spacing: -.012em; text-transform: uppercase; }
.case-next:hover strong { color: var(--menta); }

/* Aparición suave al desplazarse, solo con JavaScript activo */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* En pantallas táctiles no hay cursor: el nombre va siempre debajo de la imagen */
@media (hover: none) {
  .tile { overflow: visible; aspect-ratio: auto; background: none; }
  .tile-media { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; }
  .tile-label { position: static; padding: 10px 0 0; background: none; opacity: 1; }
  .tile-label strong { font-size: 18px; }
}

/* Celular */
@media (max-width: 760px) {
  :root { --alto-header: 64px; }
  .brand img { width: 100px; }
  .menu-btn {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 5px;
    padding: 10px 0 10px 12px;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .menu-btn span { display: block; width: 24px; height: 2px; background: var(--papel); transition: transform .25s ease, opacity .2s ease; }
  .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 0 var(--margen);
    background: var(--noche);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.012em;
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s ease, visibility .25s;
  }
  .site-nav.is-open { visibility: visible; opacity: 1; }
  .brand { position: relative; z-index: 2; }
  .hero-line { flex-direction: column; align-items: center; }
  .words { text-align: center; }
  .work-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "a" "b" "c" "d" "e"; gap: 22px; }
  .tile { overflow: visible; aspect-ratio: auto; background: none; }
  .tile-media { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; }
  .tile-b .tile-media { aspect-ratio: 4 / 5; }
  .tile-label { position: static; padding: 10px 0 0; background: none; opacity: 1; }
  .tile-label strong { font-size: 18px; }
  /* Los reels se deslizan de lado para no alargar tanto la página */
  .reels {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 74vw;
    gap: 14px;
    margin-right: calc(var(--margen) * -1);
    padding-right: var(--margen);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .reel { scroll-snap-align: start; }
  .pillars { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .pillars li:not(:last-child)::after { display: none; }
  .dot { margin: 14px 0; }
  .case-hero { flex-direction: column; align-items: flex-start; justify-content: flex-end; min-height: 82svh; }
  .case-tags { text-align: left; }
  .case-body { grid-template-columns: minmax(0, 1fr); }
  .case-side { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aura span { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .word, .tile-media img { transition: none; }
}
