/* =========================================================
   Milena Saavedra — Portafolio
   Paleta y tipografía centralizadas en :root (fácil de ajustar)
   ========================================================= */
:root {
  --bg:        #0d0d0f;   /* fondo casi negro */
  --bg-soft:   #141416;   /* fondo de secciones alternas */
  --fg:        #ece9e4;   /* texto principal (blanco cálido) */
  --fg-dim:    #9a958c;   /* texto secundario */
  --line:      #26262a;   /* líneas / bordes */
  --accent:    #c8a27a;   /* acento cálido (terracota suave) */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --maxw: 1280px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

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

/* ======================= NAVEGACIÓN ======================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px clamp(20px, 5vw, 60px);
  transition: background .4s var(--ease), padding .4s var(--ease), border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(13,13,15,.82);
  backdrop-filter: blur(14px);
  padding-top: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  font-family: var(--serif);
  font-size: 1.35rem; letter-spacing: .04em;
  color: var(--fg); text-decoration: none; white-space: nowrap;
}
.nav__links { display: flex; gap: 34px; }
.nav__links a {
  color: var(--fg); text-decoration: none;
  font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
  position: relative; padding: 4px 0; opacity: .85;
  transition: opacity .3s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px;
  width: 0; background: var(--accent); transition: width .35s var(--ease);
}
.nav__links a:hover { opacity: 1; }
.nav__links a:hover::after { width: 100%; }
.nav__toggle {
  display: none; background: none; border: none; color: var(--fg);
  font-size: 1.4rem; cursor: pointer;
}
.lang-toggle {
  background: none; border: 1px solid var(--line); color: var(--fg);
  font-family: var(--sans); font-size: .72rem; letter-spacing: .12em;
  padding: 6px 12px; border-radius: 40px; cursor: pointer; opacity: .9;
  transition: border-color .3s, opacity .3s;
}
.lang-toggle:hover { border-color: var(--fg-dim); opacity: 1; }
.lang-toggle strong { font-weight: 600; color: var(--accent); }

/* Filtro dentro del menú desplegable: oculto en escritorio, visible en el menú móvil */
.nav__filters { display: none; }

/* ======================= HERO ======================= */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }

/* Capa base: la foto cubriendo toda la portada (así se ve en móvil) */
.hero__media {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center 28%;
  transform: scale(1.05);
  animation: heroZoom 14s var(--ease) forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }

/* Capa nítida con la foto COMPLETA (se activa solo en pantallas anchas) */
.hero__photo {
  position: absolute; inset: 0; z-index: 1; display: none;
  background-size: contain; background-position: center; background-repeat: no-repeat;
}

.hero__scrim {
  position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(to top, rgba(13,13,15,.92) 0%, rgba(13,13,15,.15) 45%, rgba(13,13,15,.35) 100%);
}
.hero__content {
  position: absolute; z-index: 3;
  left: clamp(20px, 5vw, 60px); bottom: clamp(60px, 12vh, 130px);
  right: clamp(20px, 5vw, 60px);
  animation: rise 1.2s var(--ease) both .3s;
}

/* PC / tablet: la foto de base se difumina como fondo y encima se ve la foto entera.
   La foto se ancla arriba y el nombre va en una franja inferior limpia (no sobre el rostro). */
