/* Local Fonts for Self-Hosting (Excludes 3rd Party Tracker & Improves rendering performance) */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-grotesk-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/space-grotesk-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/material-symbols-outlined.woff2') format('woff2');
}

/* Base Variables */
:root {
  --color-background: #050811;
  --color-surface: #12131c;
  --color-surface-low: #1b1b24;
  --color-surface-high: #292933;
  --color-surface-lowest: #0d0d16;
  --color-surface-variant: #34343e;
  --color-text: #e3e1ef;
  --color-text-muted: #c7c4d9;
  --color-white: #ffffff;
  --color-primary: #ff9100;
  --color-accent: #ff9100;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-strong: rgba(255, 255, 255, 0.12);
  --color-shadow: rgba(195, 192, 255, 0.2);
  --radius-sm: 0.25rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --font-sans: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  /* Toast Notification Colors */
  --toast-success-bg: rgba(6, 22, 12, 0.95);
  --toast-success-border: rgba(100, 200, 100, 0.3);
  --toast-error-bg: rgba(60, 10, 10, 0.95);
  --toast-error-border: rgba(200, 100, 100, 0.3);

  /* Canvas Animation Colors (RGB format for transparency adjustments) */
  --canvas-star-white-rgb: 255, 255, 255;
  --canvas-star-tint-rgb: 195, 192, 255;
  --canvas-shooting-star-rgb: 218, 226, 253;
  --canvas-comet-trail-rgb: 68, 216, 241;
  --canvas-comet-glow: #44f169ff;

  /* Spaceship Custom Colors (Deep bright orange branding) */
  --spaceship-canopy: rgba(255, 145, 0, 0.85);
  --spaceship-engine-glow: #ff7700;
  --spaceship-engine-plasma: #ff3c00;
  --spaceship-glow: rgba(255, 90, 0, 0.45);
}

/* Accessibility Focus Indicator for Keyboard Users */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}


html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--color-background);
  color: var(--color-text);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  overflow-x: hidden;
  position: relative;
  z-index: 0;
}

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.site-header {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  z-index: 50;
  border-bottom: 1px solid var(--color-border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  background: rgba(5, 8, 17, 0.76);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  min-height: 6rem;
}

.branding {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  text-decoration: none;
}

.branding-logo {
  width: 5rem;
  height: 5rem;
  display: grid;
  place-items: center;
}

.branding-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  font-size: clamp(2.1rem, 3.2vw, 2.8rem);
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.03em;
}

.brand-accent {
  color: var(--color-accent);
}

.hero-section {
  min-height: 100vh;
  padding-top: 1rem;
  padding-bottom: 1rem;
  display: grid;
  align-items: center;
  justify-items: center;
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
}

.hero-container {
  perspective: 1200px;
  transform-style: preserve-3d;
  width: 100%;
  max-width: 90rem;
  display: grid;
  place-items: center;
}

.cosmic-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #000005;
  /* darker overall, reduce blue/green presence, add tiny warm-orange whisper */
  background: radial-gradient(circle at 20% 30%, rgba(40, 10, 0, 0.55) 0%, transparent 22%),
    radial-gradient(circle at 80% 70%, rgba(10, 15, 25, 0.22) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(5, 5, 5, 0.98) 0%, var(--color-background) 100%),
    radial-gradient(circle at 35% 60%, rgba(255, 120, 40, 0.06) 0%, transparent 20%);
}

