/* =========================================================
   FACUNDO LÓPEZ ESTÉVEZ — PORTFOLIO
   v4: modo oscuro + ES/EN + collage FERVOR + textos en gris
   ========================================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; }

:root {
  --bg: #ffffff;
  --text: #3b3b3b;
  --text-soft: rgba(59, 59, 59, 0.7);
  --border: rgba(59, 59, 59, 0.15);
  --accent: #ff5500;
  --pad-x: 56px;
  --pad-y: 48px;
  --gap: 96px;
  --font: 'Chivo Mono', ui-monospace, 'Courier New', monospace;
}

[data-theme="dark"] {
  --bg: #171717;
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.7);
  --border: rgba(255, 255, 255, 0.15);
  --accent: #ff5500;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--pad-x);
  transition: background 0.4s ease, color 0.4s ease;
}

/* Wrapper interno para limitar ancho máximo en pantallas ultra anchas */
.site-header,
main,
.site-footer {
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

a { color: inherit; text-decoration: none; }

/* Visualmente oculto pero accesible para lectores y crawlers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header { padding: var(--pad-y) 0 0; }

.logo {
  display: block;
  width: 100%;
  margin-bottom: 28px;
  transition: opacity 0.4s ease;
}

.logo:hover { opacity: 0.92; }

.logo-svg {
  display: block;
  width: 100%;
  height: auto;
}

.logo-svg path { fill: var(--accent); }

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 0 0;
  margin-bottom: 80px;
}

.nav-left { display: flex; gap: 32px; align-items: center; }
.nav-right { display: flex; gap: 20px; align-items: center; }

.nav-link {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.nav-link.active {
  font-weight: 700;
  color: var(--accent);
}

.nav-link.active::after { transform: scaleX(1); }
.nav-link:hover::after { transform: scaleX(1); }

.nav-toggle {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  background: transparent;
  border: 1.5px solid var(--border);
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  line-height: 1;
}

.nav-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-icon { width: 16px; height: 16px; fill: currentColor; }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }

/* PROYECTOS HOME */
.projects {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding-bottom: var(--gap);
}

.project {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 80px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.project.project-image-left { grid-template-columns: 1.7fr 1fr; }

.project-text {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 620px;
}

.project-title {
  font-size: 60px;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--text);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
  transition: letter-spacing 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project:hover .project-title { letter-spacing: 0.03em; }

.project-tag {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

.project-desc {
  font-size: 19px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text);
  max-width: 50ch;
}

.project-desc strong { font-weight: 700; color: var(--text); }

.project-cta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  margin-top: 8px;
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.project:hover .project-cta {
  transform: translateX(6px);
  color: var(--accent);
}

.project-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.project:hover .project-image img { transform: scale(1.04); }

.image-fallback {
  display: none;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  text-align: center;
}

.project-image.image-empty { border: 1px dashed var(--border); }
.project-image.image-empty .image-fallback { display: block; }

/* COLLAGE FERVOR */
.fervor-collage {
  position: relative;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  overflow: visible;
}

.fervor-collage-stamp {
  position: absolute;
  display: block;
  will-change: transform;
  --rot: 0deg;
  --shift: 0px;
  transform: rotate(var(--rot)) translateY(var(--shift));
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fervor-collage-stamp img {
  width: 100%;
  height: auto;
  display: block;
}

/* Mapeo (orden HTML actual): s1=fervor-1, s2=fervor-5, s3=fervor-7, s4=fervor-4,
   s5=fervor-10 (FERVOR rojo grande = ancla central), s6=fervor-8, s7=fervor-3,
   s8=fervor-9, s9=fervor-2, s10=fervor-6
   Composición según moodboard: ancla central, todo apretado en una masa. */

/* Percusión (s7=fervor-3) — arriba-izquierda */
.fc-s7 { top: 8%; left: 8%; width: 26%; --rot: -2deg; z-index: 4; }

/* Stamp Fiesta Niceto rosa (s2=fervor-5) — arriba-centro */
.fc-s2 { top: 0%; left: 30%; width: 22%; --rot: -4deg; z-index: 6; }

/* Equipo 4 chicos parados (s3=fervor-7) — arriba-centro-derecha */
.fc-s3 { top: 6%; left: 46%; width: 26%; --rot: 3deg; z-index: 5; }

/* Público manos arriba (s9=fervor-2) — arriba-derecha */
.fc-s9 { top: 14%; left: 68%; width: 30%; --rot: 2deg; z-index: 5; }

/* Músico Fito (s1=fervor-1) — izquierda-media */
.fc-s1 { top: 32%; left: 2%; width: 28%; --rot: 3deg; z-index: 7; }

/* Stamp Festival violeta vertical (s4=fervor-4) — centro-izquierda */
.fc-s4 { top: 36%; left: 22%; width: 28%; --rot: -7deg; z-index: 8; }

/* CENTRAL FERVOR rojo (s5=fervor-10) — ANCLA */
.fc-s5 { top: 34%; left: 36%; width: 32%; --rot: -2deg; z-index: 12; }

/* Stamp FERUOR rojo horizontal (s8=fervor-9) — derecha-media */
.fc-s8 { top: 38%; left: 60%; width: 32%; --rot: 6deg; z-index: 9; }

/* Stamp nombres gradiente rosa-violeta (s6=fervor-8) — abajo-izquierda */
.fc-s6 { top: 60%; left: 14%; width: 26%; --rot: -6deg; z-index: 9; }

/* Multitud abajo-derecha grande (s10=fervor-6) */
.fc-s10 { top: 62%; left: 44%; width: 46%; --rot: 2deg; z-index: 10; }

/* Soporte de video dentro de stamps: máscara de estampita aplicada por CSS */
.fervor-collage-stamp video {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
  -webkit-mask-image: url('img/stamp-mask.png');
  mask-image: url('img/stamp-mask.png');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Mapeo: s1=fle-1 (3 modelos H), s2=fle-2 (3 personas V), s3=fle-3 (FIERA hojas),
   s4=video-1 (chico pelo largo H), s5=fle-4 (FIN DEL MUNDO), s6=fle-6 (logo "fle"),
   s7=fle-5 (GAUCHO herradura), s8=video-2 (chico interior V).
   Composición exacta del moodboard del usuario. */

/* Arriba-centro: video 2 (chico interior, vertical) */
.fle-s8 { top: 0%; left: 36%; width: 26%; --rot: 0deg; z-index: 7; }

/* Izquierda-medio: fle-2 (3 personas vertical, con stamp fle arriba) */
.fle-s2 { top: 28%; left: 2%; width: 30%; --rot: -3deg; z-index: 7; }

/* Centro-izquierda-medio: fle-5 (GAUCHO con herradura) */
.fle-s7 { top: 14%; left: 18%; width: 28%; --rot: 4deg; z-index: 6; }

/* Centro-derecha-medio: fle-4 (FIN DEL MUNDO con borceguíes) */
.fle-s5 { top: 18%; left: 56%; width: 26%; --rot: -4deg; z-index: 6; }

/* Derecha-medio: video 1 (chico pelo largo) */
.fle-s4 { top: 32%; left: 70%; width: 28%; --rot: 3deg; z-index: 7; }

/* CENTRO: logo "fle" — ANCLA, encima */
.fle-s6 { top: 38%; left: 36%; width: 32%; --rot: -2deg; z-index: 12; }

/* Abajo-centro-izquierda: fle-1 (3 modelos campaña principal, horizontal) */
.fle-s1 { top: 62%; left: 22%; width: 38%; --rot: 1deg; z-index: 9; }

/* Abajo-derecha: fle-3 (FIERA en hojas) */
.fle-s3 { top: 60%; left: 58%; width: 30%; --rot: -3deg; z-index: 9; }

/* Scroll-driven animations para FLE stamps */
@supports (animation-timeline: view()) {
  .fle-s1 { animation-name: stamp-drift-up-soft; }
  .fle-s2 { animation-name: stamp-drift-down; }
  .fle-s3 { animation-name: stamp-drift-up; }
  .fle-s4 { animation-name: stamp-drift-down-soft; }
  .fle-s5 { animation-name: stamp-drift-up; }
  .fle-s6 { animation-name: stamp-drift-down; }
  .fle-s7 { animation-name: stamp-drift-up-soft; }
  .fle-s8 { animation-name: stamp-drift-down-soft; }
}

/* Movimiento sutil con scroll: cada stamp se desplaza diferente cuando entra en vista */
@supports (animation-timeline: view()) {
  .fervor-collage-stamp {
    transition: none;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
    animation-timing-function: linear;
    animation-fill-mode: both;
  }
  .fc-s1 { animation-name: stamp-drift-up; }
  .fc-s2 { animation-name: stamp-drift-down; }
  .fc-s3 { animation-name: stamp-drift-up-soft; }
  .fc-s4 { animation-name: stamp-drift-down; }
  .fc-s5 { animation-name: stamp-drift-up-soft; }
  .fc-s6 { animation-name: stamp-drift-down; }
  .fc-s7 { animation-name: stamp-drift-up; }
  .fc-s8 { animation-name: stamp-drift-down-soft; }
  .fc-s9 { animation-name: stamp-drift-up; }
  .fc-s10 { animation-name: stamp-drift-down-soft; }
}

@keyframes stamp-drift-up {
  from { transform: rotate(var(--rot)) translateY(40px); }
  to   { transform: rotate(var(--rot)) translateY(-40px); }
}
@keyframes stamp-drift-up-soft {
  from { transform: rotate(var(--rot)) translateY(20px); }
  to   { transform: rotate(var(--rot)) translateY(-20px); }
}
@keyframes stamp-drift-down {
  from { transform: rotate(var(--rot)) translateY(-30px); }
  to   { transform: rotate(var(--rot)) translateY(30px); }
}
@keyframes stamp-drift-down-soft {
  from { transform: rotate(var(--rot)) translateY(-15px); }
  to   { transform: rotate(var(--rot)) translateY(15px); }
}

@media (prefers-reduced-motion: reduce) {
  .fervor-collage-stamp { animation: none !important; transform: rotate(var(--rot)) !important; }
}

/* SOBRE MÍ ESPACIAL */
.about {
  flex: 1;
  padding-bottom: var(--gap);
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 60px;
  align-items: start;
  padding-top: 8px;
}

.about-main {
  display: flex;
  flex-direction: column;
  gap: 36px;
  min-width: 0;
}

.about-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.about-aside {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.about-image-small {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

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

.about-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about-meta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-soft);
}

.about-meta-value {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text);
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 100%;
}

.about-text p {
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: 0.005em;
  color: var(--text);
}

.about-text p strong { font-weight: 700; color: var(--text); }

/* CONTACTO */
.contact {
  flex: 1;
  padding-bottom: var(--gap);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 80px;
  align-items: start;
  padding-top: 8px;
}

.contact-headline {
  font-size: clamp(48px, 7vw, 104px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.005em;
  color: var(--text);
  margin-top: 0;
}

.contact-headline em {
  font-style: normal;
  color: var(--accent);
}

.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 100%;
}

.contact-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-soft);
}

.contact-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  overflow-wrap: normal;
  word-break: normal;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
  display: inline-block;
}

