/* ===================================================================
   Dopplit landing
   Design language ported from the v3 landing; section rhythm adapted
   from the reference site. Self-contained, no framework.
   =================================================================== */

:root {
  /* surface */
  --bg:            #272b4a;
  --bg-deep:       #080b1c;
  --nav-bg:        rgba(7, 10, 24, 0.62);
  --glow:          #4a5390;

  /* brand */
  --brand-700:     #3f4875;
  --brand-600:     #4c5790;
  --brand-500:     #5c66a4;
  --brand-400:     #7681b4;
  --brand-300:     #969ec9;
  --brand-200:     #b9c0e0;

  /* ink */
  --text:          #ffffff;
  --text-70:       rgba(255, 255, 255, 0.68);
  --text-50:       rgba(255, 255, 255, 0.50);
  --text-40:       rgba(255, 255, 255, 0.40);

  /* lines + glass
     Panels are a DARK translucent navy rather than a white tint. A white tint
     over the particle field leaves body copy fighting the scene for contrast,
     and the copy has to win. */
  --line:          rgba(255, 255, 255, 0.10);
  --line-strong:   rgba(255, 255, 255, 0.18);
  --glass:         rgba(23, 27, 51, 0.62);
  --glass-hover:   rgba(32, 37, 66, 0.74);
  --strip-bg:      #2b2f4d;

  /* accent for "good" states */
  --ok:            #6ee7b7;

  --maxw:          1120px;
  --pad:           clamp(20px, 4vw, 32px);
  --radius:        18px;

  /* fluid type */
  --fs-display:    clamp(2.85rem, 1.1rem + 7.4vw, 5.75rem);
  --fs-h2:         clamp(1.95rem, 1.15rem + 3.1vw, 3.1rem);
  --fs-h3:         clamp(1.12rem, 1.02rem + 0.42vw, 1.32rem);
  --fs-lead:       clamp(1.03rem, 0.95rem + 0.42vw, 1.19rem);
  --fs-body:       clamp(0.95rem, 0.92rem + 0.16vw, 1.01rem);
  --fs-eyebrow:    0.735rem;
  --fs-stat:       clamp(3rem, 1.4rem + 6.2vw, 5.25rem);

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
/* Lenis drives scrolling when active; let it own the behaviour */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%) translateY(-200%);
  z-index: 200; background: var(--brand-500); color: #fff; font-weight: 700;
  padding: 10px 18px; border-radius: 999px; transition: transform .2s ease;
}
.skip-link:focus { transform: translateX(-50%) translateY(0); }

/* ---------- background layers ---------- */
#scene, #glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden;
}
/* CSS owns the canvas box, the renderer owns the drawing buffer (it is created
   with updateStyle=false). Keeps the canvas from ever exceeding the viewport
   and scrolling the document sideways. */
#scene canvas { display: block; width: 100%; height: 100%; }
#glow {
  background: radial-gradient(110% 70% at 50% -10%, var(--glow) 0%, rgba(74, 83, 144, 0) 60%);
}
/* Static stand-in painted when WebGL is unavailable or motion is reduced. */
#scene.is-fallback {
  background:
    radial-gradient(42% 32% at 50% 30%, rgba(180, 190, 240, 0.20) 0%, rgba(180, 190, 240, 0) 70%),
    radial-gradient(26% 20% at 68% 58%, rgba(140, 150, 210, 0.16) 0%, rgba(140, 150, 210, 0) 70%);
}
.page { position: relative; z-index: 1; }

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}
section { position: relative; }
.band {
  padding-block: clamp(68px, 9vw, 116px);
}
.band--tight { padding-block: clamp(46px, 6vw, 74px); }

.rule { border-top: 1px solid var(--line); }

