/* =========================================================

RATIO & PRAXIS
STYLE.CSS

CAMBIOS RAPIDOS

COLOR FONDO       → --bg
COLOR TEXTO       → --text
TIPOGRAFIA MAIN   → --font-main
TIPOGRAFIA MONO   → --font-mono

========================================================= */

:root {
  --bg:         #ffffff;
  --text:       #0a0a0a;
  --muted:      #8a8a8a;
  --line:       #e9e9e9;
  --font-main:  'Space Grotesk', sans-serif;
  --font-mono:  'Space Mono', monospace;
}

/* ========================================================= */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  overflow-x: hidden;
}

/* =========================================================
NAV
========================================================= */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 40px;
  mix-blend-mode: difference;

  /* MODIFICACIÓN: Arranca oculto y se prepara para transicionar */
  transform: translateY(-100%);
  opacity: 0;
  transition: transform .4s ease, opacity .4s ease;
}

/* MODIFICACIÓN: Clase que activa JS cuando el scroll se mueve */
.nav.nav-scrolled {
  transform: translateY(0);
  opacity: 1;
}

.logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-main {
  color: white;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.logo-sub {
  color: white;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-family: var(--font-mono);
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  opacity: .55;
  transition: opacity .3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
}

/* =========================================================
HERO
========================================================= */

.hero {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* la transición del parallax se maneja en JS */
  will-change: transform;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.55),
    rgba(0,0,0,.05)
  );
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  color: white;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.hero-content {
  color: white;
}

.hero-content h1 {
  font-size: clamp(4rem, 10vw, 10rem);
  line-height: .9;
  letter-spacing: -0.06em;
  margin-bottom: 18px;
}

.hero-content p {
  font-size: 13px;
  line-height: 1.8;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-family: var(--font-mono);
}

/* =========================================================
GALLERY
========================================================= */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.gallery-item {
  overflow: hidden;
  border: 1px solid var(--line);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .7s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

/* =========================================================
STATEMENT
========================================================= */

.statement {
  padding: 140px 8vw;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 80px;
  border-top: 1px solid var(--line);
}

.section-number {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.statement-content {
  max-width: 900px;
}

.statement-content h2 {
  font-size: clamp(2.8rem, 5vw, 6rem);
  line-height: .95;
  letter-spacing: -0.05em;
  margin-bottom: 40px;
}

.statement-content p {
  font-size: 18px;
  line-height: 1.8;
  max-width: 700px;
  color: #444;
  margin-bottom: 24px;
}

/* =========================================================
METHOD
========================================================= */

.method {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  border-top: 1px solid var(--line);
}

.method-image {
  min-height: 700px;
  overflow: hidden;
}

.method-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.method-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px;
  gap: 60px;
}

.method-block span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--muted);
}

.method-block h3 {
  font-size: 3rem;
  letter-spacing: -0.05em;
  margin: 12px 0;
}

.method-block p {
  line-height: 1.9;
  max-width: 380px;
  color: #555;
}

/* =========================================================
CASES
========================================================= */

.cases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.case {
  border-top: 1px solid var(--line);
}

.case img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
}

.case-info {
  padding: 22px;
}

.case-info span {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 10px;
}

.case-info h3 {
  margin-top: 8px;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

/* =========================================================
CONTACT
========================================================= */

.contact {
  padding: 180px 40px;
  border-top: 1px solid var(--line);
}

.contact-inner {
  max-width: 900px;
}

.contact-inner span {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--muted);
}

.contact-inner h2 {
  font-size: clamp(4rem, 8vw, 8rem);
  line-height: .9;
  letter-spacing: -0.06em;
  margin: 20px 0;
}

.contact-inner p {
  color: #666;
  margin-bottom: 24px;
}

.contact-inner a {
  color: var(--text);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
}

/* =========================================================
FOOTER
========================================================= */

.footer {
  display: flex;
  justify-content: space-between;
  padding: 30px 40px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

/* =========================================================
ANIMACIONES JS
========================================================= */

.hidden {
  opacity: 0;
  transform: translateY(50px);
  transition:
    opacity .9s ease,
    transform .9s ease;
}

.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Imágenes: arranca invisible, JS agrega .loaded cuando termina de cargar.
   La lógica del JS también maneja el caso de caché (img.complete). */
img {
  opacity: 0;
  transition: opacity .8s ease;
}

img.loaded {
  opacity: 1;
}

/* =========================================================
MOBILE
========================================================= */

@media (max-width: 900px) {

  .nav-links {
    display: none;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .cases {
    grid-template-columns: 1fr;
  }

  .statement {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .method {
    grid-template-columns: 1fr;
  }

  .method-content {
    padding: 40px 30px;
  }

  .contact {
    padding: 100px 30px;
  }

  .footer {
    flex-direction: column;
    gap: 10px;
  }

}