:root {
  color-scheme: dark;
  --bg: #060816;
  --panel: rgba(15, 23, 42, 0.95);
  --panel-2: #121b37;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #8b5cf6;
  --accent-2: #38bdf8;
  --success: #22c55e;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at top, #141d3a 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.home-page {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(4, 8, 24, 0.96), rgba(10, 18, 40, 0.92)),
    radial-gradient(circle at 15% 20%, rgba(139, 92, 246, 0.35), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(56, 189, 248, 0.3), transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(34, 197, 94, 0.2), transparent 42%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='1200' viewBox='0 0 1600 1200'%3E%3Crect width='1600' height='1200' fill='transparent'/%3E%3Cpath d='M0 900 C220 760 380 760 560 860 C740 960 920 960 1120 830 C1300 710 1420 690 1600 760 L1600 1200 L0 1200 Z' fill='rgba(10, 20, 44, 0.95)'/%3E%3Cpath d='M0 920 C220 800 410 780 560 860 C710 940 980 960 1160 840 C1320 730 1460 720 1600 790' stroke='rgba(56, 189, 248, 0.2)' stroke-width='3' fill='none'/%3E%3Cpath d='M220 780 L320 640 L420 780 L530 560 L640 780 L760 620 L860 780' stroke='rgba(255,255,255,0.12)' stroke-width='7' stroke-linecap='round' fill='none'/%3E%3Ccircle cx='1180' cy='300' r='90' fill='rgba(139, 92, 246, 0.18)'/%3E%3Ccircle cx='1240' cy='260' r='40' fill='rgba(255,255,255,0.08)'/%3E%3Cpath d='M1040 430 L1100 360 L1160 430 L1100 500 Z' fill='rgba(255,255,255,0.08)'/%3E%3Cpath d='M1040 430 L1020 530 L1100 600 L1180 530 L1160 430' stroke='rgba(255,255,255,0.08)' stroke-width='4' fill='none'/%3E%3Ccircle cx='280' cy='260' r='6' fill='rgba(255,255,255,0.6)'/%3E%3Ccircle cx='340' cy='200' r='4' fill='rgba(255,255,255,0.4)'/%3E%3Ccircle cx='410' cy='290' r='5' fill='rgba(255,255,255,0.4)'/%3E%3Ccircle cx='1360' cy='220' r='6' fill='rgba(255,255,255,0.5)'/%3E%3Ccircle cx='1460' cy='340' r='4' fill='rgba(255,255,255,0.3)'/%3E%3C/svg>%3E");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.home-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.14), transparent 12%),
    radial-gradient(circle at 80% 25%, rgba(255,255,255,0.1), transparent 10%),
    linear-gradient(180deg, transparent 0%, rgba(4, 8, 24, 0.35) 100%);
  mix-blend-mode: screen;
}

body.home-page .topbar {
  background: rgba(3, 8, 24, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -2;
}

.video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) saturate(0.8);
}

.video-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(4, 8, 24, 0.8), rgba(2, 6, 23, 0.7));
  pointer-events: none;
}

body.home-page .hero {
  position: relative;
  isolation: isolate;
}

body.home-page .hero::after {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(56, 189, 248, 0.12));
  filter: blur(50px);
  z-index: -1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(6, 8, 22, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.user-pill {
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 600;
  color: white;
}

main {
  flex: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 2rem;
  padding: 3rem 0 2rem;
  align-items: center;
}

.hero-content h1,
.intro h1,
.auth-card h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.1;
  margin: 0.2rem 0 0.9rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.8rem;
}

.hero-content p,
.intro p,
.card p,
.guide-item p,
.auth-card p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.hero-card,
.card,
.guide-item,
.auth-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.hero-card {
  padding: 1.5rem;
}

.hero-card ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.section {
  margin-top: 2rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card,
.guide-item,
.auth-card {
  padding: 1.35rem;
}

.card a {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: none;
}

.guide-list {
  display: grid;
  gap: 1rem;
}

.auth-card {
  max-width: 520px;
  margin: 0 auto;
}

.auth-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.auth-form input {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0f172a;
  color: var(--text);
}

.message {
  min-height: 1.2rem;
  margin-top: 0.75rem;
  font-weight: 600;
}

.message.success {
  color: var(--success);
}

.message.error {
  color: var(--danger);
}

footer {
  text-align: center;
  padding: 1rem 1rem 2rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    gap: 0.8rem;
  }

  .nav-links {
    justify-content: center;
  }
}
