/* ==========================================================
   Flight Deck VR
   Colours and type are taken from airliner flight displays:
   green = normal, cyan = selected, magenta = route, amber = caution.
   ========================================================== */

:root {
  --display: #0b0f13;
  --panel: #12181e;
  --glass: #eef2f4;
  --dim: #a4afb7;
  --line: rgba(238, 242, 244, 0.18);
  --ink: #071217;

  --green: #3ddc84;
  --cyan: #35d0ff;
  --magenta: #ff5fd0;
  --amber: #ffb21f;

  /* B612 was designed for aircraft cockpit screens */
  --font: "B612", "Verdana", "DejaVu Sans", sans-serif;
  --mono: "B612 Mono", "DejaVu Sans Mono", "Consolas", monospace;

  --gutter: clamp(20px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--glass);
  background: var(--display);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--cyan);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px var(--gutter);
}

.wordmark {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.top nav { display: flex; gap: clamp(16px, 3vw, 36px); }

.top nav a {
  padding: 6px 0;
  font-size: 0.95rem;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.top nav a:hover { color: var(--glass); border-bottom-color: var(--cyan); }

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block;
  padding: 14px 24px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}

.btn-primary { background: var(--cyan); color: var(--ink); border-color: var(--cyan); }
.btn-primary:hover { background: #7ae1ff; border-color: #7ae1ff; }

.btn-ghost { color: var(--glass); border-color: var(--glass); }
.btn-ghost:hover { background: var(--glass); color: var(--ink); }

.btn-dark { background: var(--ink); color: var(--amber); border-color: var(--ink); }
.btn-dark:hover { background: #000; border-color: #000; }

.btn-outline { color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--amber); }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 96px);
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px var(--gutter) 72px;
  min-height: calc(100svh - 74px);
}

