/* ============================================================
   VIONARK — Layout shell
   Fixed WebGL canvas (the ocean) sits behind scrolling content.
   Persistent UI: nav, depth gauge, sound toggle, cursor.
   ============================================================ */

/* ---- The ocean: fixed full-viewport WebGL canvas ---- */
.ocean {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  z-index: var(--z-canvas);
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, #12244a 0%, #0a1226 38%, var(--ink-900) 70%, var(--abyss) 100%);
}
.ocean canvas { width: 100%; height: 100%; }

/* CSS fallback when WebGL unavailable — animated gradient ocean */
.ocean--fallback {
  background:
    radial-gradient(100% 60% at 50% 0%, rgba(74,143,255,0.18), transparent 60%),
    radial-gradient(120% 80% at 50% -10%, #12244a 0%, #0a1226 38%, var(--ink-900) 72%, var(--abyss) 100%);
}

/* A vertical scrim so text always stays legible over the scene */
.ocean-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4,6,13,0) 60%, rgba(4,6,13,0.55) 100%);
}

/* ---- Scrolling content sits above the canvas ---- */
.content {
  position: relative;
  z-index: var(--z-content);
}

/* ---- Containers ---- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { position: relative; }
.section {
  padding-block: var(--section-y);
}

/* ---- Top navigation ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-ui);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 2.2vw, 1.6rem) var(--gutter);
  pointer-events: none;
  transition: transform 0.5s var(--ease-out), opacity 0.4s ease;
}
.nav > * { pointer-events: auto; }
.nav--hidden { transform: translateY(-110%); opacity: 0; }

.nav-logo { display: flex; align-items: center; gap: 0.7rem; }
.nav-logo img { height: clamp(26px, 2.6vw, 32px); width: auto; }

.nav-right {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.8vw, 1.5rem);
}

/* ---- Depth gauge (right edge instrument) ---- */
.gauge {
  position: fixed;
  right: clamp(0.9rem, 2vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-ui);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
  pointer-events: none;
  mix-blend-mode: screen;
}
.gauge__readout {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--blue-bright);
  text-align: right;
  line-height: 1.1;
  text-shadow: 0 0 12px var(--blue-glow);
}
.gauge__readout b { color: var(--white); font-weight: 600; }
.gauge__zone {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.gauge__track {
  position: relative;
  width: 2px;
  height: clamp(120px, 22vh, 230px);
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
}
.gauge__fill {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0%;
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
  box-shadow: 0 0 10px var(--blue-glow);
}
.gauge__ticks {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(180deg, transparent 0 19px, var(--hairline-2) 19px 20px);
}

/* ---- Sound + briefing controls ---- */
.btn-sound {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}
.btn-sound:hover { color: var(--white); }
.btn-sound__viz { display: flex; align-items: flex-end; gap: 2px; height: 13px; }
.btn-sound__viz span {
  width: 2px; height: 4px; background: var(--blue);
  border-radius: 1px;
  transition: height 0.2s ease;
}
.btn-sound.is-on .btn-sound__viz span { animation: eq 1s ease-in-out infinite; }
.btn-sound.is-on .btn-sound__viz span:nth-child(2) { animation-delay: 0.18s; }
.btn-sound.is-on .btn-sound__viz span:nth-child(3) { animation-delay: 0.36s; }
.btn-sound.is-on .btn-sound__viz span:nth-child(4) { animation-delay: 0.12s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 13px; } }

/* ---- Footer ---- */
.footer {
  position: relative;
  z-index: var(--z-content);
  border-top: 1px solid var(--hairline);
  padding-block: clamp(3rem, 6vw, 5rem) 2.5rem;
  background: linear-gradient(180deg, transparent, var(--abyss));
}

/* ---- Responsive: gauge & nav tweaks ---- */
@media (max-width: 768px) {
  .gauge__track { height: 110px; }
  .nav-logo span { display: none; }
  .nav { padding-block: 1rem; }
}
@media (max-width: 600px) {
  /* keep the top bar uncluttered on phones — CTAs live in the hero & closing */
  .nav-right .btn { display: none; }
}
@media (max-width: 560px) {
  .gauge { display: none; }
}
