:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --tint: #EDE8FA;
  --ink: #16121F;
  --muted: #5D5770;
  --brand: #6D28D9;
  --brand-strong: #5B21B6;
  --spark: #C8F04D;
  --spark-ink: #16121F;
  --line: #E2DDEE;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0C15;
    --surface: #1B1726;
    --tint: #1B1726;
    --ink: #F4F1FB;
    --muted: #9C93B8;
    --brand: #8B5CF6;
    --brand-strong: #A78BFA;
    --spark: #22D3EE;
    --spark-ink: #0E0C15;
    --line: #2A2438;
  }
}

:root[data-theme="dark"] {
  --bg: #0E0C15;
  --surface: #1B1726;
  --tint: #1B1726;
  --ink: #F4F1FB;
  --muted: #9C93B8;
  --brand: #8B5CF6;
  --brand-strong: #A78BFA;
  --spark: #22D3EE;
  --spark-ink: #0E0C15;
  --line: #2A2438;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.dot { color: var(--brand); }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.03em; margin: 0; }

/* ---------- header ---------- */

.site-head {
  max-width: 66rem;
  margin: 0 auto;
  padding: 1.4rem 1rem;
  display: flex;
  align-items: center;
  gap: 2.2rem;
}

.wordmark {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.wordmark:hover { color: var(--ink); }

.site-nav { display: flex; gap: 1.6rem; flex-grow: 1; }
.site-nav a { color: var(--muted); font-size: 0.95rem; }
.site-nav a:hover { color: var(--ink); }

.head-actions { display: flex; align-items: center; gap: 0.9rem; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
:root[data-theme="dark"] .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: block; }
  :root:not([data-theme="light"]) .icon-sun { display: none; }
}

/* ---------- buttons ---------- */

.button {
  display: inline-block;
  border-radius: 10px;
  padding: 0.7rem 1.25rem;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button-primary {
  background: var(--brand);
  color: #FFFFFF;
}
.button-primary:hover {
  background: var(--brand-strong);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 35%, transparent);
}
.button-primary:active { transform: translateY(0); }

:root[data-theme="dark"] .button-primary { color: #0E0C15; background: var(--brand-strong); }
:root[data-theme="dark"] .button-primary:hover { background: var(--brand); color: #F4F1FB; }

.button-large { padding: 0.95rem 1.7rem; font-size: 1.05rem; }

.quiet-link { color: var(--muted); font-size: 0.98rem; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.quiet-link:hover { color: var(--ink); border-color: var(--muted); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 78% 12%, black, transparent 68%);
  mask-image: radial-gradient(ellipse 75% 85% at 78% 12%, black, transparent 68%);
  opacity: 0.55;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-glow i {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.hero-glow i:nth-child(1) {
  width: 520px;
  height: 520px;
  top: -180px;
  right: -100px;
  background: var(--brand);
  opacity: 0.16;
  animation: drift-a 26s ease-in-out infinite alternate;
}

.hero-glow i:nth-child(2) {
  width: 420px;
  height: 420px;
  bottom: -220px;
  left: -140px;
  background: var(--spark);
  opacity: 0.10;
  animation: drift-b 34s ease-in-out infinite alternate;
}

.hero-glow i:nth-child(3) {
  width: 300px;
  height: 300px;
  top: 30%;
  left: 48%;
  background: var(--brand-strong);
  opacity: 0.09;
  animation: drift-c 40s ease-in-out infinite alternate;
}

@keyframes drift-a { to { transform: translate(-140px, 90px) scale(1.12); } }
@keyframes drift-b { to { transform: translate(120px, -70px) scale(1.08); } }
@keyframes drift-c { to { transform: translate(-90px, -110px) scale(1.18); } }

.hero-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 40%),
    color-mix(in srgb, var(--brand) 10%, transparent), transparent 65%);
}

.hero:hover .hero-spotlight { opacity: 1; }

.hero-inner {
  position: relative;
  max-width: 66rem;
  margin: 0 auto;
  padding: 5rem 1rem 5.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 3.5rem;
  align-items: center;
}

.hero-visual {
  position: relative;
  padding: 1.5rem 0.5rem;
}

.hero-window {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 32px 80px color-mix(in srgb, var(--brand) 22%, transparent);
}

.hero-card {
  position: absolute;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(10, 6, 22, 0.35);
}

.card-shipped { width: 34%; top: -3%; right: -3%; }
.card-metrics { width: 38%; bottom: -4%; left: -5%; }

@media (prefers-reduced-motion: no-preference) {
  .hero-window { animation: float-a 8s ease-in-out infinite; }
  .card-shipped { animation: float-b 6.5s ease-in-out 0.7s infinite; }
  .card-metrics { animation: float-c 7.5s ease-in-out 0.3s infinite; }
  @keyframes float-a { 50% { transform: translateY(-9px); } }
  @keyframes float-b { 50% { transform: translateY(-10px) rotate(1.2deg); } }
  @keyframes float-c { 50% { transform: translateY(9px); } }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 2rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--spark);
  animation: ping 2.6s ease-out infinite;
}

@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--spark) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.7rem);
  font-weight: 700;
  max-width: 15ch;
}

.hero-dot { display: inline-block; }

@media (prefers-reduced-motion: no-preference) {
  .hero-dot {
    animation:
      dot-land 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s backwards,
      dot-breathe 4.5s ease-in-out 1.4s infinite;
  }
  @keyframes dot-land {
    from { transform: scale(0); }
    to { transform: scale(1); }
  }
  @keyframes dot-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.09); }
  }
}

/* ---------- scroll reveals (classes added by script.js) ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease var(--rd, 0s),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) var(--rd, 0s);
}

.reveal.on {
  opacity: 1;
  transform: none;
}

.hero-sub {
  max-width: 54ch;
  margin: 1.6rem 0 2.4rem;
  font-size: 1.15rem;
  color: var(--muted);
}

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

/* ---------- sections ---------- */

