: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-lighting,
.landing-heat,
.landing-grain {
  position: absolute;
  pointer-events: none;
}

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

.landing-scene::before {
  position: absolute;
  z-index: -1;
  inset: -24px;
  background: center / cover no-repeat url("assets/landing/carrier-original-1280.webp");
  content: "";
  filter: blur(18px) brightness(0.72) saturate(1.08);
  transform: scale(1.05);
}

.scene-layer {
  --layer-x: 0px;
  --layer-y: 0px;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  user-select: none;
  transform-origin: center;
  transform: translate3d(var(--layer-x), var(--layer-y), 0);
}

.scene-background {
  z-index: 0;
}

.scene-aircraft {
  z-index: 1;
  will-change: transform;
}

.landing-atmosphere {
  z-index: -3;
  inset: 0;
  background:
    radial-gradient(
      ellipse 31% 29% at 50% 51%,
      rgba(3, 6, 8, 0.5) 0%,
      rgba(3, 6, 8, 0.3) 50%,
      transparent 100%
    ),
    radial-gradient(ellipse 85% 76% at 50% 50%, transparent 55%, rgba(2, 3, 5, 0.36) 100%),
    linear-gradient(180deg, rgba(2, 4, 6, 0.2) 0%, transparent 30%, transparent 72%, rgba(2, 4, 6, 0.28) 100%);
}

.landing-lighting {
  z-index: -2;
  inset: 0;
  background:
    radial-gradient(circle at 14% 48%, rgba(255, 201, 105, 0.2), transparent 20%),
    radial-gradient(ellipse 38% 18% at 70% 58%, rgba(255, 91, 44, 0.12), transparent 72%);
  mix-blend-mode: screen;
}

.landing-heat {
  z-index: -1;
  inset: 47% -4% 20% 48%;
  background: radial-gradient(ellipse at 66% 32%, rgba(255, 114, 58, 0.16), transparent 66%);
  backdrop-filter: blur(1.25px) saturate(1.08);
  mask-image: radial-gradient(ellipse at 66% 32%, #000 0 34%, transparent 72%);
  opacity: 0.65;
  transform: translate3d(0, 0, 0) skewX(-1deg);
  animation: heat-shimmer 7s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

.landing-grain {
  z-index: 8;
  inset: 0;
  opacity: 0.045;
  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");
  background-size: 180px 180px;
  mix-blend-mode: soft-light;
}

@keyframes heat-shimmer {
  from {
    opacity: 0.5;
    transform: translate3d(-2px, 1px, 0) skewX(-1deg) scaleY(0.985);
  }

  to {
    opacity: 0.72;
    transform: translate3d(3px, -1px, 0) skewX(1deg) scaleY(1.015);
  }
}

.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: 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;
  }

  .landing-heat {
    animation: none;
  }
}
