/* ===================================================================
   Ocean Navigation Line — custom styles
   Tailwind (Play CDN) handles layout/utilities; this file covers the
   pieces Tailwind utility classes can't express cleanly.
   =================================================================== */

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden;
}

section[id] {
  scroll-margin-top: 6rem;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #0a0f14;
}
::-webkit-scrollbar-thumb {
  background: #2a323b;
  border: 2px solid #0a0f14;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #ff4b1f;
}

:focus-visible {
  outline: 2px solid #ff4b1f;
  outline-offset: 3px;
}

/* -------------------------------------------------------------
   Nav — contrast-adaptive via mix-blend-mode. The header itself
   stays transparent; this wrapper (white, blended) reads light
   over dark sections and dark over paper sections automatically.
   ------------------------------------------------------------- */
.nav-blend {
  color: #ffffff;
  mix-blend-mode: difference;
}

.nav-link {
  position: relative;
  padding-bottom: 2px;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Hamburger <-> close morph, driven by body.menu-open */
.hamburger-bar {
  transition: transform 0.35s ease, opacity 0.35s ease;
}
body.menu-open .hamburger-bar:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}
body.menu-open .hamburger-bar:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
}
body.menu-open {
  overflow: hidden;
}

/* -------------------------------------------------------------
   Hero
   ------------------------------------------------------------- */
.bg-grid {
  background-image:
    linear-gradient(rgba(236, 239, 234, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 239, 234, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 35%, black 0%, transparent 68%);
  mask-image: radial-gradient(ellipse at 30% 35%, black 0%, transparent 68%);
}

/* Pre-animation states — GSAP tweens these on load */
.hero-eyebrow,
.hero-sub,
.hero-cta {
  opacity: 0;
  transform: translateY(24px);
}
/* -------------------------------------------------------------
   Scroll-scrubbed video scenes
   ------------------------------------------------------------- */
.scene-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* The clip is the backdrop, never a control surface. */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* Only reveal the clip once it can actually show a real frame. Before
   that the element would paint blank over the placeholder. */
[data-scene-state='ready'] .scene-video {
  opacity: 1;
}

/* Placeholder that holds the frame while the clip downloads — and
   permanently if the file is missing. A designed backdrop, so a slow
   connection reads as "loading", never as "broken". It does not depend
   on a poster image existing on the server. */
.scene-holder::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 78% 18%, rgba(255, 75, 31, 0.16) 0%, rgba(255, 75, 31, 0) 55%),
    radial-gradient(100% 80% at 12% 85%, rgba(47, 127, 255, 0.16) 0%, rgba(47, 127, 255, 0) 60%),
    linear-gradient(160deg, #101820 0%, #070c12 100%);
}

/* Faint moving sweep, so "loading" looks deliberate rather than stalled. */
.scene-holder::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 38%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 62%
  );
  background-size: 220% 100%;
  animation: scene-sweep 2.4s linear infinite;
  opacity: 1;
  transition: opacity 0.5s ease;
}
[data-scene-state='ready'] .scene-holder::after,
[data-scene-state='failed'] .scene-holder::after {
  opacity: 0;
  animation: none;
}