/* every section shares one editorial grid: title left, content right */

.section {
  max-width: 66rem;
  margin: 0 auto;
  padding: 4.5rem 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  column-gap: 3rem;
  align-items: start;
}

.section h2 {
  grid-column: 1;
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
  margin: 0;
}

.section > :not(h2) { grid-column: 2; }

/* services as ruled rows, not cards */

.service {
  padding: 2.1rem 0;
  border-top: 1px solid var(--line);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 2.2rem;
  align-items: center;
}
.service:first-of-type { padding-top: 0.4rem; border-top: none; }
.service:last-of-type { padding-bottom: 0; }

.service-tile {
  display: block;
  width: 200px;
  height: auto;
  border-radius: 14px;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
}

.service:hover .service-tile {
  transform: scale(1.05) rotate(0.6deg);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--brand) 20%, transparent);
}

.service::before {
  content: "";
  position: absolute;
  left: -1.55rem;
  top: 50%;
  margin-top: -4.5px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--brand);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.service:hover::before { opacity: 1; transform: scale(1); }

.service h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  transition: color 0.3s ease;
}
.service:hover h3 { color: var(--brand); }
.service p { margin: 0; color: var(--muted); }

/* ---------- positioning band ---------- */

.band {
  position: relative;
  overflow: hidden;
  background: var(--tint);
  border-block: 1px solid var(--line);
}

.band-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.band-glow i {
  position: absolute;
  width: 560px;
  height: 560px;
  top: -240px;
  right: 6%;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.10;
  filter: blur(100px);
  animation: drift-b 30s ease-in-out infinite alternate;
}

.band-inner {
  position: relative;
  max-width: 66rem;
  margin-inline: auto;
  padding: 4.5rem 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  column-gap: 3rem;
  row-gap: 1.6rem;
}
.band-lead {
  grid-column: 1 / -1;
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0;
  max-width: 28ch;
}
.band-body {
  grid-column: 2;
  color: var(--muted);
  margin: 0;
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.8rem;
  counter-reset: step;
}

.steps li { counter-increment: step; }

.steps h3 { font-size: 1.25rem; margin-bottom: 0.6rem; }

.steps h3::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  margin-right: 0.7rem;
  border-radius: 999px;
  background: var(--brand);
  color: #FFFFFF;
  font-size: 0.95rem;
  vertical-align: 0.15em;
}

:root[data-theme="dark"] .steps h3::before { color: #0E0C15; background: var(--brand-strong); }

.steps p { margin: 0; color: var(--muted); }

/* ---------- about ---------- */

.about-body { margin: 0; color: var(--muted); font-size: 1.1rem; }

/* ---------- cta ---------- */

/* full-bleed dark closer, same tone in both themes */

.cta {
  position: relative;
  overflow: hidden;
  margin-top: 2.5rem;
  padding: 6.5rem 1rem 7rem;
  background: linear-gradient(135deg, #171226, #0E0B16);
  border-top: 1px solid #2A2438;
  text-align: center;
}

.cta::before {
  content: "";
  position: absolute;
  width: 760px;
  height: 760px;
  left: 50%;
  margin-left: -380px;
  bottom: -420px;
  border-radius: 50%;
  background: #8B5CF6;
  opacity: 0.14;
  filter: blur(110px);
  pointer-events: none;
  animation: breathe 9s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.14; }
  50% { transform: scale(1.14); opacity: 0.2; }
}

.cta-inner {
  position: relative;
  max-width: 66rem;
  margin: 0 auto;
}

.cta h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  max-width: 22ch;
  margin-inline: auto;
  color: #F4F1FB;
}
.cta h2 .dot { color: #8B5CF6; }
.cta p { color: #9C93B8; margin: 1.4rem auto 2.4rem; max-width: 52ch; }
.cta p.cta-alt { margin: 1.4rem auto 0; font-size: 0.95rem; }
.cta .cta-alt a { color: #A78BFA; }
.cta .cta-alt a:hover { color: #C4B5FD; }

.button-cta {
  background: #8B5CF6;
  color: #0E0C15;
  font-weight: 700;
}
.button-cta:hover {
  background: #A78BFA;
  color: #0E0C15;
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(139, 92, 246, 0.4);
}
.button-cta:active { transform: translateY(0); }

/* ---------- footer ---------- */

.site-foot {
  max-width: 66rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.site-foot p { margin: 0.3rem 0; }
.wordmark-small { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.035em; color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .site-head { flex-wrap: wrap; gap: 1rem; }
  .site-nav { order: 3; width: 100%; gap: 1.2rem; }
  .head-actions { margin-left: auto; }
  .hero-inner {
    padding-top: 3.5rem;
    padding-bottom: 4rem;
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .hero-visual { padding: 0.5rem 0 1rem; }
  .card-shipped { right: 0; }
  .card-metrics { left: 0; }
  .service { grid-template-columns: 1fr; gap: 1.4rem; }
  .service-tile { width: 100%; max-width: 340px; }
  .service::before { display: none; }
  .section { grid-template-columns: 1fr; row-gap: 0; }
  .section h2 { grid-column: 1; margin-bottom: 1.8rem; }
  .section > :not(h2) { grid-column: 1; }
  .band-inner { grid-template-columns: 1fr; }
  .band-body { grid-column: 1; }
  .steps { grid-template-columns: 1fr; gap: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-glow i,
  .band-glow i,
  .cta::before,
  .badge-dot,
  .hero-dot {
    animation: none;
  }
  .hero-spotlight { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .button, .service { transition: none; }
  html { scroll-behavior: auto; }
}
