:root {
  --ink: #18161b;
  --paper: #f4f0ed;
  --night: #0a0b11;
  --page-x: clamp(20px, 3.9vw, 56px);
  --nav-y: clamp(16px, 3.2vh, 28px);
  --spotlight-x: 50vw;
  --spotlight-y: 50vh;
  --spotlight-size: 260px;
}

.karta-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  color: #fff;
  background: var(--paper);
}

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

.scene {
  overflow: hidden;
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.scene-media {
  overflow: hidden;
}

.scene-layer {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  transform: translateZ(0);
}

.scene-layer--highlight {
  mask-image: radial-gradient(
    circle var(--spotlight-size) at var(--spotlight-x) var(--spotlight-y),
    rgb(0 0 0 / 100%) 0%,
    rgb(0 0 0 / 100%) 40%,
    rgb(0 0 0 / 75%) 60%,
    rgb(0 0 0 / 40%) 75%,
    rgb(0 0 0 / 12%) 88%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    circle var(--spotlight-size) at var(--spotlight-x) var(--spotlight-y),
    rgb(0 0 0 / 100%) 0%,
    rgb(0 0 0 / 100%) 40%,
    rgb(0 0 0 / 75%) 60%,
    rgb(0 0 0 / 40%) 75%,
    rgb(0 0 0 / 12%) 88%,
    transparent 100%
  );
  will-change: mask-image;
}

.hero-scene {
  z-index: 3;
  opacity: 1;
  background: var(--night);
}

.hero-scene .scene-layer--base {
  background-image: url("../assets/hero-background.webp");
}

.hero-scene .scene-layer--highlight {
  background-image: url("../assets/hero-card.webp");
}

.hero-scene .scene-shade {
  z-index: 1;
  background:
    linear-gradient(to top, var(--night) 0%, rgb(10 11 17 / 66%) 22%, transparent 63%),
    linear-gradient(90deg, rgb(10 11 17 / 10%), transparent 42%);
}

.panel-scene {
  z-index: 1;
  opacity: 0;
  color: var(--ink);
  background: var(--paper);
}

.panel-scene .scene-layer--base {
  background-image: url("../assets/panel-background.webp");
}

.panel-scene .scene-layer--highlight {
  background-image: url("../assets/panel-card.webp");
}

.karta-stage[data-state="playing"] .hero-scene,
.karta-stage[data-state="panel"] .hero-scene {
  pointer-events: none;
  opacity: 0;
}

.karta-stage[data-state="playing"] .panel-scene,
.karta-stage[data-state="panel"] .panel-scene {
  opacity: 1;
}

.transition-video {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms ease;
}

.karta-stage[data-state="playing"] .transition-video {
  opacity: 1;
}

.karta-nav {
  position: fixed;
  inset: 0 var(--page-x) auto;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--nav-y);
  pointer-events: none;
}

.karta-nav > * {
  pointer-events: auto;
}

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

.karta-brand-logo {
  width: 132px;
  height: 66px;
  object-fit: cover;
  object-position: center;
  filter:
    drop-shadow(0 1px 1px rgb(255 255 255 / 38%))
    drop-shadow(0 3px 10px rgb(0 0 0 / 18%));
  transition: opacity 250ms ease, transform 250ms ease;
}

.brand-link:hover .karta-brand-logo {
  opacity: 0.9;
  transform: translateY(-1px);
}

.desktop-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-button {
  min-height: 44px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition:
    color 500ms ease,
    background-color 500ms ease,
    transform 180ms ease;
}

.nav-button:active {
  transform: scale(0.98);
}

