/* ==========================================================================
   Arroyo Sur — capa premium
   Tipografía editorial, intro, revelados, parallax, cursor y marquesina.
   ========================================================================== */

:root {
  --font-serif: "Cormorant Garamond", "Times New Roman", serif;
  --ease-curtain: cubic-bezier(0.77, 0, 0.18, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --intro: 0.15s;
}
.has-intro { --intro: 2.35s; }

/* ---------- Acentos serif ---------- */
h1 em, h2 em, .manifesto em, .marquee em, .footer-cta em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.12em;
  letter-spacing: -0.01em;
  line-height: 0.9;
}
h2 { font-weight: 200; }

/* Grano sutil, como papel fotográfico */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 300; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Intro ---------- */
.intro { display: none; }
.has-intro .intro {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-content: center; justify-items: center; gap: 28px;
  background: var(--carbon); color: var(--white);
  clip-path: inset(0 0 0 0);
  animation: intro-out 1.05s var(--ease-curtain) 1.85s forwards;
}
.intro__iso { width: min(46vw, 230px); overflow: visible; }
.intro__ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.9s var(--ease-out) forwards; animation-delay: calc(var(--i) * 0.09s + 0.15s); }
.intro__fill { opacity: 0; animation: fade 0.9s ease 0.75s forwards; }
.intro__brush { transform: scaleX(0); transform-origin: left; transform-box: fill-box; animation: brush 0.8s var(--ease-out) 0.95s forwards; }
.intro__word {
  display: grid; justify-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 300; font-size: clamp(1.5rem, 4vw, 2.25rem); letter-spacing: 0.06em; text-transform: uppercase;
  opacity: 0; transform: translateY(14px); animation: rise 0.9s var(--ease-out) 0.9s forwards;
}
.intro__word small { font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.5em; color: var(--sky); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes brush { to { transform: scaleX(1); } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes intro-out { to { clip-path: inset(0 0 100% 0); visibility: hidden; } }

/* ---------- Progreso de lectura ---------- */
.scroll-progress {
  position: fixed; left: 0; top: 0; z-index: 60; width: 100%; height: 2px;
  background: var(--teal); transform-origin: left; transform: scaleX(var(--p, 0));
}

/* ---------- Cabecera que se esconde al bajar ---------- */
.site-header { transition: background-color 0.4s, padding 0.4s, transform 0.6s var(--ease-out); }
.site-header.is-hidden { transform: translateY(-100%); }

/* ---------- Inicio ---------- */
.hero { min-height: max(680px, 100svh); }
.hero__slides {
  position: absolute; inset: -6% 0; z-index: -2; background: var(--carbon-deep);
  transform: translate3d(0, var(--py, 0), 0); will-change: transform;
}
.hero__slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.8s ease; }
.hero__slide.is-active { opacity: 1; z-index: 1; }
.hero__slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); }
.hero__slide.is-active img { animation: kenburns 9s linear forwards; }
@keyframes kenburns { from { transform: scale(1.14); } to { transform: scale(1.02); } }

.hero::before {
  background:
    linear-gradient(180deg, rgba(22, 22, 22, 0.6) 0%, rgba(22, 22, 22, 0.05) 30%, rgba(22, 22, 22, 0.25) 55%, rgba(22, 22, 22, 0.9) 100%),
    linear-gradient(90deg, rgba(22, 22, 22, 0.6) 0%, rgba(22, 22, 22, 0) 65%);
}

