:root {
  --bg: #061018;
  --bg-elevated: #0a1a24;
  --text: #e8f4f8;
  --muted: #8ba3b5;
  --teal: #00d4aa;
  --aqua: #38bdf8;
  --orange: #ff6a1a;
  --line: rgba(255, 255, 255, 0.08);
  --font: 'Montserrat', sans-serif;
  --radius: 20px;
  --max: 1120px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: #020810;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== Underwater ambience ===== */
.underwater {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.underwater-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, rgba(120, 210, 255, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 70% 40% at 80% 15%, rgba(0, 180, 200, 0.12) 0%, transparent 50%),
    linear-gradient(
      180deg,
      #3a8fb0 0%,
      #1a6a88 18%,
      #0d4a66 38%,
      #083048 58%,
      #041824 78%,
      #020810 100%
    );
}

.underwater-caustics {
  position: absolute;
  inset: -20%;
  opacity: 0.28;
  background:
    radial-gradient(ellipse 30% 18% at 20% 25%, rgba(180, 240, 255, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 24% 16% at 55% 18%, rgba(140, 220, 255, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 28% 20% at 78% 32%, rgba(160, 230, 255, 0.3) 0%, transparent 55%),
    radial-gradient(ellipse 22% 14% at 35% 40%, rgba(100, 200, 230, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse 26% 16% at 65% 48%, rgba(140, 220, 255, 0.22) 0%, transparent 50%);
  mix-blend-mode: screen;
  animation: caustics-drift 18s ease-in-out infinite alternate;
}

.underwater-waves {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background:
    repeating-linear-gradient(
      105deg,
      transparent 0 40px,
      rgba(160, 230, 255, 0.06) 40px 42px,
      transparent 42px 90px
    ),
    repeating-linear-gradient(
      -95deg,
      transparent 0 55px,
      rgba(100, 200, 230, 0.05) 55px 57px,
      transparent 57px 120px
    );
  animation: waves-shift 22s linear infinite;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.25) 55%, transparent 100%);
}

.bubbles {
  position: absolute;
  inset: 0;
}

.bubble {
  --x: 50%;
  --size: 12px;
  --dur: 16s;
  --delay: 0s;
  --drift: 20px;
  --op: 0.4;

  position: absolute;
  left: var(--x);
  bottom: -30px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  opacity: 0;
  background:
    radial-gradient(circle at 32% 28%,
      rgba(255, 255, 255, 0.9) 0%,
      rgba(180, 230, 255, 0.35) 28%,
      rgba(80, 180, 220, 0.12) 60%,
      transparent 100%);
  box-shadow:
    inset -1px -2px 4px rgba(0, 30, 50, 0.35),
    inset 1px 1px 3px rgba(255, 255, 255, 0.5),
    0 0 8px rgba(120, 210, 255, 0.2);
  animation: bubble-rise var(--dur) linear var(--delay) infinite;
}

.bubble::after {
  content: '';
  position: absolute;
  top: 16%;
  left: 22%;
  width: 32%;
  height: 20%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

@keyframes caustics-drift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  100% { transform: translate3d(3%, 2%, 0) scale(1.06); }
}

@keyframes waves-shift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 120px 40px, -90px 60px; }
}

