/* ===== EBD GLASSMORPHISM THEME ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Primary - Fresh Green */
  --md-sys-color-primary: #3dd68c;
  --md-sys-color-on-primary: #003920;
  --md-sys-color-primary-container: #005231;
  --md-sys-color-on-primary-container: #8ff7b8;

  --md-sys-color-secondary: #a8c8b5;
  --md-sys-color-on-secondary: #143528;
  --md-sys-color-secondary-container: #2b4c3d;
  --md-sys-color-on-secondary-container: #c4e4d0;

  --md-sys-color-tertiary: #a0c9e8;
  --md-sys-color-on-tertiary: #00344f;
  --md-sys-color-tertiary-container: #1e4d6b;
  --md-sys-color-on-tertiary-container: #c8e6ff;

  /* Surfaces - Transparent for glass */
  --md-sys-color-surface: transparent;
  --md-sys-color-surface-dim: rgba(0, 0, 0, 0.35);
  --md-sys-color-surface-bright: rgba(255, 255, 255, 0.12);
  --md-sys-color-surface-container-lowest: rgba(255, 255, 255, 0.08);
  --md-sys-color-surface-container-low: rgba(255, 255, 255, 0.10);
  --md-sys-color-surface-container: rgba(255, 255, 255, 0.12);
  --md-sys-color-surface-container-high: rgba(255, 255, 255, 0.16);
  --md-sys-color-surface-container-highest: rgba(255, 255, 255, 0.20);

  --md-sys-color-on-surface: #f0f4f2;
  --md-sys-color-on-surface-variant: #c5d0c9;
  --md-sys-color-outline: rgba(255, 255, 255, 0.28);
  --md-sys-color-outline-variant: rgba(255, 255, 255, 0.14);

  --md-sys-color-error: #ff6b6b;
  --md-sys-color-on-error: #ffffff;

  /* Accents */
  --md-expressive-gradient: linear-gradient(135deg, #3dd68c 0%, #2bb8ff 50%, #a78bfa 100%);
  --md-expressive-glow: 0 8px 32px rgba(61, 214, 140, 0.35);

  /* Shape */
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 24px;
  --md-sys-shape-corner-full: 9999px;

  /* Elevation */
  --md-sys-elevation-1: 0 4px 20px rgba(0, 0, 0, 0.25);
  --md-sys-elevation-2: 0 8px 32px rgba(0, 0, 0, 0.35);
  --md-sys-elevation-3: 0 12px 48px rgba(0, 0, 0, 0.4);

  --transition: 0.28s cubic-bezier(0.2, 0, 0, 1);

  /* Glass helpers */
  --glass-bg: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-blur: blur(18px) saturate(1.4);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

/* ===== LIGHT THEME (still glass, brighter) ===== */
[data-theme="light"] {
  --md-sys-color-primary: #0d8a4f;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #a7f3c8;
  --md-sys-color-on-primary-container: #003920;

  --md-sys-color-secondary: #3d5c4a;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #d0e8d9;
  --md-sys-color-on-secondary-container: #1a2e24;

  --md-sys-color-tertiary: #1e5a7a;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #c8e6ff;
  --md-sys-color-on-tertiary-container: #00344f;

  --md-sys-color-surface-container-lowest: rgba(255, 255, 255, 0.72);
  --md-sys-color-surface-container-low: rgba(255, 255, 255, 0.68);
  --md-sys-color-surface-container: rgba(255, 255, 255, 0.65);
  --md-sys-color-surface-container-high: rgba(255, 255, 255, 0.78);
  --md-sys-color-surface-container-highest: rgba(255, 255, 255, 0.85);

  --md-sys-color-on-surface: #0f1a14;
  --md-sys-color-on-surface-variant: #2d3d34;
  --md-sys-color-outline: rgba(0, 0, 0, 0.18);
  --md-sys-color-outline-variant: rgba(0, 0, 0, 0.10);

  --md-expressive-gradient: linear-gradient(135deg, #0d8a4f 0%, #0ea5e9 50%, #8b5cf6 100%);
  --md-expressive-glow: 0 8px 28px rgba(13, 138, 79, 0.25);

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-blur: blur(20px) saturate(1.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Roboto', system-ui, sans-serif;
  color: var(--md-sys-color-on-surface);
  line-height: 1.6;
  transition: color 0.3s ease, background-color 0.35s ease;
  overflow-x: hidden;
  min-height: 100vh;

  /* Fixed background image for ALL pages (dark mode) */
  background-color: #0a1210;
  background-image:
    linear-gradient(rgba(8, 14, 12, 0.62), rgba(8, 14, 12, 0.78)),
    url('home-bg.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Light mode: brighter overlay so dark text is readable */
[data-theme="light"] body {
  background-color: #e8f0ec;
  background-image:
    linear-gradient(rgba(245, 250, 247, 0.78), rgba(235, 244, 239, 0.88)),
    url('home-bg.png');
}

a {
  text-decoration: none;
  color: inherit;
}

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

.container {
  width: min(1200px, 92%);
  margin-inline: auto;
}

/* ===== NAVBAR - GLASS CAPSULE ===== */
/* Centered top bar holding both navs */
/* ===== ANIMATED NAVBAR ===== */
.nav-top-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 24px);
  pointer-events: none;
  /* Entrance animation */
  opacity: 0;
  animation: navEntrance 0.85s cubic-bezier(0.22, 1.15, 0.36, 1) 0.15s forwards;
}
.nav-top-wrap > * {
  pointer-events: auto;
}

@keyframes navEntrance {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-28px) scale(0.92);
    filter: blur(6px);
  }
  60% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    filter: blur(0);
  }
}

