/* ====== Base & Tokens ====== */

:root {
  /* Brand */
  --color-primary: #5d3ffd;
  --color-secondary: #f72c9b;
  --color-accent-blue: #2fd2ff;

  /* Light default */
  --bg-page: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-soft: #f5f3ff;
  --bg-hero: radial-gradient(circle at top left, #ffe7fb 0, #ffffff 40%, #eef2ff 90%);
  --text-main: #1a103f;
  --text-soft: #8f8fb2;
  --footer-bg: #0b0221;
  --border-subtle: rgba(226, 232, 240, 0.6);
  --header-bg: rgba(255, 255, 255, 0.9);
  --header-border: rgba(148, 163, 184, 0.15);

  --shadow-soft: 0 24px 60px rgba(16, 7, 83, 0.12);
  --shadow-phone: 0 40px 80px rgba(23, 12, 94, 0.45);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-pill: 999px;
}

body[data-theme="dark"] {
  --bg-page: #020014;
  --bg-surface: #05001f;
  --bg-surface-soft: #0b012f;
  --bg-hero: radial-gradient(circle at top left, #2b1b7a 0, #050018 40%, #000000 90%);
  --text-main: #f9fafb;
  --text-soft: #9ca3dc;
  --footer-bg: #000010;
  --border-subtle: rgba(31, 41, 55, 0.7);
  --header-bg: rgba(3, 0, 20, 0.9);
  --header-border: rgba(15, 23, 42, 0.8);
  --shadow-soft: 0 26px 70px rgba(0, 0, 0, 0.8);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

/* Container */

.container {
  width: min(1180px, 100% - 3rem);
  margin-inline: auto;
}

/* ====== Header / Navigation ====== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--header-border);
  transition: box-shadow 0.25s ease, background 0.25s ease,
    border-color 0.25s ease;
}

.site-header.site-header--scrolled {
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
  gap: 1.4rem;
}

.logo img {
  height: 38px;
  display: block;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  font-size: 0.9rem;
}

.nav-link {
  position: relative;
  text-decoration: none;
  color: var(--text-soft);
  font-weight: 500;
  padding-bottom: 0.35rem;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--color-secondary),
    var(--color-primary)
  );
  transition: width 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.9rem;
  border-radius: var(--radius-pill);
  border: none;
  outline: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-primary)
  );
  box-shadow: 0 16px 38px rgba(93, 63, 253, 0.45);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 48px rgba(93, 63, 253, 0.6);
}

.btn-outline {
  border: 1px solid rgba(93, 63, 253, 0.25);
  color: var(--color-primary);
  background: #ffffff;
}

body[data-theme="dark"] .btn-outline {
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.7);
}

.btn-outline:hover {
  background: rgba(93, 63, 253, 0.04);
}

/* Theme Toggle */

.theme-toggle {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.25rem 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease, transform 0.15s ease;
}

.theme-toggle:hover {
  box-shadow: 0 10px 20px rgba(148, 163, 184, 0.55);
  transform: translateY(-1px);
}

.theme-icon {
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.theme-icon-light {
  color: #fbbf24;
}

.theme-icon-dark {
  color: #38bdf8;
}

body[data-theme="light"] .theme-icon-light {
  opacity: 1;
}

body[data-theme="dark"] .theme-icon-dark {
  opacity: 1;
}

body[data-theme="dark"] .theme-toggle {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
}

/* Mobile Nav Toggle */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.25rem;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: #111827;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

body[data-theme="dark"] .nav-toggle span {
  background: #e5e7eb;
}

/* ====== HERO ====== */

.hero {
  position: relative;
  padding-top: 6.5rem;
  background: var(--bg-hero);
  overflow: hidden;
}

.hero-bg-dot-left {
  position: absolute;
  inset: 8rem auto auto -60px;
  width: 220px;
  height: 620px;
  background-image: radial-gradient(circle, rgba(93, 63, 253, 0.22) 1px, transparent 0);
  background-size: 14px 14px;
  opacity: 0.2;
  pointer-events: none;
}

.hero-inner {
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 4rem;
  padding-block: 4.5rem 5rem;
}

.hero-copy {
  max-width: 520px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  color: var(--color-secondary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: clamp(2.2rem, 2.6vw + 1.5rem, 3.1rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.hero-title .accent {
  color: var(--color-primary);
}

.hero-text {
  margin: 0 0 1.8rem;
  color: var(--text-soft);
  font-size: 0.98rem;
  max-width: 420px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.hero-link {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-soft);
}

.hero-link span {
  color: var(--color-primary);
  font-weight: 600;
}

/* Hero Visual */

.hero-visual {
  position: relative;
  justify-self: center;
}

.hero-glow {
  position: absolute;
  inset: auto 10% -120px;
  height: 260px;
  background: radial-gradient(
    circle at top,
    rgba(163, 151, 255, 0.85),
    rgba(255, 255, 255, 0)
  );
  filter: blur(10px);
  z-index: 0;
  animation: glowPulse 5.5s ease-in-out infinite;
}

.hero-image {
  position: relative;
  display: block;
  max-width: 420px;
  width: 100%;
  z-index: 1;
  filter: drop-shadow(var(--shadow-phone));
  animation: floatPhone 7s ease-in-out infinite;
}

/* ====== Sections Generic ====== */

.section {
  padding-block: 4.5rem 4.75rem;
  background-color: var(--bg-surface);
}

.section + .section {
  border-top: 1px solid var(--border-subtle);
}

.section-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  color: var(--color-secondary);
  text-align: center;
  margin: 0 0 0.4rem;
  font-weight: 600;
}

.section-label.align-left {
  text-align: left;
}

.section-title {
  font-size: 1.7rem;
  text-align: center;
  margin: 0 0 2.4rem;
}

.section-title.align-left {
  text-align: left;
}

/* ====== Services ====== */

.services {
  background: var(--bg-surface);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.6rem;
}

.service-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.8rem 1.4rem 1.5rem;
  text-align: center;
  transform: translateY(0) scale(1);
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    background 0.2s ease;
}

body[data-theme="dark"] .service-card {
  background: var(--bg-surface-soft);
}

.service-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.22);
}

.service-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    var(--color-accent-blue),
    var(--color-primary)
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.service-title {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
  font-weight: 600;
}

.service-text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-soft);
}

/* ====== Features (App Screens) ====== */

.features {
  background: var(--bg-surface);
}

.feature-stack {
  display: flex;
  flex-direction: column;
  gap: 4.2rem;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 1fr);
  align-items: center;
  gap: 4rem;
}

