/* ==========================================================================
   SportOps landing page - custom styles
   Layered on top of Tailwind (Play CDN). Plain CSS only (no @apply).
   Handles: fonts, motion/animation, accordion, header state, decorative art.
   ========================================================================== */

:root {
  --brand-950: #071640;
  --brand-900: #0b2a6b;
  --brand-700: #1a45a0;
  --brand-600: #1e50c8;
  --brand-500: #2563eb;
  --brand-400: #4f83f4;
  --accent-500: #10b981;
  --ink-900: #0f172a;
  --ink-600: #475569;
  --header-h: 4.5rem;
}

/* --- Base -------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(37, 99, 235, 0.18);
  color: var(--brand-900);
}

/* Tasteful focus ring for keyboard users */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  background: #fff;
  color: var(--brand-700);
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* --- Header ------------------------------------------------------------ */
.site-header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease,
    backdrop-filter 0.3s ease, border-color 0.3s ease;
}
.site-header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06),
    0 12px 28px -18px rgba(15, 23, 42, 0.4);
  border-color: rgba(15, 23, 42, 0.06);
}

/* --- Decorative gradient text ----------------------------------------- */
.text-gradient {
  background: linear-gradient(120deg, var(--brand-500), var(--brand-900) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Soft decorative blobs -------------------------------------------- */
.blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  will-change: transform;
}
.blob--float {
  animation: blob-float 16s ease-in-out infinite alternate;
}
@keyframes blob-float {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(0, -26px, 0) scale(1.06);
  }
}

/* Fine dotted grid backdrop */
.bg-dotgrid {
  background-image: radial-gradient(
    rgba(37, 99, 235, 0.12) 1px,
    transparent 1px
  );
  background-size: 22px 22px;
}

/* --- Scroll reveal ----------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal[data-reveal-delay="1"] {
  transition-delay: 0.08s;
}
.reveal[data-reveal-delay="2"] {
  transition-delay: 0.16s;
}
.reveal[data-reveal-delay="3"] {
  transition-delay: 0.24s;
}
.reveal[data-reveal-delay="4"] {
  transition-delay: 0.32s;
}
.reveal[data-reveal-delay="5"] {
  transition-delay: 0.4s;
}

/* --- Logo marquee (trust strip) --------------------------------------- */
.marquee {
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 34s linear infinite;
}
.marquee:hover .marquee__track {
  animation-play-state: paused;
}
@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* --- FAQ accordion (grid-rows trick for smooth height) ---------------- */
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s ease;
}
.faq-item.is-open .faq-panel {
  grid-template-rows: 1fr;
}
.faq-panel > div {
  overflow: hidden;
}
.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
}
.faq-icon {
  transition: transform 0.3s ease;
}

/* --- Card hover polish ------------------------------------------------- */
.card-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card-lift:hover {
  transform: translateY(-4px);
}

/* --- Subtle live pulse (dashboard mock) ------------------------------- */
.pulse-dot {
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.82);
  }
}

/* Growing bars in the mock chart */
.bar-grow {
  transform-origin: bottom;
  animation: bar-grow 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes bar-grow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

/* --- Dark mode overrides ---------------------------------------------- */
html.dark .site-header.is-scrolled {
  background-color: rgba(7, 13, 28, 0.82);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05),
    0 16px 32px -20px rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.06);
}

html.dark .text-gradient {
  background: linear-gradient(120deg, #bcd3fc, var(--brand-400) 75%);
  -webkit-background-clip: text;
  background-clip: text;
}

html.dark .bg-dotgrid {
  background-image: radial-gradient(
    rgba(95, 131, 249, 0.16) 1px,
    transparent 1px
  );
}

html.dark ::selection {
  background: rgba(95, 131, 249, 0.32);
  color: #f1f5f9;
}

html.dark .skip-link {
  background: #111d38;
  color: #93b4fd;
}

/* --- Reduced motion: respect user preference -------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