.navbar {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: auto;
  max-width: none;
  flex: 0 1 auto;
  z-index: 1;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 9999px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.4s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.35s ease;
  padding: 0;
  /* subtle continuous glow pulse */
  animation: navGlowPulse 4s ease-in-out infinite;
}

@keyframes navGlowPulse {
  0%, 100% {
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25),
                0 0 0 0 rgba(61, 214, 140, 0);
  }
  50% {
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25),
                0 0 24px 2px rgba(61, 214, 140, 0.12);
  }
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3),
              0 0 20px 1px rgba(61, 214, 140, 0.1);
  animation: none;
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: none;
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(255, 255, 255, 0.88);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 10px 0 22px;
  gap: 8px;
  position: relative;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 1px;
  background: var(--md-expressive-gradient);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1), filter 0.3s ease;
  position: relative;
  animation: logoShimmer 5s ease-in-out infinite;
}

@keyframes logoShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.logo:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 10px rgba(61, 214, 140, 0.55));
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  padding: 4px;
  position: relative;
}

[data-theme="light"] .nav-links {
  background: rgba(0, 0, 0, 0.04);
}

/* Sliding active indicator (pill) */
.nav-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  border-radius: 9999px;
  background: var(--md-sys-color-primary);
  box-shadow: 0 4px 16px rgba(61, 214, 140, 0.45);
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1),
              width 0.4s cubic-bezier(0.34, 1.2, 0.64, 1),
              opacity 0.25s ease;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}

.nav-indicator.visible {
  opacity: 1;
}

.nav-link {
  display: block;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  transition: color 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.3, 0.64, 1),
              background 0.28s ease, box-shadow 0.28s ease;
  position: relative;
  z-index: 1;
  /* staggered entrance */
  opacity: 0;
  transform: translateY(-8px);
  animation: navLinkIn 0.5s cubic-bezier(0.22, 1.2, 0.36, 1) forwards;
}

/* nth-of-type ignores the indicator <span> so delays stay correct */
.nav-links li:nth-of-type(1) .nav-link { animation-delay: 0.35s; }
.nav-links li:nth-of-type(2) .nav-link { animation-delay: 0.42s; }
.nav-links li:nth-of-type(3) .nav-link { animation-delay: 0.49s; }
.nav-links li:nth-of-type(4) .nav-link { animation-delay: 0.56s; }
.nav-links li:nth-of-type(5) .nav-link { animation-delay: 0.63s; }

@keyframes navLinkIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-link:hover {
  color: var(--md-sys-color-on-surface);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .nav-link:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* Active state – indicator handles the bg */
.nav-link.active {
  color: var(--md-sys-color-on-primary);
  background: transparent !important;
  box-shadow: none;
  transform: none;
}

.nav-link.active:hover {
  color: var(--md-sys-color-on-primary);
  background: transparent !important;
  transform: none;
}

/* Fallback if JS indicator is not ready */
.nav-links:not(.has-indicator) .nav-link.active {
  background: var(--md-sys-color-primary) !important;
  box-shadow: 0 4px 14px rgba(61, 214, 140, 0.4);
}

.theme-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
  font-size: 1.1rem;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.12) rotate(12deg);
}

.theme-toggle:active {
  transform: scale(0.94);
}

[data-theme="light"] .theme-toggle {
  background: rgba(0, 0, 0, 0.06);
}

.theme-icon {
  line-height: 1;
  transition: transform 0.4s cubic-bezier(0.34, 1.5, 0.64, 1);
}

.theme-toggle:hover .theme-icon {
  transform: rotate(20deg) scale(1.1);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.06);
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--md-sys-color-primary);
  border-radius: 2px;
  transition: all 0.32s cubic-bezier(0.34, 1.3, 0.64, 1);
  transform-origin: center;
}

/* Animated hamburger → X */
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nav-top-wrap,
  .navbar,
  .logo,
  .nav-link,
  .stories-navbar,
  .stories-nav-btn {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .nav-indicator {
    transition: none !important;
  }
}