.contact-value--mail {
  font-size: clamp(13px, 2.3vw, 22px);
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
}

.contact-value:hover { transform: translateX(4px); color: var(--accent); }

.contact-links { display: flex; flex-direction: column; gap: 10px; }

.contact-links a {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  width: fit-content;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
  display: inline-block;
}

.contact-links a:hover { transform: translateX(4px); color: var(--accent); }

/* PÁGINAS DE PROYECTO */
.project-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-bottom: var(--gap);
  width: 100%;
}

.back-link {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  display: inline-block;
  width: fit-content;
  margin-top: 8px;
  padding: 8px 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.back-link:hover { transform: translateX(-6px); color: var(--accent); }

.project-hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 880px;
}

.detail-title {
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
}

.detail-title .project-tag { font-size: 18px; font-weight: 400; }

.detail-intro {
  font-size: 22px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--text);
  max-width: 75ch;
}

.detail-intro strong { font-weight: 700; }

.detail-meta {
  display: flex;
  gap: 32px;
}

.meta-item { display: flex; flex-direction: column; gap: 8px; }

.meta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-soft);
}

.meta-value { font-size: 15px; line-height: 1.4; color: var(--text); }

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 880px;
}

.detail-body p { font-size: 20px; line-height: 1.45; color: var(--text); }
.detail-body strong { font-weight: 700; }

