/* NUVIZAN — a company built like a ship.
   Palette: the deep sea (abyss, night, tide), the white sail, one warm sun.
   Motion lives in assets/js/main.js (GSAP + ScrollTrigger + SplitText + DrawSVG, Lenis). */
:root {
  --abyss: #050d2c;
  --night: #0b1a4a;
  --tide: #1d3a7a;
  --sail: #ffffff;
  --text: #e9edf6;
  --haze: #9fb2d8;
  --sun: #f2b27a;
  --line: rgba(159, 178, 216, .22);
  --display: "Marcellus", "Times New Roman", serif;
  --sans: "Zen Kaku Gothic New", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--abyss); color: var(--text);
  font: 400 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; color: var(--sail); }
h2 { font-size: clamp(36px, 4.4vw, 64px); line-height: 1.08; }
p { margin: 0; }
[id] { scroll-margin-top: 80px; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }
::selection { background: var(--sun); color: var(--abyss); }
.wrap { width: min(1240px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.section-lede { color: var(--haze); font-size: 18px; max-width: 32em; margin-top: 20px; }

/* buttons */
.btn {
  position: relative; display: inline-block; overflow: hidden; isolation: isolate;
  padding: 15px 28px; border-radius: 2px;
  font: 500 15px/1.2 var(--sans); letter-spacing: .02em; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: color .45s var(--ease), border-color .45s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn:hover::before { transform: none; }
.btn-sun { background: var(--sun); color: var(--abyss); }
.btn-sun::before { background: var(--sail); }
.btn-line { border-color: rgba(255, 255, 255, .5); color: var(--sail); }
.btn-line::before { background: var(--sail); }
.btn-line:hover { color: var(--abyss); border-color: var(--sail); }

/* --------------------------------------------------------- preloader */
.preloader { display: none; }
.motion .preloader {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 100;
  background: var(--abyss);
}
.preloader-mark { display: grid; justify-items: center; gap: 26px; }
.preloader svg { width: 74px; overflow: visible; }
.pl-sail { fill: var(--sail); fill-opacity: 0; stroke: var(--sail); stroke-width: .8; }
.pl-word { overflow: hidden; }
.pl-word img { width: 210px; transform: translateY(110%); }

/* ------------------------------------------------------------ header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 20;
  transition: background-color .4s var(--ease), border-color .4s var(--ease), transform .5s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header .wrap { display: flex; align-items: center; height: 84px; gap: 40px; }
.site-header.solid, .site-header.open {
  background: rgba(5, 13, 44, .82); border-color: var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.brand img { height: 46px; width: auto; }
.nav { display: flex; gap: 38px; margin-left: auto; }
.nav a { position: relative; font-size: 15px; text-decoration: none; color: var(--text); padding-block: 6px; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--sun);
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; color: var(--sail); padding: 8px; cursor: pointer; }

/* -------------------------------------------------------------- hero */
.hero { position: relative; min-height: max(680px, 100svh); overflow: hidden; display: grid; align-items: start; }
.hero-scene { position: absolute; inset: 0; overflow: hidden; background: var(--night); }
/* the camera drifts slowly sideways and back, without end */
.hero-pan { position: absolute; inset: 0 -4%; animation: pan 46s ease-in-out infinite alternate; }
@keyframes pan { from { transform: translateX(-3%); } to { transform: translateX(3%); } }
/* the ship: framed large on the right; it eases toward the viewer, then rides the swell */
.hero-approach {
  --tx: 9%; --ty: 4%; --s: 1.16;
  position: absolute; inset: -8% -25%; transform-origin: 48% 72%;
  transform: translate(var(--tx), var(--ty)) scale(var(--s));
}
.motion .hero-approach { animation: approach 24s cubic-bezier(.12, .55, .2, 1) both; animation-play-state: paused; }
.motion.is-ready .hero-approach { animation-play-state: running; }
.hero-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 48% 72%; transform-origin: 48% 80%;
  animation: swell 7s ease-in-out infinite alternate;
}
@keyframes approach {
  from { transform: translate(var(--tx), var(--ty)) scale(calc(var(--s) * .86)); }
  to   { transform: translate(var(--tx), var(--ty)) scale(var(--s)); }
}
@keyframes swell {
  from { transform: translateY(0) rotate(-.15deg); }
  to   { transform: translateY(-.7%) rotate(.2deg); }
}
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 48% 72%; opacity: 0; transition: opacity 1.4s var(--ease); }
.hero-scene.has-video .hero-video { opacity: 1; }
.hero-scene.has-video .hero-photo { visibility: hidden; }
/* the sail scene (Gemini clip + its first frame): whole sail in view, mast a little right of centre, lighter tint */
.hero-scene.sail .hero-approach { inset: 0; --tx: 8%; --ty: 0%; --s: 1.18; }
.hero-scene.sail .hero-video, .hero-scene.sail .hero-photo { object-position: 50% 50%; }
.hero-scene.sail .hero-tint {
  background:
    linear-gradient(90deg, rgba(5, 13, 44, .74) 0%, rgba(5, 13, 44, .4) 38%, rgba(5, 13, 44, 0) 66%),
    linear-gradient(0deg, var(--abyss) 0%, rgba(5, 13, 44, 0) 22%),
    linear-gradient(180deg, rgba(5, 13, 44, .5) 0%, rgba(5, 13, 44, 0) 16%),
    rgba(14, 38, 104, .34);
}
/* the blue in front of the sea, at reduced opacity */
.hero-tint {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 13, 44, .72) 0%, rgba(5, 13, 44, .38) 40%, rgba(5, 13, 44, 0) 70%),
    linear-gradient(0deg, var(--abyss) 0%, rgba(5, 13, 44, 0) 24%),
    linear-gradient(180deg, rgba(5, 13, 44, .55) 0%, rgba(5, 13, 44, 0) 18%),
    rgba(14, 38, 104, .44);
}
.hero-body { position: relative; z-index: 2; padding-top: clamp(140px, 22vh, 230px); }
.hero-title { font-size: clamp(46px, 6.6vw, 100px); line-height: 1.02; letter-spacing: -.01em; }
.hero .lede { max-width: 31em; margin-top: 28px; font-size: 18px; color: rgba(233, 237, 246, .88); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.scroll-cue {
  position: absolute; z-index: 2; left: 50%; bottom: 28px; width: 1px; height: 64px;
  background: rgba(255, 255, 255, .25); overflow: hidden;
}
.scroll-cue span {
  position: absolute; left: 0; top: 0; width: 1px; height: 22px; background: var(--sail);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue { from { transform: translateY(-24px); } to { transform: translateY(68px); } }

/* --------------------------------------------------------- manifesto */
.manifesto { padding: clamp(120px, 20vh, 220px) 0; }
.manifesto-text {
  font-family: var(--display); color: var(--sail);
  font-size: clamp(30px, 4.3vw, 64px); line-height: 1.22; max-width: 21em;
}

/* -------------------------------------------------------------- idea */
.idea { padding: clamp(80px, 10vw, 140px) 0 clamp(100px, 12vw, 170px); }
.idea-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 48px 80px; align-items: center; }
.aside { margin-top: 26px; color: var(--haze); max-width: 30em; }
.parts { margin: 44px 0 0; }
.parts div { border-top: 1px solid var(--line); padding: 20px 0; }
.parts dt { font-family: var(--display); font-size: 22px; color: var(--sail); }
.parts dd { margin: 6px 0 0; color: var(--haze); }
.ship-diagram { margin: 0; }
.ship-diagram svg { width: 100%; height: auto; overflow: visible; }
.d-sail, .d-line { fill: none; stroke: var(--sail); stroke-width: 1.1; stroke-linejoin: round; }
.d-water { fill: none; stroke: var(--tide); stroke-width: 1.2; }
.d-course { stroke: var(--sun); stroke-width: 1.2; stroke-dasharray: 3 6; }
.d-tick { fill: none; stroke: var(--sun); stroke-width: 1.2; }
.d-dot { fill: var(--sun); }
.d-lead { fill: none; stroke: var(--haze); stroke-width: .7; opacity: .7; }
.d-k { font-family: var(--display); font-size: 15px; fill: var(--sail); }
.d-v { font-family: var(--sans); font-size: 11px; fill: var(--haze); letter-spacing: .04em; }

/* ------------------------------------------------------------- fleet */
.fleet { background: linear-gradient(180deg, var(--abyss), var(--night) 18%, var(--night)); }
.fleet-pin { padding: clamp(100px, 12vw, 150px) 0; }
.fleet-head { position: relative; }
.fleet-progress { display: none; }
.fleet-track { display: grid; gap: 28px; margin-top: 56px; width: min(1240px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.vessel {
  display: grid; grid-template-columns: 1.15fr 1fr; min-height: 460px;
  background: rgba(5, 13, 44, .45); border: 1px solid var(--line);
}
.vessel-media { margin: 0; overflow: hidden; position: relative; }
.vessel-media img { position: absolute; inset: 0 -10%; width: 120%; height: 100%; object-fit: cover; }
.vessel-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11, 26, 74, 0) 60%, rgba(11, 26, 74, .5)), rgba(14, 38, 104, .18); }
.vessel-body { padding: clamp(28px, 3.6vw, 56px); display: flex; flex-direction: column; justify-content: center; }
.vessel-role { color: var(--sun); font-size: 15px; }
.vessel h3 { font-size: clamp(30px, 3vw, 44px); line-height: 1.1; margin-top: 10px; }
.vessel-line { font-family: var(--display); font-size: 21px; color: var(--sail); margin-top: 14px; }
.vessel-text { color: var(--haze); margin-top: 14px; max-width: 28em; }
.vessel ul { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.vessel li { font-size: 14px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); }
.vessel-group { grid-template-columns: 1fr; min-height: 0; background: none; border-style: dashed; }
.vessel-group .vessel-body { align-items: flex-start; }
.group-sail { width: 54px; height: auto; margin-bottom: 26px; }