@keyframes bubble-rise {
  0% {
    transform: translate3d(0, 0, 0) scale(0.85);
    opacity: 0;
  }
  8% { opacity: var(--op); }
  75% { opacity: var(--op); }
  100% {
    transform: translate3d(var(--drift), -110vh, 0) scale(1);
    opacity: 0;
  }
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

/* ===== Topbar ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: linear-gradient(180deg, rgba(6, 16, 24, 0.92), rgba(6, 16, 24, 0.55) 70%, transparent);
  backdrop-filter: blur(8px);
}

.topbar-back,
.topbar-nav a {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.25s ease;
}

.topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: #042018;
  background: linear-gradient(115deg, var(--teal), var(--aqua));
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 212, 170, 0.28);
}

.topbar-back:hover {
  color: #042018;
  filter: brightness(1.06);
}

.topbar-nav a:hover {
  color: var(--teal);
}

.topbar-back i {
  margin-right: 0;
}

.topbar-nav {
  display: flex;
  gap: 22px;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  z-index: 1;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background-color: #041824;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  filter: brightness(0.58) saturate(0.88) contrast(1.05);
  pointer-events: none;
}

.hero-media::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('../assets/sddefault.jpg?v=2');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.hero-bg-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: rgba(2, 16, 28, 0.18);
  background-image:
    linear-gradient(180deg, rgba(4, 28, 42, 0.15) 0%, rgba(2, 14, 24, 0.22) 45%, rgba(1, 8, 14, 0.45) 100%),
    linear-gradient(90deg, rgba(2, 12, 22, 0.2) 0%, transparent 55%);
  pointer-events: none;
}

/* Projector lives in hero coords so it is not covered by the ROV's black PNG */
.hero-projector {
  position: absolute;
  right: 18%;
  top: 28%;
  width: 0;
  height: 0;
  z-index: 5;
  pointer-events: none;
  animation: rov-float 7s ease-in-out infinite;
  will-change: transform;
}

.hero-beam,
.hero-beam--soft,
.hero-beam-core {
  position: absolute;
  right: 0;
  top: 0;
  transform-origin: right center;
  pointer-events: none;
}

.hero-beam {
  width: min(72vw, 920px);
  height: 110px;
  transform: translate(0, -50%) rotate(-4deg);
  background: linear-gradient(
    270deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(190, 235, 255, 0.65) 12%,
    rgba(120, 210, 250, 0.32) 40%,
    rgba(60, 150, 200, 0.1) 70%,
    transparent 100%
  );
  clip-path: polygon(100% 42%, 100% 58%, 0% 100%, 0% 0%);
  filter: blur(0.5px);
  opacity: 0.95;
  animation: beam-shimmer 5.5s ease-in-out infinite;
}

.hero-beam--soft {
  width: min(80vw, 1050px);
  height: 220px;
  transform: translate(0, -50%) rotate(-4deg);
  background: linear-gradient(
    270deg,
    rgba(200, 240, 255, 0.5) 0%,
    rgba(110, 200, 245, 0.22) 28%,
    rgba(50, 130, 180, 0.08) 62%,
    transparent 100%
  );
  clip-path: polygon(100% 44%, 100% 56%, 0% 100%, 0% 0%);
  filter: blur(16px);
  opacity: 0.85;
  animation: beam-soft-pulse 7s ease-in-out -1.5s infinite;
}

.hero-beam-core {
  width: min(36vw, 420px);
  height: 28px;
  transform: translate(0, -50%) rotate(-4deg);
  background: linear-gradient(
    270deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(210, 245, 255, 0.7) 35%,
    rgba(160, 220, 255, 0.2) 75%,
    transparent 100%
  );
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.9;
  animation: beam-shimmer 4.2s ease-in-out infinite;
}

.hero-rov-wrap {
  position: absolute;
  right: -4%;
  top: 8%;
  width: min(68vw, 920px);
  z-index: 6;
  animation: rov-float 7s ease-in-out infinite;
  will-change: transform;
  overflow: visible;
}

.hero-rov {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55));
  z-index: 2;
}

.hero-glow {
  position: absolute;
  right: 8%;
  top: 18%;
  width: 48vw;
  height: 48vw;
  max-width: 640px;
  max-height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 106, 26, 0.18) 0%, rgba(0, 212, 170, 0.08) 40%, transparent 70%);
  pointer-events: none;
  animation: glow-pulse 6s ease-in-out infinite;
  z-index: 2;
}