@media (min-width: 761px) {
  .hero__media { animation: none; transform: scale(1.2); filter: blur(34px) brightness(.5); }
  .hero__photo {
    display: block; animation: heroZoom 14s var(--ease) forwards;
    background-size: auto 88%;
    background-position: center 0%;
  }
  .hero .hero__content { bottom: clamp(26px, 4.4vh, 46px); }
  .hero .hero__role { margin-bottom: 12px; }
  .hero .hero__name { font-size: clamp(3.2rem, 7vw, 6.2rem); }
  .hero .hero__tagline { font-size: clamp(1.02rem, 1.6vw, 1.4rem); margin-top: 12px; }
}
/* Refuerzo de oscuridad abajo para que el nombre grande se lea sobre la foto */
@media (min-width: 761px) {
  .hero__scrim {
    background:
      linear-gradient(to top, rgba(13,13,15,.95) 0%, rgba(13,13,15,.55) 22%, rgba(13,13,15,0) 46%, rgba(13,13,15,.28) 100%);
  }
}
.hero__role {
  font-size: .8rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.hero__name {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(3rem, 11vw, 8.5rem); line-height: .95; letter-spacing: -.01em;
}
.hero__tagline {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.1rem, 2.6vw, 1.7rem); color: var(--fg-dim);
  margin-top: 18px; max-width: 30ch;
}
.hero__scroll {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1px solid rgba(236,233,228,.5); border-radius: 14px;
}
.hero__scroll span {
  position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; border-radius: 2px;
  background: var(--fg); transform: translateX(-50%);
  animation: scrollDot 1.8s infinite;
}
@keyframes scrollDot { 0%{opacity:0;top:8px} 40%{opacity:1} 80%{opacity:0;top:22px} 100%{opacity:0} }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* ======================= ENCABEZADOS DE SECCIÓN ======================= */
.section-head { text-align: center; margin-bottom: 46px; }
.section-head__kicker {
  display: block; font-size: .78rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.section-head__title {
  font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -.01em;
}

/* ======================= TRABAJO / GALERÍA ======================= */
.work { max-width: var(--maxw); margin: 0 auto; padding: clamp(80px, 12vh, 140px) clamp(20px, 5vw, 60px); }

.filters {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 46px;
}
.filter {
  background: none; border: 1px solid var(--line); color: var(--fg-dim);
  font-family: var(--sans); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 9px 20px; border-radius: 40px; cursor: pointer;
  transition: all .3s var(--ease);
}
.filter:hover { color: var(--fg); border-color: var(--fg-dim); }
.filter.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* Galería tipo mosaico vertical (columnas que se reordenan) */
.gallery { columns: 3; column-gap: 18px; }
.card {
  break-inside: avoid; margin-bottom: 18px; position: relative;
  cursor: pointer; overflow: hidden; background: var(--bg-soft);
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.card.in { opacity: 1; transform: none; }
.card img { width: 100%; transition: transform .8s var(--ease), filter .5s; }
.card:hover img { transform: scale(1.04); filter: brightness(.9); }
.card__meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 20px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  opacity: 0; transform: translateY(8px); transition: all .45s var(--ease);
  background: linear-gradient(to top, rgba(13,13,15,.7), transparent);
}
.card:hover .card__meta { opacity: 1; transform: none; }
.card__title { font-family: var(--serif); font-style: italic; font-size: 1.25rem; }
.card__cat { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }

/* ======================= EXPOSICIONES ======================= */
.gallery.exhibitions { columns: initial; column-gap: 0; display: block; max-width: 860px; margin: 0 auto; }
.exh {
  display: grid; grid-template-columns: 150px 1fr; gap: 32px; align-items: start;
  padding: 32px 0; border-bottom: 1px solid var(--line);
}
.exh:first-child { border-top: 1px solid var(--line); }

/* La imagen emerge del fondo: enfoque suave + escala al entrar en pantalla */
.exh__img { overflow: hidden; }
.exh__img img {
  width: 150px; height: 185px; object-fit: cover; background: var(--bg-soft);
  opacity: 0; transform: scale(1.12); filter: blur(9px);
  transition: opacity 1.1s var(--ease), transform 1.4s var(--ease), filter 1.1s var(--ease);
}
.exh.in .exh__img img { opacity: 1; transform: scale(1); filter: blur(0); }

/* El texto entra deslizándose de izquierda a derecha, escalonado */
.exh__body > * {
  opacity: 0; transform: translateX(-38px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
}
.exh.in .exh__body > * { opacity: 1; transform: none; }
.exh.in .exh__body > *:nth-child(2) { transition-delay: .12s; }
.exh.in .exh__body > *:nth-child(3) { transition-delay: .24s; }
.exh.in .exh__body > *:nth-child(4) { transition-delay: .36s; }
.exh__title { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.1; margin-bottom: 10px; }
.exh__meta { color: var(--fg-dim); letter-spacing: .03em; font-size: 1rem; }
.exh__award {
  color: var(--accent); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  margin-top: 12px;
}
.exh__info { color: var(--fg-dim); font-size: .92rem; margin-top: 12px; max-width: 52ch; font-style: italic; }
@media (max-width: 560px) {
  .exh { grid-template-columns: 96px 1fr; gap: 18px; padding: 24px 0; }
  .exh__img img { width: 96px; height: 120px; }
  .exh__title { font-size: 1.35rem; }
}

/* ======================= SOBRE MÍ ======================= */
.about {
  background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 90px); align-items: center;
  padding: clamp(70px, 11vh, 140px) clamp(20px, 5vw, 60px);
  max-width: var(--maxw); margin: 0 auto;
}
.about__image { position: relative; }
.about__image img { width: 100%; object-fit: cover; filter: grayscale(.15) contrast(1.02); }
.about__image::after {
  content: ""; position: absolute; inset: 0; border: 1px solid var(--line);
  transform: translate(16px, 16px); pointer-events: none;
}
.about__text h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 4vw, 3rem);
  margin-bottom: 24px; line-height: 1.05;
}
.about__text p { color: var(--fg-dim); margin-bottom: 18px; max-width: 46ch; font-size: 1.02rem; }
.about__text strong { color: var(--fg); font-weight: 400; }
.about__creds {
  list-style: none; margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px;
}
.about__creds li {
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg);
  border: 1px solid var(--line); padding: 8px 16px; border-radius: 40px;
}

