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

:root {
  --primary: #0b1a2e;
  --primary-light: #132a44;
  --accent: #f0c040;
  --accent-hover: #d4a832;
  --text: #e0e6ed;
  --text-dark: #1a2332;
  --bg: #0f1b2a;
  --card-bg: rgba(255, 255, 255, 0.05);
  --glass: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.3s ease;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --gradient-bg: linear-gradient(135deg, #0b1a2e 0%, #1a3a5c 100%);
  --gradient-accent: linear-gradient(135deg, #f0c040, #ffd966);
  --max-width: 1200px;
}

[data-theme="light"] {
  --primary: #ffffff;
  --primary-light: #f5f7fa;
  --text: #1a2332;
  --text-dark: #0b1a2e;
  --bg: #f0f4f8;
  --card-bg: rgba(0, 0, 0, 0.03);
  --glass: rgba(255, 255, 255, 0.7);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --gradient-bg: linear-gradient(135deg, #e8edf5 0%, #d0dce8 100%);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

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

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

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

ul {
  list-style: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(11, 26, 46, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(240, 192, 64, 0.15);
  transition: background var(--transition), border-color var(--transition);
}

[data-theme="light"] header {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.logo svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 8px;
}

nav ul li a {
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}

nav ul li a:hover,
nav ul li a.active {
  background: var(--accent);
  color: var(--primary);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  width: 28px;
  height: 3px;
  background: var(--text);
  border-radius: 4px;
  transition: var(--transition);
}

.theme-switch {
  background: var(--glass);
  border: 1px solid rgba(240, 192, 64, 0.2);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
  white-space: nowrap;
}

.theme-switch:hover {
  background: var(--accent);
  color: var(--primary);
}

/* Hero Section */
.hero {
  padding: 140px 0 80px;
  background: var(--gradient-bg);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(240, 192, 64, 0.08) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(5%, 5%); }
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 60px;
  flex-wrap: wrap;
}

.hero-text {
  flex: 1 1 500px;
}

.hero-text h1 {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: var(--primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(240, 192, 64, 0.3);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

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

.hero-visual {
  flex: 1 1 400px;
  display: flex;
  justify-content: center;
}

.hero-visual svg {
  width: 100%;
  max-width: 500px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

/* Sections */
section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-title p {
  font-size: 1.1rem;
  opacity: 0.75;
  max-width: 600px;
  margin: 10px auto 0;
}

/* Grid Layouts */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 32px 24px;
  border: 1px solid rgba(240, 192, 64, 0.1);
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.card.show {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.card-icon {
  margin-bottom: 16px;
}

.card-icon svg {
  width: 48px;
  height: 48px;
}

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--accent);
}

.card p {
  opacity: 0.8;
  font-size: 0.95rem;
}

/* Banner Carousel */
.banner-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--primary-light);
  margin-bottom: 40px;
}

.banner-slide {
  display: none;
  padding: 60px 40px;
  text-align: center;
  animation: fadeSlide 0.6s ease;
}

.banner-slide.active {
  display: block;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.banner-slide h3 {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.banner-slide p {
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.85;
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
}

.banner-dots button {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.banner-dots button.active {
  background: var(--accent);
}

/* FAQ */
.faq-item {
  background: var(--card-bg);
  border-radius: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(240, 192, 64, 0.08);
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item.open {
  border-color: var(--accent);
}

.faq-question {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  transition: background var(--transition);
  user-select: none;
}

.faq-question:hover {
  background: rgba(240, 192, 64, 0.05);
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0 24px;
  opacity: 0.85;
  line-height: 1.8;
}

.faq-item.open .faq-answer {
  max-height: 400px;
  padding: 0 24px 20px;
}

/* HowTo */
.howto-steps {
  counter-reset: step;
}

.howto-step {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  align-items: flex-start;
  padding: 16px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(240, 192, 64, 0.05);
  transition: var(--transition);
}

.howto-step:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.howto-step::before {
  counter-increment: step;
  content: counter(step);
  background: var(--accent);
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.howto-step h3 {
  color: var(--accent);
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.howto-step p {
  opacity: 0.85;
  font-size: 0.95rem;
}

/* Articles */
.article-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(240, 192, 64, 0.08);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.article-card.show {
  opacity: 1;
  transform: translateY(0);
}

.article-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.article-card .date {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 8px;
}

.article-card h4 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.article-card p {
  opacity: 0.75;
  font-size: 0.95rem;
  margin-bottom: 12px;
  line-height: 1.6;
}

.article-card .read-more {
  font-weight: 600;
  color: var(--accent);
  display: inline-block;
  transition: var(--transition);
}

.article-card .read-more:hover {
  transform: translateX(4px);
}

/* Footer */
footer {
  background: var(--primary);
  padding: 60px 0 30px;
  border-top: 1px solid rgba(240, 192, 64, 0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--accent);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  opacity: 0.7;
  font-size: 0.95rem;
  transition: opacity var(--transition), color var(--transition);
}

.footer-col ul li a:hover {
  opacity: 1;
  color: var(--accent);
}

.footer-col p {
  opacity: 0.7;
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid rgba(240, 192, 64, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.6;
}

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

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary);
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(240, 192, 64, 0.3);
  z-index: 999;
  transition: var(--transition);
}

.back-to-top.show {
  display: flex;
}

.back-to-top:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(240, 192, 64, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }

  nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--primary);
    padding: 16px;
    border-radius: 16px;
    margin-top: 12px;
    gap: 4px;
  }

  nav ul.open {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .hero-text h1 {
    font-size: 2.2rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero-content {
    gap: 40px;
  }

  .banner-slide {
    padding: 40px 20px;
  }

  .banner-slide h3 {
    font-size: 1.5rem;
  }

  .section-title h2 {
    font-size: 1.8rem;
  }

  section {
    padding: 60px 0;
  }

  .card {
    padding: 24px 20px;
  }

  .faq-question {
    padding: 16px 20px;
    font-size: 0.95rem;
  }

  .faq-answer {
    padding: 0 20px;
  }

  .faq-item.open .faq-answer {
    padding: 0 20px 16px;
  }

  .howto-step {
    padding: 12px;
    gap: 14px;
  }

  .howto-step::before {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .footer-grid {
    gap: 30px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .hero-text h1 {
    font-size: 2.6rem;
  }

  .hero-text p {
    font-size: 1.1rem;
  }

  .grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

/* Utility */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 40px;
}

.mb-4 {
  margin-bottom: 40px;
}

/* Scroll Animation Base */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth card reveal fallback */
@media (prefers-reduced-motion: reduce) {
  .card,
  .article-card,
  .scroll-animate {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .howto-step:hover,
  .card:hover,
  .article-card:hover {
    transform: none;
  }

  .hero::before {
    animation: none;
  }
}