.hero h1.hero__title {
  max-width: none;
  font-weight: 200;
  font-size: clamp(3.1rem, 9vw, 9.25rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}
.hero__title em { font-size: 1.1em; }
.line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.line > span { display: inline-block; }
.js .line > span { transform: translateY(112%); animation: line-up 1.4s var(--ease-out) forwards; animation-delay: calc(var(--intro) + var(--d, 0s)); }
.js .hero__in { opacity: 0; transform: translateY(24px); animation: rise 1.2s var(--ease-out) forwards; animation-delay: calc(var(--intro) + var(--d, 0s)); }
@keyframes line-up { to { transform: none; } }

.hero .brush::after { bottom: 0.04em; transform: scaleX(0); transform-origin: left; }
.js .hero .brush::after { animation: brush 1s var(--ease-out) forwards; animation-delay: calc(var(--intro) + 0.9s); }
html:not(.js) .hero .brush::after { transform: none; }

.hero__meta {
  position: absolute; right: var(--gutter); bottom: clamp(72px, 9vw, 120px);
  display: grid; justify-items: end; gap: 6px; min-width: 210px;
  font-family: var(--font-display); color: var(--white);
}
.hero__meta p:first-child { font-weight: 300; font-size: 2rem; line-height: 1; letter-spacing: -0.02em; }
.hero__meta-total { font-size: 0.875rem; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.1em; }
.hero__meta-name { font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--sky); }
.hero__progress { width: 100%; height: 1px; margin-top: 10px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.hero__progress span { display: block; height: 100%; background: var(--white); transform-origin: left; transform: scaleX(0); }
.hero__progress span.is-running { animation: progress var(--slide-time, 6.5s) linear forwards; }
@keyframes progress { to { transform: scaleX(1); } }

.hero__scroll {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 12px;
  color: rgba(255, 255, 255, 0.75); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 0.625rem; letter-spacing: 0.3em; text-transform: uppercase;
}
.js .hero__scroll { transform: translate(-50%, 24px); }
.hero__scroll i { position: relative; width: 1px; height: 48px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.hero__scroll i::after { content: ""; position: absolute; inset: 0; background: var(--white); animation: scroll-cue 2.2s var(--ease-curtain) infinite; }
@keyframes scroll-cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }
.js .hero__scroll { animation-name: rise-x; }
@keyframes rise-x { to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Franja de confianza ---------- */
.trust__list strong { font-weight: 300; font-size: 1.25rem; }

/* ---------- Etiquetas: la línea crece ---------- */
.js .reveal .label__n::after, .js .label--static .label__n::after { width: 0; transition: width 1.2s var(--ease-out) 0.2s; }
.js .reveal.is-in .label__n::after, .js .label--static.is-in .label__n::after { width: 40px; }

/* ---------- Titulares que suben palabra por palabra ---------- */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; padding-right: 0.04em; }
.w > span { display: inline-block; }
.js .reveal .w > span, .js .band .w > span { transform: translateY(110%); transition: transform 1.2s var(--ease-out); transition-delay: calc(var(--i, 0) * 45ms + 0.1s); }
.js .reveal.is-in .w > span, .js .band.is-in .w > span { transform: none; }
.js .reveal:has(.w) { transform: none; }

/* ---------- Manifiesto ---------- */
.estudio__text { align-self: end; }
.manifesto {
  font-weight: 200;
  font-size: clamp(2.1rem, 4.6vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}
.manifesto em { color: var(--teal-ink); }
.js .manifesto .word { opacity: 0.14; transition: opacity 0.5s ease; }
.js .manifesto .word.is-lit { opacity: 1; }
.estudio__text .lead { margin-top: clamp(32px, 4vw, 56px); max-width: 34em; }

.estudio__figure { align-self: start; }
.estudio__frame { aspect-ratio: 3 / 4; overflow: hidden; background: #e6e4df; }
.estudio__figure img { aspect-ratio: auto; }

/* ---------- Revelado de imágenes (telón) ---------- */
.plx { display: block; position: relative; width: 100%; height: 116%; top: -8%; will-change: transform; }
.plx img, [data-parallax] > .plx > img { width: 100%; height: 100%; object-fit: cover; }
.js .img-reveal { clip-path: inset(100% 0 0 0); transition: clip-path 1.5s var(--ease-curtain); }
.js .img-reveal img { transform: scale(1.22); transition: transform 2s var(--ease-out), opacity 0.4s; }
.js .img-reveal.is-in { clip-path: inset(0 0 0 0); }
.js .img-reveal.is-in img { transform: scale(1); }
.js .img-reveal.is-in:hover img, .js .svc:hover .img-reveal.is-in img { transform: scale(1.05); transition-duration: 1.2s; }

/* ---------- Servicios ---------- */
.svc__media { overflow: hidden; }
.svc--feature { background: var(--paper); }
.svc--feature h3 { font-weight: 200; font-size: clamp(2rem, 3.4vw, 3rem); letter-spacing: -0.025em; }
.svc h3 { font-weight: 300; }

/* ---------- Marquesina ---------- */
.marquee {
  overflow: hidden; padding-block: clamp(28px, 4vw, 56px);
  background: var(--white); border-top: 1px solid var(--line);
}
.marquee__track {
  display: flex; align-items: center; gap: clamp(28px, 4vw, 64px); width: max-content;
  animation: marquee 48s linear infinite;
}
.marquee__track > * { flex: none; white-space: nowrap; }
.marquee span {
  font-family: var(--font-display); font-weight: 200; font-size: clamp(3rem, 8vw, 7.5rem); line-height: 1; letter-spacing: -0.03em;
  color: transparent; -webkit-text-stroke: 1px var(--ink);
}
.marquee em { font-size: clamp(3.3rem, 8.8vw, 8.25rem); color: var(--teal-ink); line-height: 1; }
.marquee i { width: clamp(10px, 1.2vw, 16px); height: clamp(10px, 1.2vw, 16px); background: var(--teal); transform: rotate(45deg); }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Proyectos ---------- */
.proyectos .section-head h2 { font-size: clamp(2.6rem, 6vw, 5.5rem); line-height: 0.98; }
.project__cover { position: relative; }
.project__index {
  font-family: var(--font-display); font-weight: 200;
  font-size: clamp(4.5rem, 9vw, 8.5rem); line-height: 0.85; letter-spacing: -0.05em; text-transform: none;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.45);
}
.project__index span { font-size: 0.16em; letter-spacing: 0.2em; -webkit-text-stroke: 0; color: rgba(255, 255, 255, 0.5); vertical-align: top; margin-left: 0.6em; }
.project h3 { font-weight: 200; font-size: clamp(2.4rem, 4.4vw, 4rem); letter-spacing: -0.03em; }
.project__thumbs a { position: relative; }
.project__thumbs a::after {
  content: ""; position: absolute; inset: 0; border: 1px solid rgba(255, 255, 255, 0); transition: border-color 0.4s;
}
.project__thumbs a:hover::after { border-color: rgba(255, 255, 255, 0.5); }

/* ---------- Proceso ---------- */
.step h3 { font-weight: 300; }
.js .steps::before { transform: scaleX(0); transform-origin: left; transition: transform 2s var(--ease-out); }
.js .steps.is-drawn::before { transform: scaleX(1); }

/* ---------- Banda ---------- */
.band { padding-block: clamp(150px, 20vw, 280px); }
.band__media { top: -12%; height: 124%; transform: translate3d(0, var(--py, 0), 0); will-change: transform; }
.band h2 { max-width: 16ch; font-size: clamp(2.4rem, 5.4vw, 5rem); line-height: 1.02; }

/* ---------- Botones: relleno que sube ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: color 0.45s var(--ease-out), border-color 0.3s, transform 0.4s var(--ease-out); }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--white); transform: translateY(101%); transition: transform 0.55s var(--ease-out);
}
.btn:hover::before { transform: none; }
.btn--primary:hover { background: var(--teal); }
.btn--dark::before { background: var(--teal-ink); }
.btn--dark:hover { background: var(--carbon); color: var(--white); }
.btn--ghost:hover { background: transparent; }

/* ---------- Cursor "Ver" sobre imágenes ---------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .js .cursor {
    position: fixed; left: 0; top: 0; z-index: 250; pointer-events: none;
    display: grid; place-items: center; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%;
    background: rgba(245, 244, 241, 0.94); color: var(--ink);
    font-family: var(--font-display); font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.22em; text-transform: uppercase;
    opacity: 0; scale: 0.3; transition: opacity 0.35s, scale 0.45s var(--ease-out);
  }
  .js .cursor.is-on { opacity: 1; scale: 1; }
  .js [data-item], .js .project__thumbs a { cursor: none; }
}

/* ---------- Cierre del pie ---------- */
.site-footer { padding-top: 0; overflow: hidden; }
.footer-cta { padding-block: clamp(96px, 13vw, 180px) clamp(64px, 8vw, 112px); border-bottom: 1px solid var(--line-inv); margin-bottom: clamp(56px, 7vw, 96px); }
.footer-cta .label { color: var(--sky); }
.footer-cta__link {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.28em;
  font-family: var(--font-display); font-weight: 200; font-size: clamp(2.75rem, 8.2vw, 8rem); line-height: 0.95; letter-spacing: -0.04em;
  color: var(--white); text-decoration: none;
}
.footer-cta__link em { color: var(--sky); }
.footer-cta__link .icon { width: 0.6em; height: 0.6em; align-self: center; color: var(--teal); transition: transform 0.6s var(--ease-out); }
.footer-cta__link:hover .icon { transform: translateX(0.18em) rotate(-45deg); }
.footer-cta__link:hover span { color: var(--sky); }
.footer-cta__link span { transition: color 0.4s; }

.footer-giant {
  margin: clamp(24px, 4vw, 48px) 0 0; padding: 0 var(--gutter);
  font-family: var(--font-display); font-weight: 200; font-size: 17.6vw; line-height: 0.74; letter-spacing: -0.05em;
  white-space: nowrap; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.14);
  user-select: none; transform: translateY(0.04em);
}

/* ==========================================================================
   Adaptación
   ========================================================================== */
@media (max-width: 960px) {
  .hero__meta { display: none; }
  .estudio__frame { aspect-ratio: 4 / 5; }
}
@media (max-width: 640px) {
  .hero h1.hero__title { font-size: clamp(2.9rem, 13.5vw, 4rem); }
  .hero__scroll { display: none; }
  .manifesto { font-size: clamp(2rem, 9vw, 2.6rem); }
  .project__index { font-size: 4.5rem; }
  .footer-giant { -webkit-text-stroke-width: 0.6px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .line > span, .js .hero__in, .js .hero__scroll { transform: none !important; opacity: 1 !important; }
  .js .img-reveal { clip-path: none !important; }
  .js .img-reveal img { transform: none !important; }
  .js .w > span { transform: none !important; }
  .js .manifesto .word { opacity: 1 !important; }
  .marquee__track { animation: none !important; }
  .hero .brush::after { transform: none !important; }
}
