/* =========================================================
   Zvejniekciems — atmospheric single page
   Palette: deep sea blue, stony grey, sand beige, pine green
   ========================================================= */

:root {
  --sea-deep:   #0b1f2a;
  --sea:        #14313f;
  --stone:      #6b727a;
  --sand:       #d9cdb8;
  --pine:       #2f4733;
  --mist:       #f4f1ea;
  --ink:        #eef2f3;

  --ff-serif: "Cormorant Garamond", Georgia, serif;
  --ff-sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1180px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--ff-sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--sea-deep);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Animated background ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #0a2230 0%, #0b1f2a 55%, #07151d 100%);
}

/* Layering so the motions never fight over `transform`:
   - .backdrop__parallax → eased mouse parallax (JS sets --px/--py)
   - .slide              → cross-fading photos, each with its own Ken-Burns zoom
   Everything is oversized so no motion ever exposes a hard edge. */
.backdrop__parallax {
  position: absolute;
  inset: -3%;
  will-change: transform;
  transform: translate(var(--px, 0px), var(--py, 0px));
}

.slide {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center 42%;
  opacity: 0;
  transition: opacity 2.2s var(--ease);
  will-change: opacity;
  /* Ken-Burns runs continuously (even while hidden) so a slide never
     snaps its zoom when it fades out. Staggered so they don't move in sync. */
  animation: kenburns 26s ease-in-out infinite alternate;
}
.slide:nth-child(2) { animation-delay: -5s; }
.slide:nth-child(3) { animation-delay: -11s; }
.slide:nth-child(4) { animation-delay: -17s; }
.slide:nth-child(5) { animation-delay: -23s; }

.slide.is-active { opacity: 1; }

@keyframes kenburns {
  from { transform: scale(1.05) translate(1%, 0.6%); }
  to   { transform: scale(1.16) translate(-2%, -1.2%); }
}

/* subtle film grain to add the premium, tactile feel */
.backdrop__grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.backdrop__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 35%, transparent 50%, rgba(4, 12, 17, 0.78) 100%),
    linear-gradient(180deg, rgba(7, 21, 29, 0.45) 0%, rgba(7, 21, 29, 0.18) 35%, rgba(7, 21, 29, 0.55) 100%);
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--sea-deep);
  transition: opacity 0.9s var(--ease), visibility 0.9s var(--ease);
}
.preloader.is-done {
  opacity: 0;
  visibility: hidden;
}
.preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}
.preloader__text {
  font-family: var(--ff-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: 0.22em;
  color: var(--ink);
  text-transform: uppercase;
  animation: pulse 2.2s ease-in-out infinite;
}
.preloader__line {
  width: 0;
  height: 1px;
  background: rgba(238, 242, 243, 0.6);
  animation: grow 1.6s var(--ease) infinite alternate;
}
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes grow  { from { width: 10px; } to { width: 90px; } }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem clamp(1.2rem, 5vw, 3.5rem);
  transition: background 0.5s var(--ease), padding 0.5s var(--ease);
}
.nav.is-scrolled {
  background: rgba(7, 21, 29, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.nav__brand {
  font-family: var(--ff-serif);
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.4rem);
}
.nav__links a {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(238, 242, 243, 0.7);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.nav__links a:hover { color: var(--ink); }

/* Language toggle */
.nav__lang {
  font-family: var(--ff-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(238, 242, 243, 0.7);
  background: transparent;
  border: 1px solid rgba(238, 242, 243, 0.35);
  border-radius: 2px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav__lang:hover {
  color: var(--sea-deep);
  background: rgba(238, 242, 243, 0.92);
  border-color: rgba(238, 242, 243, 0.92);
}

/* ---------- Bilingual visibility ----------
   Both languages live in the HTML (crawlable). The body class decides
   which is shown. `revert` restores each element's natural display. */
.t-en { display: none; }
body.lang-en .t-lv { display: none; }
body.lang-en .t-en { display: revert; }

/* ---------- Sections ---------- */
.section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem clamp(1.4rem, 7vw, 7rem);
}

/* ---------- Hero ---------- */
.hero {
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.hero__content { max-width: 820px; }
.hero__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(217, 205, 184, 0.85);
  margin: 0 0 1.4rem;
}
.hero__title {
  font-family: var(--ff-serif);
  font-weight: 500;
  font-size: clamp(3.4rem, 13vw, 9rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin: 0;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.35);
}
.hero__subtitle {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 3vw, 1.7rem);
  font-weight: 400;
  color: rgba(238, 242, 243, 0.82);
  margin: 1.4rem 0 0;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: rgba(238, 242, 243, 0.6);
}
.scroll-hint__text {
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.scroll-hint__icon {
  width: 22px;
  height: 34px;
  border: 1px solid rgba(238, 242, 243, 0.4);
  border-radius: 12px;
  position: relative;
}
.scroll-hint__icon::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 3px;
  height: 6px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: rgba(238, 242, 243, 0.8);
  animation: drop 1.8s var(--ease) infinite;
}
@keyframes drop {
  0%   { opacity: 0; transform: translateY(0); }
  30%  { opacity: 1; }
  70%  { opacity: 1; transform: translateY(12px); }
  100% { opacity: 0; transform: translateY(14px); }
}

/* ---------- Content sections ---------- */
.content__wrap { max-width: 560px; }
.content__wrap--wide { max-width: 680px; }
.content--right { justify-content: flex-end; }
.content--right .content__wrap { text-align: left; }

/* Facts list */
.facts {
  margin: 2.4rem 0 0;
  border-top: 1px solid rgba(238, 242, 243, 0.16);
}
.facts__row {
  display: flex;
  gap: 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(238, 242, 243, 0.12);
}
.facts dt {
  flex: 0 0 42%;
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(217, 205, 184, 0.85);
  align-self: center;
}
.facts dd {
  margin: 0;
  font-size: 0.98rem;
  color: rgba(238, 242, 243, 0.85);
}

.content__index {
  font-size: 0.74rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(217, 205, 184, 0.8);
  margin: 0 0 1.2rem;
}
.content__title {
  font-family: var(--ff-serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 1.6rem;
}
.content__lead {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 1.3rem;
}
.content__lead em { color: var(--sand); font-style: italic; }
.content__body {
  font-size: 1rem;
  color: rgba(238, 242, 243, 0.72);
  margin: 0;
}
.content__body strong { color: var(--sand); font-weight: 500; }

/* ---------- Footer ---------- */
.footer {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
}
.footer__wrap { max-width: 640px; }
.footer__coords {
  font-family: var(--ff-serif);
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  letter-spacing: 0.06em;
  margin: 0 0 0.6rem;
}
.footer__place {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(238, 242, 243, 0.6);
  margin: 0 0 2.4rem;
}

/* Ghost button */
.ghost-btn {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  border: 1px solid rgba(238, 242, 243, 0.45);
  border-radius: 2px;
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), color 0.4s var(--ease);
}
.ghost-btn:hover {
  background: rgba(238, 242, 243, 0.95);
  border-color: rgba(238, 242, 243, 0.95);
  color: var(--sea-deep);
}

.footer__copy {
  margin: 4rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: rgba(238, 242, 243, 0.4);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav__links { gap: 1rem; }
  .nav__links a { font-size: 0.7rem; }
  .content--right { justify-content: flex-start; }
  .section { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