.nav-login {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 6px;
  color: #fff;
  background: rgb(255 255 255 / 10%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-login-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: rgb(255 255 255 / 10%);
}

.nav-login-icon svg {
  width: 15px;
  height: 15px;
}

.nav-apply {
  padding: 0 22px;
  color: var(--ink);
  background: #fff;
}

.karta-stage.nav-dark .nav-login,
.karta-stage[data-state="panel"] .nav-login {
  color: var(--ink);
  background: rgb(24 22 27 / 10%);
}

.karta-stage.nav-dark .nav-login-icon,
.karta-stage[data-state="panel"] .nav-login-icon {
  background: rgb(24 22 27 / 10%);
}

.karta-stage.nav-dark .nav-apply,
.karta-stage[data-state="panel"] .nav-apply {
  color: #fff;
  background: var(--ink);
}

.hero-copy {
  position: absolute;
  inset: auto var(--page-x) 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px;
  padding-bottom: clamp(54px, 8.9vh, 80px);
}

.hero-title-wrap {
  grid-column: span 7;
  padding-bottom: clamp(150px, 20vh, 260px);
}

.hero-title {
  max-width: 7.4em;
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(2.1rem, 5.2vw, 4.4rem);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero-title-lead {
  white-space: nowrap;
}

.hero-description {
  grid-column: 9 / span 4;
  align-self: end;
  max-width: 390px;
  margin: 0;
  color: rgb(255 255 255 / 75%);
  font-size: 15px;
  line-height: 1.62;
}

.panel-title {
  position: absolute;
  z-index: 2;
  margin: 0;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(24px);
}

.owner-title {
  top: clamp(116px, 14.2vh, 136px);
  left: var(--page-x);
  max-width: 520px;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.driver-title {
  right: clamp(56px, 6.8vw, 98px);
  bottom: clamp(60px, 8.9vh, 80px);
  max-width: 720px;
  font-size: clamp(2rem, 5.2vw, 4.3rem);
  text-align: right;
}

.karta-stage[data-state="panel"] .panel-title {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 900ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.karta-stage[data-state="panel"] .driver-title {
  transition-delay: 180ms;
}

.hero-title,
.hero-description {
  opacity: 0;
  transform: translateY(24px);
}

.karta-stage.is-ready[data-state="hero"] .hero-title,
.karta-stage.is-ready[data-state="hero"] .hero-description {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 900ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.karta-stage.is-ready[data-state="hero"] .hero-description {
  transition-delay: 200ms;
}

@media (max-width: 1023px) {
  .karta-brand-logo {
    width: 124px;
    height: 62px;
  }

  .owner-title {
    max-width: 420px;
    font-size: clamp(2.25rem, 6vw, 3.6rem);
  }

  .driver-title {
    max-width: 620px;
    font-size: clamp(1.9rem, 5.2vw, 3.7rem);
  }

  .hero-title {
    font-size: clamp(2rem, 5.7vw, 3.8rem);
  }
}

@media (max-width: 767px) {
  :root {
    --page-x: 20px;
    --nav-y: 16px;
    --spotlight-size: 190px;
  }

  .karta-brand-logo {
    width: 112px;
    height: 56px;
  }

  .desktop-actions {
    display: none;
  }

  .hero-copy {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding-bottom: clamp(42px, 5.7vh, 48px);
  }

  .hero-title-wrap {
    padding-bottom: 0;
  }

  .hero-title {
    max-width: 7.4em;
    font-size: clamp(2rem, 8.6vw, 3.35rem);
  }

  .hero-description {
    max-width: 350px;
    font-size: 15px;
  }

  .owner-title {
    top: 64px;
    left: var(--page-x);
    max-width: calc(100vw - 40px);
    font-size: clamp(2.15rem, 9vw, 3.25rem);
  }

  .driver-title {
    right: var(--page-x);
    bottom: 40px;
    max-width: calc(100vw - 40px);
    font-size: clamp(1.85rem, 8vw, 3rem);
  }
}

@media (max-height: 680px) and (min-width: 768px) {
  .hero-title-wrap {
    padding-bottom: 110px;
  }

  .owner-title {
    top: 96px;
  }

  .driver-title {
    bottom: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-layer--highlight {
    will-change: auto;
  }
}
