/* ================================================================
   Scooby-Doo.lol — Global Stylesheet
   Scooby-Doo themed dark UI with mystery vibes
   ================================================================ */

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
  /* Scooby Palette */
  --color-lime:        #B2D430;
  --color-orange:      #F7931E;
  --color-purple:      #6B3FA0;
  --color-purple-deep: #1a0a2e;
  --color-purple-mid:  #2d1550;
  --color-brown:       #8B6914;
  --color-teal:        #2EC4B6;
  --color-red:         #E63946;

  /* UI Colors */
  --bg-primary:    #0d0d1a;
  --bg-secondary:  #14112a;
  --bg-card:       rgba(26, 10, 46, 0.85);
  --bg-card-hover: rgba(43, 20, 75, 0.9);
  --text-primary:  #f0eaf8;
  --text-secondary: #b8a9d4;
  --text-muted:    #7a6b99;
  --border-color:  rgba(107, 63, 160, 0.3);
  --border-glow:   rgba(178, 212, 48, 0.4);

  /* Typography */
  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;

  /* Layout */
  --max-width: 1200px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-med:  300ms ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-lime);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-orange);
}

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

/* ── Background Overlay ─────────────────────────────────────── */
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    url('/assets/background.jpg') center/cover no-repeat fixed,
    linear-gradient(180deg, var(--bg-primary) 0%, var(--color-purple-deep) 100%);
  opacity: 0.15;
  pointer-events: none;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 26, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  text-decoration: none;
}

.logo-banner {
  height: 56px;
  width: auto;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-lime);
  letter-spacing: -0.02em;
  line-height: 1;
}

.site-tagline {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.8;
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-xs);
}

.nav-link {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-link:hover {
  color: var(--color-lime);
  background: rgba(178, 212, 48, 0.08);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(107, 63, 160, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 700px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.hero-accent {
  display: block;
  color: var(--color-orange);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  text-shadow: 0 0 40px rgba(247, 147, 30, 0.3);
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: var(--space-xl);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.hero-stats .stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-lime), var(--color-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stats .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-med);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-lime);
  color: var(--bg-primary);
  border-color: var(--color-lime);
}

.btn-primary:hover {
  background: transparent;
  color: var(--color-lime);
  box-shadow: 0 0 20px rgba(178, 212, 48, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--color-orange);
  border-color: var(--color-orange);
}

.btn-secondary:hover {
  background: var(--color-orange);
  color: var(--bg-primary);
  box-shadow: 0 0 20px rgba(247, 147, 30, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--color-purple);
  border-color: var(--color-purple);
}

.btn-outline:hover {
  background: var(--color-purple);
  color: var(--text-primary);
}

/* ── Sections ────────────────────────────────────────────────── */
.section {
  padding: var(--space-2xl) var(--space-lg);
}

.section--alt {
  background: var(--bg-secondary);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.section-icon {
  font-size: 1.5rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Card Grid ───────────────────────────────────────────────── */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: center;
  text-align: left;
}

.card-grid > * {
  flex: 1 1 300px;
  max-width: 380px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  transition: all var(--transition-med);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-purple), var(--color-lime));
  opacity: 0;
  transition: opacity var(--transition-med);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(107, 63, 160, 0.2);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

/* ── Badges ──────────────────────────────────────────────────── */
.card-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: var(--space-xs);
}

.badge--wasm {
  background: rgba(46, 196, 182, 0.15);
  color: var(--color-teal);
  border: 1px solid rgba(46, 196, 182, 0.3);
}

.badge--ai {
  background: rgba(247, 147, 30, 0.15);
  color: var(--color-orange);
  border: 1px solid rgba(247, 147, 30, 0.3);
}

.badge--rust {
  background: rgba(230, 57, 70, 0.15);
  color: var(--color-red);
  border: 1px solid rgba(230, 57, 70, 0.3);
}

.badge--soon {
  background: rgba(122, 107, 153, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(122, 107, 153, 0.3);
}

.badge--live {
  background: rgba(178, 212, 48, 0.15);
  color: var(--color-lime);
  border: 1px solid rgba(178, 212, 48, 0.3);
}

/* ── Coming Soon Card ────────────────────────────────────────── */
.card[data-status="soon"] {
  opacity: 0.55;
  cursor: default;
}

.card[data-status="soon"]:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-color);
  background: var(--bg-card);
}

/* ── Clickable Card Link ─────────────────────────────────────── */
.card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* ── About Section ───────────────────────────────────────────── */
.about-content {
  max-width: 650px;
  margin: 0 auto;
  text-align: left;
}

.about-content p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

.about-content strong {
  color: var(--color-lime);
}

.about-links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  background: rgba(13, 13, 26, 0.95);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-text a {
  color: var(--text-secondary);
}

.footer-text a:hover {
  color: var(--color-lime);
}

.footer-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  opacity: 0.6;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    flex-direction: column;
    background: rgba(13, 13, 26, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    padding: 5rem var(--space-lg) var(--space-lg);
    gap: var(--space-xs);
    transition: right var(--transition-med);
    border-left: 1px solid var(--border-color);
    z-index: 200;
  }

  .nav-links.is-open {
    right: 0;
  }

  .nav-link {
    font-size: 1rem;
    padding: var(--space-md);
  }

  .hero {
    min-height: 45vh;
    padding: var(--space-xl) var(--space-md);
  }

  .card-grid > * {
    width: 100%;
  }

  .header-inner {
    padding: var(--space-sm) var(--space-md);
  }

  .logo-banner {
    height: 36px;
  }

  .site-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .about-links {
    flex-direction: column;
  }
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeInUp 0.5s ease both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.30s; }

