:root {
  --cream: #f9f7f2;
  --cream-deep: #f0ebe3;
  --dusty-blue: #748ca3;
  --dusty-blue-deep: #5f778e;
  --beige: #c3a991;
  --beige-soft: #d4c4b0;
  --taupe: #6d5f54;
  --taupe-soft: #8a7b6e;
  --white: #fffcf8;
  --shadow: rgba(109, 95, 84, 0.12);

  --font-display: "Cinzel", serif;
  --font-script: "Great Vibes", cursive;
  --font-body: "Cormorant Garamond", Georgia, serif;

  --radius: 4px;
  --max: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--taupe);
  background: var(--cream);
  position: relative;
}

.bg-texture {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(195, 169, 145, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(116, 140, 163, 0.1), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(195, 169, 145, 0.12), transparent 45%),
    var(--cream);
}

/* —— Hero —— */
.hero {
  text-align: center;
  padding: clamp(2.5rem, 8vw, 4.5rem) 1.5rem 1.5rem;
  animation: fadeUp 0.9s ease both;
}

.hero-ornament {
  color: var(--beige);
  width: 72px;
  margin: 0 auto 1rem;
  opacity: 0.85;
}

.hero-ornament svg {
  width: 100%;
  height: auto;
  display: block;
}

.hero-label {
  font-family: var(--font-display);
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--beige);
  margin-bottom: 0.85rem;
}

.hero-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  line-height: 1.05;
}

.name-joaquim {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 7vw, 3.25rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dusty-blue);
}

.name-miguel {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.75rem, 10vw, 4.5rem);
  color: var(--dusty-blue);
  line-height: 1;
  margin-top: -0.15em;
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.35rem auto;
  max-width: 220px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--beige-soft);
}

.divider-heart {
  font-size: 0.7rem;
  color: var(--dusty-blue);
  line-height: 1;
}

.hero-subtitle {
  font-family: var(--font-script);
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  color: var(--taupe);
  margin-bottom: 0.35rem;
}

.hero-hint {
  font-size: 1rem;
  font-style: italic;
  color: var(--taupe-soft);
}

/* —— Gallery —— */
.gallery-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.25rem 3.5rem;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.btn-download-all {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--dusty-blue);
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}

.btn-download-all:hover {
  background: var(--dusty-blue-deep);
}

.btn-download-all:active {
  transform: scale(0.98);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 0.85rem;
}

@media (min-width: 600px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.1rem;
  }
}

@media (min-width: 900px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
  }
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--cream-deep);
  cursor: pointer;
  border: none;
  padding: 0;
  width: 100%;
  animation: fadeUp 0.6s ease both;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px var(--shadow);
  outline: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.04);
}

.gallery-item-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 0.75rem 0.65rem;
  background: linear-gradient(transparent, rgba(109, 95, 84, 0.45));
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.gallery-item:hover .gallery-item-overlay,
.gallery-item:focus-visible .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-overlay span {
  font-family: var(--font-display);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
}

/* —— Empty / Loading —— */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--taupe-soft);
}

.empty-heart {
  display: block;
  color: var(--dusty-blue);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.empty-state p + p {
  margin-top: 0.5rem;
}

.empty-hint {
  font-size: 0.95rem;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.empty-state code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  color: var(--dusty-blue);
  background: var(--cream-deep);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* —— Footer —— */
.footer {
  text-align: center;
  padding: 0 1.5rem 3rem;
  animation: fadeUp 1s ease 0.2s both;
}

.footer p {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--taupe-soft);
  margin-top: 0.25rem;
}

/* —— Lightbox —— */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(61, 52, 46, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 3rem 4.5rem;
  animation: fadeIn 0.25s ease;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-figure {
  max-width: min(92vw, 900px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: scaleIn 0.3s ease;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.lightbox-caption {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-download {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  background: var(--dusty-blue);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  transition: background 0.25s ease;
}

.btn-download:hover {
  background: var(--dusty-blue-deep);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  color: var(--cream);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  background: transparent;
  color: var(--cream);
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover {
  opacity: 1;
}

.lightbox-prev {
  left: 0.35rem;
}

.lightbox-next {
  right: 0.35rem;
}

@media (max-width: 600px) {
  .lightbox {
    padding: 3.5rem 0.5rem 5rem;
  }

  .lightbox-nav {
    top: auto;
    bottom: 1.25rem;
    transform: none;
    font-size: 2rem;
  }

  .lightbox-prev {
    left: calc(50% - 4rem);
  }

  .lightbox-next {
    right: calc(50% - 4rem);
  }

  .lightbox-caption {
    margin-bottom: 2.5rem;
  }
}

/* —— Animations —— */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