.red-dwarf-container {
  position: relative;
  width: 300px;
  height: 300px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.red-dwarf {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  position: relative;
  z-index: 10;
  transform: translateZ(0);
  box-shadow: 0 0 80px rgba(255, 77, 0, 0.7),
    0 0 150px rgba(255, 30, 0, 0.4);
}

.red-dwarf-texture {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 30% 30%, #ffd000 0%, #ff6a00 25%, #d62400 50%, #700202 75%, #1f0101 100%);
  box-shadow: inset -25px -25px 50px rgba(0, 0, 0, 0.95),
    inset 15px 15px 35px rgba(255, 200, 100, 0.5);
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}

.red-dwarf-texture::before,
.red-dwarf-texture::after {
  content: '';
  position: absolute;
  inset: -50%;
  border-radius: 50%;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.red-dwarf-texture::before {
  /* Dynamic, soft convective granules replacing the linear grid */
  background: radial-gradient(circle at 35% 35%, rgba(255, 166, 0, 0.35) 0%, transparent 35%),
    radial-gradient(circle at 65% 65%, rgba(255, 64, 0, 0.4) 0%, transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(255, 106, 0, 0.3) 0%, transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(230, 38, 0, 0.35) 0%, transparent 35%);
  animation: star-spin 40s linear infinite;
}

.red-dwarf-texture::after {
  /* Shifting magnetic loops/hot flares, color-dodged for visual intensity */
  background: radial-gradient(circle at 60% 40%, rgba(255, 230, 150, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 40% 60%, rgba(255, 100, 0, 0.2) 0%, transparent 50%),
    linear-gradient(115deg, transparent 35%, rgba(255, 150, 50, 0.12) 50%, transparent 65%);
  animation: star-spin-reverse 25s ease-in-out infinite alternate;
  mix-blend-mode: color-dodge;
  opacity: 0.8;
}

@keyframes star-spin {
  0% {
    transform: rotate(0deg) scale(1.2) translate(0, 0);
  }
  25% {
    transform: rotate(90deg) scale(1.22) translate(-2px, 2px);
  }
  50% {
    transform: rotate(180deg) scale(1.18) translate(2px, -2px);
  }
  75% {
    transform: rotate(270deg) scale(1.21) translate(-2px, -1px);
  }
  100% {
    transform: rotate(360deg) scale(1.2) translate(0, 0);
  }
}

@keyframes star-spin-reverse {
  0% {
    transform: rotate(360deg) scale(1.1) translate(0, 0);
  }
  30% {
    transform: rotate(240deg) scale(1.15) translate(2px, -2px);
  }
  65% {
    transform: rotate(120deg) scale(1.08) translate(-2px, 1px);
  }
  100% {
    transform: rotate(0deg) scale(1.3) translate(0, 0);
  }
}

/* Solar Flare Eruptions */
.solar-flare {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-top: -12.5px;
  /* Centering the left edge vertically */
  margin-left: 0;
  /* Left edge sits exactly at center */
  width: 30px;
  height: 10px;
  background: radial-gradient(ellipse at left, rgba(255, 200, 0, 0.95) 0%, rgba(255, 60, 0, 0.8) 40%, rgba(255, 0, 0, 0) 80%);
  border-radius: 50% 0 0 50%;
  /* organic curve for solar plume */
  filter: blur(2px);
  transform-origin: left center;
  opacity: 0;
  z-index: 8;
  /* behind the star body (z-index 10) for realistic edge eruptions */
  animation: flare-eruption 1.8s ease-out forwards;
}

@keyframes flare-eruption {
  0% {
    transform: rotate(var(--flare-angle)) translate(52px, 0) scaleX(0) scaleY(0.8);
    opacity: 0;
  }

  15% {
    opacity: 0.95;
  }

  45% {
    transform: rotate(var(--flare-angle)) translate(58px, 0) scaleX(var(--flare-scale-x, 1)) scaleY(var(--flare-scale-y, 1));
    opacity: 0.85;
  }

  100% {
    transform: rotate(var(--flare-angle)) translate(65px, 0) scaleX(0.1) scaleY(0.1);
    opacity: 0;
  }
}

/* Lava spitting droplets */
.lava-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-top: -1.5px;
  /* Center vertically */
  margin-left: -1.5px;
  /* Center horizontally */
  width: 3px;
  height: 3px;
  background: #ffea00;
  border-radius: 50%;
  box-shadow: 0 0 6px #ff5500, 0 0 12px #ff3300;
  opacity: 0;
  z-index: 11;
  /* in front of the star (z-index 10) to show spits crossing the surface/edge */
  transform-origin: center center;
  animation: spark-shoot 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes spark-shoot {
  0% {
    transform: rotate(var(--spark-angle)) translate(55px, 0) scale(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: rotate(var(--spark-angle)) translate(70px, 0) scale(1.3);
  }

  100% {
    transform: rotate(var(--spark-angle)) translate(var(--spark-distance, 130px), var(--spark-offset-y, 0px)) scale(0.2);
    opacity: 0;
  }
}

/* Bubbling lava dome cells */
.lava-bubble {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  pointer-events: none;
  filter: blur(3px);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  animation: lava-bubble-anim 3.5s ease-in-out forwards;
}

@keyframes lava-bubble-anim {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  30% {
    transform: translate(-50%, -50%) scale(0.65);
    opacity: 0.95;
  }
  60% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.85;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0;
    filter: blur(8px);
  }
}

.red-dwarf-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 0, 0.3) 0%, transparent 70%);
  filter: blur(10px);
  z-index: 9;
  transform: translateZ(-1px);
}

