:root {
  /* ===== Design System ===== */

  /* Color — grayscale foundation with alpha tiers for hierarchy */
  --bg: #000000;
  --fg: #ffffff;
  --fg-70: rgba(255, 255, 255, 0.7);
  --fg-50: rgba(255, 255, 255, 0.5);
  --fg-25: rgba(255, 255, 255, 0.25);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.3);
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-inner-from: rgba(17, 17, 17, 0.5);
  --card-inner-to: rgba(51, 51, 51, 0.5);

  /* Typography — fluid type scale (clamp: min / preferred-vw / max) */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs-display: clamp(1.75rem, 1.05rem + 3.4vw, 3.25rem);  /* 28 → 52  hero title */
  --fs-h2: clamp(1.5rem, 1.05rem + 2.2vw, 2.375rem);       /* 24 → 38  section CTA */
  --fs-h3: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);        /* 18 → 22  section titles */
  --fs-lead: clamp(0.9375rem, 0.9rem + 0.35vw, 1.125rem);  /* 15 → 18  hero subtitle/lead */
  --fs-body: 0.9375rem;                                    /* 15       body */
  --fs-sm: 0.875rem;                                       /* 14       small */
  --fs-xs: 0.8125rem;                                      /* 13       captions */
  --fs-2xs: 0.75rem;                                       /* 12       fine print */

  /* Font weights — SF Pro optical grades */
  --fw-regular: 400;
  --fw-medium: 510;
  --fw-semibold: 590;
  --fw-bold: 680;

  /* Line heights */
  --lh-tight: 1.06;
  --lh-snug: 1.3;
  --lh-normal: 1.5;

  /* Letter spacing */
  --ls-tight: -0.5px;
  --ls-snug: -0.2px;

  /* Spacing scale (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-14: 56px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-30: 120px;

  /* Radii */
  --radius-card: 24px;
  --radius-thumb: 20px;
  --radius-pill: 30px;

  /* Layout */
  --maxw: 1024px;
  --gutter: 80px;
  --gutter-sm: 24px;
  --gutter-xs: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ===== Sticky Shader Background ===== */
/* Fixed to the viewport (sized to the device screen), painted behind all
   content via negative z-index so every section scrolls over it. The black
   body background remains the fallback until a shader is wired into #shaderCanvas. */
.shader-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  pointer-events: none;
}
.shader-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===== Nav Bar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.navbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
}
.brand-mark {
  width: 60px;
  height: 40px;
  object-fit: contain;
  display: block;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}
.nav-links a {
  color: var(--fg-50);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a.btn { color: #000; font-weight: var(--fw-regular); }
.btn-sm {
  padding: 7px 16px;
  font-size: var(--fs-sm);
  line-height: 20px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-lead);
  font-weight: var(--fw-medium);
  line-height: 24px;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--fg);
  color: #000;
  font-weight: var(--fw-regular);
}
.btn-primary:hover { opacity: 0.85; }

.cta-row {
  display: flex;
  gap: var(--sp-6);
  align-items: center;
  flex-wrap: wrap;
}
.cta-row-center { justify-content: center; }

/* ===== Hero ===== */
.hero {
  padding: var(--sp-30) var(--gutter) var(--sp-20);
  max-width: var(--maxw);
  margin: 0 auto;
}
.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.hero-title {
  font-size: var(--fs-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin: 0;
}
.hero-subtitle {
  margin: var(--sp-6) auto 0;
  max-width: 620px;
  font-size: var(--fs-lead);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--fg-70);
}
.hero-cta-block {
  margin-top: var(--sp-14);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.hero-subtext {
  margin: 0;
  font-size: var(--fs-lead);
  font-weight: var(--fw-medium);
  color: var(--fg-50);
}

/* ===== Section shells ===== */
.section-title {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  margin: 0 0 var(--sp-2);
}
.section-sub {
  margin: 0 0 var(--sp-10);
  color: var(--fg-50);
  font-size: var(--fs-body);
}

/* ===== How It Works ===== */
.how {
  padding: var(--sp-10) var(--gutter) var(--sp-20);
  max-width: var(--maxw);
  margin: 0 auto;
}
.how .section-title { margin-bottom: var(--sp-6); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.card {
  position: relative;
  background-color: var(--card-bg);
  background-image: var(--card-img);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius-card);
  overflow: hidden;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.55) 32%,
    rgba(0, 0, 0, 0) 60%
  );
}
.card-body {
  position: relative;
  z-index: 1;
  padding: var(--sp-6);
}
.card-title {
  font-size: var(--fs-lead);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  margin: 0 0 var(--sp-2);
}
.card-desc {
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  line-height: 1.45;
  color: var(--fg-70);
  margin: 0;
}

/* ===== Demo Marquee ===== */
.demos {
  padding: var(--sp-10) 0 var(--sp-20);
}
.demos .section-title,
.demos .section-sub {
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--gutter);
}
.marquee {
  position: relative;
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
  display: flex;
  gap: var(--sp-5);
  width: max-content;
  padding: var(--sp-2) 10px;
  animation: marquee-scroll 40s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.demo-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 360px;
  height: 220px;
  border-radius: var(--radius-thumb);
  overflow: hidden;
  cursor: pointer;
  background: var(--card-bg);
  border: 1px solid var(--line);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.demo-thumb:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.25);
}
.demo-thumb img,
.demo-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.demo-thumb .play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.demo-thumb .play-badge span {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.demo-thumb .play-badge span::before {
  content: "";
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}
.demo-thumb .demo-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 16px 12px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
}