.hero-fade {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(90deg, rgba(2, 10, 18, 0.35) 0%, rgba(2, 10, 18, 0.14) 36%, transparent 62%),
    linear-gradient(0deg, rgba(2, 8, 16, 0.75) 0%, rgba(2, 8, 16, 0.22) 35%, transparent 55%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 7;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px 28px 72px;
}

.hero-year {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 18px;
}

.hero-brand {
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.hero-brand span {
  background: linear-gradient(115deg, var(--teal) 0%, var(--aqua) 55%, var(--orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 34ch;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn-primary {
  color: #061018;
  background: var(--teal);
  box-shadow: 0 12px 32px rgba(0, 212, 170, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: #1de0b8;
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.btn-ghost:hover {
  border-color: rgba(0, 212, 170, 0.4);
  color: var(--teal);
  transform: translateY(-2px);
}

/* ===== Sections ===== */
.section {
  position: relative;
  z-index: 1;
  padding: 96px 28px;
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.section-lead {
  color: var(--muted);
  font-size: 1.05rem;
}

/* ===== Equipment ===== */
.equipment {
  background:
    radial-gradient(ellipse 60% 40% at 10% 20%, rgba(0, 212, 170, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(2, 12, 22, 0.25) 0%, rgba(2, 12, 22, 0.45) 100%);
}

.equipment-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.equipment-visual {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.equipment-visual img {
  width: 100%;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.equipment-visual:hover img {
  transform: scale(1.04);
}

.spec-list {
  list-style: none;
  display: grid;
  gap: 12px;
}

.spec-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(12, 28, 42, 0.55);
  transition: border-color 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.spec-item i {
  color: var(--orange);
  width: 1.1em;
  margin-top: 3px;
  flex-shrink: 0;
}

.spec-item span {
  font-size: 0.95rem;
  font-weight: 500;
}

.spec-item:hover {
  border-color: rgba(255, 106, 26, 0.35);
  background: rgba(12, 28, 42, 0.85);
  transform: translateX(4px);
}

/* ===== Applications ===== */
.applications {
  background: linear-gradient(180deg, rgba(2, 12, 22, 0.2) 0%, rgba(4, 28, 42, 0.35) 50%, rgba(2, 12, 22, 0.25) 100%);
}

.app-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 72px;
}

.app-block:last-child {
  margin-bottom: 0;
}

.app-block--media-left .app-media {
  order: 0;
}

.app-block--media-left .app-copy {
  order: 1;
}

.app-copy h3 {
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.app-copy ul {
  list-style: none;
  display: grid;
  gap: 12px;
}

.app-copy li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.98rem;
}

.app-copy li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px rgba(0, 212, 170, 0.5);
}

.app-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a1520;
  min-height: 240px;
}

.app-media img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-media:hover img,
.app-media--pair:hover img {
  transform: scale(1.06);
}

.app-media--pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: transparent;
  border: none;
  overflow: visible;
  min-height: 0;
}

.app-media--pair img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  min-height: 220px;
}

.app-media--accent {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(circle at 50% 40%, rgba(0, 212, 170, 0.12), transparent 65%),
    #07141c;
}

.app-media--accent img {
  min-height: 0;
  width: min(70%, 280px);
  margin: 0 auto;
  object-fit: contain;
}

/* ===== Contacts ===== */
.contacts {
  padding-top: 72px;
}

.contacts-inner {
  padding: 48px 40px;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(0, 212, 170, 0.08), rgba(255, 106, 26, 0.05)),
    rgba(12, 28, 42, 0.7);
}

.contact-grid {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.contact-grid p {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--muted);
}

.contact-grid i {
  color: var(--orange);
  margin-top: 4px;
  width: 1.1em;
}

.contact-grid a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.contact-grid a:hover {
  color: var(--teal);
  border-color: rgba(0, 212, 170, 0.5);
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 28px 48px;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer .btn-ghost {
  min-height: 52px;
  padding: 12px 22px;
  font-size: 1rem;
  border-color: rgba(0, 212, 170, 0.45);
  color: var(--teal);
  background: rgba(0, 212, 170, 0.1);
}

/* ===== Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--d, 0) * 70ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes rov-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-1deg); }
  50% { transform: translate3d(-12px, -18px, 0) rotate(1deg); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes beam-shimmer {
  0%, 100% { opacity: 0.75; filter: blur(1.5px) brightness(0.95); }
  50% { opacity: 1; filter: blur(2px) brightness(1.15); }
}

@keyframes beam-soft-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.85; }
}

@media (max-width: 900px) {
  .topbar-nav {
    display: none;
  }

  .hero {
    align-items: flex-end;
  }

  .hero-rov-wrap {
    right: 50%;
    top: 6%;
    width: min(92vw, 520px);
    animation-name: rov-float-mobile;
  }

  .hero-projector {
    right: 50%;
    top: 22%;
    animation-name: rov-float-mobile;
  }

  .hero-beam {
    width: min(78vw, 460px);
    height: 70px;
  }

  .hero-beam--soft {
    width: min(88vw, 520px);
    height: 140px;
  }

  .hero-beam-core {
    width: min(42vw, 240px);
    height: 18px;
  }

  .hero-fade {
    background:
      linear-gradient(180deg, rgba(4, 24, 36, 0.15) 0%, rgba(4, 24, 36, 0.4) 42%, rgba(2, 8, 16, 0.88) 78%),
      linear-gradient(90deg, rgba(4, 24, 36, 0.25), transparent 45%);
  }

  .hero-content {
    padding: 280px 20px 56px;
    text-align: center;
  }

  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .equipment-grid,
  .app-block {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .app-block--media-left .app-media,
  .app-block--media-left .app-copy {
    order: initial;
  }

  .app-block--media-left .app-media {
    order: -1;
  }

  .section {
    padding: 72px 20px;
  }

  .contacts-inner {
    padding: 32px 22px;
  }

  .footer {
    flex-direction: column;
    text-align: center;
  }
}

@keyframes rov-float-mobile {
  0%, 100% { transform: translateX(50%) translateY(0); }
  50% { transform: translateX(50%) translateY(-14px); }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-rov-wrap,
  .hero-projector,
  .hero-beam,
  .hero-beam-core,
  .hero-glow,
  .underwater-caustics,
  .underwater-waves,
  .bubble {
    animation: none;
  }

  .bubble {
    opacity: 0;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .equipment-visual img,
  .app-media img,
  .btn,
  .spec-item {
    transition: none;
  }

  .equipment-visual:hover img,
  .app-media:hover img,
  .app-media--pair:hover img {
    transform: none;
  }
}