.orbit-plane {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transform: rotateX(15deg) rotateZ(-5deg);
  pointer-events: none;
}

.orbital-heading-wrapper {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  animation: orbit 25s infinite linear;
}

.orbital-heading {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  white-space: nowrap;
  color: #dae2fd;
  text-shadow: 0 0 15px rgba(68, 216, 241, 0.6);
}

@media (min-width: 768px) {
  .orbital-heading {
    font-size: 1.5rem;
  }
}

@keyframes orbit {
  0% {
    transform: rotateY(0deg) translateZ(280px) rotateY(0deg) scale(1);
    opacity: 1;
  }

  25% {
    transform: rotateY(90deg) translateZ(280px) rotateY(-90deg) scale(0.8);
    opacity: 0.6;
  }

  50% {
    transform: rotateY(180deg) translateZ(280px) rotateY(-180deg) scale(0.5);
    opacity: 0.1;
  }

  75% {
    transform: rotateY(270deg) translateZ(280px) rotateY(-270deg) scale(0.8);
    opacity: 0.6;
  }

  100% {
    transform: rotateY(360deg) translateZ(280px) rotateY(-360deg) scale(1);
    opacity: 1;
  }
}

.orbit-1 {
  animation-delay: 0s;
}

.orbit-2 {
  animation-delay: -5s;
}

.orbit-3 {
  animation-delay: -10s;
}

.orbit-4 {
  animation-delay: -15s;
}

.orbit-5 {
  animation-delay: -20s;
}

@media (min-width: 768px) {
  @keyframes orbit {
    0% {
      transform: rotateY(0deg) translateZ(380px) rotateY(0deg) scale(1);
      opacity: 1;
    }

    25% {
      transform: rotateY(90deg) translateZ(380px) rotateY(-90deg) scale(0.85);
      opacity: 0.7;
    }

    50% {
      transform: rotateY(180deg) translateZ(380px) rotateY(-180deg) scale(0.6);
      opacity: 0.15;
    }

    75% {
      transform: rotateY(270deg) translateZ(380px) rotateY(-270deg) scale(0.85);
      opacity: 0.7;
    }

    100% {
      transform: rotateY(360deg) translateZ(380px) rotateY(-360deg) scale(1);
      opacity: 1;
    }
  }
}

.space-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  /* subtle dark overlay on the canvas element so stars sit against deeper black */
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.hero-section {
  position: relative;
  z-index: 1;
}

.contact-section,
.footer {
  position: relative;
  z-index: 20;
}

.contact-section {
  padding: 6rem 0;
}

.glass-card {
  display: grid;
  gap: 2rem;
  justify-items: center;
  width: min(100%, 860px);
  margin: 0 auto;
  background: rgba(14, 15, 23, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  padding: 2rem;
  border-radius: 2rem;
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.35);
}

.section-label {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--color-primary);
}

.section-heading {
  margin: 0;
  font-size: clamp(2.25rem, 4vw, 3.75rem);
  font-weight: 800;
  color: var(--color-white);
}

.section-copy {
  margin-top: 1rem;
  color: var(--color-text-muted);
  line-height: 1.8;
  text-align: center;
}

.form-grid {
  display: grid;
  gap: 2rem;
  width: 100%;
  justify-content: center;
}

.field {
  display: grid;
  gap: 0.75rem;
}

.field-full {
  grid-column: 1 / -1;
}

.form-label {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.form-input,
.form-textarea {
  width: 100%;
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-white);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(199, 196, 217, 0.55);
}

.form-input:focus,
.form-textarea:focus {
  border-color: rgba(195, 192, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(195, 192, 255, 0.12);
}

.submit-button {
  width: auto;
  min-width: 260px;
  padding: 1.25rem 1.5rem;
  background: var(--color-primary);
  color: var(--color-surface);
  border: none;
  border-radius: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  box-shadow: 0 22px 48px rgba(195, 192, 255, 0.2);
  transition: background-color 0.25s ease, transform 0.25s ease;
  justify-self: center;
}

.submit-button:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
}

