:root {
  --bg: #ffffff;
  --text: #1f1f1f;
  --muted: #5f6368;
  --line: #e6e8ec;
  --chip: #f3f4f6;
  --dark: #111111;
  --light: #f6f7f9;
  --accent-blue: #1a73e8;
  --accent-purple: #7b4dff;
  --accent-pink: #e9428b;
  --accent-orange: #f59e0b;
  --accent-red: #ea4335;
  --accent-green: #34a853;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Google Sans", "Product Sans", "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

main {
  position: relative;
  z-index: 1;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #ffffff;
}

.page-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.25;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: clamp(10px, 1vw, 16px) clamp(16px, 2.8vw, 48px);
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.25vw, 24px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.spark-star {
  width: clamp(18px, 1.67vw, 28px);
  height: clamp(18px, 1.67vw, 28px);
  display: inline-block;
  position: relative;
  background: conic-gradient(from 130deg, var(--accent-blue), var(--accent-purple), var(--accent-pink), var(--accent-orange), var(--accent-blue));
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 67% 58%, 79% 92%, 50% 72%, 21% 92%, 33% 58%, 2% 35%, 39% 35%);
  border-radius: 2px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
  transform-style: preserve-3d;
}

/* Header logo - spin only once on page load */
.nav .spark-star {
  animation: starSpinOnce 1.2s ease-out forwards;
}

/* Hero logo - shine once */
.hero-brand .spark-star {
  animation: none; /* Remove spin animation */
  overflow: hidden; /* For shine effect */
  position: relative;
}

.hero-brand .spark-star::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  animation: shineRight 1.5s ease-in-out forwards;
  animation-delay: 2.8s; /* Start after logo stamp */
}

@keyframes shineRight {
  0% { left: -150%; }
  100% { left: 150%; }
}


.spark-star::before {
  content: "";
  position: absolute;
  inset: 18% 18% 20% 20%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 55%);
  opacity: 0.7;
}

/* Base style for nav logo only */
.nav .spark-star::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 45%);
  mix-blend-mode: screen;
  opacity: 0.5;
}

@keyframes starSpin {
  0% {
    transform: rotateZ(0deg) rotateX(8deg);
  }

  50% {
    transform: rotateZ(180deg) rotateX(-6deg);
  }

  100% {
    transform: rotateZ(360deg) rotateX(8deg);
  }
}

@keyframes starSpinOnce {
  0% {
    transform: rotateZ(0deg) rotateX(0deg);
  }

  100% {
    transform: rotateZ(360deg) rotateX(0deg);
  }
}

@keyframes brandStamp {
  0% { transform: scale(2); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.brand-name {
  font-size: clamp(14px, 1.25vw, 20px);
}

.nav-links {
  display: flex;
  gap: clamp(8px, 1.1vw, 20px);
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(11px, 0.97vw, 15px);
}

.nav-links a {
  padding: clamp(4px, 0.42vw, 8px) clamp(6px, 0.56vw, 10px);
  border-radius: clamp(5px, 0.56vw, 10px);
}

.nav-links a:hover {
  background: var(--light);
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: clamp(32px, 4vw, 44px);
  height: clamp(28px, 3.5vw, 38px);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: clamp(20px, 3vw, 28px);
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  margin: clamp(2px, 0.4vw, 4px) 0;
  transition: all 0.3s ease;
}

.nav-drawer {
  display: none;
  flex-direction: column;
  gap: clamp(8px, 1.2vw, 14px);
  padding: clamp(12px, 2vw, 20px) clamp(16px, 2.8vw, 48px);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
}

.nav-drawer.open {
  display: flex;
}

.nav-drawer a {
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: clamp(13px, 1.8vw, 16px);
  padding: clamp(8px, 1vw, 12px) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.2s ease;
}

.nav-drawer a:last-child:not(.btn) {
  border-bottom: none;
}

.nav-drawer a:hover {
  color: #ffffff !important;
  background: transparent !important;
}

.nav-drawer .btn.primary.full {
  margin-top: clamp(8px, 1vw, 12px);
  width: 100%;
  text-align: center;
  justify-content: center;
  background: #ffffff !important;
  color: #000000 !important;
  border-bottom: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: clamp(8px, 0.7vw, 12px) clamp(14px, 1.25vw, 22px);
  font-size: clamp(11px, 0.97vw, 15px);
  font-weight: 600;
  border: 1px solid transparent;
}

.btn.primary {
  background: var(--dark);
  color: #ffffff;
}

.btn.secondary {
  background: var(--light);
  color: var(--text);
  border-color: var(--line);
}

.btn.full {
  width: 100%;
}

.hero {
  position: relative;
  padding: 180px 40px 160px;
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% 50%, rgba(255, 255, 255, 0.95), transparent),
    linear-gradient(90deg,
      rgba(255, 247, 237, 0.4) 0%,
      rgba(255, 255, 255, 0.9) 30%,
      rgba(255, 255, 255, 0.95) 50%,
      rgba(255, 255, 255, 0.9) 70%,
      rgba(243, 244, 255, 0.4) 100%);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  animation: rise 0.5s ease-out forwards;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 1.1vw, 20px);
  font-weight: 600;
  color: var(--text);
  font-size: clamp(18px, 2.2vw, 40px);
  opacity: 0;
  transform: scale(0.96);
}