.feature-reverse {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.03fr);
}

.feature-media {
  position: relative;
  justify-self: center;
}

.phone-glow {
  position: absolute;
  inset: auto 18% -110px;
  height: 230px;
  background: radial-gradient(
    circle at top,
    rgba(104, 117, 245, 0.8),
    rgba(255, 255, 255, 0)
  );
  filter: blur(8px);
  z-index: 0;
  animation: glowPulse 6s ease-in-out infinite;
}

.phone-image {
  position: relative;
  display: block;
  max-width: 260px;
  width: 100%;
  z-index: 1;
  filter: drop-shadow(var(--shadow-phone));
  animation: floatPhone 6.4s ease-in-out infinite;
}

.feature-copy {
  max-width: 420px;
}

.feature-label {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.68rem;
  color: var(--color-secondary);
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.feature-title {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
}

.feature-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* ====== Blog ====== */

.blog {
  background: var(--bg-surface);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.8rem;
}

.blog-card {
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(0) scale(1);
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    background 0.2s ease;
}

body[data-theme="dark"] .blog-card {
  background: var(--bg-surface-soft);
}

.blog-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.22);
}

.blog-thumb img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.blog-body {
  padding: 1.1rem 1.4rem 1.3rem;
}

.blog-meta {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.blog-title {
  margin: 0;
  font-size: 0.98rem;
}

/* ====== Download Section ====== */

.download {
  background: linear-gradient(180deg, var(--bg-surface-soft) 0%, var(--bg-surface) 38%);
}

.download-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 3.5rem;
}

.download-visual {
  position: relative;
  justify-self: center;
}

.download-glow {
  position: absolute;
  inset: auto 15% -110px;
  height: 230px;
  background: radial-gradient(
    circle at top,
    rgba(156, 163, 255, 0.9),
    rgba(255, 255, 255, 0)
  );
  filter: blur(10px);
  z-index: 0;
  animation: glowPulse 6.4s ease-in-out infinite;
}

.download-image {
  position: relative;
  max-width: 320px;
  width: 100%;
  filter: drop-shadow(var(--shadow-phone));
  z-index: 1;
  animation: floatPhone 7.2s ease-in-out infinite;
}