/* ===== SOCIAL BAR ===== */
.social-bar {
  position: fixed;
  left: 18px;
  top: 50%;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  padding: 16px 12px;
  box-shadow: var(--glass-shadow);

  /* Always visible – animation enhances on load, never hides permanently */
  opacity: 1;
  transform: translateY(-50%);
  pointer-events: auto;
}

/* Unique "Magnetic Snap" entrance for the whole bar */
.social-bar.sb-animate {
  animation: socialBarSnapIn 0.9s cubic-bezier(0.22, 1.4, 0.36, 1) forwards;
}

@keyframes socialBarSnapIn {
  0% {
    opacity: 0;
    transform: translateY(-50%) translateX(-80px) scale(0.6) rotate(-12deg);
    filter: blur(8px);
  }
  55% {
    opacity: 1;
    transform: translateY(-50%) translateX(10px) scale(1.08) rotate(3deg);
    filter: blur(0);
  }
  75% {
    transform: translateY(-50%) translateX(-4px) scale(0.97) rotate(-1deg);
  }
  100% {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1) rotate(0deg);
    filter: blur(0);
  }
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-on-surface-variant);
  background: transparent;
  transition: background 0.28s ease, color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
  position: relative;
  opacity: 1;
  transform: scale(1);
}

/* Staggered icon pop with spin + energy ring (only during entrance) */
.social-bar.sb-animate .social-btn {
  animation: socialIconOrbitIn 0.7s cubic-bezier(0.34, 1.6, 0.64, 1) forwards;
}

.social-bar.sb-animate .social-btn:nth-child(1) { animation-delay: 0.3s; }
.social-bar.sb-animate .social-btn:nth-child(2) { animation-delay: 0.45s; }
.social-bar.sb-animate .social-btn:nth-child(3) { animation-delay: 0.6s; }

@keyframes socialIconOrbitIn {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg) translateY(20px);
  }
  60% {
    opacity: 1;
    transform: scale(1.25) rotate(15deg) translateY(-4px);
  }
  80% {
    transform: scale(0.92) rotate(-6deg) translateY(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg) translateY(0);
  }
}

/* Expanding energy ring when each icon lands */
.social-btn::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--md-sys-color-primary);
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
}

.social-bar.sb-animate .social-btn::after {
  animation: socialRingBurst 0.65s ease-out forwards;
}

.social-bar.sb-animate .social-btn:nth-child(1)::after { animation-delay: 0.4s; }
.social-bar.sb-animate .social-btn:nth-child(2)::after { animation-delay: 0.55s; }
.social-bar.sb-animate .social-btn:nth-child(3)::after { animation-delay: 0.7s; }

@keyframes socialRingBurst {
  0% {
    opacity: 0.9;
    transform: scale(0.4);
    box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.5);
  }
  70% {
    opacity: 0.4;
    transform: scale(1.5);
    box-shadow: 0 0 16px 4px rgba(61, 214, 140, 0.25);
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
    box-shadow: 0 0 0 0 transparent;
  }
}

/* Soft continuous float after entrance – stays fully visible */
.social-bar.sb-ready {
  opacity: 1 !important;
  filter: none;
  animation: socialBarFloat 4.5s ease-in-out infinite;
}

.social-bar.sb-ready .social-btn {
  opacity: 1 !important;
  transform: scale(1) rotate(0deg);
}

@keyframes socialBarFloat {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50% { transform: translateY(calc(-50% - 6px)) translateX(2px); }
}

.social-btn:hover {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  transform: scale(1.14);
  box-shadow: 0 0 18px rgba(61, 214, 140, 0.45);
}

/* Light mode ring color adjustment */
[data-theme="light"] .social-btn::after {
  border-color: #0d8a4f;
}

[data-theme="light"] .social-btn:hover {
  box-shadow: 0 0 16px rgba(13, 138, 79, 0.4);
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: 90px;
  overflow: hidden;
  background: transparent; /* body already has the image */
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: transparent; /* rely on body fixed bg */
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 820px;
  padding: 2rem;
}

.hero-tag {
  display: inline-block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  background: rgba(61, 214, 140, 0.85);
  padding: 0.4rem 1.2rem;
  border-radius: var(--md-sys-shape-corner-full);
  margin-bottom: 1.4rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(61, 214, 140, 0.35);
}

[data-theme="light"] .hero-tag {
  color: #003920;
  background: rgba(13, 138, 79, 0.9);
  box-shadow: 0 4px 16px rgba(13, 138, 79, 0.3);
}

.hero h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(3.2rem, 10vw, 5.8rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 1.3rem;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
}

[data-theme="light"] .hero h1 {
  color: #0f1a14;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.6);
}

