/* ===========================================================================
   GAIAONE ODYSSEY · RAJA AMPAT 2027 — Design System
   Concept: a descent. The page sinks from sunlit surface to the deep blue.
   Fonts are loaded via <link> in index.html <head> (parallel, non-blocking)
   rather than a CSS @import (which serialises the request waterfall).
   ======================================================================== */

:root {
  /* depth palette — brighter mid-ocean, not near-black, for readability */
  --abyss:      #08203a;
  --deep:       #0c2a47;
  --mid:        #16466a;
  --shallow:    #1f5f7d;
  --teal:       #1aa39c;
  --teal-bright:#46e0d2;
  --coral:      #ff7a52;
  --coral-soft: #ff9b7d;
  --sand:       #f0e6cf;
  --foam:       #f7faf9;
  --ink:        #d6e2e6;     /* brighter muted body text on dark for contrast */
  --ink-dim:    #9fb6bf;

  --maxw: 1280px;
  --gutter: clamp(1.25rem, 4vw, 4rem);

  --serif: 'Newsreader', Georgia, serif;
  --sans:  'Hanken Grotesk', system-ui, sans-serif;

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

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--sans);
  background: var(--abyss);
  color: var(--foam);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

/* descent background — driven by JS, sits behind everything */
.depth-bg {
  position: fixed; inset: 0; z-index: -2;
  background: linear-gradient(180deg, var(--shallow) 0%, var(--mid) 35%, var(--deep) 70%, var(--abyss) 100%);
  transition: opacity .6s ease;
}
/* film grain + caustic light overlay */
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- type ---------- */
.kicker {
  font-family: var(--sans);
  font-size: clamp(.64rem, .7vw, .72rem);
  font-weight: 500;
  letter-spacing: .26em;
  line-height: 1.7;
  text-transform: uppercase;
  color: var(--teal-bright);
}
@media (max-width: 520px) { .kicker { letter-spacing: .2em; } }
.kicker--coral { color: var(--coral-soft); }
.kicker--sand  { color: var(--sand); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.04; letter-spacing: -.01em; }

.display {
  font-size: clamp(2.9rem, 8.4vw, 8.6rem);
  font-weight: 400;
  line-height: .94;
}
.h2 { font-size: clamp(2rem, 4.8vw, 4.1rem); font-weight: 400; line-height: 1.06; }
.lead {
  font-size: clamp(1.1rem, 1.7vw, 1.5rem);
  line-height: 1.55; color: var(--foam); font-weight: 400;
  max-width: 38ch;
}
.muted { color: var(--ink); }
.serif-it { font-family: var(--serif); font-style: italic; font-weight: 400; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem var(--gutter);
  transition: background .4s ease, padding .4s ease, backdrop-filter .4s ease;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--abyss) 72%, transparent);
  backdrop-filter: blur(14px);
  padding-block: .95rem;
  border-bottom: 1px solid color-mix(in srgb, var(--foam) 8%, transparent);
}
.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-sub {
  font-family: var(--sans); font-size: .68rem; font-weight: 600; letter-spacing: .26em; color: var(--foam);
  text-transform: uppercase; padding-left: .9rem;
  border-left: 1px solid color-mix(in srgb, var(--foam) 30%, transparent);
}
@media (max-width: 600px) { .brand-sub { display: none; } .brand-logo { height: 30px; } }
.nav-links { display: flex; gap: 2.1rem; align-items: center; }
.nav-links a { color: var(--foam); text-decoration: none; font-size: .95rem; font-weight: 600; letter-spacing: .015em; transition: color .25s; }
.nav-links a:not(.btn):hover { color: var(--teal-bright); }

/* ---------- mobile menu ---------- */
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .5rem; z-index: 70; }
.nav-toggle span { display: block; width: 26px; height: 2.5px; background: var(--foam); border-radius: 2px; transition: transform .35s var(--ease), opacity .25s; }
.nav-toggle span + span { margin-top: 6px; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }
  .nav-links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; gap: 2rem;
    background: color-mix(in srgb, var(--abyss) 97%, transparent); backdrop-filter: blur(20px);
    transform: translateX(100%); transition: transform .42s var(--ease); pointer-events: none;
  }
  .nav.open .nav-links { transform: translateX(0); pointer-events: auto; }
  .nav-links a { font-family: var(--serif); font-weight: 400; font-size: 1.9rem; letter-spacing: -.01em; }
  .nav-links a.btn { font-family: var(--sans); font-size: 1rem; margin-top: 1rem; padding: 1rem 2rem; }
}

