/* ============================================================
   NORDVEGR static export — presentation & interaction layer
   (site.css carries the full compiled design system; this file
   adds the vanilla-JS equivalents of the React behaviours)
   ============================================================ */

:root {
  color-scheme: dark;
}

/* ---------- Reveal-on-scroll (progressive enhancement) ----------
   Without JS everything stays visible. With JS, <html> gets
   .anim-ready and [data-reveal] elements start hidden + slide in
   when the IntersectionObserver marks them .is-in. */
.anim-ready [data-reveal] {
  opacity: 0;
  transform: translateY(var(--rv-y, 28px));
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--rv-d, 0ms);
  will-change: opacity, transform;
}
.anim-ready [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .anim-ready [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Navbar scrolled state (mirrors glass/border/py swap) ---------- */
header.site-scrolled {
  background: rgba(5, 19, 35, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  box-shadow: 0 10px 40px -15px rgba(0, 0, 0, 0.7);
}

/* ---------- Mobile menu (vanilla equivalent of the Radix Sheet) ---------- */
.mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(3, 13, 26, 0.6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.mobile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(320px, 86vw);
  background: rgba(6, 24, 43, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  transform: translateX(105%);
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
}
.mobile-panel.open {
  transform: translateX(0);
}
body.menu-open {
  overflow: hidden;
}
@media (min-width: 1024px) {
  .mobile-backdrop,
  .mobile-panel {
    display: none;
  }
}

/* ---------- Native select polish (replaces Radix combobox) ---------- */
select[id="journeyStyle"],
select[id="travellers"],
select[id="travelMonth"] {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c9d8e8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
select[id="journeyStyle"] option,
select[id="travellers"] option,
select[id="travelMonth"] option {
  background: #06182b;
  color: #e6eef7;
}

/* ---------- Form validation + success ---------- */
.field-error {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--destructive);
  padding-top: 0.5rem;
}
input.invalid,
select.invalid {
  border-color: var(--destructive);
}
#form-success {
  animation: success-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#form-success.showing {
  display: flex;
}
@keyframes success-pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- Count-up stat spans ---------- */
[data-count-to] {
  font-variant-numeric: tabular-nums;
}