.hero h1 span {
  background: var(--md-expressive-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2.6rem;
  max-width: 520px;
  margin-inline: auto;
  font-weight: 500;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .hero-desc {
  color: #1a2e24;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.5);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 2rem;
  border-radius: var(--md-sys-shape-corner-full);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-expressive-glow);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(61, 214, 140, 0.5);
  filter: brightness(1.08);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-3px);
}

[data-theme="light"] .btn-outline {
  background: rgba(13, 138, 79, 0.1);
  color: #0d8a4f;
  border: 1.5px solid rgba(13, 138, 79, 0.45);
}

[data-theme="light"] .btn-outline:hover {
  background: rgba(13, 138, 79, 0.18);
  border-color: #0d8a4f;
  color: #0a6b3d;
}

.btn-download {
  background: transparent;
  color: var(--md-sys-color-primary);
  border: 1.5px solid var(--md-sys-color-primary);
  font-weight: 700;
}

.btn-download:hover {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  transform: translateY(-2px);
}

.btn-large {
  padding: 1.1rem 2.6rem;
  font-size: 1.05rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 1.2rem 1.8rem;
  border-radius: var(--md-sys-shape-corner-extra-large);
  min-width: 110px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .stat {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stat-num {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .stat-num {
  color: #0f1a14;
  text-shadow: none;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.82);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
}

[data-theme="light"] .stat-label {
  color: #2d3d34;
}

/* ===== SECTIONS ===== */
.section {
  padding: 5.5rem 0;
  position: relative;
}

.section-alt {
  background: transparent;
}

.page-section {
  padding-top: 6.5rem;
  min-height: calc(100vh - 160px);
}

.section-header {
  text-align: center;
  margin-bottom: 3.2rem;
}

.section-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 0.7rem;
  color: var(--md-sys-color-on-surface);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .section-header h2 {
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.7);
}

.section-header h2 span {
  background: var(--md-expressive-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-header p {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1.1rem;
  font-weight: 500;
}

/* ===== GLASS CARDS (shared) ===== */
.download-card,
.news-card,
.player-card,
.game-download-box {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--glass-shadow);
  transition: all var(--transition);
}

/* ===== MAP DOWNLOAD CARDS ===== */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.6rem;
}

.download-card {
  padding: 1.9rem;
}

.download-card:hover {
  border-color: var(--md-sys-color-primary);
  transform: translateY(-6px) scale(1.015);
  box-shadow: var(--md-expressive-glow), 0 12px 40px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .download-card:hover {
  background: rgba(255, 255, 255, 0.85);
}

.card-icon {
  font-size: 2.4rem;
  margin-bottom: 1rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 214, 140, 0.18);
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid rgba(61, 214, 140, 0.3);
}

.download-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.download-card p {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--md-sys-color-outline);
  margin-bottom: 0.6rem;
  font-weight: 500;
}

/* ===== NEWS ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.6rem;
}

.news-card {
  padding: 1.9rem;
}

.news-card:hover {
  border-color: var(--md-sys-color-primary);
  transform: translateY(-4px);
  box-shadow: var(--md-expressive-glow);
  background: rgba(255, 255, 255, 0.14);
}

.news-card.featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(61, 214, 140, 0.22) 0%, rgba(43, 184, 255, 0.18) 50%, rgba(167, 139, 250, 0.2) 100%);
  border-color: rgba(61, 214, 140, 0.35);
}

.news-date {
  font-size: 0.8rem;
  color: var(--md-sys-color-primary);
  font-weight: 700;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.news-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.news-card p {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.98rem;
  margin-bottom: 1.1rem;
}

.read-more {
  color: var(--md-sys-color-primary);
  font-weight: 700;
  font-size: 0.95rem;
}

.read-more:hover {
  text-decoration: underline;
}

/* ===== GAME DOWNLOAD ===== */
.game-download-box {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
  padding: 3.2rem;
}

.game-info h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.9rem;
  margin-bottom: 1rem;
  font-weight: 800;
  color: var(--md-sys-color-on-surface);
}

.game-info > p {
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.feature-list {
  list-style: none;
  margin-bottom: 1.6rem;
}

.feature-list li {
  padding: 0.4rem 0;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
}

.version-info {
  display: flex;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: var(--md-sys-color-outline);
  margin-bottom: 1.9rem;
  flex-wrap: wrap;
  font-weight: 500;
}

.game-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-placeholder {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  background: var(--md-expressive-gradient);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 2.9rem;
  color: white;
  box-shadow: 
    var(--md-expressive-glow),
    0 20px 50px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  overflow: hidden;
  position: relative;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), 
              box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              border-radius 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-placeholder:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 
    var(--md-expressive-glow),
    0 28px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-radius: 28px;
}

.game-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-placeholder:hover img {
  transform: scale(1.05);
}

.game-placeholder small {
  font-size: 0.95rem;
  letter-spacing: 4px;
  margin-top: 4px;
  opacity: 0.9;
}

