/* ============================================================
   NAV
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gr) 0 var(--gl);
  height: 60px;
  background: rgba(5, 8, 13, 0);
  transition: background 0.4s ease;
}

/* Becomes opaque once user scrolls past the hero */
.site-nav.scrolled {
  background: rgba(5, 8, 13, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-wordmark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: #ffffff;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #ffffff;
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:          #05080d;
  --surface:     #0b1018;
  --border:      rgba(255,255,255,0.08);
  --accent:      #4a9eff;
  --accent-dim:  rgba(74,158,255,0.15);
  --text:        #e8eaed;
  --text-mid:    #8a9bb0;
  --text-dim:    #4a5568;
  --font-mono:    'Courier New', Courier, monospace;
  --font-sans:    'Helvetica Neue', Helvetica, Arial, sans-serif;
  /* Editorial / UI pairing for about, contact */
  --font-display: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-prose:   'Source Serif 4', Georgia, 'Times New Roman', serif;
  --gl:          68px;   /* global left gutter */
  --gr:          44px;   /* global right gutter */
  --line-x:      36px;   /* x position of the vertical rule */
}

/* ============================================================
   PERSISTENT LEFT RULE
   ============================================================ */
.page-rule {
  position: fixed;
  left: var(--line-x);
  top: 0;
  width: 1px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.55);
  z-index: 200;          /* above everything including the nav */
  transform-origin: top center;
  transform: scaleY(0);
  animation: line-draw 1s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards;
  pointer-events: none;
}

@keyframes line-draw {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

.page-rule-h {
  position: fixed;
  top: 60px;          /* bottom edge of the nav */
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.55);
  z-index: 200;
  transform-origin: left center;
  transform: scaleX(0);
  animation: line-draw-h 1s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards;
  pointer-events: none;
}

@keyframes line-draw-h {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* --- video background --- */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.5) saturate(0.7);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* heavier dark at top (for nav legibility) and bottom (for text legibility) */
  background:
    linear-gradient(to bottom,
      rgba(5,8,13,0.55) 0%,
      rgba(5,8,13,0.0) 30%,
      rgba(5,8,13,0.0) 55%,
      rgba(5,8,13,0.75) 100%);
}

.hero-content {
  position: absolute;
  z-index: 2;
  bottom: 36px;
  left: 0;
  right: 0;
  padding: 0 var(--gr) 0 var(--gl);
  max-width: 900px;
}

.slogan {
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 28px;
  opacity: 0;
  animation: fade-up 0.8s ease 0.45s forwards;
}

.slogan-line {
  display: block;
}

/* --- scroll cue --- */
.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-decoration: none;
  margin-top: 32px;
  opacity: 0;
  animation: fade-in 1s ease 1.4s forwards;
}

.scroll-cue-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.35em;
  color: rgba(255,255,255,0.45);
}

.scroll-cue-arrow {
  width: 20px;
  color: rgba(255,255,255,0.45);
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

/* offset sections so fixed nav doesn't cover headings */
#about, #schematic, #port, #contact {
  scroll-margin-top: 60px;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  background: var(--bg);
  padding: 120px var(--gr) 160px var(--gl);
  position: relative;
}

/* Slightly tighter vertical rhythm between stacked story sections */
.about:has(+ .about) {
  padding-bottom: 100px;
}

.about + .about {
  padding-top: 72px;
}

.about::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--border));
}

.about-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.about-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.45em;
  color: var(--accent);
  margin-bottom: 28px;
}

.about-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 100px;
}