/* ---------- buttons ---------- */
.btn {
  --c: var(--coral);
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--sans); font-size: .82rem; font-weight: 500; letter-spacing: .04em;
  padding: .85rem 1.5rem; border-radius: 100px;
  background: var(--c); color: #1a0d08; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s;
  box-shadow: 0 8px 30px -10px color-mix(in srgb, var(--coral) 70%, transparent);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -10px color-mix(in srgb, var(--coral) 80%, transparent); }
.btn--ghost {
  background: transparent; color: var(--foam);
  border-color: color-mix(in srgb, var(--foam) 22%, transparent); box-shadow: none;
}
.btn--ghost:hover { border-color: var(--foam); background: color-mix(in srgb, var(--foam) 6%, transparent); }
.btn .arrow { transition: transform .35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ===========================================================================
   HERO
   ======================================================================== */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
html.flat .hero { min-height: 760px; } /* screenshot helper only */
.hero-media { position: absolute; inset: -8% 0 0 0; z-index: -1; will-change: transform; }
.hero-media img { width: 100%; height: 116%; object-fit: cover; filter: saturate(1.05) contrast(1.04); }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--abyss) 55%, transparent) 0%, transparent 28%, transparent 45%, color-mix(in srgb, var(--abyss) 88%, transparent) 92%),
    radial-gradient(120% 80% at 50% 120%, color-mix(in srgb, var(--deep) 70%, transparent), transparent 60%);
}
.hero-inner { position: relative; width: 100%; padding-bottom: clamp(3rem, 8vh, 7rem); }
.hero .display { mix-blend-mode: normal; }
.hero .display em { font-style: italic; font-weight: 300; color: var(--sand); }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 1.4rem 2.6rem; align-items: center;
  margin-top: 2.2rem; padding-top: 1.6rem;
  border-top: 1px solid color-mix(in srgb, var(--foam) 14%, transparent);
}
.hero-meta .stat { display: flex; flex-direction: column; gap: .25rem; }
.hero-meta .stat b { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; color: var(--foam); }
.hero-meta .stat span { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); }
.hero-cta { margin-left: auto; display: flex; gap: .8rem; }
@media (max-width: 760px) { .hero-cta { margin-left: 0; width: 100%; } .hero-cta .btn { flex: 1; justify-content: center; } }

/* hamburger stays legible over the bright hero image */
.nav-toggle span { box-shadow: 0 1px 4px rgba(3, 8, 15, .5); }

/* ---------- mobile hero ---------- */
@media (max-width: 600px) {
  .display { font-size: clamp(3rem, 15vw, 4rem); line-height: 1.0; }
  .hero .display .ln { display: block; }      /* stack Dive. / Plant. / Restore. */
  .hero-inner { padding-bottom: clamp(4rem, 12vh, 6rem); }
  .hero .kicker { font-size: .62rem; }
  .hero-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem .7rem; padding-top: 1.3rem; }
  .hero-meta .stat b { font-size: 1.1rem; }
  .hero-meta .stat span { font-size: .56rem; letter-spacing: .08em; }
  .hero-cta { grid-column: 1 / -1; flex-direction: column; gap: .7rem; margin-top: .3rem; }
  .hero-cta .btn { width: 100%; }
}

.scroll-cue {
  position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-dim);
}
.scroll-cue .line { width: 1px; height: 42px; background: linear-gradient(var(--teal-bright), transparent); }

/* ===========================================================================
   MANIFESTO band
   ======================================================================== */
.manifesto { padding-block: clamp(7rem, 16vh, 13rem); }
.manifesto p {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.7rem, 4vw, 3.4rem); line-height: 1.18; letter-spacing: -.01em;
  max-width: 22ch;
}
.manifesto .word { display: inline-block; }
.manifesto .hl { color: var(--teal-bright); font-style: italic; }

/* ===========================================================================
   CONSERVATION
   ======================================================================== */
.conservation { padding-block: clamp(4rem, 9vh, 8rem) clamp(6rem, 12vh, 11rem); }
.cons-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
@media (max-width: 900px) { .cons-grid { grid-template-columns: 1fr; } }
.cons-figure { position: relative; border-radius: 4px; overflow: hidden; aspect-ratio: 4/5; }
.cons-figure img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); will-change: transform; }
.cons-figure figcaption {
  position: absolute; left: 1rem; bottom: 1rem; right: 1rem;
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sand);
  display: flex; align-items: center; gap: .5rem;
}
.cons-figure figcaption::before { content: ""; width: 22px; height: 1px; background: var(--coral); }