.submit-button.glow-active {
  box-shadow: 0 22px 48px rgba(195, 192, 255, 0.2),
    0 0 30px rgba(255, 145, 0, 0.6),
    0 0 60px rgba(255, 145, 0, 0.3),
    inset 0 0 20px rgba(255, 145, 0, 0.2);
  animation: button-glow 2s ease-in-out infinite;
}

@keyframes button-glow {

  0%,
  100% {
    box-shadow: 0 22px 48px rgba(195, 192, 255, 0.2),
      0 0 30px rgba(255, 145, 0, 0.6),
      0 0 60px rgba(255, 145, 0, 0.3),
      inset 0 0 20px rgba(255, 145, 0, 0.2);
  }

  50% {
    box-shadow: 0 22px 48px rgba(195, 192, 255, 0.2),
      0 0 40px rgba(255, 145, 0, 0.8),
      0 0 80px rgba(255, 145, 0, 0.4),
      inset 0 0 25px rgba(255, 145, 0, 0.3);
  }
}

.footer {
  padding: 4rem 0 3rem;
}

.footer-inner {
  display: grid;
  justify-items: center;
  padding: 0 1.5rem;
}

.footer-top {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  text-align: center;
}

.section-heading-group,
.footer-logo-group {
  display: grid;
  gap: 1rem;
  align-items: center;
  justify-items: center;
}

.footer-logo {
  width: 6rem;
  height: 6rem;
}

.footer-title {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  color: var(--color-white);
}

.brand-title .brand-accent,
.footer-title .brand-accent {
  color: var(--color-primary);
}

.footer-copy {
  max-width: 22rem;
  margin: 1.5rem auto 0;
  color: rgba(227, 225, 239, 0.8);
  font-size: 0.95rem;
  line-height: 1.8;
}

.footer-meta {
  margin-top: 2rem;
  /* removed border-top to eliminate grey separator line */
  padding-top: 1.5rem;
  display: grid;
  gap: 1rem;
  font-size: 0.8rem;
  color: rgba(229, 227, 239, 0.7);
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .submit-button {
    grid-column: 1 / -1;
  }

  .footer-top {
    grid-template-columns: 1fr;
    align-items: center;
    text-align: center;
  }

  .footer-meta {
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
    padding-top: 2rem;
  }
}

@media (min-width: 1024px) {
  .header-inner {
    padding: 0 2.25rem;
  }

  .glass-card {
    padding: 2.75rem;
  }
}

/* Mobile adjustments: slightly narrower card, reduced padding, keep inputs full-width */
@media (max-width: 639px) {
  .glass-card {
    width: calc(100% - 2rem);
    margin: 0 auto;
    padding: 1.25rem;
    border-radius: 1rem;
  }

  .form-grid {
    gap: 1rem;
  }

  .form-input,
  .form-textarea {
    width: 100%;
  }

  .submit-button {
    min-width: 180px;
    padding: 1rem 1.25rem;
    justify-self: center;
  }

  .section-heading {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
  }
}

/* ============================================
   Toast Notifications — Center Swoop & Premium Glow Animation
   ============================================ */

.k2-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  z-index: 9999;
  color: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  max-width: calc(100% - 32px);
  text-align: center;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.k2-toast.success {
  background: var(--toast-success-bg);
  border: 1px solid var(--toast-success-border);
}

.k2-toast.error {
  background: var(--toast-error-bg);
  border: 1px solid var(--toast-error-border);
}

/* ==========================================================================
   Spaceship Swooping Animation & Vintage Plane-style Banner
   ========================================================================== */

/* Outer wrapper: handles coordinate motion (swoop, stay, dive-off) at the bottom of the hero section */
.spaceship-wrapper {
  position: absolute;
  bottom: 8%;
  /* Sits safely below the red dwarf star and orbiting headers */
  top: auto;
  left: 50%;
  transform: translate(60vw, 0) scale(0.7) rotate(-3deg);
  /* start state offscreen-right */
  opacity: 0;
  z-index: 15;
  /* sits behind contact-section (z-index 20) and above star-container (z-index 10) */
  pointer-events: none;
  /* ensures no overlay blocks clicking inputs or forms */
  display: none;
  /* activated via Javascript setTimeout */
}