/* Generic Brand Wrapper for Nav and Footer */
.brand-wrapper {
  position: relative;
  display: inline-block;
  line-height: 1;
  padding-bottom: 0; /* Keep baseline aligned */
}

.brand-arrow {
  position: absolute;
  /* Match hero arrow spacing and span */
  bottom: clamp(-6px, -0.5vw, -9px);
  /* Start at middle of 'S' */
  left: 6%;
  /* End at 'i' */
  width: 88%;
  height: clamp(6px, 0.6vw, 10px);
  pointer-events: none;
}

/* Adjustments for Hero Brand */
.hero-brand-wrapper {
  display: inline-block;
  position: relative;
  line-height: 1;
  padding-bottom: clamp(6px, 0.6vw, 10px); /* Space for the arrow */
}

.hero-brand-arrow {
  position: absolute;
  /* Position below text with small gap - never touch letters */
  bottom: clamp(-3px, -0.25vw, -5px);
  /* Start at middle of 'S' (approximately 6%) */
  left: 6%;
  /* End at 'i' - width spans from middle of S to end of i (88%) */
  width: 88%;
  height: clamp(10px, 1vw, 18px);
  opacity: 0;
  transition: opacity 0.3s ease-out 0.2s;
  pointer-events: none;
}

.hero-brand.reveal-stamp .hero-brand-arrow {
  opacity: 1;
}

.hero-brand-text {
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.hero-brand.reveal-stamp {
  opacity: 1;
  transform: scale(1);
  animation: brandStamp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.hero-brand.reveal-stamp .hero-brand-text {
  opacity: 1;
  position: relative;
  color: #ffffff; /* Set text to white */
  background: none;
  -webkit-text-fill-color: initial;
  background-clip: border-box;
  -webkit-background-clip: border-box;
  animation: none;
  overflow: visible; /* Allow star to be visible above the i */
}

/* Simple white shine overlay */
.hero-brand.reveal-stamp .hero-brand-text::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%) skewX(-20deg);
  animation: shineSweep 1s ease-out forwards;
  animation-delay: 0.2s;
  pointer-events: none;
}

@keyframes shineSweep {
  0% { transform: translateX(-100%) skewX(-20deg); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(100%) skewX(-20deg); opacity: 0; }
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--muted);
}

.hero-title {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(24px, 4.2vw, 76px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 clamp(14px, 1.9vw, 32px);
}

.hero-title .line {
  display: block;
  opacity: 0;
  transform: translateY(14px);
  min-height: 1.1em;
}

.hero-sub {
  font-size: clamp(12px, 1.18vw, 19px);
  line-height: 1.6;
  color: var(--muted);
  max-width: clamp(280px, 47vw, 720px);
  margin: 0 auto clamp(18px, 2.5vw, 44px);
  opacity: 0;
  transform: translateY(14px);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(14px);
}

.hero-points {
  display: grid;
  gap: 10px;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
  opacity: 0;
  transform: translateY(14px);
}

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

.hero .hero-sub {
  color: var(--muted);
}

.hero .hero-pill {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--muted);
}

.hero .btn.primary {
  background: var(--dark);
  color: #ffffff;
}

.hero .btn.secondary {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.12);
}

.hero .point {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--muted);
}

.hero .point::before {
  background: var(--accent-blue);
}

.point {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--light);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
}

.point::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-blue);
}

.section {
  max-width: clamp(320px, 76vw, 1200px);
  margin: 0 auto;
  padding: clamp(40px, 5.5vw, 100px) clamp(16px, 1.4vw, 24px);
}

.section-head {
  max-width: clamp(280px, 52.8vw, 800px);
  margin: 0 auto clamp(16px, 2.1vw, 36px);
  text-align: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(9px, 0.76vw, 12px);
  color: var(--muted);
  margin-bottom: clamp(6px, 0.7vw, 12px);
}

.section h2 {
  margin: 0 0 10px;
}

.section p {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: clamp(10px, 1.1vw, 18px);
  grid-template-columns: repeat(3, 1fr);
}

.cards {
  margin-top: 20px;
}

