/* =========================================================================
   PELAGIC ARCHIVES — Araf Studio
   Deep-sea scroll-depth theme. Tokens, glass system, zone layout, HUD.
   ========================================================================= */

@font-face { font-display: swap; }

:root{
  /* ---- depth palette (interpolated live by JS via --depth custom prop) --- */
  --c-surface:   #cdeef1;
  --c-surface-2: #7fd3d6;
  --c-twilight:  #12707a;
  --c-midnight:  #0b3049;
  --c-abyss:     #071527;
  --c-hadal:     #030509;

  --ink-light:   #06181d;
  --ink-dark:    #eef7f6;

  --phos:        #7dffd0;   /* bioluminescent accent */
  --phos-dim:    #3fae8f;
  --pressure:    #ff8a63;   /* gauge warning */

  --glass-edge:      rgba(255,255,255,.38);
  --glass-edge-dim:  rgba(255,255,255,.10);
  --glass-fill:      rgba(8,22,30,.42);
  --glass-blur:      22px;

  --font-display: 'Syne', sans-serif;
  --font-body:    'Newsreader', Georgia, serif;

  --measure: 62ch;
  --edge: clamp(20px, 5vw, 64px);

  --depth: 0; /* 0..1, set by JS on documentElement */
}

*,*::before,*::after{ box-sizing:border-box; }
html{
  scroll-behavior:smooth;
  background: var(--c-surface);
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
}

body{
  margin:0;
  font-family: var(--font-body);
  color: var(--ink-dark);
  background: transparent;
  overflow-x:hidden;
  min-height:100vh;
}

h1,h2,h3,h4,.font-display{
  font-family: var(--font-display);
  font-weight:700;
  letter-spacing:-0.01em;
  line-height:1.02;
  margin:0;
}

p{ margin:0; }

a{ color:inherit; }

::selection{ background: var(--phos); color:#03110c; }

/* ------------------------------------------------------------------------
   Fixed depth backdrop — canvas particles + gradient wash, sits behind all
   content. Color/opacity driven by JS reading scroll fraction.
   ------------------------------------------------------------------------ */
#ocean-bg{
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, var(--c-surface), var(--c-surface-2));
  transition: background .15s linear;
}
#ocean-particles{
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}
/* soft vignette that deepens with scroll, purely CSS via var */
#ocean-vignette{
  position: fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background: radial-gradient(120% 90% at 50% 8%,
      rgba(255,255,255,0) 0%,
      rgba(0,0,0,0) 55%,
      rgba(0,0,0, calc(var(--depth) * .55)) 100%);
}

/* rays of light — fade out as depth increases */
.light-rays{
  position: fixed;
  top:-10%; left:0; right:0;
  height:70vh;
  z-index:-1;
  pointer-events:none;
  opacity: calc(1 - var(--depth) * 1.35);
  background:
    repeating-linear-gradient(100deg,
      rgba(255,255,255,.10) 0 2px,
      rgba(255,255,255,0) 2px 60px);
  transform-origin: top center;
  transition: opacity .2s linear;
}

/* ------------------------------------------------------------------------
   Liquid glass system
   ------------------------------------------------------------------------ */
.glass{
  background:
    linear-gradient(155deg, rgba(255,255,255,.14), rgba(255,255,255,.02) 55%, rgba(255,255,255,.06)),
    var(--glass-fill);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-edge-dim);
  box-shadow:
    inset 0 1px 0 var(--glass-edge),
    inset 0 -1px 10px rgba(0,0,0,.25),
    0 12px 40px rgba(0,0,0,.28);
}

/* ------------------------------------------------------------------------
   Nav
   ------------------------------------------------------------------------ */
.nav{
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display:flex;
  align-items:center;
  gap: clamp(14px, 3vw, 34px);
  padding: 10px 12px 10px 22px;
  border-radius: 999px;
  width: min(94vw, 920px);
}
.nav-word{
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: .01em;
  white-space: nowrap;
  margin-right: auto;
}
.nav-word em{ font-style:normal; color: var(--phos); }
.nav-links{
  display:flex;
  gap: clamp(10px, 2vw, 22px);
  list-style:none;
  margin:0; padding:0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
}
.nav-links a{
  text-decoration:none;
  opacity:.78;
  transition: opacity .2s ease, color .2s ease;
  padding: 4px 0;
}
.nav-links a:hover{ opacity:1; color:var(--phos); }
.nav-links{ display:none; }
@media (min-width: 760px){ .nav-links{ display:flex; } }

