/* ================================================
   HEADER — views/partials/header.css
   Premium purple/lavender sticky navigation bar
   ================================================ */
.main-header {
  position: relative;
  height: 70px;
  display: flex;
  align-items: center;
  z-index: 10000 !important;
  background: var(--bg-secondary); /* Solid visible background */
  border-bottom: 1.5px solid var(--border);
  box-shadow: none;
  transition: background var(--transition-normal), border-color var(--transition-normal);
}

/* Scroll shadow adjustment */
.main-header.scrolled {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.08);
}

/* ── Inner flex row ── */
.header-inner {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 24px;
}

/* ── Logo ── */
.logo {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.logo:hover { color: var(--text-primary); }

.brand-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ── Desktop Nav Menu ── */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0 auto; /* centre between logo and actions */
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: left var(--transition-normal), right var(--transition-normal);
}
.nav-link:hover,
.nav-link.active {
  color: var(--purple-500);
  background: var(--bg-tertiary);
}
.nav-link:hover::after,
.nav-link.active::after {
  left: 10px;
  right: 10px;
}

/* ── Primary CTA in Nav ── */
.btn-nav-cta {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-actions {
  display: flex ;
  flex-direction: row ;
  align-items: center ;
  gap: 10px ;
  flex-shrink: 0 ;
  flex-wrap: nowrap ;
}

/* ── All Tools Menu Container & Mobile/Tablet Defaults ── */
.tools-menu-container {
  display: flex;
  align-items: center;
  position: static;
}

.tools-nav-text,
.tools-nav-chevron {
  display: none;
}

.mega-menu {
  display: none !important;
}

/* ── All Tools Nav Button (Mobile/Tablet Base: 40x40 icon button) ── */
.tools-nav-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  transition:
    color           var(--transition-fast),
    border-color    var(--transition-fast),
    background      var(--transition-fast),
    transform       var(--transition-fast),
    box-shadow      var(--transition-fast);
}
.tools-nav-btn:hover {
  color: var(--purple-500);
  border-color: var(--purple-500);
  background: var(--lavender-100);
  transform: scale(1.07);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.tools-nav-btn:active { transform: scale(0.95); }
.tools-nav-btn .icon-grid-2484a1,
.tools-nav-btn .icon {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-normal);
}
.tools-nav-btn:hover .icon-grid-2484a1,
.tools-nav-btn:hover .icon {
  transform: rotate(90deg);
}