.about-schematic {
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-schematic-img {
  width: 100%;
  max-width: calc(420px * 1.3);
  height: auto;
  display: block;
  filter: invert(1);
  opacity: 0.85;
  transform: translateX(clamp(12px, 2.5vw, 28px));
}

/* Schematic in the leading (left) column — mirror the nudge used on the right */
.about-schematic-img--lead {
  transform: translateX(clamp(-28px, -2.5vw, -12px)) rotate(-3deg);
  max-width: min(300px, 36vw);
}

/* Keep pre-whitened wireframes visible on dark backgrounds */
.about-schematic-img--white {
  filter: none;
  opacity: 1;
}

.about-heading {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 60px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #f5f7fa;
  margin-bottom: 48px;
}

.about-body {
  display: block;
}

.about-body p {
  font-family: var(--font-prose);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(228, 232, 240, 0.82);
}

.about-body p + p {
  margin-top: 1.25em;
}

.about-kicker {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #f5f7fa;
  margin-top: 1.5em !important;
}

/* --- pillars --- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.pillar {
  position: relative;
  background-color: var(--surface);
  padding: 40px 32px 40px 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 3px solid transparent;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

/* Economics / scale — warm metal */
.pillar--economics {
  border-left-color: rgba(212, 168, 90, 0.55);
  background-image: linear-gradient(
    145deg,
    rgba(212, 168, 90, 0.1) 0%,
    transparent 58%
  );
}
.pillar--economics .pillar-icon {
  color: #d4a85a;
}
.pillar--economics:hover {
  background-color: rgba(212, 168, 90, 0.07);
  background-image: linear-gradient(
    145deg,
    rgba(212, 168, 90, 0.16) 0%,
    rgba(11, 16, 24, 0.97) 70%
  );
  box-shadow: inset 0 0 0 1px rgba(212, 168, 90, 0.14);
}

/* Acoustic / subsurface — cool teal */
.pillar--acoustic {
  border-left-color: rgba(78, 196, 186, 0.55);
  background-image: linear-gradient(
    145deg,
    rgba(78, 196, 186, 0.09) 0%,
    transparent 58%
  );
}
.pillar--acoustic .pillar-icon {
  color: #4ec4ba;
}
.pillar--acoustic:hover {
  background-color: rgba(78, 196, 186, 0.06);
  background-image: linear-gradient(
    145deg,
    rgba(78, 196, 186, 0.15) 0%,
    rgba(11, 16, 24, 0.97) 70%
  );
  box-shadow: inset 0 0 0 1px rgba(78, 196, 186, 0.16);
}

/* Velocity / deployment — electric indigo */
.pillar--velocity {
  border-left-color: rgba(139, 156, 255, 0.55);
  background-image: linear-gradient(
    145deg,
    rgba(139, 156, 255, 0.1) 0%,
    transparent 58%
  );
}
.pillar--velocity .pillar-icon {
  color: #8b9cff;
}
.pillar--velocity:hover {
  background-color: rgba(139, 156, 255, 0.07);
  background-image: linear-gradient(
    145deg,
    rgba(139, 156, 255, 0.16) 0%,
    rgba(11, 16, 24, 0.97) 70%
  );
  box-shadow: inset 0 0 0 1px rgba(139, 156, 255, 0.15);
}

.pillar-icon {
  width: 40px;
  opacity: 1;
  transition: color 0.2s ease;
}

.pillar-icon svg {
  width: 100%;
  height: auto;
}

.pillar-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.pillar--economics .pillar-title {
  letter-spacing: 0.1em;
}

.pillar--acoustic .pillar-title {
  letter-spacing: 0.05em;
  line-height: 1.35;
}

.pillar--velocity .pillar-title {
  letter-spacing: 0.11em;
}

.pillar-desc {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-mid);
}

/* ============================================================
   PRODUCT CARDS
   ============================================================ */
.product-cards-header {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-mid);
  text-align: center;
  max-width: 740px;
  margin: 24px auto 0;
}

.product-cards {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.product-card {
  flex: 1 1 0;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-mid);
}

.product-card-inner {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(255, 255, 255, 0.35);
  overflow: hidden;
  background: var(--surface);
}

.product-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 700px) {
  .product-cards {
    flex-direction: column;
    align-items: center;
  }
  .product-card {
    flex: 0 1 auto;
    width: 100%;
    max-width: 360px;
  }
}

/* ============================================================
   PORT MAP SECTION
   ============================================================ */
.port-section {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 72px var(--gr) 56px var(--gl);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Header row */
.port-header {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.port-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--accent);
  margin-bottom: 10px;
}