/* ---------- type ---------- */
.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-40);
  margin-bottom: 18px;
}
h1, h2, h3 { font-weight: 800; letter-spacing: -0.028em; line-height: 1.06; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.016em; line-height: 1.3; }
.lead {
  font-size: var(--fs-lead);
  line-height: 1.62;
  color: var(--text-70);
  font-weight: 450;
}
.muted { color: var(--text-50); }
.section-head { max-width: 42rem; }
.section-head .lead { margin-top: 16px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nav__inner {
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 28px; height: 28px; }
.brand span {
  font-size: 1.38rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1;
}
.nav__actions { display: flex; align-items: center; gap: 8px; }
/* Below this the wordmark and the secondary link collide. The primary CTA is
   the only thing that has to survive. */
@media (max-width: 560px) {
  .nav__actions .btn--quiet { display: none; }
  .brand span { font-size: 1.22rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 0.94rem; font-weight: 700; letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .22s ease, border-color .22s ease,
              transform .22s ease, box-shadow .22s ease;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--primary {
  background: var(--brand-500); color: #fff;
  box-shadow: 0 10px 28px -12px rgba(92, 102, 164, 0.9);
}
.btn--primary:hover { background: var(--brand-400); transform: translateY(-1px); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.11); }
.btn--sm { padding: 9px 18px; font-size: 0.875rem; }
.btn--quiet {
  background: none; color: var(--text-70); padding: 9px 14px;
  font-size: 0.875rem; font-weight: 600;
}
.btn--quiet:hover { color: #fff; }

/* ---------- hero ---------- */
.hero {
  min-height: min(92vh, 860px);
  display: flex; align-items: center;
  padding-block: clamp(72px, 11vw, 132px);
}
.hero__inner { max-width: 44rem; position: relative; }
/* Soft ground behind the hero copy. At narrow widths the text column and the
   particle core occupy the same space, and the lead paragraph loses contrast
   without this. */
.hero__inner::before {
  content: "";
  position: absolute;
  inset: -12% -18% -14% -34%;
  background: radial-gradient(58% 58% at 38% 50%, rgba(23, 27, 51, 0.82) 0%, rgba(23, 27, 51, 0) 72%);
  z-index: -1;
  pointer-events: none;
}
.hero h1 {
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  perspective: 900px;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 4px; }
.hero h1 .hw { display: inline-block; transform-origin: bottom; will-change: transform, opacity; }
.hero .lead { margin-top: 26px; max-width: 32rem; }
.hero .lead strong { color: #fff; font-weight: 700; }
.hero__cta { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; }

.scrollcue {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-40);
  pointer-events: none;
}

/* word-flip entrance */
.js .hero h1 .hw { opacity: 0; transform: translateY(70px) rotateX(-80deg); }
.hero h1.in .hw {
  opacity: 1; transform: none;
  transition: opacity .85s cubic-bezier(0.16, 1, 0.3, 1),
              transform .95s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- scroll reveal ---------- */
.js .rv {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s cubic-bezier(0.16, 1, 0.3, 1),
              transform .8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.js .rv.in { opacity: 1; transform: none; }

/* ---------- stat strip ---------- */
.stats {
  display: grid; gap: clamp(28px, 4vw, 44px);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat__n {
  font-size: var(--fs-stat);
  font-weight: 800; line-height: 0.92; letter-spacing: -0.045em;
  background: linear-gradient(170deg, #ffffff 24%, var(--brand-300) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat__l { margin-top: 12px; font-size: var(--fs-body); color: var(--text-70); max-width: 17rem; }
.stats__note { margin-top: 38px; font-size: 0.87rem; color: var(--text-50); max-width: 44rem; }

/* ---------- integration marquee ---------- */
.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--strip-bg);
  padding-block: 34px;
  overflow: hidden;
}
.strip .eyebrow { text-align: center; margin-bottom: 24px; }
.marquee { position: relative; }
.marquee::before, .marquee::after {
  content: ""; position: absolute; inset-block: 0; width: clamp(48px, 10vw, 120px);
  z-index: 2; pointer-events: none;
}
/* Fade to the strip's own colour, so the mask is invisible rather than a
   dark vignette sitting on a lighter band. */
.marquee::before { left: 0;  background: linear-gradient(to right, var(--strip-bg), rgba(43, 47, 77, 0)); }
.marquee::after  { right: 0; background: linear-gradient(to left,  var(--strip-bg), rgba(43, 47, 77, 0)); }
.marquee__track {
  display: flex; width: max-content; align-items: center;
  animation: marquee 38s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__set { display: flex; flex: none; align-items: center; }
.chip {
  margin-inline: clamp(14px, 2.4vw, 30px);
  font-size: 0.92rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text-50); white-space: nowrap;
  transition: color .2s ease;
}
.chip:hover { color: #fff; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 680px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 680px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: var(--radius);
  padding: clamp(22px, 2.6vw, 30px);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  height: 100%;
  transition: background-color .25s ease, border-color .25s ease;
}
.card:hover { background: var(--glass-hover); border-color: var(--line-strong); }
.card__tag {
  font-size: 0.655rem; font-weight: 800; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--brand-300); margin-bottom: 14px;
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--text-70); font-size: 0.95rem; }
.card__fix {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-50); font-size: 0.875rem;
}
.card__fix b { color: var(--brand-200); font-weight: 650; }

/* mouse tilt */
.tilt { height: 100%; transform-style: preserve-3d; transition: transform .2s ease-out; }

/* ---------- guarantees ---------- */
.guards { display: grid; gap: 2px; border-radius: var(--radius); overflow: hidden; }
.guard {
  display: grid; gap: 6px 22px;
  padding: clamp(20px, 2.4vw, 26px) clamp(20px, 2.4vw, 28px);
  background: var(--glass);
  border: 1px solid var(--line);
  transition: background-color .25s ease;
}
.guard:hover { background: var(--glass-hover); }
@media (min-width: 860px) {
  .guard { grid-template-columns: 19rem 1fr; align-items: start; }
}
.guard h3 { font-size: 1.04rem; }
.guard p { color: var(--text-70); font-size: 0.93rem; }

/* ---------- steps ---------- */
.steps { counter-reset: step; display: grid; gap: 18px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; padding-top: 26px; border-top: 1px solid var(--line-strong); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  position: absolute; top: -0.85em; left: 0;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em;
  color: var(--brand-300); background: var(--bg); padding-right: 12px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--text-70); font-size: 0.93rem; }

/* ---------- audience ---------- */
.shapes { display: grid; gap: 14px; }
@media (min-width: 780px) { .shapes { grid-template-columns: repeat(3, 1fr); } }
.shape {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 24px; background: var(--glass);
}
.shape h3 { font-size: 1rem; margin-bottom: 6px; }
.shape p { font-size: 0.9rem; color: var(--text-50); }

/* ---------- before / with ---------- */
.compare { display: grid; gap: 18px; }
@media (min-width: 820px) { .compare { grid-template-columns: repeat(2, 1fr); } }
.col {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 3vw, 34px);
  background: var(--glass);
}
.col--with { border-color: rgba(150, 158, 201, 0.42); background: rgba(58, 66, 116, 0.68); }
.col h3 { margin-bottom: 20px; font-size: 1.08rem; }
.col li {
  display: flex; gap: 13px; align-items: flex-start;
  padding-block: 11px; font-size: 0.93rem; color: var(--text-70);
  border-top: 1px solid var(--line);
}
.col li:first-of-type { border-top: 0; padding-top: 0; }
.mark { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.col--before .mark { color: var(--text-40); }
.col--with   .mark { color: var(--ok); }

/* ---------- final cta ---------- */
.final {
  border: 1px solid var(--line-strong);
  border-radius: clamp(20px, 3vw, 28px);
  padding: clamp(36px, 6vw, 72px);
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(92, 102, 164, 0.46) 0%, rgba(92, 102, 164, 0) 62%),
    rgba(23, 27, 51, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: center;
}
.final h2 { max-width: 20ch; margin-inline: auto; }
.final .lead { margin-top: 18px; max-width: 40ch; margin-inline: auto; }
.final .hero__cta { justify-content: center; margin-top: 30px; }

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding-block: 34px;
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  font-size: 0.85rem; color: var(--text-40);
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .rv, .js .hero h1 .hw { opacity: 1 !important; transform: none !important; }
  .marquee__track { animation: none; }
  .tilt { transform: none !important; }
}