/* ── Large Screen Mega Menu & Expanded All Tools Button (min-width: 1025px) ── */
@media (min-width: 1025px) {
  .tools-nav-btn {
    width: auto;
    height: 40px;
    padding: 0 14px;
    gap: 8px;
    border-radius: 12px;
  }

  .tools-nav-btn:hover,
  .tools-menu-container.is-open .tools-nav-btn {
    transform: none;
    color: var(--purple-500);
    border-color: var(--purple-500);
    background: var(--lavender-100);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
  }

  [data-theme='dark'] .tools-nav-btn:hover,
  [data-theme='dark'] .tools-menu-container.is-open .tools-nav-btn {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--purple-400);
    color: var(--purple-400);
  }

  .tools-nav-text {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
    transition: color var(--transition-fast);
  }

  .tools-nav-btn:hover .tools-nav-text,
  .tools-menu-container.is-open .tools-nav-text {
    color: var(--purple-600);
  }

  [data-theme='dark'] .tools-nav-btn:hover .tools-nav-text,
  [data-theme='dark'] .tools-menu-container.is-open .tools-nav-text {
    color: var(--purple-400);
  }

  .tools-nav-chevron {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask: url('/assets/icons/chevron-down.svg') no-repeat center / contain;
    mask: url('/assets/icons/chevron-down.svg') no-repeat center / contain;
    transform: rotate(0deg);
    transform-origin: center center;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), color var(--transition-fast);
    flex-shrink: 0;
  }

  .tools-nav-btn:hover .tools-nav-chevron,
  .tools-menu-container.is-open .tools-nav-chevron {
    transform: rotate(180deg);
    color: var(--purple-500);
  }

  [data-theme='dark'] .tools-nav-btn:hover .tools-nav-chevron,
  [data-theme='dark'] .tools-menu-container.is-open .tools-nav-chevron {
    color: var(--purple-400);
  }

  /* ── Mega Menu Floating Dropdown Card ── */
  .mega-menu {
    display: block !important;
    position: absolute;
    top: calc(100% + 8px);
    left: 24px;
    right: 24px;
    width: calc(100% - 48px);
    max-height: min(420px, calc(100vh - 90px));
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    padding: 22px 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.22s;
    z-index: 10001;
    box-sizing: border-box;
  }

  .mega-menu::-webkit-scrollbar {
    width: 6px;
  }
  .mega-menu::-webkit-scrollbar-track {
    background: transparent;
  }
  .mega-menu::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.35);
    border-radius: 4px;
  }
  .mega-menu::-webkit-scrollbar-thumb:hover {
    background: var(--purple-500);
  }

  [data-theme='dark'] .mega-menu {
    background: #0d081b;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  }

  /* Invisible hover bridge between header button and mega menu */
  .mega-menu::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
    background: transparent;
  }

  /* Hover & Active State */
  .tools-menu-container:hover .mega-menu,
  .tools-menu-container.is-open .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Grid Layout (Auto-fit Columns with dynamic wrapping) */
  .mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px 22px;
  }

  .mega-menu-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mega-menu-category-title {
    font-family: var(--font-heading);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mega-menu-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .mega-tool-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    min-width: 0;
  }

  .mega-tool-item:hover {
    background: var(--lavender-100);
    color: var(--purple-600);
    transform: translateX(2px);
  }

  [data-theme='dark'] .mega-tool-item:hover {
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple-400);
  }

  /* ── All Tool Icons Uniform Theme Purple Styling ── */
  .mega-tool-icon-wrapper {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(124, 58, 237, 0.1);
    color: var(--purple-500);
    transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
  }

  [data-theme='dark'] .mega-tool-icon-wrapper {
    background: rgba(139, 92, 246, 0.18);
    color: var(--purple-400);
  }

  .mega-tool-item:hover .mega-tool-icon-wrapper {
    transform: scale(1.1);
    background: var(--purple-500);
    color: #ffffff;
  }

  [data-theme='dark'] .mega-tool-item:hover .mega-tool-icon-wrapper {
    background: var(--purple-400);
    color: #0d081b;
  }

  .mega-tool-icon-wrapper .icon {
    width: 16px;
    height: 16px;
    background-color: currentColor;
  }

  /* Global root-relative paths for mega menu tool icons */
  .mega-tool-icon-wrapper .icon-case-converter-hash { -webkit-mask-image: url('/assets/icons/case-converter-hash-502bcf.svg'); mask-image: url('/assets/icons/case-converter-hash-502bcf.svg'); }
  .mega-tool-icon-wrapper .icon-color-picker-suite { -webkit-mask-image: url('/assets/icons/color-picker-suite.svg'); mask-image: url('/assets/icons/color-picker-suite.svg'); }
  .mega-tool-icon-wrapper .icon-file-text { -webkit-mask-image: url('/assets/icons/file-text-ef7eeb.svg'); mask-image: url('/assets/icons/file-text-ef7eeb.svg'); }
  .mega-tool-icon-wrapper .icon-image-compressor-camera { -webkit-mask-image: url('/assets/icons/image-compressor-camera-15db41.svg'); mask-image: url('/assets/icons/image-compressor-camera-15db41.svg'); }
  .mega-tool-icon-wrapper .icon-image-resizer-crop { -webkit-mask-image: url('/assets/icons/image-resizer-crop-d019f4.svg'); mask-image: url('/assets/icons/image-resizer-crop-d019f4.svg'); }
  .mega-tool-icon-wrapper .icon-sparkles { -webkit-mask-image: url('/assets/icons/sparkles.svg'); mask-image: url('/assets/icons/sparkles.svg'); }
  .mega-tool-icon-wrapper .icon-password-generator { -webkit-mask-image: url('/assets/icons/password-generator.svg'); mask-image: url('/assets/icons/password-generator.svg'); }
  .mega-tool-icon-wrapper .icon-qr-generator { -webkit-mask-image: url('/assets/icons/qr-generator.svg'); mask-image: url('/assets/icons/qr-generator.svg'); }
  .mega-tool-icon-wrapper .icon-heart { -webkit-mask-image: url('/assets/icons/heart.svg'); mask-image: url('/assets/icons/heart.svg'); }
  .mega-tool-icon-wrapper .icon-calendar { -webkit-mask-image: url('/assets/icons/calendar.svg'); mask-image: url('/assets/icons/calendar.svg'); }
  .mega-tool-icon-wrapper .icon-browse-colors { -webkit-mask-image: url('/assets/icons/browse-colors.svg'); mask-image: url('/assets/icons/browse-colors.svg'); }
  .mega-tool-icon-wrapper .icon-adjust { -webkit-mask-image: url('/assets/icons/adjust.svg'); mask-image: url('/assets/icons/adjust.svg'); }
  .mega-tool-icon-wrapper .icon-code { -webkit-mask-image: url('/assets/icons/code.svg'); mask-image: url('/assets/icons/code.svg'); }
  .mega-tool-icon-wrapper .icon-layers { -webkit-mask-image: url('/assets/icons/layers.svg'); mask-image: url('/assets/icons/layers.svg'); }
  .mega-tool-icon-wrapper .icon-color-picker { -webkit-mask-image: url('/assets/icons/color-picker.svg'); mask-image: url('/assets/icons/color-picker.svg'); }
  .mega-tool-icon-wrapper .icon-color-palette { -webkit-mask-image: url('/assets/icons/color-palette.svg'); mask-image: url('/assets/icons/color-palette.svg'); }
  .mega-tool-icon-wrapper .icon-palette-generator { -webkit-mask-image: url('/assets/icons/palette-generator.svg'); mask-image: url('/assets/icons/palette-generator.svg'); }
  .mega-tool-icon-wrapper .icon-gradient-maker { -webkit-mask-image: url('/assets/icons/gradient-maker.svg'); mask-image: url('/assets/icons/gradient-maker.svg'); }
  .mega-tool-icon-wrapper .icon-pdf-merger { -webkit-mask-image: url('/assets/icons/pdf-merger.svg'); mask-image: url('/assets/icons/pdf-merger.svg'); }

  .mega-tool-name {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }
}