.nav-btn{
  border-radius:999px;
  border:1px solid var(--glass-edge-dim);
  background: linear-gradient(155deg, rgba(255,255,255,.18), rgba(255,255,255,.02));
  color: var(--ink-dark);
  width:38px; height:38px;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  flex: 0 0 auto;
  transition: transform .25s cubic-bezier(.22,.9,.3,1.35);
}
.nav-btn:hover{ transform: scale(1.08); }
.nav-btn svg{ width:16px; height:16px; }
.nav-btn .ic-off{ display:none; }
.nav-btn.is-muted .ic-on{ display:none; }
.nav-btn.is-muted .ic-off{ display:block; }

/* ------------------------------------------------------------------------
   HUD — depth / pressure gauge, fixed bottom
   ------------------------------------------------------------------------ */
.hud{
  position: fixed;
  right: clamp(10px, 3vw, 26px);
  bottom: clamp(10px, 3vw, 26px);
  z-index: 55;
  width: 168px;
  padding: 14px 16px 16px;
  border-radius: 22px;
  font-family: var(--font-display);
}
.hud-row{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  font-size:10.5px;
  text-transform:uppercase;
  letter-spacing:.08em;
  opacity:.62;
  margin-bottom:2px;
}
.hud-val{
  font-size: 21px;
  font-weight:800;
  font-variant-numeric: tabular-nums;
  margin-bottom:10px;
}
.hud-val small{ font-size:11px; font-weight:600; opacity:.6; margin-left:2px; }
.hud-bar{
  height:5px;
  border-radius:6px;
  background: rgba(255,255,255,.14);
  overflow:hidden;
  margin-bottom:12px;
}
.hud-bar > i{
  display:block;
  height:100%;
  width: calc(var(--depth) * 100%);
  border-radius:6px;
  background: linear-gradient(90deg, var(--phos), var(--pressure));
  transition: width .12s linear;
}
.hud-zone{
  font-size:11.5px;
  font-weight:700;
  letter-spacing:.02em;
  padding-top:8px;
  border-top:1px solid var(--glass-edge-dim);
}
.hud-zone span{ color:var(--phos); }

@media (max-width: 560px){
  .hud{ width: 132px; padding:11px 13px 13px; }
  .hud-val{ font-size:17px; }
}

/* ------------------------------------------------------------------------
   Dive gate overlay
   ------------------------------------------------------------------------ */
