/* ========================
   Design tokens & layout
======================== */
:root {
  --hero-gradient: linear-gradient(135deg, #eff6ff, #fdf2f8);
  --hero-gradient-dark: linear-gradient(135deg, #0f172a, #1e1b4b);
  --surface-radius: 1.25rem;
  --surface-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.12);
  --surface-shadow-dark: 0 2rem 3.5rem rgba(2, 6, 23, 0.65);
  --surface-padding: 2.5rem;
  --section-space: 3rem;
  --section-space-mobile: 2.5rem;
}

/* ========================
   Global base styling
======================== */
body {
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
  background: #f5f7fb;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========================
   Hero module
======================== */
.hero {
  padding-top: var(--section-space);
  padding-bottom: calc(var(--section-space) - 0.5rem);
}

.hero-card h1 {
  letter-spacing: 0.02em;
}

.hero-description {
  max-width: 620px;
}

.hero-visual {
  max-width: 320px;
  width: 100%;
  filter: drop-shadow(0 25px 45px rgba(15, 23, 42, 0.15));
}

.hero-card {
  background: var(--hero-gradient);
  border: none;
  border-radius: var(--surface-radius);
  box-shadow: 0 2rem 3.5rem rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.25), transparent 45%);
  pointer-events: none;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 12px 20px;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.25);
  filter: blur(60px);
  opacity: 0.4;
}

@media (max-width: 576px) {
  .hero {
    padding-top: calc(var(--section-space) - 0.5rem);
    padding-bottom: var(--section-space-mobile);
  }

  .hero-description {
    max-width: 100%;
  }

  .hero-visual {
    max-width: 240px;
  }
}

/* ========================
   Typography helpers
======================== */
.tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #2563eb;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-title {
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bs-primary);
}

/* ========================
   Glass cards & modules
======================== */
:is(.card-glass, .access-module) {
  border-radius: var(--surface-radius);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--surface-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

:is(.card-glass, .access-module):hover {
  transform: translateY(-6px);
  box-shadow: 0 2.5rem 4rem rgba(15, 23, 42, 0.2);
}

/* ========================
   Access module block
======================== */
.access-module {
  padding: var(--surface-padding);
}

@media (max-width: 576px) {
  .access-module {
    padding: 1.75rem;
  }
}

.module-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.status-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.9);
  display: inline-block;
  margin-right: 0.35rem;
}

/* ========================
   Entry cards
======================== */
.entry-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 0;
}

.entry-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(236, 72, 153, 0.4));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.entry-card .card-body {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
}

.entry-card:hover {
  transform: translateY(-4px);
}

.entry-card:hover .link-primary {
  color: #ec4899 !important;
}

/* ========================
   Badges & pills
======================== */
.badge-soft {
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

/* ========================
   Footer
======================== */
footer {
  padding: 2.5rem 0 3.5rem;
  font-size: 0.95rem;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

/* ========================
   Dark mode overrides
======================== */
@media (prefers-color-scheme: dark) {
  /* Global base */
  body {
    background: radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.16), transparent 45%), radial-gradient(circle at 80% 0%, rgba(236, 72, 153, 0.2), transparent 50%), #070b1f;
    color: #f8fafc;
    color-scheme: dark;
  }

  /* Hero adjustments */
  .hero-description {
    color: rgba(226, 232, 240, 0.85);
  }

  .hero-card {
    background: linear-gradient(120deg, #2c3e86, #4c1d72, #75307a);
    box-shadow: 0 3rem 4rem rgba(0, 6, 20, 0.85);
  }

  .tagline {
    background: rgba(15, 23, 42, 0.85);
    color: #dbeafe;
  }

  /* Card + module shells */
  .card,
  .card h1,
  .card h2,
  .card h3,
  .card h4,
  .card h5,
  .card h6,
  .card p,
  .card li {
    color: #f8fafc;
  }

  :is(.card-glass, .access-module) {
    background: rgba(13, 20, 42, 0.92);
    border-color: rgba(120, 146, 196, 0.35);
    box-shadow: 0 2rem 3.5rem rgba(5, 8, 20, 0.85);
    backdrop-filter: blur(18px);
  }

  :is(.card-glass, .access-module):hover {
    box-shadow: 0 2.75rem 4.25rem rgba(1, 6, 18, 0.85);
  }

  .access-module {
    background: rgba(16, 22, 47, 0.95);
  }

  /* Section dividers & entry cards */
  .module-header {
    border-color: rgba(96, 110, 142, 0.5);
  }

  .entry-card .card-body {
    background: rgba(20, 26, 52, 0.9);
  }

  .badge-soft {
    background: rgba(34, 197, 94, 0.23);
    color: #bbf7d0;
  }

  /* Footer + buttons */
  footer {
    border-color: rgba(71, 85, 105, 0.45);
    color: rgba(241, 245, 249, 0.85);
  }

  .btn-primary {
    background: #2563eb;
    border: none;
  }

  .btn-outline-primary {
    color: #93c5fd;
    border-color: rgba(147, 197, 253, 0.65);
  }

  .btn-outline-primary:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #bfdbfe;
  }

  /* Accent text helpers */
  .text-body-secondary {
    color: rgba(226, 232, 240, 0.78) !important;
  }

  .section-title {
    color: #93c5fd;
  }

  .entry-card .badge {
    color: #0f172a;
  }
}