.port-title {
  font-size: clamp(24px, 3.5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}

.port-coords {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-top: 6px;
}

.port-header-right {
  display: flex;
  gap: 32px;
  padding-bottom: 4px;
  flex-shrink: 0;
}

.port-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.port-stat strong {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}

.port-stat span {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Map container */
.port-map-wrap {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  /* Preserve the SVG's 1696:1388 aspect ratio */
  aspect-ratio: 2010 / 1506;
  border: 1px solid var(--border);
  background: #04111e;
  overflow: hidden;

  /* Reveal: simple fade-in on scroll */
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.port-map-wrap.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* The map image — SVG already has ocean bg + blue strokes baked in */
.port-map-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Buoy nodes */
.bnode {
  position: absolute;
  left: var(--bx);
  top: var(--by);
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);

  /* Staggered fade-in handled by parent .is-visible trigger */
  opacity: 0;
  transition: opacity 0.4s ease;
}

.port-map-wrap.is-visible .bnode {
  opacity: 1;
  /* Each node uses its own --bd delay on top of the map reveal */
  transition-delay: calc(0.9s + var(--bd));
}

/* The solid dot */
.bnode::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 5px var(--accent), 0 0 10px rgba(74,158,255,0.4);
}

/* The sonar ring */
.bnode::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: sonar-ping 3.2s ease-out infinite;
  animation-delay: var(--bd);
}

@keyframes sonar-ping {
  0%   { inset: 0;      opacity: 0.7; }
  100% { inset: -18px;  opacity: 0;   }
}

/* Legend */
.port-legend {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  gap: 28px;
  align-items: center;
}

.port-legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.port-legend-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 5px var(--accent);
  flex-shrink: 0;
}

.port-legend-ring {
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.6;
}


/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  border-top: 1px solid var(--border);
  padding: 96px var(--gr) 96px var(--gl);
  background: var(--bg);
}

.about + .contact {
  padding-top: 72px;
}

.contact-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.45em;
  color: var(--accent);
  margin-bottom: 28px;
}

.contact-heading {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
}

.contact-email {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.8vw, 15px);
  letter-spacing: 0.1em;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-email:hover {
  color: var(--accent);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* --- Tablet (≤ 900px) --- */
@media (max-width: 900px) {
  .about-top {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .pillars {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Port: stack header on medium screens --- */
@media (max-width: 700px) {
  .port-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .port-header-right {
    gap: 24px;
  }
  .port-stat {
    align-items: flex-start;
  }
}

/* --- Mobile (≤ 540px): full phone pass --- */
@media (max-width: 540px) {
  :root {
    --gl:     24px;
    --gr:     20px;
    --line-x: 12px;
  }

  /* Nav: compress letter-spacing so wordmark fits */
  .nav-wordmark {
    font-size: 9.5px;
    letter-spacing: 0.18em;
  }
  .nav-links {
    gap: 16px;
  }
  .nav-links a {
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  /* Hero */
  .hero {
    min-height: 100dvh;
  }
  .slogan {
    margin-bottom: 12px;
  }
  .scroll-cue {
    margin-top: 20px;
  }

  /* About */
  .about {
    padding: 72px var(--gr) 80px var(--gl);
  }
  .about:has(+ .about) {
    padding-bottom: 56px;
  }
  .about + .about {
    padding-top: 48px;
  }
  .about-heading {
    margin-bottom: 32px;
  }
  .about-body {
    margin-bottom: 48px;
    gap: 20px;
  }
  .pillars {
    grid-template-columns: 1fr;
  }
  .pillar {
    padding: 24px 20px;
  }

  /* Schematic: disable scroll-driven animation, reveal all parts */
  .s-part {
    opacity: 1 !important;
  }
  .s-draw {
    stroke-dashoffset: 0 !important;
  }
  .s-ann,
  .s-ann-text {
    opacity: 1 !important;
  }
  .schematic-card {
    opacity: 1 !important;
  }
  .schematic-progress-readout,
  .schematic-prog-track {
    display: none;
  }
  .schematic-svg {
    max-width: 240px;
  }

  /* Port map */
  .port-section {
    padding: 56px var(--gr) 40px var(--gl);
    gap: 20px;
  }
  .port-stat strong {
    font-size: 18px;
  }

  /* Contact */
  .contact {
    padding: 64px var(--gr) 64px var(--gl);
  }
  .about + .contact {
    padding-top: 52px;
  }
}
