* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  background: #06101b;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
  background: #06101b;
  color: #f3f7fa;
}

.airport-scene,
.airport-scene > div {
  position: fixed;
  inset: 0;
}

.airport-scene {
  overflow: hidden;
  background:
    linear-gradient(180deg, #020b1670 0%, #07111a20 44%, #02050970 100%),
    url("./assets/airport-dusk.png") center 62% / cover no-repeat;
  transform: scale(1.025);
}

.horizon-glow {
  top: 36%;
  bottom: auto;
  height: 27%;
  background: radial-gradient(ellipse at center, #f0a75a38, transparent 68%);
  filter: blur(18px);
  opacity: .85;
  animation: horizon-drift 18s ease-in-out infinite alternate;
}

.scene-vignette {
  background:
    linear-gradient(180deg, #0007, transparent 24% 70%, #0009),
    radial-gradient(ellipse at center, transparent 35%, #000b 100%);
  pointer-events: none;
}

.launcher {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1180px, calc(100% - 48px));
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(30px, 6vh, 72px) 0 clamp(28px, 7vh, 74px);
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: clamp(30px, 7vh, 72px);
}

.brand {
  text-align: center;
  text-shadow: 0 4px 22px #000;
}

.brand h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 66px);
  font-weight: 300;
  letter-spacing: clamp(7px, 1.7vw, 20px);
  line-height: 1;
}

.trainer-browser {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  align-self: start;
  min-width: 0;
  gap: clamp(6px, 1vw, 12px);
}

.trainer-viewport {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.trainer-viewport::-webkit-scrollbar {
  display: none;
}

.trainer-links {
  --trainer-gap: clamp(20px, 3.4vw, 44px);
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - var(--trainer-gap)) / 2);
  align-self: start;
  gap: var(--trainer-gap);
}

.trainer-nav {
  display: grid;
  width: 30px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid #dce8ef42;
  border-radius: 999px;
  background: #071018c7;
  color: #f3f7fa;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 8px 22px #0008;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.trainer-nav:hover,
.trainer-nav:focus-visible {
  border-color: #f3f7faaa;
  background: #122331e8;
}

.trainer-nav:focus-visible {
  outline: 2px solid #f3f7fa;
  outline-offset: 3px;
}

.trainer-nav:disabled {
  opacity: .25;
  cursor: default;
}

.nav-arrow-portrait {
  display: none;
}

.trainer-card {
  --accent: #62bfff;
  position: relative;
  display: grid;
  min-height: clamp(340px, 48vh, 470px);
  padding: clamp(22px, 3vw, 36px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, #dce8ef 18%);
  border-radius: 22px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 11%, transparent), transparent 44%),
    linear-gradient(180deg, #0c1721e8, #071018e0);
  color: var(--accent);
  box-shadow: 0 24px 70px #000b, inset 0 1px #ffffff15;
  text-decoration: none;
  backdrop-filter: blur(12px);
  -webkit-tap-highlight-color: transparent;
  transition: transform 280ms ease, border-color 280ms ease, box-shadow 280ms ease;
  cursor: pointer;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.trainer-card::before {
  content: "";
  position: absolute;
  inset: -45%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 19%, transparent), transparent 57%);
  opacity: .48;
  transform: translate3d(-22%, -17%, 0);
  transition: opacity 280ms ease, transform 600ms ease;
  pointer-events: none;
}

.trainer-card-vor { --accent: #5dbbff; }
.trainer-card-ils { --accent: #ffad50; }

.trainer-card:hover,
.trainer-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 84%, white 16%);
  box-shadow: 0 30px 78px #000c, 0 0 30px color-mix(in srgb, var(--accent) 25%, transparent), inset 0 1px #ffffff22;
  transform: translateY(-6px) scale(1.012);
}

.trainer-card:hover::before,
.trainer-card:focus-visible::before {
  opacity: .78;
  transform: translate3d(10%, 5%, 0);
}

.trainer-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

.trainer-card h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #f5f8fa;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 520;
  letter-spacing: .13em;
  line-height: 1.1;
  text-shadow: 0 2px 12px #000;
}

.trainer-instrument {
  position: relative;
  z-index: 1;
  align-self: center;
  width: 100%;
  max-height: 275px;
  overflow: visible;
  color: var(--accent);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 40%, transparent));
}