/* Intermediate Large Screens: Slightly tighter padding */
@media (min-width: 1025px) and (max-width: 1240px) {
  .mega-menu {
    padding: 20px 22px;
  }
  .mega-menu-grid {
    gap: 16px 18px;
  }
  .mega-tool-item {
    padding: 5px 6px;
    gap: 7px;
  }
  .mega-tool-name {
    font-size: 0.82rem;
  }
  .mega-menu-category-title {
    font-size: 0.7rem;
  }
}

/* ── Theme Toggle Button ── */
.theme-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    color           var(--transition-fast),
    border-color    var(--transition-fast),
    background      var(--transition-fast),
    transform       var(--transition-fast),
    box-shadow      var(--transition-fast);
  overflow: hidden;
}
.theme-btn:hover {
  color: var(--purple-500);
  border-color: var(--purple-500);
  /* background: var(--lavender-100); */
  transform: scale(1.07);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.theme-btn:active { transform: scale(0.95); }
.theme-btn svg,.theme-btn .icon,
.theme-btn img ,.theme-btn .icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-primary) !important;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition-normal);
}
.theme-btn:hover svg,.theme-btn:hover .icon,
.theme-btn:hover img ,.theme-btn:hover .icon {
  transform: rotate(45deg);
}

/* ── Hamburger (mobile only) ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.nav-hamburger:hover {
  border-color: var(--purple-500);
  background: var(--lavender-100);
}
.nav-hamburger .bar {
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-normal);
  transform-origin: center;
}
/* Hamburger → X animation */
.nav-hamburger[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px)  rotate(45deg);  }
.nav-hamburger[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile Breakpoint ── */
@media (max-width: 860px) {
  .nav-hamburger { display: flex; }

  .nav-menu {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 20px;
    /* Slide up hidden by default */
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
    z-index: 10002;
    margin: 0;
  }
  .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: 13px 16px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }
  .nav-link:last-of-type { border-bottom: none; }
  .nav-link::after { display: none; }
}