.gate{
  position: fixed; inset:0; z-index: 200;
  display:flex; align-items:center; justify-content:center;
  background: radial-gradient(120% 100% at 50% 0%, #12464f 0%, #030509 78%);
  padding: 24px;
  transition: opacity .7s ease, visibility .7s ease;
}
.gate.is-hidden{ opacity:0; visibility:hidden; pointer-events:none; }
.gate-card{
  max-width: 460px;
  width:100%;
  text-align:center;
  border-radius: 28px;
  padding: 44px 32px 36px;
}
.gate-eyebrow{
  font-family: var(--font-display);
  font-size:11px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color: var(--phos);
  margin-bottom:14px;
  display:block;
}
.gate-title{
  font-size: clamp(28px, 6vw, 38px);
  margin-bottom:14px;
}
.gate-desc{
  font-size:15.5px;
  line-height:1.55;
  opacity:.82;
  max-width: 38ch;
  margin: 0 auto 28px;
}
.gate-actions{ display:flex; flex-direction:column; gap:10px; align-items:center; }
.btn-dive{
  font-family: var(--font-display);
  font-weight:700;
  font-size:14.5px;
  letter-spacing:.02em;
  color:#03110c;
  background: linear-gradient(155deg, var(--phos), #46c9a3);
  border:none;
  border-radius:999px;
  padding: 15px 34px;
  cursor:pointer;
  box-shadow: 0 10px 30px rgba(125,255,208,.28);
  transition: transform .25s cubic-bezier(.22,.9,.3,1.35);
}
.btn-dive:hover{ transform: translateY(-2px) scale(1.02); }
.gate-skip{
  font-family: var(--font-display);
  font-size:12.5px;
  font-weight:600;
  background:none; border:none;
  color: var(--ink-dark);
  opacity:.55;
  cursor:pointer;
  text-decoration: underline;
  text-underline-offset:3px;
}
.gate-skip:hover{ opacity:.85; }

/* ------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------ */
.hero{
  position:relative;
  min-height:100svh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding: 120px var(--edge) 80px;
  color: var(--ink-light);
}
.hero-eyebrow{
  font-family: var(--font-display);
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  opacity:.68;
  margin-bottom: 22px;
}
.hero-title{
  font-size: clamp(46px, 9vw, 108px);
  max-width: 16ch;
}
.hero-title .line{ display:block; }
.hero-title em{
  font-style:normal;
  color: var(--c-twilight);
}
.hero-sub{
  font-family: var(--font-body);
  font-size: clamp(16px, 2vw, 19px);
  line-height:1.6;
  max-width: 48ch;
  margin-top: 26px;
  opacity:.82;
}
.hero-foot{
  margin-top: 56px;
  display:flex;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
  font-family: var(--font-display);
  font-size:12px;
}
.hero-foot .tag{
  border-radius:999px;
  border:1px solid rgba(6,24,29,.18);
  padding: 8px 16px;
  font-weight:700;
  letter-spacing:.02em;
}
.hero-scroll{
  position:absolute;
  bottom: 34px; left: var(--edge);
  display:flex; align-items:center; gap:10px;
  font-family: var(--font-display);
  font-size:11px;
  letter-spacing:.1em;
  text-transform:uppercase;
  opacity:.6;
}
.hero-scroll i{
  width:1px; height:34px;
  background: currentColor;
  display:block;
  position:relative;
  overflow:hidden;
}
.hero-scroll i::after{
  content:'';
  position:absolute; left:0; top:-100%;
  width:100%; height:100%;
  background: var(--ink-light);
  animation: dropline 1.8s ease-in-out infinite;
}
@keyframes dropline{
  0%{ top:-100%; } 60%{ top:100%; } 100%{ top:100%; }
}

/* ------------------------------------------------------------------------
   Reveal-on-scroll (Intersection Observer driven)
   ------------------------------------------------------------------------ */
.reveal{
  opacity:0;
  transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.16,.8,.24,1), transform .9s cubic-bezier(.16,.8,.24,1);
}
.reveal.is-visible{ opacity:1; transform:none; }
.reveal-1{ transition-delay:.05s; }
.reveal-2{ transition-delay:.14s; }
.reveal-3{ transition-delay:.22s; }
.reveal-4{ transition-delay:.30s; }
@media (prefers-reduced-motion: reduce){
  .reveal{ transition:none; opacity:1; transform:none; }
}

/* ------------------------------------------------------------------------
   Zone sections
   ------------------------------------------------------------------------ */
.zone{
  position:relative;
  min-height: 100svh;
  display:flex;
  align-items:center;
  padding: 90px var(--edge);
}
.zone-inner{
  max-width: 1180px;
  margin: 0 auto;
  width:100%;
  display:grid;
  grid-template-columns: 1fr;
  gap: 30px;
}
@media (min-width: 860px){
  .zone-inner{ grid-template-columns: 1.1fr .9fr; align-items:center; gap: 60px; }
  .zone--alt .zone-inner{ direction: rtl; }
  .zone--alt .zone-inner > *{ direction: ltr; }
}
.zone-meta{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-bottom: 22px;
  font-family: var(--font-display);
}
.zone-index{
  font-size:13px;
  font-weight:800;
  color: var(--phos);
}
.zone-range{
  font-size:12px;
  font-weight:700;
  letter-spacing:.05em;
  opacity:.6;
  padding-left:12px;
  border-left:1px solid var(--glass-edge-dim);
}
.zone-title{ font-size: clamp(30px, 4.6vw, 52px); margin-bottom:20px; }
.zone-desc{
  font-size: 16.5px;
  line-height:1.75;
  max-width: var(--measure);
  opacity:.88;
}
.zone-facts{
  list-style:none;
  margin: 26px 0 0;
  padding:0;
  display:grid;
  gap:12px;
}
.zone-facts li{
  font-family: var(--font-body);
  font-size:14.5px;
  line-height:1.55;
  padding-left: 20px;
  position:relative;
  opacity:.82;
  max-width: var(--measure);
}
.zone-facts li::before{
  content:'';
  position:absolute; left:0; top:.55em;
  width:7px; height:7px;
  border-radius:50%;
  background: var(--phos);
  box-shadow: 0 0 8px var(--phos);
}

.zone-visual{
  position:relative;
  aspect-ratio: 4/5;
  border-radius: 30px;
  overflow:hidden;
}
.zone-visual svg{ width:100%; height:100%; display:block; }

/* zone panel — stat card floating in the visual */
.zone-panel{
  position:absolute;
  left:20px; bottom:20px; right:20px;
  padding: 18px 20px;
  border-radius:20px;
}
.zone-panel-row{
  display:flex; justify-content:space-between; align-items:baseline;
  font-family: var(--font-display);
}
.zone-panel-row + .zone-panel-row{ margin-top:8px; }
.zone-panel-k{ font-size:11px; letter-spacing:.06em; text-transform:uppercase; opacity:.6; }
.zone-panel-v{ font-size:14px; font-weight:800; }

/* ------------------------------------------------------------------------
   Live field archive (OBIS feed)
   ------------------------------------------------------------------------ */
.feed{
  padding: 100px var(--edge) 40px;
}
.feed-tabs{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  max-width:880px;
  margin: 0 auto 28px;
}
.feed-tab{
  font-family: var(--font-display);
  font-size:12.5px;
  font-weight:700;
  letter-spacing:.02em;
  color: var(--ink-dark);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--glass-edge-dim);
  border-radius:999px;
  padding: 10px 20px;
  cursor:pointer;
  opacity:.68;
  transition: opacity .2s ease, background .2s ease, transform .2s ease;
}
.feed-tab:hover{ opacity:.9; transform: translateY(-1px); }
.feed-tab.is-active{
  opacity:1;
  background: linear-gradient(155deg, rgba(125,255,208,.22), rgba(125,255,208,.04));
  border-color: rgba(125,255,208,.4);
  color: var(--phos);
}

