.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  color: #fff;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

body[data-hero-theme="light"] .site-header:not(.is-scrolled) {
  color: #12161c;
}

.site-header.is-scrolled {
  background: var(--surface-dark);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.14);
}

.header-inner {
  width: min(100%, var(--content-width));
  height: 74px;
  margin: 0 auto;
  padding: 0 64px;
  display: flex;
  align-items: center;
  gap: 50px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 17px;
}

/* Pimax's own wordmark, inlined so fill: currentColor follows the header
   theme: white over the dark hero, dark over the light one. */
.pimax-logo {
  display: block;
  width: auto;
  height: 23px;
  flex: none;
}

.brand-divider {
  width: 1px;
  height: 29px;
  background: currentColor;
  opacity: 0.35;
}

.realm-brand {
  display: flex;
  align-items: center;
}

.realm-logo {
  display: none;
  object-fit: contain;
}

.realm-wordmark {
  width: 120px;
  height: 38px;
}

.realm-monogram {
  width: 58px;
  height: 28px;
}

/* Over the hero: full wordmark, in the version that suits the active slide. */
.site-header:not(.is-scrolled) .realm-wordmark.realm-on-dark {
  display: block;
}

body[data-hero-theme="light"]
  .site-header:not(.is-scrolled)
  .realm-wordmark.realm-on-dark {
  display: none;
}

body[data-hero-theme="light"]
  .site-header:not(.is-scrolled)
  .realm-wordmark.realm-on-light {
  display: block;
}

/* Scrolled: the bar is solid dark, so the light mark always applies. */
.site-header.is-scrolled .realm-monogram {
  display: block;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-left: auto;
}

.main-nav a {
  font-size: 14px;
  white-space: nowrap;
}

.main-nav a:hover,
.button-text:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero {
  position: relative;
  min-height: 685px;
  overflow: hidden;
  background: var(--surface-hero);
  color: var(--text);
  transition: color 0.5s ease;
}

.hero[data-theme="dark"] {
  color: #fff;
}

.hero-media,
.hero-layer {
  position: absolute;
  inset: 0;
}

.hero-media {
  z-index: 0;
}

.hero-layer {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  object-fit: cover;
}

.hero-layer.is-active {
  opacity: 1;
}

.hero-layer-crystal {
  background-image: url("../assets/pimax/crystal-super-hero.webp");
}

.hero-layer-video {
  background: #101929 url("../assets/pimax/steam-frame-vr.webp") center / cover
    no-repeat;
}

.hero-layer-editorial {
  background-image: url("../assets/pimax/steam-frame-vr.webp");
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    90deg,
    rgba(8, 13, 23, 0.8),
    rgba(8, 13, 23, 0.35) 50%,
    transparent 80%
  );
  transition: opacity 0.5s ease;
}

.hero[data-theme="dark"]::after {
  opacity: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 200px 64px 100px;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(68px, 7vw, 106px);
  line-height: 0.94;
  letter-spacing: -0.065em;
  font-weight: 700;
}

.hero-title-line {
  display: block;
}

.hero-title-primary {
  display: flex;
  align-items: baseline;
  gap: 26px;
}

.hero-title-primary > span:first-child {
  font-family: "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.06em;
}

.hero-vr-label {
  display: inline-block;
  padding: 0;
  font-size: 0.36em;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-title-region {
  width: fit-content;
  margin-top: 8px;
  font-size: 0.7em;
  line-height: 1.05;
  letter-spacing: -0.05em;
  font-weight: 400;
}

.hero-title-region::after {
  content: "";
  display: block;
  width: 92px;
  height: 6px;
  margin-top: 15px;
  background: linear-gradient(90deg, #2c7597, var(--action));
  box-shadow: inset 0 1px 0 rgba(150, 240, 255, 0.65);
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}

.hero-intro {
  max-width: 640px;
  margin: 24px 0 0;
  font-size: 16px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 29px;
}

.button-text {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
}

.hero-availability {
  margin: 16px 0 0;
  font-size: 12px;
  opacity: 0.68;
}

.hero-mobile-image {
  display: none;
}

.hero-controls {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 23px;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateX(-50%);
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero-dots button {
  width: 18px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: currentColor;
  color: currentColor;
  cursor: pointer;
  opacity: 0.3;
}

.hero-dots button.is-active {
  opacity: 1;
}

@media (max-width: 900px) {
  .header-inner {
    padding-left: 30px;
    padding-right: 30px;
  }
  .header-inner {
    gap: 22px;
  }
  .main-nav {
    gap: 18px;
  }
  .hero-content {
    padding-left: 30px;
    padding-right: 30px;
  }
}

@media (max-width: 700px) {
  .site-header {
    background: rgba(22, 25, 30, 0.48);
  }
  .header-inner {
    height: 66px;
    padding: 0 22px;
    justify-content: space-between;
  }
  .brand {
    gap: 10px;
  }
  .pimax-logo {
    height: 20px;
  }
  .brand-divider {
    height: 24px;
  }
  .realm-wordmark {
    width: 104px;
    height: 33px;
  }
  .realm-monogram {
    width: 50px;
    height: 24px;
  }
  .main-nav {
    display: none;
  }
  .hero {
    min-height: 680px;
  }
  .hero-layer-crystal {
    background-image: none;
    background-color: var(--surface-hero);
  }
  .hero-layer-editorial {
    background-color: #172238;
    background-size: auto 62%;
    background-position: 58% bottom;
  }
  .hero::after {
    background: linear-gradient(
    180deg,
    rgba(8, 13, 23, 0.78),
    rgba(8, 13, 23, 0.35) 52%,
    transparent 80%
    );
  }
  .hero-content {
    padding: 140px 22px 0;
  }
  .hero h1 {
    font-size: clamp(55px, 12vw, 74px);
    line-height: 1.02;
  }
  .hero-title-primary {
    gap: 16px;
  }
  .hero-title-region::after {
    width: 68px;
    height: 4px;
    margin-top: 10px;
  }
  .hero-intro {
    max-width: 370px;
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.55;
  }
  .hero-actions {
    margin-top: 22px;
  }
  .hero-mobile-image {
    display: block;
    position: absolute;
    right: 0;
    bottom: -40px;
    z-index: 1;
    width: min(85%, 360px);
    max-height: 360px;
    object-fit: contain;
    transition: opacity 0.5s ease;
  }
  .hero[data-theme="dark"] .hero-mobile-image {
    opacity: 0;
  }
  .hero-controls {
    bottom: 12px;
  }
}

@media (max-width: 420px) {
  .realm-wordmark {
    width: 88px;
    height: 28px;
  }
  .hero {
    min-height: 700px;
  }
  .hero-content {
    padding-top: 132px;
  }
  .hero-actions {
    gap: 16px;
  }
  .hero-intro {
    font-size: 13px;
  }
  .hero-availability {
    max-width: 310px;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-layer,
  .hero::after,
  .hero-mobile-image,
  .site-header {
    transition: none;
  }
  .hero-dots button[data-hero-dot="1"] {
    display: none;
  }
}