@media (max-width: 480px) {
  .btn-nav-cta { display: none; }
  .logo { font-size: 1.15rem; gap: 8px; }
  .brand-logo-img { width: 28px; height: 28px; border-radius: 7px; }
}

/* ==========================================================================
   JET FLIGHT & MATRIX ANIMATION SYSTEM (Large Screens Only)
   ========================================================================== */

/* ── Logo Desktop/Mobile Switch ── */
.logo-desktop {
  display: none;
}
.logo-mobile {
  display: flex;
  align-items: center;
}

/* ── Mobile & Tablet: Right-to-Left Gradient Sweep (2s sweep, runs once at page load) ── */
.mobile-matrix-text {
  display: inline-block;
  color: var(--text-primary);
  background: linear-gradient(90deg,
    currentColor 0%,
    currentColor 30%,
    var(--purple-500) 45%,
    var(--lavender-300) 55%,
    var(--purple-400) 65%,
    currentColor 80%,
    currentColor 100%
  );
  background-size: 400px 100%;
  background-position: 0px 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: mobile-matrix-sweep 6s cubic-bezier(0.25, 1, 0.5, 1) 0.1s 1 forwards;
  will-change: background-position;
}

[data-theme='dark'] .mobile-matrix-text {
  background: linear-gradient(90deg,
    currentColor 0%,
    currentColor 30%,
    var(--purple-400) 45%,
    #ffffff 55%,
    var(--lavender-200) 65%,
    currentColor 80%,
    currentColor 100%
  );
  background-size: 400px 100%;
  background-position: 0px 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes mobile-matrix-sweep {
  0% {
    background-position: 0px 0;
  }
  100% {
    background-position: -400px 0;
  }
}

@media (min-width: 861px) {
  .logo {
    width: auto !important;
    max-width: none !important;
    gap: 12px;
  }
  .brand-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .logo-desktop {
    display: flex;
    align-items: center;
    position: relative;
    width: 165px; /* Fixed width stops translation from pushing right-side header nav-actions */
    flex-shrink: 0;
  }
  .logo-mobile {
    display: none;
  }
}

/* ── Runway Wrapper and Layout ── */
.logo-runway-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  height: 40px;
  padding: 0 4px;
  overflow: visible;
  width: 100%;
}

.logo-text-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
  z-index: 1;
}

.matrix-text-wrapper {
  /* inline-block so width can be pinned by JS — inline-flex can resize */
  display: inline-block;
  overflow: hidden;
  height: 32px;
  position: relative;
  flex-shrink: 0;
  vertical-align: middle;
}

.matrix-text {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transform-origin: center bottom;
  white-space: nowrap;
  overflow: hidden;
  will-change: transform, opacity, background-position;
  background: linear-gradient(90deg,
    currentColor 0%,
    currentColor 30%,
    var(--purple-500) 45%,
    var(--lavender-300) 55%,
    var(--purple-400) 65%,
    currentColor 80%,
    currentColor 100%
  );
  background-size: 400px 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Per-letter scramble spans */
.matrix-text .mc {
  display: inline-block;
  font-size: 1.1rem;           /* scrambling — smaller */
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  transition: font-size 0.1s ease-out, color 0.15s ease-out;
  -webkit-text-fill-color: inherit;
}

/* Scrambling dynamic letters — Hacker Green */
.matrix-text .mc[data-state="scrambling"] {
  color: #00d25b;
  -webkit-text-fill-color: #00d25b;
  text-shadow: 0 0 5px rgba(0, 210, 91, 0.4);
}

[data-theme='dark'] .matrix-text .mc[data-state="scrambling"] {
  color: #00ff66;
  -webkit-text-fill-color: #00ff66;
  text-shadow: 0 0 6px rgba(0, 255, 102, 0.7), 0 0 12px rgba(0, 255, 102, 0.4);
}

/* Revealed letter — jump to full size and original text color */
.matrix-text .mc[data-state="revealed"] {
  font-size: 1.3rem;
  color: var(--text-primary);
  -webkit-text-fill-color: inherit;
  text-shadow: none;
}


.runway-text {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.runway-line {
  position: absolute;
  bottom: 0px;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--purple-500) 0px,
    var(--purple-500) 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.15;
  transition: opacity 0.3s ease, filter 0.3s ease;
  pointer-events: none;
}

/* ── Jet Flight Container & Silhouette ── */
.jet-flight-container {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  will-change: transform, opacity;
}

.jet-flight {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: 80px;
  height: 100%;
  will-change: transform;
}

/* Airplane Silhouette Wireframe */
.flight-silhouette {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90px;
  height: 25px;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 0 3px rgba(139, 92, 246, 0.5));
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: opacity;
}

