/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

@font-face {
  font-family: 'Bergen Sans';
  src: url('../fonts/35855b0e68d9bbaa0ad1b374c81277ee.woff2') format('woff2'),
       url('../fonts/35855b0e68d9bbaa0ad1b374c81277ee.woff') format('woff'),
       url('../fonts/35855b0e68d9bbaa0ad1b374c81277ee.ttf') format('truetype');
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Bergen Sans';
  src: url('../fonts/21ab927d4de6da77fad25d8eedca3f2d.woff2') format('woff2'),
       url('../fonts/21ab927d4de6da77fad25d8eedca3f2d.woff') format('woff'),
       url('../fonts/21ab927d4de6da77fad25d8eedca3f2d.ttf') format('truetype');
  font-weight: 400; font-style: italic; font-display: swap;
}

/* ── Mobile menu — full screen overlay ── */
.mobile-menu {
  display: flex; flex-direction: column;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20,24,32,.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 100px 2.5rem 3rem;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-12px);
  transition: opacity .12s ease, visibility .12s ease, transform .22s ease;
}
.mobile-menu.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0);
}
.mobile-menu-logo {
  height: 130px; width: auto; max-width: 360px; object-fit: contain;
  align-self: flex-start; margin-bottom: 2rem;
  opacity: 0; transform: translateY(12px);
  transition: opacity .3s ease .04s, transform .3s ease .04s;
  filter: drop-shadow(0 0px 8px rgba(255,255,255,.35));
}
.mobile-menu.open .mobile-menu-logo { opacity: 1; transform: translateY(0); }
.mobile-menu a {
  font-size: clamp(1.15rem, 4vw, 1.5rem);
  opacity: 0; transform: translateY(16px);
  transition: opacity .3s ease, transform .3s ease, color .2s;
}
.mobile-menu-footer a {
  font-size: 1.10rem !important;
  opacity: 1; transform: none;
}
/* logo es el 1er hijo, los links son del 2 al 5 */
.mobile-menu.open a:nth-child(2) { opacity:1; transform:translateY(0); transition-delay:.10s; }
.mobile-menu.open a:nth-child(3) { opacity:1; transform:translateY(0); transition-delay:.17s; }
.mobile-menu.open a:nth-child(4) { opacity:1; transform:translateY(0); transition-delay:.24s; }
.mobile-menu.open a:nth-child(5) { opacity:1; transform:translateY(0); transition-delay:.31s; }
.mobile-menu-footer {
  margin-top: auto;
  opacity: 0; transform: translateY(10px);
  transition: opacity .3s ease .35s, transform .3s ease .35s;
}
.mobile-menu.open .mobile-menu-footer { opacity: 1; transform: translateY(0); }

/* ── Hamburger bars ── */
.hamburger { position: relative; z-index: 1001; }
.hamburger span { display: block; width: 24px; height: 1.5px; background: #e8edf3; margin: 5px 0; transition: all .32s cubic-bezier(.4,0,.2,1); transform-origin: center; }
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Logo swap ── */
.nav-logo-dark  { opacity: 0; pointer-events: none; }
.nav-logo-white { opacity: 1; filter: drop-shadow(0 0px 10px rgba(255,255,255,.9)) drop-shadow(0 0px 22px rgba(255,255,255,.55)); }
#navbar.scrolled .nav-logo-dark  { opacity: 1; pointer-events: auto; }
#navbar.scrolled .nav-logo-white { opacity: 0; }

/* ── Navbar con menú abierto — quita el fondo blanco ── */
#navbar.menu-open {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  transition: none !important;
}

/* ── Navbar scrolled state ── */
#navbar.scrolled {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(43,48,58,.10), 0 4px 24px rgba(43,48,58,.06);
}
#navbar.scrolled .nav-inner { height: 64px; }
#navbar.scrolled .nav-logo  { height: 42px; }
#navbar.scrolled .nav-links a { color: rgba(43,48,58,.7); }
#navbar.scrolled .nav-links a:hover,
#navbar.scrolled .nav-links a.active { color: #2b303a; }