/* ======================= CONTACTO ======================= */
.contact {
  text-align: center; padding: clamp(90px, 15vh, 180px) clamp(20px, 5vw, 60px);
  max-width: 760px; margin: 0 auto;
}
.contact__title {
  font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1; margin-bottom: 22px;
}
.contact__lead { color: var(--fg-dim); font-size: 1.1rem; margin-bottom: 42px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.contact__btn {
  font-family: var(--sans); font-size: .85rem; letter-spacing: .1em;
  text-decoration: none; color: var(--bg); background: var(--fg);
  padding: 16px 32px; border-radius: 40px; transition: all .3s var(--ease);
  border: 1px solid var(--fg);
}
.contact__btn:hover { background: var(--accent); border-color: var(--accent); color: #1a1207; }
.contact__btn--ghost { background: none; color: var(--fg); border-color: var(--line); }
.contact__btn--ghost:hover { background: none; border-color: var(--fg); color: var(--fg); }

/* ======================= PIE ======================= */
.footer {
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  padding: 40px clamp(20px, 5vw, 60px);
  max-width: var(--maxw); margin: 0 auto;
}
.footer__brand { font-family: var(--serif); font-size: 1.3rem; }
.footer__links { display: flex; gap: 26px; }
.footer__links a {
  color: var(--fg-dim); text-decoration: none; font-size: .82rem;
  letter-spacing: .1em; text-transform: uppercase; transition: color .3s;
}
.footer__links a:hover { color: var(--fg); }
.footer__meta { color: var(--fg-dim); font-size: .78rem; width: 100%; padding-top: 14px; border-top: 1px solid var(--line); }

/* ======================= LIGHTBOX ======================= */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: rgba(8,8,10,.96); backdrop-filter: blur(6px);
  padding: 4vh 2vw;
}
.lightbox.open { display: flex; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox__figure { max-width: min(92vw, 900px); max-height: 92vh; text-align: center; }
.lightbox__figure img {
  max-width: 100%; max-height: 84vh; margin: 0 auto; object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.lightbox__figure figcaption {
  margin-top: 18px; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--fg);
}
.lightbox__close {
  position: absolute; top: 22px; right: 26px; background: none; border: none;
  color: var(--fg); font-size: 1.6rem; cursor: pointer; opacity: .8; transition: opacity .3s;
}
.lightbox__close:hover { opacity: 1; }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--fg); font-size: 3rem; cursor: pointer;
  opacity: .55; transition: opacity .3s; padding: 20px; line-height: 1;
}
.lightbox__nav:hover { opacity: 1; }
.lightbox__nav--prev { left: 1vw; }
.lightbox__nav--next { right: 1vw; }

/* ======================= RESPONSIVE ======================= */
/* Escritorio grande: galería más ancha y con 3 columnas amplias */
@media (min-width: 1500px) {
  :root { --maxw: 1440px; }
}

/* Laptop / escritorio pequeño (por defecto son 3 columnas) */
@media (max-width: 1100px) {
  .gallery { columns: 3; column-gap: 16px; }
}

/* Tablet: 2 columnas, "Sobre mí" en una sola columna */
@media (max-width: 1000px) {
  .gallery { columns: 2; }
  .about {
    grid-template-columns: 1fr; gap: 40px;
    text-align: center; justify-items: center;
  }
  .about__image { max-width: 460px; }
  .about__text p { margin-left: auto; margin-right: auto; }
  .about__creds { justify-content: center; }
}

/* Tablet en vertical / móvil grande: menú hamburguesa */
@media (max-width: 760px) {
  .nav { padding: 20px 22px; }
  .nav.scrolled { padding: 14px 22px; }
  .nav__links {
    position: fixed; inset: 0 0 0 auto; width: 80%; max-width: 350px;
    flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 22px;
    background: rgba(13,13,15,.98); backdrop-filter: blur(16px);
    padding: 92px 44px 44px; transform: translateX(100%);
    transition: transform .4s var(--ease); overflow-y: auto;
  }
  .nav__links.open { transform: none; }
  .nav__links a { font-size: 1.05rem; }
  .lang-toggle { margin-top: 4px; font-size: .8rem; padding: 9px 16px; }
  .nav__toggle { display: block; z-index: 60; }
  /* Filtro por categoría dentro del menú */
  .nav__filters {
    display: flex; flex-wrap: wrap; gap: 8px; width: 100%;
    margin-top: 4px; padding-top: 22px; border-top: 1px solid var(--line);
  }
  .nav__filters .filter { font-size: .72rem; padding: 7px 14px; letter-spacing: .1em; }
  .gallery { columns: 2; column-gap: 12px; }
  .card { margin-bottom: 12px; }
}
/* Dispositivos sin hover (táctiles): título visible por defecto */
@media (hover: none) {
  .card__meta { opacity: 1; transform: none; }
  .card:hover img { transform: none; filter: none; }
}

/* Teléfono: una sola columna */
@media (max-width: 560px) {
  .gallery { columns: 1; }
  .hero__content { bottom: 90px; }
  .contact__links { flex-direction: column; }
  .contact__btn { width: 100%; text-align: center; }
  .footer { flex-direction: column; align-items: flex-start; }
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .card, .exh__img img, .exh__body > * { opacity: 1 !important; transform: none !important; filter: none !important; }
}
