:root {
  --cols-desktop: 4;
  --cols-mobile: 2;
  --bg: #0d0d0d;
  --bg-soft: #151515;
  --fg: #f2f0ec;
  --fg-muted: #a8a49c;
  --accent: #c9a869;
  --gap: 6px;
  --header-h: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
}

h1, h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0;
}

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

img { max-width: 100%; }

/* Header */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  background: rgba(13, 13, 13, 0.65);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
  font-family: Georgia, serif;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  font-weight: 400;
}
.logo-accent { color: var(--accent); }

.site-nav { display: flex; gap: 32px; }
.site-nav a {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url('https://picsum.photos/seed/elena-hero/1600/1000') center/cover no-repeat;
  filter: brightness(0.45);
}
.hero-content {
  position: relative;
  text-align: center;
  color: var(--fg);
}
.hero-content h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: 0.08em;
}
.hero-content p {
  margin-top: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.scroll-cue {
  display: inline-block;
  margin-top: 48px;
  font-size: 1.5rem;
  color: var(--accent);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* Sections */
main { padding-top: 0; }
.section-heading {
  text-align: center;
  padding: 90px 20px 30px;
}
.section-heading h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}
.section-heading p {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(var(--cols-mobile), 1fr);
  align-items: center;
  gap: var(--gap);
  padding: 0 var(--gap);
  max-width: 1600px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(var(--cols-desktop), 1fr);
    gap: 10px;
    padding: 0 10px;
  }
}

.photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeIn 0.5s ease forwards;
}
@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}
.photo img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s ease;
}
.photo:hover img { transform: scale(1.06); }
.photo figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 12px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--fg);
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
}
.photo:hover figcaption { opacity: 1; transform: translateY(0); }

/* Loader */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 0 80px;
  color: var(--fg-muted);
  font-size: 0.85rem;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader.hidden { visibility: hidden; }

.empty-state {
  text-align: center;
  color: var(--fg-muted);
  padding: 40px 20px 80px;
}
.empty-state.hidden { display: none; }

/* About */
.about-grid {
  max-width: 1000px;
  margin: 0 auto;
  padding: 80px 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
@media (min-width: 768px) {
  .about-grid { grid-template-columns: 0.8fr 1fr; }
}
.about-portrait img {
  width: 100%;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  border-radius: 6px;
}
.about-text h2 { font-size: 1.8rem; margin-bottom: 20px; }
.about-text p { color: var(--fg-muted); margin-bottom: 16px; }

/* Contact */
.contact { padding-bottom: 100px; }
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
  font-size: 1rem;
}
.contact-links a {
  padding: 10px 18px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 30px;
  color: var(--fg);
  transition: border-color 0.2s, color 0.2s;
}
.contact-links a:hover { border-color: var(--accent); color: var(--accent); }

/* Footer */
.site-footer {
  text-align: center;
  padding: 28px;
  color: var(--fg-muted);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 88vw;
  max-height: 92vh;
}
.lightbox-img {
  max-width: 88vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
  cursor: pointer;
}
.lightbox-caption {
  max-width: 60ch;
  text-align: center;
  margin-top: 16px;
  padding: 0 20px;
}
.lightbox-caption.hidden { display: none; }
.lightbox-caption h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  margin: 0 0 6px;
  color: var(--fg);
}
.lightbox-caption p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--fg-muted);
}
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
}
.lightbox-close {
  top: 24px;
  right: 28px;
  font-size: 2rem;
  line-height: 1;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  padding: 10px 16px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

.lightbox-spinner {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.lightbox-spinner.visible { display: flex; }
.lightbox-spinner .spinner { width: 34px; height: 34px; border-width: 3px; }

/* Download widget */
.download-widget {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 1010;
}
.download-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(20,20,20,0.85);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}
.download-btn:hover { border-color: var(--accent); color: var(--accent); }
.download-widget.open .download-btn { transform: scale(0.94); border-color: var(--accent); color: var(--accent); }

.download-menu {
  position: absolute;
  left: 0;
  bottom: 58px;
  min-width: 240px;
  max-width: min(320px, calc(100vw - 40px));
  max-height: 50vh;
  overflow-y: auto;
  background: rgba(18,18,18,0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.download-widget.open .download-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.download-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 6px;
  transition: background 0.15s;
}
.download-item:hover { background: rgba(255,255,255,0.06); }
.download-label {
  font-size: 0.88rem;
  color: var(--fg);
  letter-spacing: 0.02em;
}
.download-meta {
  font-size: 0.72rem;
  color: var(--fg-muted);
}
.download-empty {
  padding: 12px;
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin: 0;
}

/* Mobile nav */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    left: 0;
    background: rgba(13,13,13,0.97);
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .site-nav.open { max-height: 240px; }
  .site-nav a {
    padding: 18px 0;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
}

/* Lightbox en móvil vertical: se navega con swipe, las flechas estorban */
@media (max-width: 767px) and (orientation: portrait) {
  .lightbox-nav { display: none; }
}

/* Lightbox en móvil horizontal: el texto pasa al lado de la foto en vez de debajo */
@media (orientation: landscape) and (max-height: 500px) {
  .lightbox-frame {
    flex-direction: row;
    align-items: center;
    max-width: 92vw;
  }
  .lightbox-img {
    max-width: 55vw;
    max-height: 88vh;
  }
  .lightbox-caption {
    margin-top: 0;
    margin-left: 20px;
    text-align: left;
    max-width: 32ch;
    padding: 0;
  }
}