.feed-panel{
  max-width: 960px;
  margin: 0 auto;
  border-radius: 26px;
  padding: 26px 26px 22px;
}
.feed-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:20px;
  padding-bottom:16px;
  border-bottom: 1px solid var(--glass-edge-dim);
}
.feed-range{
  font-family: var(--font-display);
  font-size:13px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
  color: var(--phos);
}
.feed-reroll{
  font-family: var(--font-display);
  font-size:11.5px;
  font-weight:700;
  color: var(--ink-dark);
  background: rgba(255,255,255,.08);
  border:1px solid var(--glass-edge-dim);
  border-radius:999px;
  padding: 8px 16px;
  cursor:pointer;
  transition: transform .2s ease, opacity .2s ease;
}
.feed-reroll:hover{ transform: translateY(-1px); }
.feed-reroll:disabled{ opacity:.4; cursor:default; transform:none; }

.feed-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap:14px;
  min-height: 160px;
}
.feed-card{
  padding: 16px 18px;
  border-radius:16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--glass-edge-dim);
}
.feed-card-name{
  font-family: var(--font-body);
  font-style: italic;
  font-size:15.5px;
  line-height:1.3;
  margin-bottom:10px;
  color: var(--ink-dark);
}
.feed-card-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-family: var(--font-display);
  font-size:10.5px;
  letter-spacing:.03em;
  text-transform:uppercase;
  opacity:.55;
  margin-top:6px;
}
.feed-card-row b{
  font-weight:700;
  opacity:.85;
  text-transform:none;
  letter-spacing:0;
  font-size:11.5px;
}
.feed-state{
  grid-column: 1/-1;
  text-align:center;
  padding: 30px 10px;
  font-family: var(--font-body);
  font-style: italic;
  font-size:14.5px;
  opacity:.55;
}
.feed-skel{
  height: 88px;
  border-radius:16px;
  background: linear-gradient(100deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.04) 70%);
  background-size: 200% 100%;
  animation: feedshine 1.4s ease-in-out infinite;
}
@keyframes feedshine{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}
.feed-credit{
  margin-top:18px;
  font-family: var(--font-display);
  font-size:10.5px;
  letter-spacing:.02em;
  opacity:.45;
  text-align:center;
}
.feed-credit a{ color: var(--phos); text-decoration:none; }
.feed-credit a:hover{ text-decoration:underline; }