/* ===== Final CTA ===== */
.final-cta {
  padding: var(--sp-30) var(--gutter);
  text-align: center;
}
.final-cta-inner {
  max-width: 680px;
  margin: 0 auto;
}
.final-cta-title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  margin: 0 0 var(--sp-5);
}
.final-cta-sub {
  font-size: var(--fs-lead);
  line-height: var(--lh-normal);
  color: var(--fg-50);
  margin: 0 0 var(--sp-10);
}
.final-cta-fine {
  margin-top: var(--sp-6);
  font-size: var(--fs-xs);
  color: var(--fg-25);
}

/* ===== Success (post-checkout) ===== */
.success {
  padding: var(--sp-30) var(--gutter) var(--sp-20);
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.success-inner {
  max-width: 620px;
}
.success-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--sp-6);
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
}
.success-badge svg {
  width: 26px;
  height: 26px;
  display: block;
}
.success-title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin: 0 0 var(--sp-5);
}
.success-sub {
  font-size: var(--fs-lead);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--fg-70);
  margin: 0 0 var(--sp-10);
}
.success-steps {
  list-style: none;
  margin: 0 0 var(--sp-10);
  padding: 0;
  text-align: left;
  display: grid;
  gap: var(--sp-3);
}
.success-steps li {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-thumb);
  padding: var(--sp-5);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.step-label {
  display: block;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--fg-50);
  margin-bottom: var(--sp-2);
}
.step-body {
  display: block;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--fg-70);
}
.step-body strong {
  color: var(--fg);
  font-weight: var(--fw-semibold);
}
.inline-link {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--line-strong);
}
.inline-link:hover { text-decoration-color: var(--fg); }
.success-ref {
  font-size: var(--fs-2xs);
  color: var(--fg-25);
  margin: 0 0 var(--sp-6);
  word-break: break-all;
}

/* ===== Footer ===== */
.site-footer {
  padding: var(--sp-10) var(--gutter) var(--sp-16);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  color: var(--fg-25);
  font-size: var(--fs-2xs);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer-mark {
  width: 36px;
  height: 24px;
  filter: invert(1);
  opacity: 0.5;
}

/* ===== Video Modal ===== */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.video-modal[hidden] { display: none; }
.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  animation: fade-in 0.2s ease;
}
.video-modal-body {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  animation: pop-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.video-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: var(--fg);
  font-size: var(--sp-8);
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  opacity: 0.7;
}
.video-modal-close:hover { opacity: 1; }
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #111;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
/* Placeholder shown when a demo file isn't in assets/videos/ yet. */
.video-frame.is-missing video { visibility: hidden; }
.video-frame.is-missing::after {
  content: "Demo capture coming soon.";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-50);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}
.video-caption {
  margin: var(--sp-4) 4px 0;
  font-size: var(--fs-sm);
  color: var(--fg-50);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== Responsive =====
   Type sizing is handled by the fluid clamp() scale in :root, so breakpoints
   only adjust layout (gutters, grid, stacking) — not font sizes. */
@media (max-width: 900px) {
  .navbar-inner { padding: 12px var(--gutter-sm); }
  .nav-links { gap: var(--sp-4); }
  .nav-links a:not(.btn) { display: none; }
  .hero { padding: 72px var(--gutter-sm) var(--sp-16); }
  .how { padding: var(--sp-8) var(--gutter-sm) var(--sp-14); }
  .card-grid { grid-template-columns: 1fr; }
  .card { min-height: 400px; }
  .demos .section-title,
  .demos .section-sub { padding: 0 var(--gutter-sm); }
  .final-cta { padding: var(--sp-20) var(--gutter-sm); }
  .success { padding: var(--sp-20) var(--gutter-sm) var(--sp-14); }
  .site-footer { padding: var(--sp-8) var(--gutter-sm); flex-direction: column; align-items: flex-start; }
  .demo-thumb { width: 280px; height: 172px; }
}

@media (max-width: 480px) {
  .hero { padding: var(--sp-14) var(--gutter-xs) var(--sp-10); }
  .hero-cta-block { margin-top: var(--sp-10); }
  .btn { padding: 12px 18px; }
  .cta-row { gap: var(--sp-3); flex-direction: column; align-items: stretch; }
  .cta-row .btn { width: 100%; }
  .how { padding: var(--sp-6) var(--gutter-xs) var(--sp-10); }
  .card { min-height: 340px; }
  .demos .section-title,
  .demos .section-sub { padding: 0 var(--gutter-xs); }
  .final-cta { padding: var(--sp-16) var(--gutter-xs); }
  .success { padding: var(--sp-16) var(--gutter-xs) var(--sp-10); }
  .success-steps li { padding: var(--sp-4); }
  .site-footer { padding: var(--sp-6) var(--gutter-xs); }
  .demo-thumb { width: 240px; height: 148px; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}