[data-theme='dark'] .flight-silhouette {
  filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.7));
}
/* Override fill colour to match theme via CSS — the SVG uses class .cls-1 */
.flight-silhouette .cls-1 {
  fill: #8b5cf6;
}
[data-theme='dark'] .flight-silhouette .cls-1 {
  fill: #a78bfa;
}

/* Jet Contrail (Smoke Trail) */
.jet-flight::after {
  content: '';
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 0px;
  height: 2px;
  background: linear-gradient(90deg, var(--purple-500), transparent);
  opacity: 0;
  pointer-events: none;
  border-radius: var(--radius-full);
  will-change: width, opacity;
}

/* Tire Smoke Puffs */
.runway-smoke {
  position: absolute;
  bottom: 4px;
  width: 20px;
  height: 8px;
  background: radial-gradient(
    circle,
    rgba(15, 23, 42, 0.85) 0%,
    rgba(30, 41, 59, 0.55) 45%,
    rgba(71, 85, 105, 0.15) 70%,
    transparent 80%
  );
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  filter: blur(1.2px);
  will-change: transform, opacity, filter;
  z-index: 3;
}

[data-theme='dark'] .runway-smoke {
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(226, 232, 240, 0.55) 45%,
    rgba(203, 213, 225, 0.15) 70%,
    transparent 80%
  );
}

.smoke-1 {
  left: 12px;
}

.smoke-2 {
  left: 28px;
}

/* ── Coordinated Animations (min-width: 861px) — Runs 1 time at page load, not infinite ── */
@media (min-width: 861px) {
  .jet-flight-container {
    animation: flight-path 40s ease-in 1 forwards;
  }

  .flight-silhouette {
    animation: silhouette-visibility 40s ease-in 1 forwards;
  }

  .jet-flight::after {
    animation: contrail-glow 40s ease-in 1 forwards;
  }

  /* CSS only handles translateY rise. Shimmer is pure JS (backgroundPosition).
     No class-based animation changes — they would restart the matrix-rise clock. */
  .matrix-text {
    animation: matrix-rise 40s ease-in 1 forwards;
  }

  .runway-line {
    animation: runway-activation 40s ease-in 1 forwards;
  }

  .runway-smoke.smoke-1 {
    animation: touchdown-smoke-1 40s ease-in 1 forwards;
  }

  .runway-smoke.smoke-2 {
    animation: touchdown-smoke-2 40s ease-in 1 forwards;
  }
}

/* ── Animation Keyframes (40s Total Cycle — 10s flight & landing & reveal + 30s rest pause) ── */
@keyframes flight-path {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0; }
  4.0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; animation-timing-function: cubic-bezier(0.4, 0, 1, 1); }
  6.4% { transform: translate(-240px, -24px) rotate(12deg) scale(0.85); opacity: 0; }
  6.5% { transform: translate(600px, -30px) rotate(-8deg) scale(0.85); opacity: 0; }
  8.0% { transform: translate(600px, -30px) rotate(-8deg) scale(0.85); opacity: 0; animation-timing-function: linear; }
  8.4% { transform: translate(500px, -25px) rotate(-8deg) scale(0.85); opacity: 1; animation-timing-function: linear; }
  13.6% { transform: translate(20px, 0px) rotate(-1deg) scale(1.02); opacity: 1; animation-timing-function: cubic-bezier(0.1, 0.8, 0.2, 1); }
  14.4% { transform: translate(0px, 0px) rotate(0deg) scale(1); opacity: 0; }
  15.6% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0; }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0; }
}