.download-copy {
  max-width: 460px;
}

.download-text {
  margin: 0 0 1.6rem;
  font-size: 0.94rem;
  color: var(--text-soft);
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.store-badge img {
  height: 44px;
  display: block;
}

/* ====== Newsletter / CTA ====== */

.newsletter-cta {
  padding-block: 4rem 4.5rem;
  background: var(--bg-surface);
}

.newsletter-box {
  position: relative;
  border-radius: 30px;
  background: linear-gradient(
    135deg,
    rgba(47, 210, 255, 0.13),
    rgba(93, 63, 253, 0.08)
  );
  padding: 2.4rem 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
  box-shadow: 0 18px 50px rgba(59, 130, 246, 0.18);
}

body[data-theme="dark"] .newsletter-box {
  background: radial-gradient(
    circle at top left,
    rgba(56, 189, 248, 0.12),
    rgba(37, 99, 235, 0.12),
    rgba(15, 23, 42, 1)
  );
}

.newsletter-title {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
}

.newsletter-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.newsletter-input {
  flex: 1 1 220px;
  min-width: 0;
  border-radius: var(--radius-pill);
  border: none;
  padding: 0.8rem 1.1rem;
  font-size: 0.9rem;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4);
  outline: none;
  background: #ffffff;
}

body[data-theme="dark"] .newsletter-input {
  background: #020617;
  color: #e5e7eb;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.6);
}

.newsletter-input:focus {
  box-shadow: 0 0 0 2px rgba(93, 63, 253, 0.7);
}

/* ====== Footer ====== */

.site-footer {
  padding-block: 3rem 2.5rem;
  background: var(--footer-bg);
  color: #e5e7eb;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 0.8fr);
  gap: 2.5rem;
  align-items: center;
}

.footer-logo {
  height: 34px;
  margin-bottom: 0.9rem;
}

.footer-copy {
  margin: 0;
  color: #a5b4fc;
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.4rem;
  font-size: 0.86rem;
}

.footer-links a {
  color: #e5e7eb;
  text-decoration: none;
  opacity: 0.9;
}

.footer-links a:hover {
  opacity: 1;
}

.footer-social {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

.footer-social img {
  width: 26px;
  height: 26px;
  display: block;
}

/* ====== Scroll Animations ====== */

[data-animate] {
  --stagger: 0s;
  opacity: 0;
  transform: translateY(26px) scale(0.98);
  transition:
    opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}

[data-animate="fade-up-delay"] {
  --stagger: 0.15s;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: var(--stagger);
}

/* ====== Animations ====== */

@keyframes floatPhone {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.55;
    filter: blur(10px);
  }
  50% {
    opacity: 0.95;
    filter: blur(16px);
  }
}

/* ====== Responsive Breakpoints ====== */

@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-inner {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .download-copy {
    justify-self: center;
  }

  .section-label.align-left,
  .section-title.align-left {
    text-align: center;
  }

  .newsletter-box {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .newsletter-form {
    justify-content: center;
  }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .hero-copy {
    justify-self: center;
  }

  .hero-text {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-bg-dot-left {
    inset: 10rem auto auto -80px;
    height: 380px;
  }

  .feature,
  .feature-reverse {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .feature-copy {
    justify-self: center;
  }

  .feature-reverse .feature-media {
    order: -1;
  }

  .download-inner {
    gap: 2.7rem;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .main-nav {
    position: absolute;
    inset: calc(100% + 0.5rem) 1.5rem auto;
    background: var(--bg-surface);
    border-radius: 18px;
    box-shadow: 0 24px 65px rgba(15, 23, 42, 0.22);
    padding: 0.8rem 1rem 1rem;
    flex-direction: column;
    gap: 0.65rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .nav-login {
    width: 100%;
    justify-content: center;
    margin-top: 0.4rem;
  }

  .site-header.nav-open .main-nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-header.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .site-header.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .section {
    padding-block: 3.5rem 3.75rem;
  }

  .header-inner {
    gap: 0.75rem;
  }

  .theme-toggle {
    margin-right: 0.2rem;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 2rem, 100%);
  }

  .services-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-inner {
    padding-block: 3.3rem 4rem;
  }

  .hero-bg-dot-left {
    display: none;
  }

  .newsletter-box {
    padding: 2rem 1.6rem;
  }

  .newsletter-form {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ====== Motion-Reduce ====== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
