/* Typography + base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-deep: #03080f;
  --bg-panel: rgba(8, 20, 32, 0.72);
  --cyan: #00f5d4;
  --mag: #ff00aa;
  --text: #e8f4ff;
  --muted: #7a9ab8;
  --border-glow: rgba(0, 245, 212, 0.35);
  --font-display: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Fira Code", Consolas, monospace;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-display);
  background:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(0, 245, 212, 0.12), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(255, 0, 170, 0.08), transparent),
    var(--bg-deep);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

.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;
}

.hidden {
  display: none !important;
}

/* Cursor spotlight */
.spotlight {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--sx, 50%) var(--sy, 50%),
    rgba(0, 245, 212, 0.06),
    transparent 40%
  );
  z-index: 0;
}

.app-root {
  position: relative;
  z-index: 1;
  max-width: 52rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* Boot overlay */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 0, 170, 0.18), transparent 45%),
    radial-gradient(circle at 70% 80%, rgba(0, 245, 212, 0.12), transparent 50%),
    var(--bg-deep);
}

.boot-grid {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(0, 245, 212, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 212, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: grid-drift 20s linear infinite;
}

.boot-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background: repeating-linear-gradient(
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.65) 2px,
    rgba(0, 0, 0, 0.65) 4px
  );
}

@keyframes grid-drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 48px 48px, 48px 48px;
  }
}

.boot-inner {
  text-align: center;
  padding: 2rem;
  max-width: 28rem;
}

.boot-brand {
  font-family: var(--font-mono);
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  color: var(--cyan);
  margin-bottom: 1.75rem;
  text-transform: uppercase;
}

.boot-status {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  min-height: 3.2rem;
  color: var(--text);
}

.boot-foot {
  margin-top: 1.75rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boot-bar-wrap {
  height: 4px;
  background: rgba(0, 245, 212, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 1rem;
}

.boot-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mag), var(--cyan));
  border-radius: 2px;
  transition: width 0.3s ease-out;
}

.boot-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.85s ease,
    visibility 0s linear 0.85s;
}

/* Hero */
.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--border-glow);
  border-radius: 999px;
  color: var(--cyan);
  margin-bottom: 1rem;
  background: rgba(0, 245, 212, 0.06);
  box-shadow: 0 0 24px rgba(0, 245, 212, 0.15);
}

.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.65rem);
  font-weight: 800;
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-sub {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 44ch;
  margin: 0 0 2rem;
}

/* Glass panel */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 245, 212, 0.2);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(255, 0, 170, 0.08) inset,
    0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.panel {
  padding: 1.5rem 1.35rem;
  margin-bottom: 1.5rem;
}

.panel-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.panel-hint {
  margin: 0 0 1.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.flight-form {
  margin: 0;
}

.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: stretch;
}

.flight-input {
  flex: 1 1 12rem;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text);
  background: rgba(2, 8, 16, 0.85);
  border: 1px solid rgba(0, 245, 212, 0.25);
  border-radius: 8px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.flight-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.12);
}

.flight-input.shake {
  animation: shake 0.45s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}

.btn-submit,
.btn-secondary {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition:
    transform 0.15s,
    box-shadow 0.2s;
}

.btn-submit {
  color: var(--bg-deep);
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), #4afcff);
  box-shadow: 0 0 28px rgba(0, 245, 212, 0.35);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 36px rgba(0, 245, 212, 0.5);
}

.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  display: block;
  margin: 2rem auto 0;
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--border-glow);
}

.btn-secondary:hover {
  background: rgba(0, 245, 212, 0.08);
}

.flight-error {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: #ff6b9d;
  font-family: var(--font-mono);
}

/* Pipeline */
.pipeline-section {
  margin-bottom: 1.5rem;
}

.pipeline-panel {
  padding: 1.25rem 1rem;
}

.pipeline-heading {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}

.pipeline-log {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
}

.pipeline-log li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(0, 245, 212, 0.08);
  color: var(--muted);
}

.pipeline-log li:last-child {
  border-bottom: none;
}

.pipeline-log li strong {
  color: var(--text);
  font-weight: 600;
}