/* ── Scroll reveal (JS toggles .is-visible) ─────────────────── */
.section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Show immediately for no-JS fallback */
@media (prefers-reduced-motion: reduce) {
  .section,
  .card {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   TORCH-IN-THE-DARK — Glow hover effects across all interactive
   elements. Radiant borders, text glow, and subtle light emanation
   that makes each element look like it's lit by a torch.
   ══════════════════════════════════════════════════════════════ */

/* ── Nav Links — lime torch sweep ────────────────────────────── */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-lime);
  border-radius: 1px;
  transition: width 0.35s ease, left 0.35s ease;
  box-shadow: 0 0 6px var(--color-lime);
}
.nav-link:hover::after {
  width: 80%;
  left: 10%;
}
.nav-link:hover {
  text-shadow: 0 0 8px rgba(178, 212, 48, 0.5);
}

/* ── Buttons — radiant torch glow ────────────────────────────── */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.btn-primary::after {
  box-shadow: 0 0 20px rgba(178, 212, 48, 0.5), inset 0 0 20px rgba(178, 212, 48, 0.1);
}
.btn-primary:hover::after {
  opacity: 1;
}
.btn-primary:hover {
  text-shadow: 0 0 8px rgba(178, 212, 48, 0.6);
}

.btn-secondary::after {
  box-shadow: 0 0 20px rgba(247, 147, 30, 0.5), inset 0 0 20px rgba(247, 147, 30, 0.1);
}
.btn-secondary:hover::after {
  opacity: 1;
}
.btn-secondary:hover {
  text-shadow: 0 0 8px rgba(247, 147, 30, 0.6);
}

.btn-outline::after {
  box-shadow: 0 0 20px rgba(107, 63, 160, 0.5), inset 0 0 20px rgba(107, 63, 160, 0.1);
}
.btn-outline:hover::after {
  opacity: 1;
}

/* ── Cards — torch-lit card reveal ───────────────────────────── */
.card:hover {
  box-shadow:
    0 12px 40px rgba(107, 63, 160, 0.2),
    0 0 30px rgba(178, 212, 48, 0.08),
    inset 0 0 30px rgba(178, 212, 48, 0.02);
}
.card:hover .card-icon {
  filter: drop-shadow(0 0 10px rgba(178, 212, 48, 0.6));
  transform: scale(1.1);
  transition: filter 0.3s ease, transform 0.3s ease;
}
.card:hover .card-title {
  text-shadow: 0 0 12px rgba(178, 212, 48, 0.35);
}

/* ── Card links (Env Inspector, etc.) ────────────────────────── */
.card--link {
  cursor: pointer;
}
.card--link:hover {
  border-color: var(--color-lime);
  box-shadow:
    0 12px 40px rgba(107, 63, 160, 0.2),
    0 0 40px rgba(178, 212, 48, 0.12);
}

/* ── Hero accent — pulsing torch glow ────────────────────────── */
.hero-accent {
  animation: heroGlow 3s ease-in-out infinite alternate;
}
@keyframes heroGlow {
  0%   { text-shadow: 0 0 40px rgba(247, 147, 30, 0.3); }
  100% { text-shadow: 0 0 60px rgba(247, 147, 30, 0.5), 0 0 100px rgba(247, 147, 30, 0.15); }
}

/* ── Hero stat numbers — subtle glow on hover ────────────────── */
.hero-stats .stat:hover .stat-num {
  filter: drop-shadow(0 0 6px rgba(178, 212, 48, 0.5));
}
.hero-stats .stat {
  transition: transform 0.2s ease;
}
.hero-stats .stat:hover {
  transform: scale(1.08);
}

/* ── Badge glow ──────────────────────────────────────────────── */
.badge {
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.badge:hover {
  box-shadow: 0 0 12px rgba(178, 212, 48, 0.4);
  transform: translateY(-1px);
}

/* ── Footer links — torch underline ──────────────────────────── */
.footer a {
  position: relative;
}
.footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-lime);
  transition: width 0.3s ease;
  box-shadow: 0 0 4px rgba(178, 212, 48, 0.5);
}
.footer a:hover::after {
  width: 100%;
}
.footer a:hover {
  text-shadow: 0 0 6px rgba(178, 212, 48, 0.3);
}

/* ── Scroll-to-top — glowing torch button ────────────────────── */
#scroll-top {
  transition: all 0.3s ease;
}
#scroll-top:hover {
  box-shadow: 0 0 20px rgba(178, 212, 48, 0.4), 0 0 40px rgba(178, 212, 48, 0.15);
  transform: translateY(-2px);
}

/* ── Status dots — glow matching color ───────────────────────── */
.status-dot--ready {
  box-shadow: 0 0 8px rgba(178, 212, 48, 0.6);
  animation: dotPulse 2s ease-in-out infinite;
}
.status-dot--loading {
  box-shadow: 0 0 8px rgba(247, 147, 30, 0.6);
}
.status-dot--error {
  box-shadow: 0 0 8px rgba(230, 57, 70, 0.6);
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(178, 212, 48, 0.6); }
  50%      { box-shadow: 0 0 16px rgba(178, 212, 48, 0.9); }
}