.spaceship-wrapper.swoop-active {
  display: block;
  animation: swoop-sequence 14s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Inner assembly: handles floating hover motion */
.spaceship-assembly {
  display: flex;
  flex-direction: row;
  /* Spaceship on left (leads), banner on right (trailing) */
  align-items: center;
}

.swoop-active .spaceship-assembly {
  animation: assembly-hover-sequence 14s ease-in-out forwards;
}

/* Sleek futuristic spaceship body */
.spaceship-body {
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px var(--spaceship-glow)) drop-shadow(0 0 20px rgba(255, 145, 0, 0.25));
  transform-origin: 50px 25px;
  /* center of ship for rotation */
}

.swoop-active .spaceship-body {
  /* Handles spaceship body mechanics (vibrate, detach, rotate, move-above-banner) */
  animation: spaceship-maneuver 14s ease-in-out forwards;
}

/* Engine boosters: fire during active maneuvers */
.booster-flames {
  transform-origin: 80px 25px;
  transform: scale(0);
  opacity: 0;
}

.swoop-active .booster-flames {
  animation: booster-sequence 14s ease-in-out forwards;
}

/* Engine booster flame flicker to look like a realistic solar flare plume */
.booster-flames-inner {
  transform-origin: 82px 25px;
  animation: engine-flicker 0.12s ease-in-out infinite alternate;
}

@keyframes engine-flicker {
  0% {
    transform: scaleX(0.9) scaleY(0.95);
    opacity: 0.85;
  }
  100% {
    transform: scaleX(1.15) scaleY(1.05);
    opacity: 1;
  }
}

/* Prop-plane style banner structure */
.prop-banner {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 20px;
  /* 20px gap for the tow strings connecting it to the spaceship */
  transform-origin: left center;
  flex-shrink: 0;
}

.swoop-active .prop-banner {
  animation: banner-flap-sequence 14s ease-in-out forwards;
}

/* Dynamic tow strings connecting spaceship to the banner */
.prop-banner-string {
  position: absolute;
  left: -20px;
  /* spans the 20px gap back to the spaceship */
  width: 20px;
  height: 1px;
  background: var(--color-white);
}

.prop-banner-string-top {
  top: 28%;
  transform: rotate(14deg);
  transform-origin: right top;
}

.prop-banner-string-bottom {
  bottom: 28%;
  transform: rotate(-14deg);
  transform-origin: right bottom;
}

.swoop-active .prop-banner-string {
  /* Strings detach/dissolve at 50% (7s) when the ship detaches, and reattach on dock at 62.9% (8.8s) */
  animation: horizontal-strings-sequence 14s ease-in-out forwards;
}

/* Vertical reattach tow string (decommissioned) */
.prop-banner-string-vertical {
  position: absolute;
  top: -25px;
  left: 50%;
  width: 1px;
  height: 25px;
  background: var(--color-white);
  transform: translateX(-50%) scaleY(0);
  transform-origin: bottom center;
  opacity: 0;
  z-index: 5;
}

.swoop-active .prop-banner-string-vertical {
  animation: vertical-string-sequence 14s ease-in-out forwards;
}

/* Spaceship message banner styling (Tech-infused retro glassmorphism with dynamic glowing border) */
.prop-banner-content {
  background: rgba(18, 19, 28, 0.65);
  /* dark translucent glass */
  border: 2px solid var(--color-primary);
  /* orange border */
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 6px;
  padding: 8px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 10;
  width: 340px;
  /* Fixed width to prevent wrapper center shifts when text content changes */
  box-sizing: border-box;
  /* Includes padding in the width */
  overflow: hidden;
}

/* Reinforced grommet where tow strings connect */
.prop-banner-content::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 10px;
  border-left: 2px solid var(--color-primary);
  /* matching orange */
  background: transparent;
}

/* Bold vintage typewriter text */
.prop-banner-text {
  color: var(--color-text);
  /* crisp text color matching branding */
  font-family: 'Courier New', Courier, monospace;
  font-weight: 900;
  font-size: 0.98rem;
  /* slightly larger text */
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  white-space: normal;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  /* drop shadow for readability */
  transition: opacity 0.4s ease-in-out;
}

.prop-banner-text.message-fade-out {
  opacity: 0;
}

/* ----------------------------------------------------------------------
   Keyframe Animations (14-Second Sequence)
   ---------------------------------------------------------------------- */

