/* ============================================================
   QDRN 404 — Custom Page
   Cinematic missed-flight concept
   ============================================================ */

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

:root {
  --qdrn-blue:  #002D72;
  --qdrn-green: #A3C940;
  --sky-deep:   #06091a;
  --sky-mid:    #0d1b3e;
  --sky-dusk:   #1a2f5a;
  --horizon:    #1e3a6e;
  --glow-amber: #f0a030;
  --glow-rose:  #c05060;
  --ground:     #0a0e1a;
  --runway-lit: #304060;
  --text-main:  #e8edf5;
  --text-sub:   #8da4c0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background: var(--sky-deep);
  color: var(--text-main);
}

/* ─── Scene ─────────────────────────────────────────────── */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

/* Sky */
.sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    #4a5e8a 0%,
    #5e7298 15%,
    #7a8eaa 35%,
    #a09060 58%,
    #c8a030 74%,
    #e0a828 83%,
    #c06020 90%,
    #7a3010 96%,
    #2e1008 100%
  );
}

/* Horizon atmospheric glow */
.horizon-glow {
  position: absolute;
  bottom: 28%;
  left: 0;
  right: 0;
  height: 18%;
  background: radial-gradient(
    ellipse 80% 100% at 50% 100%,
    rgba(240, 160, 20, 0.55) 0%,
    rgba(220, 120, 30, 0.28) 45%,
    transparent 72%
  );
  pointer-events: none;
}

/* Stars canvas */
.stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.7;
}

/* City silhouette */
.cityline {
  position: absolute;
  bottom: 28%;
  left: 0;
  right: 0;
  height: 8vw;
  min-height: 40px;
  max-height: 90px;
  background-color: #050810;
  clip-path: polygon(
    0% 100%,
    0% 60%,
    1% 60%, 1% 30%, 2% 30%, 2% 60%,
    3% 60%, 3% 45%, 3.5% 45%, 3.5% 60%,
    4% 60%, 4% 20%, 5% 20%, 5% 60%,
    5.5% 60%, 5.5% 50%, 6% 50%, 6% 60%,
    7% 60%, 7% 35%, 8% 35%, 8% 15%, 9% 15%, 9% 35%, 9.5% 35%, 9.5% 60%,
    10% 60%, 10% 40%, 11% 40%, 11% 60%,
    11.5% 60%, 11.5% 55%, 12% 55%, 12% 60%,
    13% 60%, 13% 28%, 14% 28%, 14% 60%,
    15% 60%, 15% 45%, 16% 45%, 16% 60%,
    17% 60%, 17% 32%, 18% 32%, 18% 10%, 19% 10%, 19% 32%, 20% 32%, 20% 60%,
    21% 60%, 21% 48%, 22% 48%, 22% 60%,
    23% 60%, 23% 38%, 24% 38%, 24% 60%,
    25% 60%, 25% 52%, 26% 52%, 26% 25%, 27% 25%, 27% 52%, 28% 52%, 28% 60%,
    30% 60%, 30% 42%, 31% 42%, 31% 60%,
    35% 60%, 35% 55%, 36% 55%, 36% 60%,
    100% 60%, 100% 100%
  );
}

/* Ground */
.ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28%;
  background: linear-gradient(
    to bottom,
    #0c1422 0%,
    #080d18 40%,
    #060a14 100%
  );
  border-top: 1px solid rgba(163, 201, 64, 0.08);
}

/* Runway */
.runway {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) perspective(400px) rotateX(35deg);
  transform-origin: bottom center;
  width: 140px;
  height: 200%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  gap: 18px;
  padding-bottom: 10px;
}

.runway-line {
  width: 30px;
  height: 22px;
  background: rgba(163, 201, 64, 0.18);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(163, 201, 64, 0.1);
}

/* ─── Plane ──────────────────────────────────────────────── */

.plane-group {
  position: absolute;
  bottom: 26%;
  left: -310px;
  width: 280px;
  height: 78px;
  will-change: transform, opacity;
}

.plane-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.5));
}

/* Contrail */
.contrail {
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(
    to left,
    rgba(255,255,255,0.6),
    rgba(255,255,255,0.2),
    transparent
  );
  border-radius: 2px;
  transition: width 0.3s ease;
  pointer-events: none;
}

/* ─── Person ─────────────────────────────────────────────── */

.person-group {
  position: absolute;
  bottom: 27.5%;
  left: 80px;
  width: 34px;
  height: 58px;
  opacity: 0;
  will-change: transform, opacity;
}

.person-svg {
  width: 100%;
  height: 100%;
  transform-origin: 50% 95%;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* Single smooth running cycle — vertical bob + forward lean */
.person-group.running .person-svg {
  animation: personBob 0.54s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

@keyframes personBob {
  0%   { transform: translateY(0px)   rotate(-6deg); }
  50%  { transform: translateY(-4px)  rotate(-7deg); }
  100% { transform: translateY(0px)   rotate(-6deg); }
}

/* ─── Content overlay ────────────────────────────────────── */

.content {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 24px 10vh;
  pointer-events: none;
}

.content-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.2s ease, transform 1.2s ease;
  pointer-events: auto;
  max-width: 560px;
  width: 100%;
}

.content-inner.visible {
  opacity: 1;
  transform: translateY(0);
}

.logo-link {
  display: inline-block;
  margin-bottom: 28px;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.logo-link:hover {
  opacity: 1;
}

.logo {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.error-code {
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  font-size: clamp(11px, 2vw, 13px);
  font-weight: 600;
  letter-spacing: 0.4em;
  color: var(--qdrn-green);
  text-transform: uppercase;
  margin-bottom: 16px;
  opacity: 0.85;
}

.headline {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: clamp(24px, 4.5vw, 42px);
  font-weight: normal;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.subline {
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  font-size: clamp(14px, 2vw, 16px);
  line-height: 1.65;
  color: var(--text-sub);
  margin-bottom: 36px;
  max-width: 400px;
}

.btn-home {
  display: inline-block;
  padding: 13px 32px;
  background: transparent;
  border: 1px solid rgba(163, 201, 64, 0.5);
  color: var(--qdrn-green);
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 3px;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  cursor: pointer;
}

.btn-home:hover {
  background: rgba(163, 201, 64, 0.12);
  border-color: var(--qdrn-green);
  color: #c4e860;
}

.btn-home:active {
  background: rgba(163, 201, 64, 0.2);
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 480px) {
  .content {
    padding-bottom: 8vh;
  }

  .logo {
    height: 28px;
  }

  .runway {
    width: 80px;
  }

  .runway-line {
    width: 18px;
    height: 14px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .content {
    padding-bottom: 4vh;
    align-items: center;
  }

  .logo {
    height: 24px;
  }

  .headline {
    font-size: 22px;
  }
}

/* ─── Reduced motion ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .person-group.running .person-svg {
    animation: none;
  }

  .content-inner {
    transition: opacity 0.4s ease;
  }
}