/* desktop: the companies sail past horizontally while the section is pinned */
@media (min-width: 981px) {
  .motion .fleet-pin { height: 100vh; padding: 0; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
  .motion .fleet-head { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 40px; }
  .motion .fleet-head .section-lede { grid-column: 1; }
  .motion .fleet-progress {
    display: block; grid-column: 2; grid-row: 1 / span 2; align-self: end;
    width: 180px; height: 1px; background: var(--line); margin-bottom: 10px;
  }
  .motion .fleet-progress span { display: block; height: 100%; background: var(--sun); transform-origin: left; transform: scaleX(0); }
  .motion .fleet-track {
    display: flex; gap: 3vw; width: max-content; margin: 6vh 0 0;
    padding-inline: max(var(--gutter), (100vw - 1240px) / 2);
  }
  .motion .vessel { width: min(72vw, 1060px); height: min(58vh, 560px); min-height: 0; flex: none; }
  .motion .vessel-group { width: min(34vw, 460px); }
}

/* ----------------------------------------------------------- marquee */
.marquee { overflow: hidden; padding: clamp(40px, 6vw, 90px) 0; border-block: 1px solid var(--line); }
.marquee-track { display: flex; width: max-content; }
.marquee span {
  font-family: var(--display); font-size: clamp(64px, 11vw, 180px); line-height: 1; padding-right: .45em;
  color: transparent; -webkit-text-stroke: 1px rgba(233, 237, 246, .42); white-space: nowrap;
}
.marquee span:nth-child(3n + 2) { color: var(--sail); -webkit-text-stroke: 0; }

/* ------------------------------------------------------------ course */
.course { padding: clamp(100px, 12vw, 170px) 0; }
.route {
  --p: 1;
  list-style: none; margin: 72px 0 0; padding: 0; position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px;
}
.route::before {
  content: ""; position: absolute; left: 0; right: 0; top: 7px;
  border-top: 1px dashed rgba(242, 178, 122, .7);
  transform: scaleX(var(--p)); transform-origin: left;
}
.route li { position: relative; padding-top: 42px; }
.route li::before {
  content: ""; position: absolute; left: 0; top: 0; width: 15px; height: 15px; border-radius: 50%;
  background: var(--abyss); border: 1.5px solid var(--sun);
}
.route li:first-child::before { background: var(--sun); }
.route time { font-family: var(--display); font-size: 34px; color: var(--sun); line-height: 1; }
.route h3 { font-size: 22px; margin-top: 14px; }
.route p { color: var(--haze); margin-top: 8px; font-size: 16px; }

/* ----------------------------------------------------------- contact */
.contact { position: relative; padding: clamp(110px, 14vw, 190px) 0; overflow: hidden; }
.contact-bg { position: absolute; inset: -15% 0; }
.contact-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .38; }
.contact-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--abyss), rgba(5, 13, 44, .55) 35%, rgba(5, 13, 44, .7) 70%, var(--abyss)); }
.contact-grid { position: relative; display: grid; grid-template-columns: 5fr 6fr; gap: 48px 80px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 28px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--haze); }
.form .wide { grid-column: 1 / -1; }
.form input, .form textarea {
  font: inherit; font-size: 17px; color: var(--sail); background: transparent;
  border: 0; border-bottom: 1px solid rgba(159, 178, 216, .45); padding: 8px 0; border-radius: 0; resize: vertical;
  transition: border-color .3s var(--ease);
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--sun); }
.form .btn { justify-self: start; }
.form-note { grid-column: 1 / -1; color: var(--haze); font-size: 15px; min-height: 1.5em; }

