:root {
  --bg1: #f9fafb;
  --bg2: #fefce8;
  --bg3: #e0f2fe;

  --accent-green: #22c55e;
  --accent-yellow: #eab308;
  --accent-orange: #f97316;

  --card-bg: rgba(255, 255, 255, 0.9);
  --card-border: rgba(15, 23, 42, 0.06);
  --card-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);

  --text-main: #0f172a;
  --text-muted: #6b7280;
  --chip-bg: rgba(255, 255, 255, 0.9);
  --chip-border: rgba(15, 23, 42, 0.08);
  --footer-chip-bg: rgba(255, 255, 255, 0.8);
}

:root[data-theme="dark"] {
  --bg1: #020617;
  --bg2: #020617;
  --bg3: #020617;

  --card-bg: rgba(15, 23, 42, 0.96);
  --card-border: rgba(148, 163, 184, 0.28);
  --card-shadow: 0 26px 70px rgba(0, 0, 0, 0.9);

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --chip-bg: rgba(15, 23, 42, 0.96);
  --chip-border: rgba(148, 163, 184, 0.5);
  --footer-chip-bg: rgba(15, 23, 42, 0.96);
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html, body { 
  height: 100%; 
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 45%, var(--bg3) 100%);
  min-height: 100vh;
}

/* Animated background spots */
.spot {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: float 18s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

.spot.green {
  width: 420px; 
  height: 420px;
  background: var(--accent-green);
  top: 5%; 
  left: 10%;
  animation-delay: 0s;
}

.spot.yellow {
  width: 380px; 
  height: 380px;
  background: var(--accent-yellow);
  bottom: 10%; 
  right: 10%;
  animation-delay: 2s;
}

.spot.orange {
  width: 320px; 
  height: 320px;
  background: var(--accent-orange);
  top: 60%; 
  left: 50%;
  animation-delay: 4s;
}

@keyframes float {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.03); opacity: 0.45; }
  100% { transform: translateY(20px) scale(1.08); opacity: 0.3; }
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  user-select: none;
  transition: background 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

:root[data-theme="dark"] .theme-toggle {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.04);
}

.theme-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

:root[data-theme="light"] .theme-icon.sun,
:root[data-theme="dark"] .theme-icon.moon {
  opacity: 1;
}

.theme-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

/* Main content */
.main {
  position: relative;
  z-index: 1;
  padding: 80px 20px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header section */
.header-section {
  text-align: center;
  margin-bottom: 48px;
}

.site-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--accent-green), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Catalog container */
.catalog-container {
  position: relative;
  z-index: 1;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  justify-items: center;
}

/* Program card */
.program-card {
  position: relative;
  z-index: 1;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--card-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.program-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

:root[data-theme="dark"] .program-card:hover {
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.95);
}

.program-icon {
  margin-bottom: 20px;
  color: var(--accent-green);
  display: flex;
  justify-content: center;
  align-items: center;
}

.program-icon svg {
  width: 56px;
  height: 56px;
}

.program-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
}

.program-description {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
  flex-grow: 1;
}

.program-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.feature-tag {
  font-size: 13px;
  padding: 6px 12px;
  background: var(--chip-bg);
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  color: var(--text-main);
  font-weight: 500;
  transition: all 0.2s ease;
}

.feature-tag:hover {
  transform: scale(1.05);
}

.card-footer {
  width: 100%;
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-download,
.btn-details {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-download {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-orange));
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.btn-details {
  background: var(--chip-bg);
  color: var(--text-main);
  border: 1px solid var(--chip-border);
}

.btn-details:hover {
  background: var(--card-bg);
  transform: translateY(-2px);
}

/* Responsive design */
@media (max-width: 768px) {
  .main {
    padding: 60px 16px 40px;
  }

  .site-title {
    font-size: 2.2rem;
  }

  .site-subtitle {
    font-size: 1rem;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .program-card {
    max-width: 100%;
    padding: 28px 24px;
  }

  .theme-toggle {
    top: 16px;
    right: 16px;
    padding: 5px 6px;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 1.8rem;
  }

  .program-card {
    padding: 24px 20px;
  }

  .program-name {
    font-size: 1.3rem;
  }
}