/* 1. Outer Wrapper: Swoop-in -> Stay Centered -> Dive straight down behind contact form */
@keyframes swoop-sequence {
  0% {
    transform: translate(60vw, 0) scale(0.6) rotate(-5deg);
    opacity: 0;
  }

  8% {
    opacity: 1;
  }

  21.4% {
    /* Anchored center position below the hero container */
    transform: translate(-50%, 0) scale(1) rotate(0deg);
    opacity: 1;
  }

  85.7% {
    /* Holds centered position during the detach-rotate-dock maneuver & text display */
    transform: translate(-50%, 0) scale(1) rotate(0deg);
    opacity: 1;
  }

  100% {
    /* Dive straight down-screen behind the contact form */
    transform: translate(-50%, 140vh) scale(1) rotate(0deg);
    opacity: 0;
  }
}

/* 2. Spaceship Body: Hover -> Vibrate -> Detach (Fly Left) -> Rotate 90deg Down -> Dock back to Left Side */
@keyframes spaceship-maneuver {

  0%,
  37.1% {
    transform: translate(0, 0) rotate(0deg);
  }

  39.3% {
    /* Boosters fire up, engine vibration */
    transform: translate(-3px, 0) rotate(0.5deg);
  }

  42.9% {
    /* Detaches and moves left, snapping strings */
    transform: translate(-90px, 0) rotate(0deg);
  }

  50% {
    /* Rotates 90 degrees right (nose faces downwards) */
    transform: translate(-90px, 0) rotate(-90deg);
  }

  55.7% {
    /* Moves back to dock on the left side of the banner, pointing down */
    transform: translate(15px, 0) rotate(-90deg);
  }

  100% {
    /* Stay docked during vertical dive */
    transform: translate(15px, 0) rotate(-90deg);
  }
}

/* 3. Engine Booster scale and glow sequence */
@keyframes booster-sequence {

  0%,
  36.4% {
    transform: scale(0);
    opacity: 0;
  }

  42.9% {
    /* Boosters ignite at detach */
    transform: scale(1.6);
    opacity: 1;
  }

  50% {
    /* Medium power during rotation */
    transform: scale(1.1);
    opacity: 0.8;
  }

  55.7% {
    /* Low power during docking */
    transform: scale(0.9);
    opacity: 0.6;
  }

  85.7% {
    /* Full blast for down-screen dive */
    transform: scale(1.8);
    opacity: 1;
  }

  100% {
    transform: scale(1.8);
    opacity: 1;
  }
}

/* 4. Snapping horizontal tow lines, then reattaching on dock */
@keyframes horizontal-strings-sequence {

  0%,
  42.9% {
    opacity: 1;
    transform: scaleX(1);
  }

  46.4%,
  55% {
    opacity: 0;
    transform: scaleX(0);
  }

  55.7%,
  100% {
    opacity: 1;
    transform: scaleX(1);
  }
}

/* 5. Deploying vertical reattach tow line (not used for side redocking) */
@keyframes vertical-string-sequence {

  0%,
  100% {
    opacity: 0;
    transform: translateX(-50%) scaleY(0);
  }
}