.detail-gallery { display: flex; flex-direction: column; gap: 32px; }

.gallery-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-soft);
  text-transform: uppercase;
}

.gallery-feature { width: 100%; overflow: hidden; position: relative; }
.gallery-feature img { width: 100%; height: auto; display: block; }

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

/* GALERÍA MASONRY: 2 columnas alternadas con parallax sutil y scale al entrar */
.gallery-linear {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 40px;
  width: 100%;
  align-items: start;
}

/* Alternancia: items impares más abajo (efecto masonry) */
.gallery-linear > .gallery-linear-item:nth-child(odd) {
  margin-top: 60px;
}

.gallery-linear-item,
.gallery-linear-item.reveal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  /* Estado inicial sutil para entrada con scale + fade (fallback) */
  opacity: 0;
  transform: scale(0.94) translateY(20px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.gallery-linear-item.reveal-in,
.gallery-linear-item.reveal.reveal-in {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.gallery-linear-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

.gallery-linear-caption {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  text-transform: uppercase;
}

/* Placeholders (sin imagen aún) en galería masonry */
.gallery-linear-item .gallery-feature.image-empty {
  border: 1px dashed var(--border);
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-linear-item .gallery-feature.image-empty .image-fallback { display: block; }

/* Variante que mantiene el PNG con su fondo original (no recorta) */
.gallery-linear-item.keep-bg img {
  background: transparent;
  object-fit: contain;
}

/* Scroll-driven animation moderna (browsers que la soportan) */
@supports (animation-timeline: view()) {
  .gallery-linear-item,
  .gallery-linear-item.reveal {
    animation: gallery-enter linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 35%;
    opacity: 1;
    transform: none;
    transition: none;
  }

  @keyframes gallery-enter {
    from {
      opacity: 0;
      transform: scale(0.92) translateY(40px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  /* Parallax sutil: items pares e impares se desplazan en sentidos opuestos durante el scroll */
  .gallery-linear > .gallery-linear-item:nth-child(even) {
    animation: gallery-enter linear both, parallax-even linear both;
    animation-timeline: view(), view();
    animation-range: entry 0% cover 35%, cover 0% exit 100%;
  }

  .gallery-linear > .gallery-linear-item:nth-child(odd) {
    animation: gallery-enter linear both, parallax-odd linear both;
    animation-timeline: view(), view();
    animation-range: entry 0% cover 35%, cover 0% exit 100%;
  }

  @keyframes parallax-even {
    from { translate: 0 0; }
    to { translate: 0 -36px; }
  }

  @keyframes parallax-odd {
    from { translate: 0 0; }
    to { translate: 0 18px; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-linear-item,
  .gallery-linear-item.reveal,
  .gallery-linear > .gallery-linear-item:nth-child(even),
  .gallery-linear > .gallery-linear-item:nth-child(odd) {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    translate: 0 0 !important;
    transition: none !important;
  }
}

.gallery-item {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.gallery-item:hover img { transform: scale(1.04); }
.gallery-item.image-empty { border: 1px dashed var(--border); }
.gallery-item.image-empty .image-fallback { display: block; }

.gallery-empty-note {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  font-style: italic;
}

/* Sub-secciones (para VARIOS) */
.detail-subsection {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.detail-subsection:first-child { border-top: none; padding-top: 0; }

.subsection-header {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
}

.subsection-title {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--text);
}

.subsection-tag { font-size: 14px; color: var(--text-soft); }

.subsection-desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  max-width: 60ch;
}

.subsection-desc strong { font-weight: 700; }

/* COLORAMA destacado */
.colorama-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 40px 0;
}

.colorama-feature .gallery-feature { aspect-ratio: 1 / 1; }

.colorama-feature .gallery-feature.image-empty {
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.colorama-feature .gallery-feature.image-empty::after {
  content: 'Imagen Álbum COLORAMA';
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-soft);
}

.next-project {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 60px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.next-project:hover { transform: translateX(8px); }

.next-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-soft);
}

.next-title {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--text);
  transition: color 0.3s ease;
}

.next-project:hover .next-title { color: var(--accent); }

.back-link-bottom {
  margin-top: 40px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text);
  display: inline-block;
  width: fit-content;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.back-link-bottom:hover { transform: translateX(-6px); color: var(--accent); }

/* 404 */
.not-found {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 0;
  gap: 32px;
}

.not-found-code {
  font-size: 180px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.not-found-msg {
  font-size: 18px;
  color: var(--text);
  max-width: 32ch;
  line-height: 1.5;
}

.not-found-back {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text);
  padding: 12px 24px;
  border: 1.5px solid var(--text);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.not-found-back:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* FOOTER naranja */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-top: auto;
}

.foot-right { display: flex; gap: 24px; }

.foot-right a {
  position: relative;
  transition: opacity 0.3s ease;
}

.foot-right a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.foot-right a:hover::after { transform: scaleX(1); }

/* CURSOR */
@media (hover: hover) {
  body { cursor: none; }
  a, button, input, textarea, .nav-link, .nav-toggle { cursor: none; }
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
}

.cursor-inner, .cursor-outer {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}

.cursor-inner {
  width: 8px;
  height: 8px;
  background: var(--accent);
  margin: -4px 0 0 -4px;
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease;
}

.cursor-outer {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--text);
  margin: -18px 0 0 -18px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease,
              background 0.3s ease;
}

.cursor.cursor-hover .cursor-inner { width: 0; height: 0; margin: 0; }

.cursor.cursor-hover .cursor-outer {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-color: var(--accent);
  background: rgba(255, 85, 0, 0.08);
}

.cursor.cursor-click .cursor-outer { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.cursor.cursor-hidden { opacity: 0; }

@media (hover: none) {
  .cursor { display: none; }
  body { cursor: auto; }
}

/* REVEALS */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-in { opacity: 1; transform: translateY(0); }

.project.reveal .project-image,
.project.reveal .fervor-collage { transition-delay: 0.15s; }

.site-header.reveal { transform: translateY(-12px); }

/* LOADER */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8vw;
  transition: opacity 0.7s cubic-bezier(0.65, 0, 0.35, 1),
              transform 0.9s cubic-bezier(0.65, 0, 0.35, 1),
              visibility 0.9s ease;
  will-change: transform, opacity;
}

.loader-logo {
  width: 100%;
  max-width: 720px;
  height: auto;
  opacity: 1;
}

/* Animación stretch: cada letra entra achatada (scaleY 0) y se estira hasta su altura */
.loader-logo .logo-letter {
  transform: scaleY(0.04);
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: letter-stretch 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

@keyframes letter-stretch {
  0% {
    transform: scaleY(0.04);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* Stagger: cada letra arranca un poco después que la anterior */
.loader-logo .logo-letter-0 { animation-delay: 0.05s; }
.loader-logo .logo-letter-1 { animation-delay: 0.12s; }
.loader-logo .logo-letter-2 { animation-delay: 0.19s; }
.loader-logo .logo-letter-3 { animation-delay: 0.26s; }
.loader-logo .logo-letter-4 { animation-delay: 0.33s; }
.loader-logo .logo-letter-5 { animation-delay: 0.40s; }
.loader-logo .logo-letter-6 { animation-delay: 0.47s; }
.loader-logo .logo-letter-7 { animation-delay: 0.54s; }
.loader-logo .logo-letter-8 { animation-delay: 0.61s; }
.loader-logo .logo-letter-9 { animation-delay: 0.68s; }
.loader-logo .logo-letter-10 { animation-delay: 0.75s; }
.loader-logo .logo-letter-11 { animation-delay: 0.82s; }

@keyframes loader-logo-in {
  to { opacity: 1; transform: translateY(0); }
}

.loader.loader-out {
  opacity: 0;
  transform: translateY(-24px);
  visibility: hidden;
  pointer-events: none;
}

body.loading { overflow: hidden; }

/* LIGHTBOX */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
}

.lightbox.lightbox-open { opacity: 1; visibility: visible; }

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transform: scale(0.96);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.lightbox-open .lightbox-img { transform: scale(1); }

.lightbox-close {
  position: absolute;
  top: 28px;
  right: 32px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0.08em;
  cursor: none;
  padding: 8px 12px;
  text-transform: uppercase;
  font-weight: 700;
  transition: opacity 0.3s ease;
}

.lightbox-close:hover { opacity: 0.6; }

@media (hover: none) {
  .lightbox-close, .project-image { cursor: pointer; }
}

::selection { background: var(--accent); color: #ffffff; }

/* RESPONSIVE */
@media (max-width: 900px) {
  :root { --pad-x: 28px; --pad-y: 32px; --gap: 64px; }

  .main-nav {
    margin-bottom: 56px;
    flex-wrap: wrap;
    gap: 20px;
  }

  .nav-left { gap: 20px; flex-wrap: wrap; }
  .nav-right { gap: 12px; }

  .project,
  .project.project-image-left {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .project .project-image,
  .project.project-image-left .project-image,
  .project .fervor-collage,
  .project.project-image-left .fervor-collage { order: 2; }

  .project .project-text,
  .project.project-image-left .project-text { order: 1; }

  .project-title { font-size: 40px; }
  .project-image { aspect-ratio: 4 / 3; }

  .about {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .about-aside {
    position: static;
    order: -1;
  }
  .about-image-small { width: 140px; }
  .about-meta-row { grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 14px 0; }

  .detail-meta { gap: 24px; }
  .gallery-grid, .gallery-grid-3 { grid-template-columns: 1fr; }
  .gallery-linear { grid-template-columns: 1fr; gap: 32px; }
  .gallery-linear > .gallery-linear-item:nth-child(odd) { margin-top: 0; }
  .next-title { font-size: 36px; }
  .not-found-code { font-size: 100px; }
  .colorama-feature { grid-template-columns: 1fr; gap: 24px; }
  .subsection-title { font-size: 28px; }

  .contact { grid-template-columns: 1fr; gap: 40px; }
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 32px 24px; }

  .site-footer { font-size: 11px; padding: 20px 0; gap: 12px; flex-wrap: wrap; }
  .foot-center { flex-basis: 100%; text-align: center; order: 3; }
  .foot-left { order: 1; }
  .foot-right { order: 2; gap: 16px; }
}

@media (max-width: 560px) {
  :root { --pad-x: 20px; }

  .nav-link { font-size: 16px; }
  .nav-toggle { font-size: 11px; width: 34px; height: 34px; min-width: 34px; min-height: 34px; padding: 0; }
  .theme-toggle { width: 34px; height: 34px; min-width: 34px; min-height: 34px; }
  .project-title { font-size: 32px; }
  .project-tag { font-size: 14px; }
  .project-desc { font-size: 15px; }
  .contact-value { font-size: 18px; }
  .contact-value--mail { font-size: 16px; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-text p { font-size: 18px; line-height: 1.45; }
  .detail-title { font-size: 36px; }
  .detail-intro { font-size: 17px; }
  .detail-body p { font-size: 16px; }
  .not-found-code { font-size: 80px; }
}

/* DESKTOP GRANDE: textos un poco más grandes */
@media (min-width: 1200px) {
  .project-title { font-size: 68px; }
  .project-tag { font-size: 22px; }
  .project-desc { font-size: 20px; }
  .about-text p { font-size: 28px; }
  .detail-intro { font-size: 24px; }
  .detail-body p { font-size: 21px; }
  .meta-value { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .loader, .loader-logo { animation: none; transition: opacity 0.2s ease; }
  .loader-logo .logo-letter { transform: none !important; opacity: 1 !important; }
}
