:root {
  /* Paleta de colores inspirada en Dalmacia y el Adriático */
  --ink: #122c3d;
  --ink-soft: #304e63;
  --paper: #f2ede2;
  --paper-warm: #ebdcc5;
  --stone: #ded3c1;
  --coral: #bd6952;
  --hairline: rgba(18, 44, 61, 0.08);

  /* Sombras suaves y premium */
  --shadow-sm: 0 2px 8px rgba(18, 44, 61, 0.04);
  --shadow-md: 0 12px 35px rgba(18, 44, 61, 0.08);
  --shadow-lg: 0 30px 80px rgba(8, 20, 30, 0.6);

  /* Tipografías */
  --serif: 'Newsreader', Georgia, serif;
  --mono: 'DM Mono', monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --maxw: 1600px;
}

/* Reseteo y Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 4px;
}

/* Nav */
.nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  z-index: 10;
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.nav a {
  color: #fff;
  text-decoration: none;
  transition: opacity 0.3s;
}

.nav a:hover {
  opacity: 0.7;
}

.nav__brand span {
  opacity: 0.5;
  margin: 0 0.5rem;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 2rem;
  overflow: hidden;
  isolation: isolate;
}

.hero__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url('../images/full/13.jpg');
  background-size: cover;
  background-position: center 60%;
  transform: scale(1.06);
  animation: heroZoom 20s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(18, 44, 61, 0.4) 0%,
    rgba(18, 44, 61, 0.25) 45%,
    rgba(18, 44, 61, 0.8) 100%
  );
}

.hero__veil::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(18, 44, 61, 0.5) 100%);
}

@keyframes heroZoom {
  to {
    transform: scale(1);
  }
}

.hero__copy {
  max-width: 800px;
  animation: fadeUp 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.hero__copy .eyebrow {
  color: var(--stone);
  opacity: 0.9;
  letter-spacing: 0.4em;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(4.5rem, 16vw, 12rem);
  font-weight: 400;
  line-height: 0.85;
  letter-spacing: -0.01em;
  text-shadow: 0 4px 30px rgba(18, 44, 61, 0.25);
  margin-bottom: 2rem;
}

.hero__place {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  color: var(--paper);
  opacity: 0.95;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.hero__place i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
}

/* Scroll button */
.scroll {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.scroll:hover {
  opacity: 1;
}

.scroll b {
  position: relative;
  width: 20px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  display: inline-block;
}

.scroll b::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 2px;
  height: 6px;
  background: #fff;
  border-radius: 1px;
  transform: translateX(-50%);
  animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollDot {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) translateY(8px);
    opacity: 0.2;
  }
}

/* Story Section */
.story {
  position: relative;
  padding: clamp(6rem, 15vw, 11rem) 1.5rem;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  overflow: hidden;
}

.story__mark {
  position: absolute;
  top: 1rem;
  font-family: var(--serif);
  font-size: clamp(15rem, 35vw, 28rem);
  font-weight: 500;
  color: var(--stone);
  opacity: 0.15;
  user-select: none;
  pointer-events: none;
  line-height: 1;
  z-index: 0;
}

.story__intro {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 3.5rem;
}

.story__intro h2 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
}

.story__body {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  line-height: 1.85;
  color: var(--ink-soft);
  text-align: justify;
  text-align-last: center;
  margin-bottom: 4rem;
}

.story__body p {
  margin-bottom: 2rem;
}

.story__body p:last-child {
  margin-bottom: 0;
}

/* Facts List */
.facts {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: clamp(2rem, 8vw, 6rem);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 2rem 1rem;
  width: 100%;
}

.facts div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.facts dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--coral);
  margin-bottom: 0.5rem;
}

.facts dd {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink);
}

/* Gallery Section */
.gallery-section {
  padding: 4rem 0 8rem;
  background: var(--paper);
  border-top: 1px solid var(--hairline);
}

.gallery-heading {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
}

.gallery-heading h2 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.gallery-heading h2 em {
  font-style: italic;
}

.gallery-heading p:last-child {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
  opacity: 0.8;
}

/* Masonry Layout */
.gallery {
  column-count: 4;
  column-gap: 1.5rem;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
  max-width: var(--maxw);
  margin: 0 auto;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(30px);
  animation: itemReveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes itemReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-item__button {
  position: relative;
  width: 100%;
  display: block;
  text-align: left;
  overflow: hidden;
  border-radius: 4px;
  background: var(--stone);
  box-shadow: var(--shadow-sm);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item__button img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover effects */
.gallery-item__button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 50%,
    rgba(18, 44, 61, 0.35) 100%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.gallery-item__button:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.gallery-item__button:hover img {
  transform: scale(1.04);
}

.gallery-item__button:hover::before {
  opacity: 1;
}

/* Photo Number */
.gallery-item__number {
  position: absolute;
  bottom: 1rem;
  right: 1.2rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  z-index: 2;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item__button:hover .gallery-item__number {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
footer {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--stone);
  border-top: 1px solid var(--hairline);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
}

footer p {
  margin-bottom: 0.5rem;
}

footer span {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.7;
}

/* Lightbox Premium */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 20, 29, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lb__stage {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 6rem 7rem;
}

.lb__stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: var(--shadow-lg);
  border-radius: 2px;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-user-drag: none;
}

.lb__stage img.loaded {
  opacity: 1;
  transform: scale(1);
}

/* Lightbox Controls */
.lb__close {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.3s;
  z-index: 1002;
  backdrop-filter: blur(4px);
}

.lb__close:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(90deg);
}

.lb__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.3s;
  z-index: 1001;
  backdrop-filter: blur(4px);
}

.lb__nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lb__prev {
  left: 2rem;
}

.lb__next {
  right: 2rem;
}

.lb__prev:hover {
  transform: translateY(-50%) translateX(-4px);
}

.lb__next:hover {
  transform: translateY(-50%) translateX(4px);
}

/* Lightbox Caption */
#lb-caption {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  text-align: center;
  width: 90%;
  max-width: 850px;
  line-height: 1.6;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#lb-caption.loaded {
  opacity: 1;
}

/* Lightbox Counter */
.lb__count {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.5rem 1.4rem;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  backdrop-filter: blur(4px);
  z-index: 1001;
}

/* Responsive Rules */
@media (max-width: 1400px) {
  .gallery {
    column-count: 3;
    padding: 0 3rem;
  }
}

@media (max-width: 992px) {
  .gallery {
    column-count: 2;
    column-gap: 1.2rem;
    padding: 0 2rem;
  }
  .gallery-item {
    margin-bottom: 1.2rem;
  }
  .lb__stage {
    padding: 4rem 4rem 6rem;
  }
  .lb__nav {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  .lb__prev {
    left: 1rem;
  }
  .lb__next {
    right: 1rem;
  }
  .lb__close {
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 576px) {
  .gallery {
    column-count: 1;
    padding: 0 1.25rem;
  }
  .story {
    padding: 5rem 1.25rem;
  }
  .facts {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }
  .lb__stage {
    padding: 3rem 1rem 5rem;
  }
  .lb__nav {
    display: none; /* Ocultar botones de navegación en móviles para favorecer el gesto swipe */
  }
  .lb__close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
  #lb-caption {
    bottom: 4.5rem;
    font-size: 0.95rem;
    width: 88%;
  }
  .lb__count {
    bottom: 1.5rem;
  }
}

/* Accesibilidad y Reducción de Animaciones */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero__image {
    animation: none;
    transform: scale(1);
  }
}