/* ===== ABOUT / PLAYERS ===== */
.about-intro {
  max-width: 720px;
  margin: 0 auto 3.2rem;
  text-align: center;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1.1rem;
  font-weight: 500;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--md-sys-shape-corner-extra-large);
  padding: 1.8rem 2rem;
  box-shadow: var(--glass-shadow);
}

.players-title {
  text-align: center;
  align-items: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.35rem;
  margin-bottom: 2.2rem;
  color: var(--md-sys-color-primary);
  font-weight: 700;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.4rem;
  justify-items: stretch;
}

.player-card {
  padding: 1.7rem 1.4rem;
  text-align: center;
}

/* Center the last player card (Sabbir) when it sits alone on the final row */
.player-card--last {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: 260px;
}

.player-card:hover {
  border-color: var(--md-sys-color-primary);
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--md-expressive-glow);
  background: rgba(255, 255, 255, 0.14);
}

.player-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--md-expressive-gradient);
  color: white;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.1rem;
  box-shadow: 0 6px 20px rgba(61, 214, 140, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.player-card h4 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.role {
  font-size: 0.8rem;
  color: var(--md-sys-color-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.65rem;
}

.player-bio {
  font-size: 0.88rem;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  padding: 3.2rem 0 1.6rem;
  margin-top: 2rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-brand p {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.9rem;
  margin-top: 0.4rem;
  font-weight: 500;
}

.footer-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: var(--md-sys-shape-corner-full);
  transition: all var(--transition);
}

.footer-links a:hover {
  background: rgba(61, 214, 140, 0.2);
  color: var(--md-sys-color-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  color: var(--md-sys-color-outline);
  font-size: 0.85rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .game-download-box {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 2.2rem;
  }

  .game-visual {
    order: -1;
  }

  .game-placeholder {
    max-width: 360px;
  }

  .feature-list {
    display: inline-block;
    text-align: left;
  }

  .version-info {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .navbar {
    top: auto;
    left: auto;
    transform: none;
    max-width: none;
    width: auto;
  }

  .nav-container {
    height: 54px;
    padding: 0 8px 0 18px;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-16px) scale(0.94);
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 4px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.34, 1.3, 0.64, 1),
                opacity 0.3s ease,
                visibility 0.3s;
    pointer-events: none;
    visibility: hidden;
  }

  [data-theme="light"] .nav-links {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  }

  .nav-links.open {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  /* Stagger mobile menu items when open */
  .nav-links.open .nav-link {
    animation: mobileLinkIn 0.4s cubic-bezier(0.22, 1.2, 0.36, 1) forwards;
  }
  .nav-links.open li:nth-of-type(1) .nav-link { animation-delay: 0.05s; }
  .nav-links.open li:nth-of-type(2) .nav-link { animation-delay: 0.1s; }
  .nav-links.open li:nth-of-type(3) .nav-link { animation-delay: 0.15s; }
  .nav-links.open li:nth-of-type(4) .nav-link { animation-delay: 0.2s; }
  .nav-links.open li:nth-of-type(5) .nav-link { animation-delay: 0.25s; }

  @keyframes mobileLinkIn {
    from {
      opacity: 0;
      transform: translateX(-12px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .nav-link {
    text-align: center;
    padding: 0.7rem 1rem;
  }

  /* Hide sliding indicator on mobile – use solid active bg */
  .nav-indicator {
    display: none !important;
  }
  .nav-links .nav-link.active,
  .nav-links .nav-link.active:hover {
    background: var(--md-sys-color-primary) !important;
    color: var(--md-sys-color-on-primary);
    box-shadow: 0 4px 14px rgba(61, 214, 140, 0.4);
  }

  .hero-stats {
    gap: 1.2rem;
  }

  .news-card.featured {
    grid-column: auto;
  }

  .social-bar {
    left: 10px;
    gap: 12px;
    padding: 12px 8px;
  }

  .social-btn {
    width: 48px;
    height: 48px;
  }
}

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

  .btn {
    width: 100%;
    max-width: 280px;
  }

  body {
    background-attachment: scroll; /* better performance on mobile */
  }
}

/* ===== PAGE OPEN TYPING ANIMATION ===== */

/* Hide main text until typing starts (prevents flash) */
.hero-tag,
.hero-content h1,
.hero-desc,
.section-header h2,
.section-header p,
.about-intro p {
  visibility: hidden;
}

.hero-tag.typing,
.hero-tag.typed,
.hero-content h1.typing,
.hero-content h1.typed,
.hero-desc.typing,
.hero-desc.typed,
.section-header h2.typing,
.section-header h2.typed,
.section-header p.typing,
.section-header p.typed,
.about-intro p.typing,
.about-intro p.typed {
  visibility: visible;
}

.typewriter-cursor {
  display: inline-block;
  width: 2.5px;
  height: 1.05em;
  background: var(--md-sys-color-primary);
  margin-left: 3px;
  vertical-align: text-bottom;
  border-radius: 1px;
  animation: blink-cursor 0.7s step-end infinite;
  box-shadow: 0 0 10px var(--md-sys-color-primary);
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Smooth cascade reveal for cards & buttons after typing finishes */
.hero-buttons,
.hero-stats,
.players-grid,
.download-grid,
.news-grid,
.game-download-box,
.player-card,
.download-card,
.news-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-buttons.visible,
.hero-stats.visible,
.players-grid.visible,
.download-grid.visible,
.news-grid.visible,
.game-download-box.visible,
.player-card.visible,
.download-card.visible,
.news-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fallback: if JS never runs, still show content after a short delay */
@media (scripting: none) {
  .hero-tag,
  .hero-content h1,
  .hero-desc,
  .section-header h2,
  .section-header p,
  .about-intro p {
    visibility: visible !important;
  }

  .hero-buttons,
  .hero-stats,
  .players-grid,
  .download-grid,
  .news-grid,
  .game-download-box,
  .player-card,
  .download-card,
  .news-card {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== STORIES SYSTEM ===== */
.stories-rings {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 0.85rem 0.5rem 2rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: flex-start;
  align-items: center;
}
.stories-rings::-webkit-scrollbar { display: none; }

.story-ring {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.28s cubic-bezier(0.2, 0, 0, 1);
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}
.story-ring:hover { transform: translateY(-6px) scale(1.03); }
.story-ring:active { transform: scale(0.96); }

/* Smooth rounded box shape */
.story-ring-avatar {
  width: 100px;
  height: 120px;
  border-radius: 22px;
  padding: 3.5px;
  background: linear-gradient(145deg, #3dd68c 0%, #2bb8ff 45%, #a78bfa 100%);
  position: relative;
  box-shadow: 0 8px 24px rgba(61, 214, 140, 0.38);
  transition: box-shadow 0.28s ease, transform 0.28s ease;
}
.story-ring:hover .story-ring-avatar {
  box-shadow: 0 14px 32px rgba(61, 214, 140, 0.55);
}

.story-ring-avatar.seen {
  background: linear-gradient(145deg, rgba(255,255,255,0.32), rgba(255,255,255,0.12));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}
[data-theme="light"] .story-ring-avatar.seen {
  background: linear-gradient(145deg, rgba(0,0,0,0.16), rgba(0,0,0,0.06));
}

.story-ring-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 19px;
  background: #0d1512;
  border: 2.5px solid #0a1010;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--md-sys-color-on-surface);
  overflow: hidden;
  box-sizing: border-box;
}

[data-theme="light"] .story-ring-avatar-inner {
  border-color: #fff;
  background: #f0f4f2;
}
.story-ring-avatar-inner span {
  background: var(--md-expressive-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.story-ring-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 17px;
  display: block;
}


.story-ring-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  max-width: 100px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.stories-archive-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--md-sys-color-on-surface);
  letter-spacing: 0.5px;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.4rem;
}

.story-card {
  position: relative;
  border-radius: var(--md-sys-shape-corner-large);
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.story-card:hover {
  transform: translateY(-5px);
  border-color: var(--md-sys-color-primary);
  box-shadow: var(--md-expressive-glow);
}
.story-card-media {
  height: 140px;
  background: linear-gradient(135deg, rgba(61, 214, 140, 0.35), rgba(43, 184, 255, 0.3), rgba(167, 139, 250, 0.35));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  position: relative;
}
.story-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.45), transparent 55%);
}
.story-card-body {
  padding: 1.1rem 1.2rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.story-card-date {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--md-sys-color-primary);
  margin-bottom: 0.35rem;
}
.story-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.story-card p {
  font-size: 0.88rem;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.45;
  flex: 1;
}
.story-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--md-sys-color-outline);
  font-weight: 500;
}

/* Story Viewer Modal */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.story-viewer.open {
  opacity: 1;
  pointer-events: auto;
}
.story-viewer .story-content {
  transform: scale(0.82) translateY(28px);
  opacity: 0;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
.story-viewer.open .story-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.story-viewer .story-header,
.story-viewer .story-progress {
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.35s ease 0.12s, transform 0.35s ease 0.12s;
}
.story-viewer.open .story-header,
.story-viewer.open .story-progress {
  opacity: 1;
  transform: translateY(0);
}
.story-viewer .story-nav {
  opacity: 0;
  transition: opacity 0.3s ease 0.2s, background 0.2s;
}
.story-viewer.open .story-nav {
  opacity: 1;
}
.story-viewer-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
}
.story-progress {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 2;
}
.story-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  overflow: hidden;
}
.story-progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 2px;
  transition: width 0.05s linear;
}
.story-header {
  position: absolute;
  top: 28px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}
.story-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.story-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--md-expressive-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.5);
}
.story-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}
.story-time {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
}
.story-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.story-close:hover { opacity: 1; }