@keyframes scene-sweep {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

/* Readability scrim. The copy sits on one side of each section, so the
   gradient is weighted to that side rather than dimming the whole
   frame — the footage stays the point. */
.scene-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.scrim-left {
  background:
    linear-gradient(90deg, rgba(6, 11, 16, 0.9) 0%, rgba(6, 11, 16, 0.55) 38%, rgba(6, 11, 16, 0) 68%),
    linear-gradient(180deg, rgba(6, 11, 16, 0.55) 0%, rgba(6, 11, 16, 0) 28%, rgba(6, 11, 16, 0.5) 100%);
}
.scrim-right {
  background:
    linear-gradient(270deg, rgba(6, 11, 16, 0.9) 0%, rgba(6, 11, 16, 0.55) 38%, rgba(6, 11, 16, 0) 68%),
    linear-gradient(180deg, rgba(6, 11, 16, 0.55) 0%, rgba(6, 11, 16, 0) 28%, rgba(6, 11, 16, 0.5) 100%);
}

@media (max-width: 640px) {
  /* Narrow screens leave no clear side, so even the weighted scrim
     stops holding the type. Darken the whole frame instead. */
  .scrim-left,
  .scrim-right {
    background: linear-gradient(
      180deg,
      rgba(6, 11, 16, 0.72) 0%,
      rgba(6, 11, 16, 0.5) 45%,
      rgba(6, 11, 16, 0.78) 100%
    );
  }
}


/* Sound toggle: crossed-out speaker by default, waves once enabled. */
#sea-sound .sound-wave {
  opacity: 0;
}
#sea-sound .sound-off {
  opacity: 1;
}
#sea-sound.sound-on .sound-wave {
  opacity: 1;
}
#sea-sound.sound-on .sound-off {
  opacity: 0;
}
#sea-sound.sound-on {
  color: #ff4b1f;
  border-color: #ff4b1f;
}
#sea-sound svg path {
  transition: opacity 0.25s ease;
}

.hero-globe-wrap {
  opacity: 0;
}

/* Soft bloom behind the WebGL canvas. The shader glow stops at the
   canvas edge; this lets the light bleed into the hero background so
   the globe sits in the page rather than on top of it. */
.hero-globe-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 118%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle at 46% 40%,
    rgba(255, 90, 36, 0.16) 0%,
    rgba(47, 127, 255, 0.13) 42%,
    rgba(47, 127, 255, 0) 68%
  );
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}
.hero-globe-wrap > canvas {
  position: relative;
  z-index: 1;
}
.hero-line-inner {
  transform: translateY(110%);
}

.scroll-cue-line {
  transform-origin: top;
  animation: scrollLine 2.2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%,
  100% {
    transform: scaleY(1);
    opacity: 0.4;
  }
  50% {
    transform: scaleY(0.35);
    opacity: 1;
  }
}

/* -------------------------------------------------------------
   Marquee
   ------------------------------------------------------------- */
.marquee-track {
  width: max-content;
  animation: marquee 26s linear infinite;
}
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* -------------------------------------------------------------
   Service cards — hairline corner-tick, like a registration
   mark on a technical drawing. Reveals on hover.
   ------------------------------------------------------------- */
.service-card {
  transition: background-color 0.3s ease;
}
.service-card::before,
.service-card::after {
  content: '';
  position: absolute;
  background: currentColor;
  opacity: 0.25;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}
.service-card::before {
  top: 0;
  left: 0;
  width: 16px;
  height: 1px;
}
.service-card::after {
  top: 0;
  left: 0;
  width: 1px;
  height: 16px;
}
.service-card:hover {
  background-color: rgba(10, 15, 20, 0.03);
}
.service-card:hover::before,
.service-card:hover::after {
  opacity: 1;
  background: #ff4b1f;
}

/* -------------------------------------------------------------
   Horizontal scroll process section
   ------------------------------------------------------------- */
.horizontal-track {
  width: max-content;
}

#route-vehicle {
  transition: left 0.05s linear;
}

/* -------------------------------------------------------------
   Testimonial carousel
   ------------------------------------------------------------- */
.testi-track {
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.testi-track::-webkit-scrollbar {
  display: none;
}
.testi-card {
  scroll-snap-align: start;
}

/* -------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .marquee-track,
  .scroll-cue-line {
    animation: none !important;
  }
  .hero-eyebrow,
  .hero-sub,
  .hero-cta,
  .hero-globe-wrap,
  .hero-line-inner {
    opacity: 1 !important;
    transform: none !important;
  }
  /* Hold frame one rather than looping footage. */
  .scene-video {
    animation: none !important;
  }
  #sea-sound {
    display: none !important;
  }
}
