:root {
  --bg: #f8f4ff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-alt: rgba(255, 255, 255, 0.6);
  --text: #1a1033;
  --muted: #5b4f7a;
  --accent: #7c3aed;
  --accent-2: #f43f5e;
  --accent-3: #06b6d4;
  --accent-4: #f59e0b;
  --accent-hover: #6d28d9;
  --border: rgba(124, 58, 237, 0.22);
  --glow: rgba(124, 58, 237, 0.45);
  --shadow: 0 18px 50px rgba(88, 28, 135, 0.18);
  --font-display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

html.dark,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070312;
  --surface: rgba(28, 18, 52, 0.82);
  --surface-solid: #16102a;
  --surface-alt: rgba(20, 12, 40, 0.72);
  --text: #f8f4ff;
  --muted: #c4b5fd;
  --accent: #c4b5fd;
  --accent-2: #fb7185;
  --accent-3: #67e8f9;
  --accent-4: #fcd34d;
  --accent-hover: #ddd6fe;
  --border: rgba(196, 181, 253, 0.28);
  --glow: rgba(167, 139, 250, 0.55);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: background 0.45s ease, color 0.45s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 12% 18%, rgba(244, 63, 94, 0.55), transparent 38%),
    radial-gradient(circle at 88% 10%, rgba(6, 182, 212, 0.5), transparent 34%),
    radial-gradient(circle at 72% 82%, rgba(124, 58, 237, 0.55), transparent 40%),
    radial-gradient(circle at 6% 88%, rgba(250, 204, 21, 0.45), transparent 32%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.2), transparent 55%),
    linear-gradient(135deg, #ffe4f3 0%, #ede9fe 30%, #dbeafe 65%, #cffafe 100%);
  animation: bgShift 12s ease-in-out infinite alternate;
}

html.dark body::before,
html[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 12% 18%, rgba(244, 63, 94, 0.35), transparent 38%),
    radial-gradient(circle at 88% 10%, rgba(6, 182, 212, 0.3), transparent 34%),
    radial-gradient(circle at 72% 82%, rgba(124, 58, 237, 0.42), transparent 40%),
    radial-gradient(circle at 6% 88%, rgba(250, 204, 21, 0.22), transparent 32%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.15), transparent 55%),
    linear-gradient(135deg, #0a0418 0%, #1a0f33 35%, #0b1a33 70%, #061525 100%);
}

@keyframes bgShift {
  0% {
    filter: hue-rotate(0deg) saturate(1.1);
    transform: scale(1) rotate(0deg);
  }
  100% {
    filter: hue-rotate(30deg) saturate(1.35);
    transform: scale(1.08) rotate(2deg);
  }
}

.bg-animation {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.aurora {
  position: absolute;
  inset: -20%;
  background:
    conic-gradient(from 180deg at 50% 50%, #f43f5e, #a855f7, #06b6d4, #facc15, #f43f5e);
  opacity: 0.28;
  filter: blur(60px);
  animation: auroraSpin 18s linear infinite;
}

html.dark .aurora,
html[data-theme="dark"] .aurora {
  opacity: 0.22;
}

@keyframes auroraSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.92;
  animation: floatBlob 10s ease-in-out infinite;
}

html.dark .blob,
html[data-theme="dark"] .blob {
  opacity: 0.7;
  filter: blur(48px);
}

.blob-1 {
  width: 480px;
  height: 480px;
  top: -120px;
  left: -100px;
  background: linear-gradient(135deg, #f43f5e, #fb923c, #facc15);
  animation-delay: 0s;
}

.blob-2 {
  width: 420px;
  height: 420px;
  top: 22%;
  right: -120px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4, #22d3ee);
  animation-delay: -3s;
}

.blob-3 {
  width: 360px;
  height: 360px;
  bottom: 5%;
  left: 12%;
  background: linear-gradient(135deg, #facc15, #22c55e, #06b6d4);
  animation-delay: -6s;
}

.blob-4 {
  width: 300px;
  height: 300px;
  top: 55%;
  left: 45%;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  animation-delay: -2s;
}

.blob-5 {
  width: 260px;
  height: 260px;
  bottom: 20%;
  right: 15%;
  background: linear-gradient(135deg, #3b82f6, #14b8a6);
  animation-delay: -8s;
}

.grid-glow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.1) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 90%);
  animation: gridPulse 6s ease-in-out infinite;
}

html.dark .grid-glow,
html[data-theme="dark"] .grid-glow {
  background-image:
    linear-gradient(rgba(196, 181, 253, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 181, 253, 0.14) 1px, transparent 1px);
}

.sparkles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.6) 1px, transparent 1px);
  background-size: 120px 120px, 200px 200px;
  background-position: 0 0, 60px 60px;
  opacity: 0.35;
  animation: sparkleDrift 20s linear infinite;
}

