:root {
  color-scheme: dark;
  font-family: Manrope, "Helvetica Neue", Arial, sans-serif;
  background: #020813;
  color: #f5f7fa;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #020813;
}

body {
  min-height: 100svh;
}

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #020813;
}

.hero h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-poster,
.hero-poster img,
.hero-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.hero-poster {
  z-index: 1;
  opacity: 1;
  transition: opacity 320ms ease;
}

.hero-poster img,
.hero-video {
  object-fit: cover;
  object-position: center;
}

.hero-video {
  z-index: 2;
  opacity: 0;
  background: #020813;
  transition: opacity 320ms ease;
}

.video-ready .hero-video {
  opacity: 1;
}

.video-ready .hero-poster {
  opacity: 0;
}

/* Ambient layer: enriches the poster, loading, and reduced-motion states,
   then yields to the video once it is playing. */
.ambient {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 1;
  transition: opacity 700ms ease;
}

.video-ready .ambient {
  opacity: 0;
}

.ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 3, 8, 0.55) 100%);
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: radial-gradient(rgba(245, 247, 250, 0.14) 0.55px, transparent 0.75px);
  background-size: 4px 4px;
}

.ambient-signal {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 62%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 216, 255, 0.5), transparent);
  opacity: 0.4;
  filter: blur(0.5px);
  animation: signal-drift 24s ease-in-out infinite;
}

@keyframes signal-drift {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.32;
  }
  50% {
    transform: translateY(-22vh);
    opacity: 0.55;
  }
}

.contact-link {
  position: absolute;
  z-index: 4;
  top: max(24px, env(safe-area-inset-top));
  right: max(28px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 216, 255, 0.58);
  color: #f5f7fa;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-6px);
  animation: contact-in 600ms ease 240ms forwards;
  transition:
    color 160ms ease,
    border-color 160ms ease;
}

@keyframes contact-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.contact-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00d8ff;
  box-shadow: 0 0 8px rgba(0, 216, 255, 0.6);
  transition: box-shadow 160ms ease;
}

.contact-link:hover {
  color: #00d8ff;
  border-color: #00d8ff;
}

.contact-link:hover .contact-dot {
  box-shadow: 0 0 12px rgba(0, 216, 255, 0.9);
}

.contact-link:focus-visible {
  outline: 2px solid #00d8ff;
  outline-offset: 6px;
}

@media (max-width: 720px), (orientation: portrait) {
  .hero-poster img,
  .hero-video {
    object-position: center;
  }

  .contact-link {
    top: max(20px, env(safe-area-inset-top));
    right: max(22px, env(safe-area-inset-right));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-poster,
  .hero-video,
  .contact-link,
  .contact-dot,
  .ambient {
    transition: none;
  }

  .ambient-signal {
    animation: none;
    opacity: 0.4;
  }

  .contact-link {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