/* ------------------------------------------------------------ footer */
.site-footer { padding: 72px 0 36px; border-top: 1px solid var(--line); overflow: hidden; }
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.motto { font-family: var(--display); color: var(--haze); font-size: 20px; }
.site-footer nav { display: flex; gap: 28px; flex-wrap: wrap; font-size: 15px; }
.site-footer nav a { text-decoration: none; color: var(--haze); transition: color .3s var(--ease); }
.site-footer nav a:hover { color: var(--sail); }
.footer-word { width: 100%; height: auto; margin: clamp(56px, 8vw, 110px) 0 28px; opacity: .92; }
.legal { color: rgba(159, 178, 216, .7); font-size: 14px; }

/* -------------------------------------------------- animation states */
/* if the scripts never arrive, the curtain still lifts */
.motion .preloader { animation: pl-fallback .01s 5s forwards; }
@keyframes pl-fallback { to { visibility: hidden; } }
.pin-manifesto .manifesto { min-height: 100vh; display: grid; align-items: center; padding: 0; }
/* SplitText line masks */
.line-mask { overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }

/* -------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .nav { display: none; }
  .menu-btn { display: block; }
  .site-header.open .nav {
    display: flex; flex-direction: column; gap: 0; position: absolute; top: 84px; left: 0; right: 0;
    background: rgba(5, 13, 44, .97); padding: 6px var(--gutter) 22px; border-bottom: 1px solid var(--line);
  }
  .site-header.open .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .idea-grid, .contact-grid { grid-template-columns: 1fr; }
  .vessel { grid-template-columns: 1fr; }
  .vessel-media { aspect-ratio: 16 / 10; }
  .route { grid-template-columns: 1fr 1fr; row-gap: 48px; }
  .route::before { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .brand img { height: 38px; }
  .hero-body { padding-top: 120px; }
  .hero .lede { font-size: 16px; }
  .hero-approach { --tx: 0%; --ty: 4%; --s: 1.18; }
  .hero-scene.sail .hero-approach { --tx: 0%; --s: 1.05; }
  .route { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-pan, .hero-approach, .hero-photo, .scroll-cue span { animation: none; }
}