html.dark .sparkles,
html[data-theme="dark"] .sparkles {
  opacity: 0.2;
}

@keyframes sparkleDrift {
  0% { transform: translateY(0); }
  100% { transform: translateY(-120px); }
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -30px) scale(1.1); }
  50% { transform: translate(-20px, 25px) scale(0.95); }
  75% { transform: translate(25px, 35px) scale(1.05); }
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.hero {
  position: relative;
  padding: 104px 0 84px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 12% 8% auto;
  height: 70%;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(6, 182, 212, 0.12), rgba(244, 63, 94, 0.1));
  filter: blur(40px);
  animation: heroGlow 8s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes heroGlow {
  0% { opacity: 0.6; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

.hero .container {
  position: relative;
  z-index: 1;
}

.tag {
  display: inline-block;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--surface), rgba(255, 255, 255, 0.5));
  backdrop-filter: blur(14px);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  animation: fadeUp 0.8s ease both;
  box-shadow: var(--shadow);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(2.2rem, 5.4vw, 4rem);
  line-height: 1.08;
  font-weight: 800;
  animation: fadeUp 0.9s ease 0.1s both, titleShine 6s ease-in-out infinite;
  background: linear-gradient(120deg, var(--text) 0%, var(--accent) 30%, var(--accent-2) 55%, var(--accent-3) 80%, var(--accent-4) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html.dark h1,
html[data-theme="dark"] h1 {
  background: linear-gradient(120deg, #ffffff 0%, #c4b5fd 25%, #fb7185 50%, #67e8f9 75%, #fcd34d 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
}

@keyframes titleShine {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.subtitle {
  max-width: 720px;
  margin: 22px 0 34px;
  color: var(--muted);
  font-size: 1.12rem;
  animation: fadeUp 1s ease 0.2s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  animation: fadeUp 1.1s ease 0.3s both;
}

.button {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border: none;
  border-radius: 14px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
  background-size: 200% auto;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-position 0.4s ease;
  box-shadow: 0 12px 28px var(--glow);
  animation: btnGlow 4s ease-in-out infinite;
}

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 12px 28px var(--glow); }
  50% { box-shadow: 0 16px 40px rgba(244, 63, 94, 0.4); }
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}

.button:hover {
  transform: translateY(-3px) scale(1.03);
  background-position: 100% center;
}

.button:hover::after {
  transform: translateX(120%);
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: none;
}

.button-secondary:hover {
  background: var(--surface-solid);
  border-color: var(--accent);
}

.section {
  padding: 72px 0;
  position: relative;
}

.section h2 {
  margin: 0 0 28px;
  font-size: clamp(1.7rem, 3.8vw, 2.5rem);
  font-weight: 800;
  background: linear-gradient(120deg, var(--text), var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  animation: fadeUp 0.8s ease both, cardFloat 6s ease-in-out infinite;
}

.card:nth-child(1) { animation-delay: 0.05s, 0s; }
.card:nth-child(2) { animation-delay: 0.12s, -1.5s; }
.card:nth-child(3) { animation-delay: 0.19s, -3s; }
.card:nth-child(4) { animation-delay: 0.26s, -4.5s; }

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(6, 182, 212, 0.12), rgba(244, 63, 94, 0.1));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.card:hover {
  transform: translateY(-10px) rotate(-0.5deg) !important;
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 28px 56px var(--glow);
  animation-play-state: paused;
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  position: relative;
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(120deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card p {
  position: relative;
  margin: 0;
  color: var(--muted);
}

.card p + p {
  margin-top: 14px;
}

.section-alt {
  background: transparent;
}

.callout {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 34px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 50%, rgba(124, 58, 237, 0.08) 100%);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: fadeUp 0.9s ease both;
}

.callout::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4, #f43f5e, #facc15, #7c3aed);
  background-size: 300% 300%;
  animation: borderFlow 8s ease infinite;
  z-index: -1;
  opacity: 0.5;
}

.callout::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.4), transparent 70%);
  animation: floatBlob 10s ease-in-out infinite;
}

@keyframes borderFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.callout h2 {
  position: relative;
}

.callout p {
  position: relative;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1.05rem;
}

.footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
  padding: 22px 0 28px;
  text-align: center;
}

.theme-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  width: 54px;
  height: 54px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, background 0.3s ease, border-color 0.3s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
}

.theme-toggle:active {
  transform: translateY(0);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .hero {
    padding: 78px 0 60px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .blob-1,
  .blob-2,
  .blob-3,
  .blob-4,
  .blob-5 {
    transform: scale(0.7);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