.story-content {
  position: relative;
  z-index: 1;
  width: min(420px, 92vw);
  height: min(720px, 82vh);
  border-radius: 18px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
}
.story-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0d2a1c 0%, #0a1f2e 45%, #1a1030 100%);
  font-size: 5rem;
  position: relative;
}
.story-media .story-emoji {
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.4));
  animation: storyPulse 2.4s ease-in-out infinite;
}
@keyframes storyPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.story-caption {
  padding: 1.1rem 1.3rem 1.4rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.55));
  color: #fff;
  font-size: 0.98rem;
  line-height: 1.45;
  max-height: 35%;
  overflow-y: auto;
}
.story-caption strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.story-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  backdrop-filter: blur(8px);
}
.story-nav:hover { background: rgba(255,255,255,0.22); }
.story-prev { left: max(12px, calc(50% - 250px)); }
.story-next { right: max(12px, calc(50% - 250px)); }

body.story-open { overflow: hidden; }

@media (max-width: 600px) {
  .story-ring-avatar { width: 78px; height: 94px; border-radius: 16px; }
  .story-ring-avatar-inner { border-radius: 13px; }
  .story-ring-img { border-radius: 12px; }
  .story-ring-label { font-size: 0.75rem; max-width: 78px; }
  .stories-rings { gap: 1rem; padding: 0.5rem 0.25rem 1.5rem; }
  .story-content { height: min(640px, 78vh); }
  .story-nav { width: 36px; height: 36px; font-size: 1.5rem; }
  .story-prev { left: 6px; }
  .story-next { right: 6px; }
}