/* ── Nav underline ── */
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 1px; background: #6c94bf; transform: scaleX(0);
  transform-origin: left; transition: transform .25s;
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* ── Hero slider ── */
.hero-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.18);
  animation: heroKenBurns 18s infinite;
  transform-origin: center center;
  filter: brightness(1.15);
}
.hero-slide:nth-child(1) { animation-delay: 0s; }
.hero-slide:nth-child(2) { animation-delay: 6s; }
.hero-slide:nth-child(3) { animation-delay: 12s; }
@keyframes heroKenBurns {
  0%   { opacity: 0; transform: scale(1.18); }
  6%   { opacity: 1; transform: scale(1.15); }
  33%  { opacity: 1; transform: scale(1.0);  }
  39%  { opacity: 0; transform: scale(0.98); }
  100% { opacity: 0; transform: scale(1.18); }
}

/* ── Hero overlays ── */
.hero-overlay-light {
  position: absolute; inset: 0;
  background: rgba(27,30,38,.15);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.45), transparent 92%);
}

/* ── Image frame ── */
.img-frame { position: relative; overflow: hidden; }
.img-frame img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); transition: filter .6s; }
.img-frame:hover img { filter: saturate(1); }
.img-frame::before {
  content: ''; position: absolute; top: 16px; left: 16px; right: -16px; bottom: -16px;
  border: 1px solid rgba(108,148,191,.18); z-index: -1;
}

/* ── Gallery hover + Ken Burns ── */
.gallery-item { overflow: hidden; position: relative; }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.88);
  animation: galleryKB 14s ease-in-out infinite alternate;
}
.gallery-item:nth-child(2) img { animation-delay: -2.5s; }
.gallery-item:nth-child(3) img { animation-delay: -5s; }
.gallery-item:nth-child(4) img { animation-delay: -7.5s; }
.gallery-item:nth-child(5) img { animation-delay: -10s; }
.gallery-item:nth-child(6) img { animation-delay: -12s; }
.gallery-item:hover img { filter: saturate(1); }
@keyframes galleryKB {
  0%   { transform: scale(1.00) translate(0, 0); }
  33%  { transform: scale(1.06) translate(-1.2%, 0.6%); }
  66%  { transform: scale(1.04) translate(1%, -0.8%); }
  100% { transform: scale(1.00) translate(0, 0); }
}

/* ── Gallery grid ── */
.gallery-grid {
  display: grid; gap: 4px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 300px 300px;
}
@media (max-width: 1024px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 220px 220px 220px; }
}
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: 1fr; grid-template-rows: repeat(6, 220px); }
}

/* ── Scroll reveal ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .75s ease, transform .75s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: .12s; }
.reveal-d2 { transition-delay: .24s; }
.reveal-d3 { transition-delay: .36s; }
.reveal-d4 { transition-delay: .48s; }

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,12,16,.92);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .3s ease, visibility .3s ease;
  padding: 2rem;
}
.lightbox.open {
  opacity: 1; visibility: visible; pointer-events: auto;
}
.lightbox img {
  max-width: 90vw; max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 32px 80px rgba(0,0,0,.5);
  transform: scale(.94);
  transition: transform .35s cubic-bezier(.22,.68,0,1.2), opacity .15s ease;
}
.lightbox.open img { transform: scale(1); }
.lightbox-close {
  position: absolute; top: 1.5rem; right: 2rem;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.7); font-size: 2.4rem; line-height: 1;
  transition: color .2s;
}
.lightbox-close:hover { color: #fff; }
.lightbox-prev, .lightbox-next {
  position: fixed; top: 38%; transform: translateY(-50%);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.85); font-size: 2.8rem; line-height: 1;
  width: 52px; height: 52px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s; z-index: 2;
}
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }
.lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255,255,255,.18); color: #fff;
}
.lightbox-counter {
  position: absolute; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
  font-family: monospace; font-size: .75rem; letter-spacing: .14em;
  color: rgba(255,255,255,.45);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .hero-slide { animation: none; opacity: 0; transform: none; }
  .hero-slide:first-child { opacity: 1; }
}
