/* Shared "alive" layer for every page: sea-light backdrop, glass nav, wave
   line, entrances, hover lift. Pure CSS plus assets/alive.js (which only adds
   classes); nothing here hides content, so pages read the same without JS.
   Loaded after site-nav.css. */

/* ── Sea light behind everything ── */
body::before {
  content: ""; position: fixed; inset: -12vh -12vw; z-index: -1; pointer-events: none;
  /* Blue on the left, warm light top right: the same sides as the logo's waves and
     sun. Both lights use the same falloff (Dino approved the blue on 2026-11-28
     and wants the orange to match it). No small bright core on the orange: it
     looked like a sun. This is the ONLY
     orange light on a page; sections must not add their own. */
  background:
    radial-gradient(46% 52% at 90% 10%, rgba(232,164,64,0.38) 0%, rgba(226,160,62,0.25) 22%, rgba(212,160,60,0.09) 46%, transparent 68%),
    radial-gradient(52% 58% at 12% 10%, rgba(0,160,210,0.46) 0%, rgba(0,150,199,0.30) 22%, rgba(0,150,199,0.10) 46%, transparent 68%),
    radial-gradient(58% 52% at 8% 94%, rgba(0,119,182,0.36) 0%, rgba(0,119,182,0.22) 24%, transparent 66%);
  animation: alive-drift 26s ease-in-out infinite alternate;
}
@keyframes alive-drift { to { transform: translate3d(3vw, 4vh, 0) scale(1.08); } }

/* ── Nav: frosted glass, firmer once the page has scrolled ── */
nav#mainNav { background: rgba(27,40,56,0.55); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5); transition: background 0.3s, box-shadow 0.3s; view-transition-name: site-nav; }
nav#mainNav.scrolled { background: rgba(22,34,47,0.78); box-shadow: 0 10px 30px -18px rgba(0,0,0,0.8); }

/* ── Pages cross-fade into each other ── */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }

/* ── Wave line ── */
.wave-div { position: relative; height: 54px; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent); }
.wave-div::before, .wave-div::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% + 600px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 54' preserveAspectRatio='none'%3E%3Cpath d='M0 26 Q75 4 150 26 T300 26 T450 26 T600 26 V54 H0 Z' fill='%230096C7' fill-opacity='.22'/%3E%3Cpath d='M0 26 Q75 4 150 26 T300 26 T450 26 T600 26' fill='none' stroke='%237FD0E8' stroke-width='1.5' stroke-opacity='.85'/%3E%3C/svg%3E") repeat-x 0 0 / 600px 100%;
  animation: alive-wave 16s linear infinite;
}
/* The front wave carries a crisp crest line; the back one stays a soft fill. */
.wave-div::after { top: 10px; opacity: 0.7; animation-duration: 25s; animation-direction: reverse; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 54' preserveAspectRatio='none'%3E%3Cpath d='M0 26 Q75 4 150 26 T300 26 T450 26 T600 26 V54 H0 Z' fill='%235ABED6' fill-opacity='.2'/%3E%3C/svg%3E"); }
@keyframes alive-wave { to { transform: translate3d(-600px, 0, 0); } }

/* ── Entrances (class added by alive.js when the element scrolls into view) ── */
.alive-in { animation: alive-rise 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) backwards; animation-delay: var(--alive-d, 0ms); }
@keyframes alive-rise { from { opacity: 0; transform: translateY(18px); } }

/* ── Live dot ── */
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #4CC38A; margin-right: 0.55rem; vertical-align: 0.08em; box-shadow: 0 0 0 0 rgba(76,195,138,0.6); animation: alive-pulse 2s infinite; }
@keyframes alive-pulse { to { box-shadow: 0 0 0 11px rgba(76,195,138,0); } }

@media (prefers-reduced-motion: reduce) {
  body::before, .wave-div::before, .wave-div::after, .live-dot, .alive-in { animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