/* Story reveal animations */
.stories-rings,
.stories-grid,
.story-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.story-ring {
  opacity: 0;
  transform: translateY(20px) scale(0.85);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.stories-rings.visible,
.stories-grid.visible,
.story-card.visible {
  opacity: 1;
  transform: none;
}
.story-ring.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .stories-rings,
  .stories-grid,
  .story-card,
  .story-ring {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== PUBLIC PICTURES GALLERY ===== */
.pics-hero {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 1.5rem 3.5rem;
  overflow: hidden;
}
.pics-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.75) 100%),
    url('home-bg.png') center / cover no-repeat;
  filter: brightness(0.7);
  z-index: 0;
}
.pics-hero-content {
  position: relative;
  z-index: 1;
}
.pics-kicker {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}
.pics-hero h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
  margin-bottom: 0.6rem;
}
.pics-breadcrumb {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
}
.pics-breadcrumb a {
  color: var(--md-sys-color-primary);
  font-weight: 600;
  text-decoration: none;
}
.pics-breadcrumb a:hover { text-decoration: underline; }
.pics-breadcrumb span { margin: 0 0.35rem; opacity: 0.7; }

.pics-section {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.pics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.35rem;
}

.pic-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  cursor: pointer;
  background: #0a1210;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 36px rgba(0,0,0,0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.pic-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 16px 48px rgba(61, 214, 140, 0.22);
  border-color: rgba(61, 214, 140, 0.4);
}
.pic-card-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.pic-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem;
  text-align: center;
}
.pic-emoji {
  font-size: 3.2rem;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.45));
  transition: transform 0.35s ease;
}
.pic-card:hover .pic-emoji { transform: scale(1.12); }
.pic-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.45);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  max-width: 90%;
  line-height: 1.3;
}