.hero h1 {
  font-size: clamp(3.4rem, 8.2vw, 7.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.hero h1 span { display: block; }

.lede {
  max-width: 28em;
  margin: 28px 0 32px;
  font-size: clamp(1.15rem, 1.5vw, 1.35rem);
  line-height: 1.55;
}

.hero-pfd {
  width: 100%;
  max-width: 520px;
  margin: 0;
  justify-self: center;
}

.pfd { display: block; width: 100%; height: auto; }

/* PFD drawing styles */
.pfd text { font-family: var(--mono); font-weight: 700; fill: var(--glass); }
.pfd .big { font-size: 18px; }
.pfd .selected { font-size: 15px; fill: var(--cyan); }
.pfd .scale text { font-size: 14px; }
.pfd .scale line { stroke: #fff; stroke-width: 2; }
.pfd .tape-bg { fill: #1c2329; opacity: 0.92; }
.pfd .box { fill: #000; stroke: #fff; stroke-width: 2; }
.pfd #fma { font-size: 14px; fill: var(--green); }
.pfd #att-ladder line { stroke: #fff; stroke-width: 2; }
.pfd #att-ladder text { font-size: 13px; }
.pfd #roll-ticks path,
.pfd #roll-ticks line { stroke: #fff; stroke-width: 2; fill: none; }
.pfd #roll-ticks polygon { fill: #fff; }

.replay {
  margin-top: 14px;
  padding: 10px 18px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--glass);
  background: transparent;
  border: 2px solid var(--glass);
  border-radius: 4px;
  cursor: pointer;
}
.replay:hover:not(:disabled) { background: var(--glass); color: var(--ink); }
.replay:disabled { opacity: 0.45; cursor: default; }

/* ---------- How it plays ---------- */

.flight {
  background: var(--panel);
  padding: clamp(56px, 9vw, 112px) 0;
}

.flight h2,
.vr h2,
.shots h2 { font-size: clamp(2.2rem, 4.8vw, 3.9rem); }

.intro {
  max-width: 36em;
  margin: 20px 0 44px;
  color: var(--dim);
}

.flight-ui { --gap: 8px; }

.tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
}

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  color: var(--glass);
  background: transparent;
  border: 2px solid rgba(238, 242, 244, 0.32);
  border-radius: 4px;
  cursor: pointer;
}
.tab:hover { border-color: var(--cyan); }

.tab .num {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(238, 242, 244, 0.16);
  font-size: 0.9rem;
}

.tab[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); color: var(--ink); }
.tab[aria-pressed="true"] .num { background: var(--ink); color: var(--cyan); }

/* Flight profile: ground, climb, cruise, descent */
.profile {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
  height: 220px;
  margin-top: var(--gap);
}

.bay {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.3s;
}
.bay svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.bay polygon { fill: rgba(238, 242, 244, 0.05); transition: fill 0.3s; }
.bay polyline {
  fill: none;
  stroke: var(--magenta);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.bay span {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  font-size: 0.82rem;
  line-height: 1.25;
  color: var(--dim);
}
.bay.is-active { border-color: var(--cyan); }
.bay.is-active polygon { fill: rgba(53, 208, 255, 0.16); }
.bay.is-active polyline { stroke-width: 5; }
.bay.is-active span { color: var(--glass); }

.plane {
  position: absolute;
  top: 0;
  left: 0;
  width: calc((100% - 4 * var(--gap)) / 5);
  height: 100%;
  pointer-events: none;
  transform: translateX(calc(var(--step) * (100% + var(--gap))));
  transition: transform 0.9s cubic-bezier(0.6, 0, 0.2, 1);
}
.plane svg {
  position: absolute;
  left: 50%;
  top: var(--alt);
  transform: translate(-50%, -50%) rotate(var(--rot));
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
  transition: top 0.9s cubic-bezier(0.6, 0, 0.2, 1), transform 0.9s cubic-bezier(0.6, 0, 0.2, 1);
}

.detail {
  max-width: 44rem;
  margin-top: 36px;
  padding-left: 22px;
  border-left: 10px solid var(--cyan);
}
.context { margin-bottom: 8px; font-size: 0.95rem; color: var(--dim); }
.detail h3 { margin-bottom: 12px; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.detail p:last-child { max-width: 34em; }

/* ---------- In the headset ---------- */

.vr { padding: clamp(56px, 9vw, 112px) 0; }

.vr-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 6vw, 96px);
  align-items: start;
}

.vr-list article {
  padding: 28px 0 32px;
  border-top: 1px solid var(--line);
}
.vr-list article:first-child { padding-top: 0; border-top: 0; }
.vr-list h3 { margin-bottom: 10px; font-size: 1.6rem; }
.vr-list p { max-width: 32em; color: var(--dim); }

/* ---------- Screenshots ---------- */

.shots { padding: 0 0 clamp(56px, 9vw, 112px); }
.shots h2 { margin-bottom: 36px; }
.shots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.shots-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: var(--panel);
}

/* ---------- Get the game ---------- */

.get {
  background: var(--amber);
  color: var(--ink);
  padding: clamp(56px, 9vw, 104px) 0;
}
.get h2 { font-size: clamp(2.6rem, 7vw, 5.5rem); line-height: 1; letter-spacing: -0.03em; }
.get-note { margin-top: 22px; font-size: 1.2rem; font-weight: 700; }
.get .actions { margin-top: 32px; }

/* ---------- Footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  color: var(--dim);
  font-size: 0.95rem;
}
.foot a { color: var(--glass); }

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-bottom: 56px;
  }
  .hero-pfd { max-width: 440px; justify-self: start; }
  .vr-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .top nav a:not(:last-child) { display: none; }
  .top nav a { white-space: nowrap; }

  /* Phases become numbered chips; the profile keeps its shape */
  .tab { justify-content: center; padding: 10px 6px; }
  .tab-name { display: none; }

  .profile { height: 150px; }
  .bay span { display: none; }
  .plane svg { width: 46px; height: 16px; }
}

@media (max-width: 420px) {
  .btn { width: 100%; text-align: center; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plane, .plane svg, .bay, .bay polygon { transition: none; }
}
