:root {
  color-scheme: dark;
  --paper: #f1f3f0;
  --paper-muted: rgba(232, 236, 233, 0.68);
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.46);
  --black: #050708;
  --warm: #d8b589;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--black);
  color: var(--paper);
}

body {
  font-family:
    "Tomahawk Han",
    "Tomahawk Sans",
    "Source Han Sans SC",
    "Microsoft YaHei UI",
    sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: #fff;
  color: #050708;
}

.skip-link:focus {
  top: 1rem;
}

.landing {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: #050708;
}

.landing-scene,
.scene-layer,
.landing-atmosphere,
.landing-grain {
  position: absolute;
  pointer-events: none;
}

.landing-scene {
  z-index: -4;
  inset: 0;
  overflow: hidden;
}

.scene-layer {
  --layer-x: 0px;
  --layer-y: 0px;
  --layer-origin-x: 0px;
  --layer-origin-y: 0px;
  --layer-scale: 1;
  max-width: none;
  object-fit: cover;
  object-position: center;
  user-select: none;
  transform-origin: center;
  transform: translate3d(calc(var(--layer-x) + var(--layer-origin-x)), calc(var(--layer-y) + var(--layer-origin-y)), 0) scale(var(--layer-scale));
  will-change: transform;
}

.scene-background {
  --layer-scale: 1.035;
  inset: -2%;
  width: 104%;
  height: 104%;
}

.scene-carrier {
  --layer-scale: 1.055;
  inset: -3%;
  width: 106%;
  height: 106%;
}

.scene-aircraft {
  --layer-origin-x: -10vw;
  --layer-origin-y: 10vw;
  --layer-scale: 1.075;
  inset: -4%;
  width: 108%;
  height: 108%;
}

.landing-atmosphere {
  z-index: -3;
  inset: 0;
  background:
    radial-gradient(
      ellipse 33% 31% at 50% 51%,
      rgba(3, 6, 8, 0.64) 0%,
      rgba(3, 6, 8, 0.41) 48%,
      transparent 100%
    ),
    linear-gradient(180deg, rgba(2, 4, 6, 0.28) 0%, transparent 30%, transparent 70%, rgba(2, 4, 6, 0.4) 100%);
}

.landing-grain {
  z-index: 8;
  inset: -50%;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  transform: rotate(7deg);
  mix-blend-mode: soft-light;
}

.landing-nav {
  position: relative;
  z-index: 10;
  height: 62px;
  margin: 0 clamp(24px, 4vw, 74px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  animation: enter-nav 560ms 80ms var(--ease-out) backwards;
  transition-property: opacity, transform, filter;
  transition-duration: 180ms;
  transition-timing-function: var(--ease-out);
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.landing-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.landing-brand span {
  display: grid;
  gap: 3px;
}

.landing-brand b {
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.23em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.landing-brand small,
.game-menu h1 small {
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

.landing-brand small {
  color: var(--paper-muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.44em;
}

.landing-nav nav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 2.8vw, 48px);
  font-size: 13px;
  letter-spacing: 0.13em;
}

.landing-nav nav a {
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: rgba(241, 243, 240, 0.72);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  transition-property: color;
  transition-duration: 140ms;
  transition-timing-function: ease-out;
}
.github-icon {
  width: 15px;
  height: 15px;
  margin-right: 5px;
  fill: currentColor;
}

.landing-nav nav a::after {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 6px;
  left: 0;
  height: 1px;
  background: currentColor;
  transition-property: right;
  transition-duration: 180ms;
  transition-timing-function: var(--ease-out);
}

.landing-nav nav a:hover,
.landing-nav nav a:focus-visible {
  color: #fff;
}

.landing-nav nav a:hover::after,
.landing-nav nav a:focus-visible::after {
  right: 0;
}

.game-menu {
  position: absolute;
  z-index: 5;
  top: 48%;
  left: 50%;
  width: min(560px, calc(100vw - 40px));
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%);
  text-align: center;
  transition-property: opacity, transform, filter;
  transition-duration: 180ms;
  transition-timing-function: var(--ease-out);
}

.menu-mark {
  width: clamp(64px, 6.2vw, 96px);
  aspect-ratio: 1;
  object-fit: contain;
  margin-bottom: 18px;
  filter:
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 24px rgba(219, 228, 225, 0.14));
  animation: enter-menu 600ms 120ms var(--ease-out) backwards;
}

.game-menu h1 {
  margin: 0;
  display: grid;
  justify-items: center;
  text-shadow:
    0 3px 20px rgba(0, 0, 0, 0.82),
    0 1px 1px rgba(0, 0, 0, 0.8);
}

.game-menu h1 span {
  font-size: clamp(48px, 5.2vw, 82px);
  font-weight: 720;
  line-height: 1;
  letter-spacing: 0.08em;
  text-indent: 0.08em;
  animation: enter-menu 600ms 190ms var(--ease-out) backwards;
}

.game-menu h1 small {
  margin-top: 13px;
  color: rgba(241, 243, 240, 0.72);
  font-size: clamp(11px, 0.9vw, 14px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.64em;
  text-indent: 0.64em;
  animation: enter-menu 600ms 240ms var(--ease-out) backwards;
}

.primary-cta {
  width: 236px;
  min-height: 58px;
  margin-top: 38px;
  padding: 0 21px 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(236, 240, 237, 0.12), rgba(236, 240, 237, 0.04)),
    rgba(6, 10, 12, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 14px 38px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  animation: enter-menu 600ms 310ms var(--ease-out) backwards;
  transition-property: background-color, border-color, color, box-shadow, transform;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-out);
}

.primary-cta svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
  transition-property: transform;
  transition-duration: 180ms;
  transition-timing-function: var(--ease-out);
}

.primary-cta:hover,
.primary-cta:focus-visible {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(241, 243, 240, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 16px 42px rgba(0, 0, 0, 0.34);
  color: #070a0c;
}

.primary-cta:hover svg,
.primary-cta:focus-visible svg {
  transform: translateX(3px);
}

.primary-cta:active {
  transform: scale(0.96);
}

.landing-brand:focus-visible,
.landing-nav nav a:focus-visible,
.primary-cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.landing.is-leaving .landing-nav {
  opacity: 0;
  transform: translateY(-8px);
  filter: blur(3px);
}

.landing.is-leaving .game-menu {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 10px));
  filter: blur(4px);
}

@keyframes enter-nav {
  from {
    opacity: 0;
    transform: translateY(-10px);
    filter: blur(4px);
  }
}

@keyframes enter-menu {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(4px);
  }
}

@media (max-width: 700px) {
  .landing-nav {
    height: 68px;
    margin: 0 18px;
  }

  .landing-brand span {
    display: none;
  }

  .landing-brand img {
    width: 36px;
    height: 36px;
  }

  .landing-nav nav {
    gap: 20px;
    font-size: 12px;
  }

  .landing-nav nav a {
    min-height: 40px;
  }

  .scene-layer {
    object-position: 58% center;
  }

  .game-menu {
    top: 52%;
  }

  .menu-mark {
    margin-bottom: 15px;
  }

  .game-menu h1 span {
    font-size: clamp(46px, 15vw, 66px);
  }

  .primary-cta {
    width: min(232px, calc(100vw - 64px));
    margin-top: 34px;
  }
}

@media (max-width: 430px) {
  .landing-nav nav a[href*="github"] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