/* Gradient variants for placeholder cards */
.pic-gradient-2 { background: linear-gradient(145deg, #0a1a28 0%, #1a1030 40%, #0d2035 100%); }
.pic-gradient-3 { background: linear-gradient(145deg, #0d2a40 0%, #1a3a50 50%, #0a2040 100%); }
.pic-gradient-4 { background: linear-gradient(145deg, #1a1020 0%, #2a1528 40%, #0d1a28 100%); }
.pic-gradient-5 { background: linear-gradient(145deg, #0d2a1c 0%, #1a3a28 50%, #0a2018 100%); }
.pic-gradient-6 { background: linear-gradient(145deg, #1a2030 0%, #0d2840 50%, #1a1040 100%); }
.pic-gradient-7 { background: linear-gradient(145deg, #2a1a10 0%, #1a2818 50%, #0d1a20 100%); }
.pic-gradient-8 { background: linear-gradient(145deg, #1a1030 0%, #0a1a28 40%, #201040 100%); }

.pic-card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 1rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.pic-card:hover .pic-card-overlay {
  opacity: 1;
  transform: translateY(0);
}
.pic-author {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.pic-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--md-expressive-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 0.65rem;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.35);
}
.pic-author strong {
  display: block;
  font-size: 0.9rem;
  color: #fff;
  font-weight: 700;
}
.pic-author span {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  margin-top: 1px;
}

/* Always show overlay on touch devices */
@media (hover: none) {
  .pic-card-overlay {
    opacity: 1;
    transform: none;
  }
}

/* Lightbox */
.pic-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.pic-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.pic-lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(14px);
}
.pic-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 3;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  cursor: pointer;
  opacity: 0.85;
  line-height: 1;
}
.pic-lightbox-close:hover { opacity: 1; }
.pic-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: background 0.2s;
}
.pic-lightbox-nav:hover { background: rgba(255,255,255,0.22); }
.pic-lightbox-prev { left: 16px; }
.pic-lightbox-next { right: 16px; }
.pic-lightbox-content {
  position: relative;
  z-index: 2;
  width: min(900px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.pic-lightbox-media {
  flex: 1;
  min-height: 320px;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1512;
  font-size: 6rem;
}
.pic-lightbox-info {
  padding: 1.2rem 1.5rem 1.4rem;
  background: rgba(10,16,14,0.95);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.pic-lightbox-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}
.pic-lightbox-info p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

body.pic-lightbox-open { overflow: hidden; }

@media (max-width: 640px) {
  .pics-hero { min-height: 220px; padding: 6rem 1rem 2.5rem; }
  .pics-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .pic-lightbox-nav { width: 40px; height: 40px; font-size: 1.5rem; }
  .pic-lightbox-prev { left: 8px; }
  .pic-lightbox-next { right: 8px; }
}

/* Reveal for pic cards */
.pics-grid,
.pic-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.pics-grid.visible,
.pic-card.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .pics-grid, .pic-card {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Story images (no emoji) */
.story-ring-avatar-inner {
  padding: 0;
}
.story-card-media-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 55%);
  pointer-events: none;
}
.story-card-media {
  position: relative;
  background-color: #0d1512;
}
.story-media {
  background-color: #0a1010;
  background-repeat: no-repeat;
}





/* ===== SEPARATE STORIES NAVBAR ===== */
.stories-navbar {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  transform: none;
  z-index: 1;
  pointer-events: auto;
  flex-shrink: 0;
  /* slight delayed entrance so it feels sequential with main nav */
  opacity: 0;
  animation: storiesNavIn 0.7s cubic-bezier(0.22, 1.2, 0.36, 1) 0.4s forwards;
}

@keyframes storiesNavIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stories-navbar-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 58px;
  padding: 0 10px 0 8px;
  box-sizing: border-box;
  border-radius: 9999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: box-shadow 0.35s ease, transform 0.3s ease;
}

.stories-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  height: 42px;
  padding: 0 1.1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #3dd68c 0%, #2bb8ff 100%);
  background-size: 200% 200%;
  color: #003920 !important;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  text-decoration: none;
  border: none;
  box-shadow: 0 4px 16px rgba(61, 214, 140, 0.35);
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1),
              box-shadow 0.28s ease,
              filter 0.28s ease;
  white-space: nowrap;
  animation: storiesBtnGlow 3.5s ease-in-out infinite;
}

@keyframes storiesBtnGlow {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 0 4px 16px rgba(61, 214, 140, 0.35);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 4px 22px rgba(43, 184, 255, 0.4);
  }
}

.stories-nav-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 26px rgba(61, 214, 140, 0.55);
  filter: brightness(1.08);
  color: #003920 !important;
  animation: none;
}
.stories-nav-btn:active {
  transform: translateY(0) scale(0.98);
}
.stories-nav-btn.active {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4), 0 6px 22px rgba(61, 214, 140, 0.45);
  filter: brightness(1.08);
}
.stories-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
  transition: transform 0.3s ease;
}
.stories-nav-btn:hover .stories-nav-icon {
  transform: rotate(-8deg) scale(1.1);
}
[data-theme="light"] .stories-nav-btn {
  background: linear-gradient(135deg, #0d8a4f 0%, #0ea5e9 100%);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(13, 138, 79, 0.3);
}
[data-theme="light"] .stories-nav-btn:hover {
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(13, 138, 79, 0.4);
}
[data-theme="light"] .stories-navbar-inner {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(0, 0, 0, 0.1);
}

/* Theme toggle inside stories navbar */
.stories-navbar .theme-toggle {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

/* Main navbar: no longer needs space for stories/theme on the right */
.nav-container {
  padding-right: 16px;
}

@media (max-width: 768px) {
  .nav-top-wrap {
    top: 12px;
    gap: 8px;
    max-width: calc(100% - 16px);
  }
  .stories-nav-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
  }
  .stories-navbar .theme-toggle {
    width: 34px;
    height: 34px;
  }
  .stories-navbar-inner {
    height: 54px;
    padding: 0 8px 0 6px;
    gap: 0.35rem;
  }
  .stories-nav-btn {
    height: 38px;
  }
}