@media (prefers-reduced-motion: reduce){
  .feed-skel{ animation:none; }
}

/* ------------------------------------------------------------------------
   Expeditions (archive timeline)
   ------------------------------------------------------------------------ */
.log{
  padding: 100px var(--edge) 120px;
  position:relative;
}
.log-head{
  max-width: 720px;
  margin: 0 auto 64px;
  text-align:center;
}
.log-eyebrow{
  font-family: var(--font-display);
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color: var(--phos);
  margin-bottom:16px;
  display:block;
}
.log-title{ font-size: clamp(30px, 5vw, 50px); margin-bottom:16px; }
.log-desc{ font-size:16px; line-height:1.65; opacity:.78; }

.log-list{
  max-width: 880px;
  margin: 0 auto;
  list-style:none;
  padding:0;
  border-left: 1px solid var(--glass-edge-dim);
}
.log-item{
  position:relative;
  padding: 0 0 46px 34px;
}
.log-item:last-child{ padding-bottom:0; }
.log-item::before{
  content:'';
  position:absolute;
  left:-5.5px; top:4px;
  width:11px; height:11px;
  border-radius:50%;
  background: var(--phos);
  box-shadow: 0 0 0 4px rgba(125,255,208,.14);
}
.log-year{
  font-family: var(--font-display);
  font-size:13px;
  font-weight:800;
  color: var(--phos);
  margin-bottom:8px;
  display:block;
}
.log-name{ font-size: clamp(20px, 2.6vw, 26px); margin-bottom:10px; }
.log-body{ font-size:15px; line-height:1.68; opacity:.82; max-width:64ch; }

/* ------------------------------------------------------------------------
   Social / footer
   ------------------------------------------------------------------------ */
.social{
  padding: 90px var(--edge) 60px;
  text-align:center;
}
.social-head{ max-width:640px; margin:0 auto 44px; }
.social-eyebrow{
  font-family: var(--font-display);
  font-size:12px; letter-spacing:.14em; text-transform:uppercase;
  color: var(--phos); margin-bottom:14px; display:block;
}
.social-title{ font-size: clamp(26px, 4.4vw, 40px); margin-bottom:14px; }
.social-desc{ font-size:15.5px; line-height:1.6; opacity:.78; }

.social-grid{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}
.sc{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 13px 20px;
  border-radius:999px;
  text-decoration:none;
  color: var(--ink-dark);
  font-family: var(--font-display);
  transition: transform .25s cubic-bezier(.22,.9,.3,1.35);
}
.sc:hover{ transform: translateY(-3px); }
.sc svg{ width:16px; height:16px; flex:0 0 auto; }
.sc-name{ font-size:13px; font-weight:700; }
.sc-handle{ font-size:11px; opacity:.55; }

footer{
  padding: 44px var(--edge) 50px;
  text-align:center;
  font-family: var(--font-display);
}
.foot-brand{ font-size:14px; font-weight:800; margin-bottom:10px; }
.foot-brand em{ font-style:normal; color:var(--phos); }
.foot-tag{ font-size:11.5px; opacity:.5; letter-spacing:.04em; margin-bottom:18px; }
.foot-copy{
  font-size: 11px;
  line-height:1.8;
  opacity:.42;
  max-width: 60ch;
  margin: 0 auto;
}
.foot-copy strong{ opacity:.85; }

/* ------------------------------------------------------------------------
   Reduced-motion / small helpers
   ------------------------------------------------------------------------ */
.sr-only{
  position:absolute; width:1px; height:1px;
  padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