.instrument-fine,
.runway-center {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.cardinal-points,
.ils-label {
  fill: currentColor;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-anchor: middle;
}

.vor-indication {
  fill: #071018;
  stroke: currentColor;
  stroke-width: 2;
}

.ils-markers {
  fill: #071018;
  stroke: currentColor;
  stroke-width: 2;
}

.runway-perspective {
  stroke: currentColor;
  stroke-width: 1.5;
}

.enter-label {
  position: relative;
  z-index: 1;
  justify-self: end;
  align-self: end;
  color: #f5f8fa;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .18em;
}

.enter-label span {
  display: inline-block;
  margin-left: 7px;
  color: var(--accent);
  transition: transform 220ms ease;
}

.trainer-card:hover .enter-label span,
.trainer-card:focus-visible .enter-label span {
  transform: translateX(5px);
}

.launcher-entering .airport-scene { animation: scene-in 1.6s ease-out both; }
.launcher-entering .brand { animation: brand-in 1s .25s ease-out both; }
.launcher-entering .trainer-card-vor { animation: card-left-in 1.05s .55s cubic-bezier(.2,.75,.24,1) both; }
.launcher-entering .trainer-card-ils { animation: card-right-in 1.05s .68s cubic-bezier(.2,.75,.24,1) both; }

@keyframes scene-in {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1.025); }
}

@keyframes brand-in {
  from { opacity: 0; transform: translateY(-15px); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes card-left-in {
  from { opacity: 0; transform: translateX(-55px) scale(.98); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes card-right-in {
  from { opacity: 0; transform: translateX(55px) scale(.98); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes horizon-drift {
  from { transform: translateX(-1.5%) scale(1); opacity: .68; }
  to { transform: translateX(1.5%) scale(1.06); opacity: .9; }
}

@media (max-width: 760px) {
  .launcher {
    width: min(560px, calc(100% - 28px));
    height: auto;
    padding: 30px 0 42px;
    gap: 30px;
  }

  .brand h1 {
    font-size: clamp(29px, 10vw, 46px);
    letter-spacing: clamp(5px, 3vw, 12px);
  }

  .trainer-links {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .trainer-card {
    min-height: 310px;
  }
}

@media (max-width: 420px) {
  .trainer-card {
    min-height: 275px;
    padding: 20px;
  }

  .trainer-card h2 { font-size: 22px; }
  .trainer-instrument { max-height: 205px; }
}

@media (orientation: portrait) and (max-width: 1024px) {
  .launcher {
    height: 100svh;
    min-height: 100svh;
    padding: clamp(14px, 3svh, 28px) 0;
    gap: clamp(10px, 2svh, 18px);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .trainer-browser {
    align-self: stretch;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 28px minmax(0, 1fr) 28px;
    gap: 7px;
  }

  .trainer-nav {
    width: 100%;
    height: 28px;
    border-radius: 10px;
    font-size: 16px;
  }

  .nav-arrow-landscape {
    display: none;
  }

  .nav-arrow-portrait {
    display: inline;
  }

  .trainer-viewport {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
  }

  .trainer-links {
    --trainer-gap: 18px;
    height: 100%;
    grid-template-columns: 1fr;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-auto-rows: calc((100% - var(--trainer-gap)) / 2);
  }

  .trainer-card {
    height: 100%;
    min-height: 0;
    padding: clamp(12px, 2.2svh, 20px);
    border-radius: clamp(15px, 2.6svh, 20px);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .trainer-card h2 {
    font-size: clamp(18px, 2.9svh, 24px);
  }

  .trainer-instrument {
    height: 100%;
    min-height: 0;
    max-height: none;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .launcher {
    width: min(1180px, calc(100% - 28px));
    height: 100svh;
    min-height: 100svh;
    padding: clamp(10px, 3vh, 16px) 0;
    gap: clamp(8px, 2.5vh, 14px);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .brand h1 {
    font-size: clamp(24px, 7vh, 34px);
    letter-spacing: clamp(6px, 1.6vw, 14px);
  }

  .trainer-browser {
    align-self: stretch;
    min-height: 0;
    grid-template-columns: 26px minmax(0, 1fr) 26px;
    gap: clamp(4px, 1vw, 8px);
  }

  .trainer-nav {
    width: 100%;
    height: 30px;
    font-size: 15px;
  }

  .nav-arrow-landscape {
    display: inline;
  }

  .nav-arrow-portrait {
    display: none;
  }

  .trainer-viewport {
    height: 100%;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
  }

  .trainer-links {
    --trainer-gap: clamp(14px, 3.4vw, 32px);
    height: 100%;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - var(--trainer-gap)) / 2);
    align-self: stretch;
    min-height: 0;
  }

  .trainer-card {
    min-height: 0;
    height: 100%;
    padding: clamp(12px, 3.2vh, 18px);
    border-radius: clamp(14px, 4vh, 20px);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .trainer-card h2 {
    font-size: clamp(18px, 6vh, 26px);
  }

  .trainer-instrument {
    min-height: 0;
    height: 100%;
    max-height: min(47vh, 210px);
  }

  .enter-label {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
