:root {
  --bg: #f6f5f2;
  --text: #1c1c1c;
  --muted: #8a8a85;
  --gap: 14px;
  --pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Header ---------- */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px var(--pad);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  z-index: 10;
}
.name {
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.right { display: flex; align-items: center; gap: 28px; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; }
.right a:hover { color: var(--muted); }
.right a.current { border-bottom: 1px solid var(--text); padding-bottom: 2px; }
.right a.current:hover { color: var(--text); }
@media (max-width: 560px) {
  .top { flex-direction: column; gap: 14px; align-items: flex-start; }
  .right { gap: 18px; flex-wrap: wrap; }
}
.langs { display: flex; gap: 10px; }
.langs button {
  background: none; border: 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: var(--muted); padding: 2px 0;
  border-bottom: 1px solid transparent;
}
.langs button:hover { color: var(--text); }
.langs button.active { color: var(--text); border-bottom-color: var(--text); }

/* ---------- Título de página (igual en Work, About y Contact) ---------- */
.page-title {
  padding: clamp(40px, 6vw, 80px) var(--pad) clamp(28px, 4vw, 48px);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-align: center;
}

/* ---------- Gallery ---------- */
/* Las columnas las crea script.js (nº de columnas según el ancho: ver COLUMNS_FOR) */
.gallery {
  padding: 0 var(--pad);
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}
.gallery .col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.gallery figure {
  cursor: zoom-in;
  overflow: hidden;
  background: #e8e6e1;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.gallery figure.visible { opacity: 1; transform: none; }
.gallery img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.9s ease, filter 0.4s ease;
}
.gallery figure:hover img { transform: scale(1.03); }
.gallery figcaption {
  position: absolute;
  width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); /* solo para lectores de pantalla */
}

/* ---------- About ---------- */
.about {
  padding: 0 var(--pad) clamp(40px, 6vw, 80px);
  max-width: 760px;
  margin: 0 auto;
  min-height: 60vh;
}
.about-text p { margin-bottom: 18px; font-size: 1.15rem; font-weight: 200; line-height: 1.8; }

/* ---------- Contact ---------- */
.contact {
  padding: 0 var(--pad) clamp(60px, 8vw, 100px);
  text-align: center;
  min-height: 60vh;
}
.contact p { color: var(--muted); font-size: 1.15rem; font-weight: 200; }
.contact .links {
  margin-top: 22px;
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
  font-size: 1.05rem;
}
.contact .links a { color: var(--text); border-bottom: 1px solid var(--text); padding-bottom: 2px; }
.contact .links a:hover { color: var(--muted); border-color: var(--muted); }

footer {
  padding: 24px var(--pad) 36px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: center;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(246, 245, 242, 0.98);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 50;
  padding: 48px 70px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.lightbox p { margin-top: 16px; font-size: 0.8rem; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.lightbox button {
  position: absolute; background: none; border: 0; cursor: pointer;
  font-size: 2.4rem; font-weight: 200; color: var(--text); line-height: 1; padding: 12px;
}
.lightbox button:hover { color: var(--muted); }
.lb-close { top: 14px; right: 22px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lightbox { padding: 56px 14px; } .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .gallery figure { opacity: 1; transform: none; }
}