.pipeline-log .metric {
  color: var(--mag);
  font-size: 0.72rem;
}

/* Verdict */
.verdict-section {
  text-align: center;
  padding: 2rem 0 1rem;
  min-height: 14rem;
}

.verdict-no {
  font-size: clamp(5rem, 22vw, 12rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(120deg, var(--cyan), #fff, var(--mag));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 40px rgba(0, 245, 212, 0.45));
  transform: scale(0.3);
  opacity: 0;
}

.verdict-no.show {
  animation: no-slam 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes no-slam {
  0% {
    transform: scale(0.3) rotate(-2deg);
    opacity: 0;
    filter: drop-shadow(0 0 0 transparent);
  }
  55% {
    transform: scale(1.08) rotate(0.5deg);
    opacity: 1;
    filter: drop-shadow(0 0 50px rgba(255, 0, 170, 0.5));
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
    filter: drop-shadow(0 0 36px rgba(0, 245, 212, 0.4));
  }
}

.verdict-disclaimer {
  max-width: 36rem;
  margin: 1.25rem auto 0;
  padding: 0.85rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text);
  text-align: left;
  background: rgba(2, 8, 16, 0.75);
  border: 1px solid rgba(0, 245, 212, 0.22);
  border-radius: 8px;
  opacity: 0;
  transform: translateY(0.35rem);
}

.verdict-disclaimer strong {
  color: var(--cyan);
  font-weight: 700;
}

.verdict-disclaimer.show {
  animation: disclaimer-in 0.55s ease 0.65s forwards;
}

@keyframes disclaimer-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flash-once {
  animation: flash-once 0.35s ease;
}

@keyframes flash-once {
  0% {
    background-color: transparent;
  }
  35% {
    background-color: rgba(0, 245, 212, 0.12);
  }
  100% {
    background-color: transparent;
  }
}

.glitch-text {
  animation: glitch 2.8s ease-in-out infinite;
}

.glitch-text-soft {
  animation: glitch-soft 4s ease-in-out infinite;
}

@keyframes glitch {
  0%,
  88%,
  100% {
    text-shadow:
      0.04em 0 var(--mag),
      -0.04em 0 var(--cyan);
    transform: translate(0);
  }
  90% {
    text-shadow:
      -0.06em 0 var(--mag),
      0.06em 0 var(--cyan);
    transform: translate(-1px, 0);
  }
  92% {
    text-shadow:
      0.06em 0 var(--mag),
      -0.06em 0 var(--cyan);
    transform: translate(1px, 0);
  }
}

@keyframes glitch-soft {
  0%,
  95%,
  100% {
    text-shadow: none;
  }
  96% {
    text-shadow: 2px 0 var(--cyan);
  }
  97% {
    text-shadow: -2px 0 var(--mag);
  }
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 245, 212, 0.1);
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer code {
  font-size: 0.72rem;
  color: var(--cyan);
}

.site-footer a {
  color: var(--cyan);
}

.btn-how {
  display: block;
  margin: 1.25rem auto 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.2s;
}

.btn-how:hover {
  color: var(--cyan);
}

.btn-how:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 15, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(28rem, 100%);
  max-height: min(85vh, 32rem);
  overflow-y: auto;
  padding: 1.5rem 1.35rem;
  margin: 0;
}

.modal-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
}

.modal-body p {
  margin: 0 0 0.85rem;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-body code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--cyan);
}

.modal-close {
  margin: 1.25rem auto 0;
  width: 100%;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .boot-grid {
    animation: none;
  }

  .glitch-text,
  .glitch-text-soft {
    animation: none;
    text-shadow: none;
  }

  .boot-overlay.fade-out {
    transition: opacity 0.35s ease;
  }

  .verdict-no.show {
    animation: no-slam-simple 0.6s ease forwards;
  }

  .verdict-disclaimer.show {
    animation: none;
    opacity: 1;
    transform: none;
  }

  @keyframes no-slam-simple {
    from {
      opacity: 0;
      transform: scale(0.96);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  .flight-input.shake {
    animation: none;
  }

  .flash-once {
    animation: none;
  }
}
