:root {
  --bg-color: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-color: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.3);
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.1);
  --glass-blur: 12px;
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --container-width: 1024px;
}

/* Light Theme Mode Support (Future proofing) */
@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-color: #0284c7;
    --accent-glow: rgba(2, 132, 199, 0.2);
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.05);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Decorative Background Gradient */
body::before {
  content: '';
  /* Ensure background stays behind */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 15% 50%, var(--accent-glow), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.15), transparent 25%);
  z-index: -1;
  pointer-events: none;
  /* Critical: let clicks pass through */
}

.container,
header,
main,
footer {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  position: relative;
  /* Create stacking context */
  z-index: 2;
  /* Force above background */
}

header {
  z-index: 1000 !important;
  /* Header always on top */
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.2s;
}

a:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px var(--accent-glow);
}

/* Header */
header {
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(var(--glass-blur));
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand .muted {
  font-size: 0.9rem;
  font-weight: 400;
  margin-left: 8px;
  opacity: 0.7;
}

nav a {
  margin-left: 20px;
  font-weight: 500;
  color: var(--text-muted);
}

nav a:hover,
nav a.active {
  color: var(--text-main);
}

/* Main Content */
main {
  flex: 1;
  padding-top: 40px;
  padding-bottom: 60px;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Cards & Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(var(--glass-blur));
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.3);
  border-color: var(--accent-color);
}

.card h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.card h2 a {
  color: var(--text-main);
}

.card h2 a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

.muted {
  color: var(--text-muted);
}

/* Buttons & CTA */
.cta {
  display: inline-flex;
  padding: 12px 20px;
  background: var(--accent-color);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.cta:hover {
  background: #0ea5e9;
  transform: scale(1.02);
  text-decoration: none;
  box-shadow: 0 6px 16px var(--accent-glow);
}

/* Lists in content */
ol,
ul {
  padding-left: 20px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 8px;
}

li strong {
  color: var(--text-main);
}

/* Footer */
footer {
  border-top: 1px solid var(--card-border);
  padding: 30px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: auto;
}

/* Utilities */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 99px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-color);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 500;
}

.dropdown-toggle:hover {
  color: var(--text-main);
}

.dropdown-toggle:after {
  content: '▼';
  font-size: 0.6em;
  opacity: 0.7;
  transform: translateY(1px);
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-color);
  /* More solid background for menu */
  border: 1px solid var(--card-border);
  border-radius: 12px;
  min-width: 150px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
  padding: 6px;
  flex-direction: column;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: flex;
}

.dropdown-menu a {
  padding: 8px 16px;
  margin: 2px 0;
  color: var(--text-muted);
  display: block;
  border-radius: 8px;
  margin-left: 0;
  /* Override default nav a */
}

.dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  text-decoration: none;
  text-shadow: none;
}

/* --- Mobile Responsive Styles --- */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  /* Push to right if needed */
}

@media (max-width: 768px) {
  header {
    height: auto;
    min-height: 70px;
    padding: 12px 24px;
    flex-wrap: wrap;
    /* Allow nav to break to new line */
  }

  .brand {
    font-size: 1.3rem;
  }

  .mobile-menu-btn {
    display: block;
  }

  /* Nav turns into a full-width dropdown/overlay */
  nav {
    display: none;
    /* Hidden by default */
    width: 100%;
    flex-direction: column;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
    margin-top: 12px;
  }

  nav.active {
    display: flex;
    /* Show when toggled */
    animation: slideDown 0.3s ease-out;
  }

  nav a {
    margin-left: 0;
    margin-bottom: 12px;
    display: block;
    padding: 10px 0;
    font-size: 1.1rem;
    text-align: center;
    border-radius: 8px;
  }

  nav a:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .dropdown {
    width: 100%;
    display: block;
    margin-bottom: 12px;
    text-align: center;
  }

  .dropdown-toggle {
    width: 100%;
    justify-content: center;
    padding: 10px 0;
    font-size: 1.1rem;
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border: none;
    padding: 0;
    background: rgba(0, 0, 0, 0.2);
    display: none;
    margin-top: 5px;
  }

  .dropdown.active .dropdown-menu {
    display: flex;
  }

  /* Adjust Content Layout */
  h1 {
    font-size: 2rem;
    text-align: center;
  }

  .container {
    padding: 0 16px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  p {
    text-align: center;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* FORCE FIX for Mobile Button */
.mobile-menu-btn {
  z-index: 9999 !important;
  /* Ensure it's on top of everything */
  position: relative;
  touch-action: manipulation;
  /* Improve touch response */
}

nav {
  z-index: 9998;
}

/* Stretched Link for Cards */
.card {
  position: relative;
  /* Ensure it's reachable */
  z-index: 5;
}

.card h2 a::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: pointer;
}

.card:hover {
  border-color: var(--accent-color);
  background: rgba(56, 189, 248, 0.05);
  /* Enhanced feedback */
}

/* Ensure real links inside (like buttons) are still clickable above the stretched link if needed */
.card .cta {
  position: relative;
  z-index: 20;
}