/* 6. Floating idle hover simulation (restricted to post-docking phase) */
@keyframes assembly-hover-sequence {
  0%,
  55.7% {
    transform: translateY(0px) rotate(0deg);
  }

  /* First hover cycle */
  63.2% {
    transform: translateY(-6px) rotate(-0.5deg);
  }

  70.7% {
    transform: translateY(0px) rotate(0deg);
  }

  /* Second hover cycle */
  78.2% {
    transform: translateY(3px) rotate(0.5deg);
  }

  85.7%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

/* 7. Prop-banner aerodynamic flapping loop (Only during active flight phase) */
@keyframes banner-flap-sequence {
  0%,
  100% {
    transform: rotate(0deg) skewY(0deg);
  }
}

/* Custom Orange Downward Arrow SVG in Banner */
.prop-banner-arrow {
  color: var(--color-primary);
  vertical-align: middle;
  margin: 0 4px;
  display: inline-block;
  line-height: 1;
}

.prop-banner-arrow svg {
  width: 14px;
  height: 14px;
  stroke-width: 3.5;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .spaceship-wrapper {
    transform: translate(60vw, 0) scale(0.65);
    bottom: 12%;
    /* Sits slightly higher on mobile for visibility */
  }

  @keyframes swoop-sequence {
    0% {
      transform: translate(60vw, 0) scale(0.5) rotate(-5deg);
      opacity: 0;
    }

    8% {
      opacity: 1;
    }

    21.4% {
      transform: translate(-50%, 0) scale(0.85) rotate(0deg);
      opacity: 1;
    }

    85.7% {
      transform: translate(-50%, 0) scale(0.85) rotate(0deg);
      opacity: 1;
    }

    100% {
      transform: translate(-50vw, 140vh) scale(0.85) rotate(0deg);
      opacity: 0;
    }
  }

  @keyframes spaceship-maneuver {

    0%,
    37.1% {
      transform: translate(0, 0) rotate(0deg);
    }

    39.3% {
      transform: translate(-2px, 0) rotate(0.5deg);
    }

    42.9% {
      transform: translate(-70px, 0) rotate(0deg);
    }

    50% {
      transform: translate(-70px, 0) rotate(-90deg);
    }

    55.7% {
      /* Dock back to the left side of the banner, pointing down */
      transform: translate(15px, 0) rotate(-90deg);
    }

    100% {
      transform: translate(15px, 0) rotate(-90deg);
    }
  }

  .prop-banner-content {
    width: 240px;
    box-sizing: border-box;
    padding: 6px 12px;
  }

  .prop-banner-text {
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   Hamburger Menu & Side Drawer - Cosmic Glassmorphic Design
   ========================================================================== */

/* Menu toggle button in header */
.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: transform 0.2s ease;
  border-radius: 50%;
  width: 3.5rem;
  height: 3.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-toggle:hover {
  background: rgba(255, 145, 0, 0.1);
  border-color: rgba(255, 145, 0, 0.3);
  box-shadow: 0 0 15px rgba(255, 145, 0, 0.2);
}

.hamburger-box {
  width: 1.75rem;
  height: 1.25rem;
  display: inline-block;
  position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  width: 1.75rem;
  height: 2px;
  background-color: var(--color-white);
  position: absolute;
  transition-property: transform, top, bottom, background-color;
  transition-duration: 0.3s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 4px;
}

.hamburger-inner {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-inner::before {
  content: "";
  top: -7px;
}

.hamburger-inner::after {
  content: "";
  bottom: -7px;
}

/* Transform hamburger to 'X' when open */
.menu-toggle[aria-expanded="true"] .hamburger-inner {
  background-color: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger-inner::before {
  top: 0;
  transform: rotate(45deg);
  background-color: var(--color-primary);
}

.menu-toggle[aria-expanded="true"] .hamburger-inner::after {
  bottom: 0;
  transform: rotate(-45deg);
  background-color: var(--color-primary);
}

/* Drawer overlay backdrop */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 8, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.drawer-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Side drawer panel */
.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 420px);
  background: rgba(10, 11, 20, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 95;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
}

.side-drawer.is-active {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
}

.close-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.drawer-content {
  flex: 1;
  padding: 0 2rem 2rem;
  overflow-y: auto;
}

.drawer-section-title {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
}

/* Application list styling */
.apps-grid {
  display: grid;
  gap: 1.25rem;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.app-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 145, 0, 0.35);
  box-shadow: 0 10px 25px rgba(255, 145, 0, 0.1), 
              0 0 15px rgba(255, 145, 0, 0.05);
  transform: translateY(-2px);
}

.app-logo-wrapper {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.app-card:hover .app-logo-wrapper {
  transform: scale(1.08) rotate(2deg);
  border-color: rgba(255, 145, 0, 0.5);
  box-shadow: 0 0 10px rgba(255, 145, 0, 0.2);
}

.app-card-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
}

.app-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.app-card-name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-white);
  transition: color 0.2s;
}

.app-card:hover .app-card-name {
  color: var(--color-primary);
}

.app-card-link-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Sub-menu accordion styling */
.submenu-toggle {
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: inherit;
  font-family: inherit;
  outline: none;
  display: flex;
  align-items: center;
  position: relative;
}

.submenu-chevron {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.3s;
}

.submenu-toggle:hover .submenu-chevron {
  color: var(--color-primary);
}

.submenu-toggle[aria-expanded="true"] .submenu-chevron {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.submenu-links-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 1rem;
  margin-left: 2.75rem; /* Aligned with the text of the app-card */
  border-left: 1.5px solid rgba(255, 145, 0, 0.2);
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.25s ease, margin 0.3s ease;
}

.submenu-link {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  display: block;
}

.submenu-link:hover {
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.04);
  padding-left: 1.15rem; /* Premium slide-in effect */
}

.submenu-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}