.cons-copy h2 { margin: 1.4rem 0 1.6rem; }
.cons-copy h2 em { font-style: italic; color: var(--teal-bright); }
.cons-copy .lead { margin-bottom: 2.6rem; }

.impact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; border-top: 1px solid color-mix(in srgb, var(--foam) 12%, transparent); padding-top: 2rem; }
@media (max-width: 520px) { .impact { grid-template-columns: 1fr; gap: 1.6rem; } }
.impact .num { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 400; color: var(--foam); line-height: 1; }
.impact .num small { font-size: .5em; color: var(--coral-soft); }
.impact .lbl { font-size: .74rem; color: var(--ink); margin-top: .5rem; line-height: 1.4; }

/* reef-threat panel — bright, high-contrast (dark text on sand) */
.threat {
  margin-top: clamp(4rem, 9vh, 8rem);
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--sand); border-radius: 10px; overflow: hidden;
}
@media (max-width: 700px){ .threat { grid-template-columns: 1fr; } }
.threat .cell {
  padding: clamp(1.8rem, 3vw, 2.8rem);
  display: flex; flex-direction: column; gap: .6rem;
  border-right: 1px solid rgba(10, 42, 71, 0.12);
}
.threat .cell:last-child { border-right: 0; }
@media (max-width: 700px){ .threat .cell { border-right: 0; border-bottom: 1px solid rgba(10,42,71,.12); } .threat .cell:last-child { border-bottom: 0; } }
.threat .cell b {
  font-family: var(--serif); font-weight: 400; line-height: 1;
  font-size: clamp(3rem, 6vw, 4.6rem); color: var(--deep);
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.threat .cell > span {
  font-size: clamp(.86rem, 1vw, .98rem); line-height: 1.4;
  color: #3a5168; font-weight: 500; max-width: 24ch;
}
.threat .cell b .val { font-size: inherit; } /* keep the number the same size as its unit */

/* ===========================================================================
   DIVE MAP
   ======================================================================== */
.divemap { padding-block: clamp(5rem, 11vh, 10rem); }
.divemap-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: clamp(2.5rem,5vw,4rem); flex-wrap: wrap; }
.divemap-head .lead { max-width: 30ch; }
.map-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(2rem,5vw,4rem); align-items: center; }
@media (max-width: 900px){ .map-grid { grid-template-columns: 1fr; } }
.map-figure { position: relative; border-radius: 4px; overflow: hidden; background: var(--deep); padding: 1.5rem; border: 1px solid color-mix(in srgb, var(--teal-bright) 18%, transparent); }
.map-figure img { width: 100%; display: block; border-radius: 2px; }
.map-figure .tag { position: absolute; top: 1.2rem; left: 1.2rem; }

.sites { list-style: none; display: flex; flex-direction: column; }
.sites li { padding-block: 1.15rem; border-bottom: 1px solid color-mix(in srgb, var(--foam) 10%, transparent); display: flex; align-items: baseline; gap: 1rem; cursor: default; transition: padding-left .35s var(--ease); }
.sites li:hover { padding-left: .8rem; }
.sites li .idx { font-size: .7rem; color: var(--teal-bright); font-variant-numeric: tabular-nums; min-width: 1.6rem; }
.sites li .name { font-family: var(--serif); font-size: clamp(1.15rem,2vw,1.5rem); color: var(--foam); }
.sites li .meta { margin-left: auto; font-size: .72rem; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; }
.sites li:hover .name { color: var(--teal-bright); }

/* ===========================================================================
   FOOTER (slice stub)
   ======================================================================== */
.footer { padding-block: clamp(4rem,9vh,7rem) 3rem; border-top: 1px solid color-mix(in srgb, var(--foam) 10%, transparent); }
.footer-top { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-end; }
.footer .big { font-family: var(--serif); font-size: clamp(2rem,5vw,3.4rem); font-weight: 300; max-width: 16ch; }
.footer .socials { display: flex; gap: 1.4rem; font-size: .8rem; }
.footer .socials a { color: var(--ink); text-decoration: none; }
.footer .socials a:hover { color: var(--coral-soft); }
.footer-base { margin-top: 4rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .72rem; color: var(--ink-dim); }

/* ---------- reveal primitives ---------- */
/* hidden ONLY when JS confirms motion is running (.animate); otherwise visible (no-JS safe) */
.animate [data-reveal] { opacity: 0; transform: translateY(28px); will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