.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: clamp(10px, 1.1vw, 18px);
  padding: clamp(12px, 1.25vw, 22px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.metric-value {
  font-size: clamp(18px, 1.9vw, 32px);
  font-weight: 600;
  margin: 0 0 clamp(4px, 0.42vw, 8px);
}

.metric-label {
  margin: 0;
}

.metric-sub {
  margin: clamp(4px, 0.42vw, 8px) 0 0;
  color: var(--muted);
  font-size: clamp(10px, 0.9vw, 14px);
}

.feature h3,
.step h3 {
  margin: 0 0 8px;
}

.feature p,
.step p {
  margin: 0;
  color: var(--muted);
}

.steps .step {
  position: relative;
}

.step-num {
  position: absolute;
  top: clamp(10px, 0.97vw, 16px);
  right: clamp(10px, 1.1vw, 18px);
  font-size: clamp(10px, 0.83vw, 13px);
  color: var(--muted);
}

.plans {
  grid-template-columns: repeat(3, 1fr);
}

.plan-name {
  margin: 0 0 clamp(4px, 0.42vw, 8px);
  font-size: clamp(12px, 1.1vw, 18px);
  font-weight: 600;
}

.plan-price {
  margin: 0 0 clamp(8px, 0.83vw, 14px);
  font-size: clamp(18px, 1.9vw, 32px);
  font-weight: 600;
}

.plan-list {
  list-style: none;
  padding: 0;
  margin: 0 0 clamp(10px, 1.1vw, 18px);
  display: grid;
  gap: clamp(4px, 0.56vw, 10px);
  color: var(--muted);
  font-size: clamp(10px, 0.9vw, 15px);
}

.plan-list li::before {
  content: "- ";
}

.plan.featured {
  border-color: #cfd4dc;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.06);
}

.cta .cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 1.1vw, 18px);
  border: 1px solid var(--line);
  border-radius: clamp(10px, 1.1vw, 18px);
  padding: clamp(14px, 1.5vw, 26px);
  background: #ffffff;
}

.faq {
  max-width: clamp(280px, 62.5vw, 960px);
  margin: 0 auto;
  display: grid;
  gap: clamp(6px, 0.7vw, 12px);
}

details {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: clamp(8px, 0.83vw, 14px);
  padding: clamp(10px, 0.97vw, 16px) clamp(12px, 1.1vw, 18px);
}

summary {
  cursor: pointer;
  font-weight: 600;
}

summary::-webkit-details-marker {
  display: none;
}

.footer {
  background: #ffffff;
  border-top: 1px solid var(--line);
  padding: 0;
  position: relative;
  z-index: 1;
}

.footer-container {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: clamp(30px, 4.2vw, 70px) clamp(16px, 2.8vw, 48px) clamp(12px, 1.4vw, 24px);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 4.2vw, 70px);
  padding-bottom: clamp(26px, 3.5vw, 56px);
}

.footer-left {
  display: flex;
  align-items: flex-start;
}

.footer-headline {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(18px, 2.8vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
  font-weight: 500;
}

/* Spark.Ai brand with arrow in footer headline */
.footer-headline-brand {
  position: relative;
  display: inline-block;
  padding-bottom: clamp(4px, 0.4vw, 8px);
}

.footer-headline-arrow {
  position: absolute;
  /* Position below text with small gap */
  bottom: clamp(-2px, -0.2vw, -4px);
  /* Start at middle of 'S' */
  left: 6%;
  /* End at 'i' */
  width: 88%;
  height: clamp(8px, 0.8vw, 14px);
  pointer-events: none;
}

.footer-right {
  display: flex;
  justify-content: flex-end;
}

.footer-links-group {
  display: flex;
  gap: clamp(30px, 5.5vw, 100px);
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 0.83vw, 14px);
}

.footer-column h4 {
  font-size: clamp(11px, 0.97vw, 15px);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 clamp(2px, 0.28vw, 5px) 0;
}

.footer-column a {
  font-size: clamp(11px, 0.97vw, 15px);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: clamp(14px, 1.67vw, 28px);
  border-top: 1px solid var(--line);
}

.footer-brand-small {
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.42vw, 8px);
  font-weight: 600;
  font-size: clamp(11px, 0.97vw, 15px);
  color: var(--text);
}

.footer-brand-small .spark-star {
  width: clamp(14px, 1.25vw, 20px);
  height: clamp(14px, 1.25vw, 20px);
}

.footer-brand-small .brand-wrapper {
  padding-bottom: 0; /* Keep baseline aligned */
}

.footer-brand-small .brand-arrow {
  /* Match hero arrow spacing and span */
  bottom: clamp(-6px, -0.5vw, -9px);
  /* Start at middle of 'S' */
  left: 6%;
  /* End at 'i' */
  width: 88%;
  height: clamp(6px, 0.6vw, 10px);
}

.footer-legal {
  display: flex;
  gap: clamp(12px, 1.67vw, 28px);
}

.footer-legal a {
  font-size: clamp(10px, 0.9vw, 14px);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Override media query to maintain consistent layout */
@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-bottom-bar {
    flex-direction: row;
    align-items: center;
  }

  .footer-legal {
    flex-wrap: nowrap;
  }
}

/* Typing animation handles hero-title .line elements via JS */
.is-loaded .hero-title .line {
  animation: none;
  opacity: 1;
  transform: none;
}

.is-loaded .hero-sub {
  opacity: 0;
  transform: translateY(14px);
}

.is-loaded .hero-actions {
  opacity: 0;
  transform: translateY(14px);
}

.is-loaded .hero-points {
  display: grid;
  gap: 10px;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
  opacity: 0;
  transform: translateY(14px);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile navigation breakpoint */
@media (max-width: 900px) {
  .hero {
    min-height: 100vh;
    min-height: 100svh;
  }

  .cta .cta-inner {
    flex-direction: row;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}