@keyframes silhouette-visibility {
  0% { opacity: 0; }
  4.0% { opacity: 0; animation-timing-function: ease-in-out; }
  4.8% { opacity: 0.85; }
  6.3% { opacity: 0.85; }
  6.4% { opacity: 0; }
  8.0% { opacity: 0; animation-timing-function: ease-in-out; }
  8.4% { opacity: 0.85; }
  13.6% { opacity: 0.85; animation-timing-function: ease-out; }
  14.8% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes contrail-glow {
  0% { width: 0px; opacity: 0; }
  4.0% { width: 0px; opacity: 0; }
  4.2% { width: 10px; opacity: 0.7; }
  5.6% { width: 30px; opacity: 0.8; }
  6.2% { width: 30px; opacity: 0.8; }
  6.4% { width: 0px; opacity: 0; }
  8.0% { width: 0px; opacity: 0; }
  8.4% { width: 15px; opacity: 0.7; }
  11.0% { width: 25px; opacity: 0.8; }
  13.2% { width: 15px; opacity: 0.5; }
  13.6% { width: 0px; opacity: 0; }
  100% { width: 0px; opacity: 0; }
}

@keyframes matrix-rise {
  0% { transform: translateY(0); opacity: 1; }
  4.0% { transform: translateY(0); opacity: 1; animation-timing-function: ease-in; }
  5.0% { transform: translateY(110%); opacity: 0; }
  13.6% { transform: translateY(110%); opacity: 0; animation-timing-function: cubic-bezier(0.1, 0.8, 0.2, 1); }
  15.6% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes runway-activation {
  0% { opacity: 0.15; filter: drop-shadow(0 0 0px var(--purple-500)); }
  4.0% { opacity: 0.15; filter: drop-shadow(0 0 0px var(--purple-500)); }
  4.2% { opacity: 0.6; filter: drop-shadow(0 0 3px var(--purple-500)); }
  5.6% { opacity: 0.6; filter: drop-shadow(0 0 3px var(--purple-500)); }
  6.4% { opacity: 0.15; filter: drop-shadow(0 0 0px var(--purple-500)); }
  8.0% { opacity: 0.15; }
  8.4% { opacity: 0.5; filter: drop-shadow(0 0 3px var(--purple-500)); }
  11.6% { opacity: 0.5; filter: drop-shadow(0 0 3px var(--purple-500)); }
  13.2% { opacity: 0.5; filter: drop-shadow(0 0 3px var(--purple-500)); }
  13.6% { opacity: 0.95; filter: drop-shadow(0 0 8px var(--purple-500)); } /* Touchdown flash */
  14.8% { opacity: 0.4; filter: drop-shadow(0 0 2px var(--purple-500)); }
  15.6% { opacity: 0.15; filter: drop-shadow(0 0 0px var(--purple-500)); }
  100% { opacity: 0.15; filter: drop-shadow(0 0 0px var(--purple-500)); }
}

@keyframes touchdown-smoke-1 {
  0% { opacity: 0; transform: translate(0, 0) scale(0.2); filter: blur(1.2px); }
  13.5% { opacity: 0; transform: translate(0, 0) scale(0.2); filter: blur(1.2px); }
  13.6% { opacity: 0.95; transform: translate(0, 0) scale(0.85); filter: blur(0.8px); }
  14.2% { opacity: 0.6; transform: translate(18px, -4px) scale(1.35); filter: blur(2px); }
  14.8% { opacity: 0; transform: translate(36px, -8px) scale(1.7); filter: blur(3.5px); }
  100% { opacity: 0; transform: translate(36px, -8px) scale(1.7); filter: blur(3.5px); }
}

@keyframes touchdown-smoke-2 {
  0% { opacity: 0; transform: translate(0, 0) scale(0.2); filter: blur(1.2px); }
  13.6% { opacity: 0; transform: translate(0, 0) scale(0.2); filter: blur(1.2px); }
  13.7% { opacity: 0.95; transform: translate(0, 0) scale(0.85); filter: blur(0.8px); }
  14.3% { opacity: 0.6; transform: translate(18px, -4px) scale(1.35); filter: blur(2px); }
  14.9% { opacity: 0; transform: translate(36px, -8px) scale(1.7); filter: blur(3.5px); }
  100% { opacity: 0; transform: translate(36px, -8px) scale(1.7); filter: blur(3.5px); }
}
