:root {
  color-scheme: dark;
}

html,
body {
  background: #05080D;
}

body {
  font-family: 'Inter', sans-serif;
}

/* ---------- Ambient backdrop: offset block grid echoing the logo icon ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(42, 157, 244, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 157, 244, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: 0 0, 0 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 75%);
  animation: grid-drift 70s linear infinite;
}

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

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-glow::before,
.bg-glow::after {
  content: '';
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 780px;
  max-height: 780px;
  border-radius: 9999px;
  filter: blur(120px);
  opacity: 0.08;
  animation: glow-drift 60s ease-in-out infinite;
}

.bg-glow::before {
  top: -14%;
  left: -14%;
  background: #2a9df4;
}

.bg-glow::after {
  top: auto;
  left: auto;
  bottom: -14%;
  right: -14%;
  background: #f4862a;
  animation-delay: -30s;
}

@keyframes glow-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3%, 3%) scale(1.08); }
}

/* ---------- Entrance sequence ---------- */
.enter {
  opacity: 0;
  transform: translateY(14px);
  animation: enter-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes enter-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-1 { animation-delay: 0.5s; }
.delay-3 { animation-delay: 0.62s; }
.delay-5 { animation-delay: 1.2s; }

/* Slogan: presented as a tagline/quote, not a plain description */
.slogan {
  font-style: italic;
}

/* Logo: distinct cinematic entrance (fade + gentle scale-up) */
.logo-enter {
  opacity: 0;
  transform: scale(0.94);
  animation: logo-enter-anim 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.15s;
}

@keyframes logo-enter-anim {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Logo: continuous "breathing" glow once the entrance settles — signals the system is live */
.logo-pulse {
  animation: logo-breathe 3.6s ease-in-out infinite;
  animation-delay: 0.95s;
}

@keyframes logo-breathe {
  0%, 100% { filter: drop-shadow(0 0 0px rgba(42, 157, 244, 0)); }
  50% { filter: drop-shadow(0 0 20px rgba(42, 157, 244, 0.4)); }
}

/* 4 app cards: individual staggered fade-up (each card follows the previous one) */
.card-enter {
  opacity: 0;
  transform: translateY(18px);
  animation: enter-up 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.glass-card:nth-child(1) { animation-delay: 0.72s; }
.glass-card:nth-child(2) { animation-delay: 0.8s; }
.glass-card:nth-child(3) { animation-delay: 0.88s; }
.glass-card:nth-child(4) { animation-delay: 0.96s; }

/* ---------- Glass card ---------- */
.glass-card {
  position: relative;
  background: rgba(248, 250, 252, 0.04);
  border: 1px solid rgba(248, 250, 252, 0.09);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.glass-card:hover,
.glass-card:focus-visible {
  transform: translateY(-8px);
  background: rgba(248, 250, 252, 0.06);
}

/* Alternating brand-colored glow + solid border reveal on hover (1&3 blue, 2&4 orange) */
.glass-card.glow-blue:hover,
.glass-card.glow-blue:focus-visible {
  border-color: rgba(42, 157, 244, 0.85);
  box-shadow: 0 24px 60px -20px rgba(42, 157, 244, 0.45);
}

.glass-card.glow-orange:hover,
.glass-card.glow-orange:focus-visible {
  border-color: rgba(244, 134, 42, 0.85);
  box-shadow: 0 24px 60px -20px rgba(244, 134, 42, 0.45);
}

/* One-shot diagonal sheen sweep, synced to each card's own entrance */
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(248, 250, 252, 0.16) 48%, transparent 62%);
  background-size: 260% 260%;
  background-position: -130% -130%;
  opacity: 0;
  pointer-events: none;
  animation: card-sheen 1.1s ease-out forwards;
}

@keyframes card-sheen {
  0% { opacity: 0; background-position: -130% -130%; }
  12% { opacity: 1; }
  55% { opacity: 1; }
  100% { opacity: 0; background-position: 130% 130%; }
}

.glass-card:nth-child(1)::before { animation-delay: 0.87s; }
.glass-card:nth-child(2)::before { animation-delay: 0.95s; }
.glass-card:nth-child(3)::before { animation-delay: 1.03s; }
.glass-card:nth-child(4)::before { animation-delay: 1.11s; }

/* HUD corner brackets echoing the logo's offset blocks */
.glass-card .bracket {
  position: absolute;
  z-index: 1;
  width: 22px;
  height: 22px;
  border: 2px solid;
  opacity: 0.55;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.glass-card .bracket-tl {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
  border-color: #2a9df4;
}

.glass-card .bracket-br {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
  border-color: #f4862a;
}

.glass-card:hover .bracket,
.glass-card:focus-visible .bracket {
  width: 30px;
  height: 30px;
  opacity: 1;
}

.glass-card:hover .bracket-tl,
.glass-card:focus-visible .bracket-tl {
  box-shadow: -4px -4px 18px rgba(42, 157, 244, 0.55);
}

.glass-card:hover .bracket-br,
.glass-card:focus-visible .bracket-br {
  box-shadow: 4px 4px 18px rgba(244, 134, 42, 0.55);
}

.glass-card:hover .card-icon,
.glass-card:focus-visible .card-icon {
  transform: scale(1.08);
  border-color: rgba(42, 157, 244, 0.5);
}

.card-icon {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease;
}

/* ---------- Logo glow: biased toward the icon block, kept off the wordmark so the graphite "247" stays on plain background ---------- */
.logo-halo {
  position: absolute;
  inset: -30% 25% -30% -30%;
  background: radial-gradient(closest-side at 35% 50%, rgba(42, 157, 244, 0.14), rgba(244, 134, 42, 0.07) 55%, transparent 72%);
  filter: blur(36px);
  z-index: -1;
}

/* ---------- Focus visibility ---------- */
a:focus-visible {
  outline: 2px solid #2a9df4;
  outline-offset: 4px;
  border-radius: 4px;
}

.status-dot {
  background-color: #2a9df4;
  animation: pulse-dot-duo 6.5s ease-in-out infinite;
}

@keyframes pulse-dot-duo {
  0%, 100% { background-color: #2a9df4; opacity: 1; }
  25% { opacity: 0.4; }
  50% { background-color: #f4862a; opacity: 1; }
  75% { opacity: 0.4; }
}

/* Portal badge: slow-rotating brand-gradient ring — echoes logo-breathe's "system is live" motif without competing with the cards' HUD-bracket signature.
   The pill is wide and short, so the conic-gradient's own angle is animated (not a transform: rotate on the box) —
   rotating the box itself would sweep a much larger diagonal silhouette than the pill for such an elongated shape. */
@property --badge-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.badge-orbit {
  position: relative;
  isolation: isolate;
  border-radius: 9999px;
}

.badge-orbit::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(from var(--badge-angle), #2a9df4, #f4862a, #2a9df4);
  animation: badge-orbit-spin 6.5s linear infinite;
  z-index: -1;
}

.badge-orbit::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  border-radius: inherit;
  background: rgba(5, 8, 13, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: -1;
}

@keyframes badge-orbit-spin {
  to { --badge-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  .enter,
  .logo-enter,
  .card-enter {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .bg-grid,
  .bg-glow::before,
  .bg-glow::after,
  .status-dot,
  .logo-pulse,
  .badge-orbit::before {
    animation: none;
  }
  .glass-card::before {
    animation: none;
    opacity: 0;
  }
  .glass-card,
  .glass-card .bracket,
  .card-icon {
    transition: none;
  }
}
