/* Wivoo LP — design tokens + base */

:root {
  /* LIGHT theme (default) — cream + slate + brand green */
  --bg: #F6F2EA;
  --bg-2: #F1ECDF;
  --surface: #FFFFFF;
  --surface-2: #F0EADC;
  --line: rgba(18, 32, 53, 0.07);
  --line-strong: rgba(18, 32, 53, 0.12);
  --ink: #122035;
  --ink-2: #2F3F58;
  --ink-3: #5B6B83;
  --ink-mute: #93A0B5;

  --primary: #1FBF54;        /* vibrant green (from W gradient right) */
  --primary-deep: #14A445;
  --primary-ink: #FFFFFF;
  --accent: #2DB6B8;         /* teal (from W gradient left) */
  --accent-deep: #1F9697;
  --brand-gradient: linear-gradient(135deg, #2DB6B8 0%, #2FC062 55%, #4ACE3F 100%);

  --danger: #E14B3D;
  --warn: #E89B2D;

  --shadow-lg: 0 30px 80px -24px rgba(18, 32, 53, .18), 0 6px 16px rgba(18, 32, 53, .06);
  --shadow-md: 0 10px 30px -10px rgba(18, 32, 53, .14), 0 2px 6px rgba(18, 32, 53, .04);
  --shadow-sm: 0 1px 0 rgba(255,255,255,.5) inset, 0 1px 2px rgba(18,32,53,.06);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --font-display: "Bricolage Grotesque", "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Geist", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1240px;
}

/* Palette: fresh — softer green-tinted off-white */
[data-palette="fresh"] {
  --bg: #F1F7EE;
  --bg-2: #E7F1E3;
  --surface: #FFFFFF;
  --surface-2: #E2EFDD;
  --line: rgba(20, 60, 40, 0.08);
  --line-strong: rgba(20, 60, 40, 0.14);
  --ink: #0F2A1C;
  --ink-2: #2E4838;
  --ink-3: #5F7868;
  --ink-mute: #91A698;
  --primary: #1FBF54;
  --primary-deep: #14A445;
  --primary-ink: #FFFFFF;
  --accent: #2DB6B8;
}

/* Palette: warm sand */
[data-palette="warm"] {
  --bg: #FAEFE0;
  --bg-2: #F4E5D0;
  --surface: #FFFFFF;
  --surface-2: #F0E2CA;
  --line: rgba(58, 38, 18, 0.08);
  --line-strong: rgba(58, 38, 18, 0.14);
  --ink: #2C1F12;
  --ink-2: #4D3A26;
  --ink-3: #7B6748;
  --ink-mute: #A99580;
  --primary: #1FBF54;
  --primary-deep: #14A445;
  --primary-ink: #FFFFFF;
  --accent: #E07B3C;
}

/* Palette: dark — deep slate with brand green */
[data-palette="dark"] {
  --bg: #0E1A1F;
  --bg-2: #11212A;
  --surface: #182A33;
  --surface-2: #20353F;
  --line: rgba(47, 192, 98, 0.10);
  --line-strong: rgba(255, 255, 255, 0.10);
  --ink: #EAF4F0;
  --ink-2: #BFCED2;
  --ink-3: #8AA0A6;
  --ink-mute: #5E737A;
  --primary: #2FD46B;
  --primary-deep: #1FBF54;
  --primary-ink: #07140C;
  --accent: #3CD0D2;
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  max-width: 100vw;
}

a { color: inherit; }

::selection { background: var(--primary); color: var(--primary-ink); }

img { max-width: 100%; display: block; }

/* Layout */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.section {
  padding: 72px 0;
  position: relative;
}

.section--tight { padding: 64px 0; }
.section--alt { background: var(--bg-2); }
.section--inverted {
  background: var(--ink);
  color: var(--bg);
}

/* Typography */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 18%, transparent);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0;
  color: var(--ink);
}

.h-display {
  font-size: clamp(48px, 7.2vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: balance;
}

.h-1 {
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.h-2 {
  font-size: clamp(28px, 3.2vw, 44px);
  letter-spacing: -0.022em;
  line-height: 1.06;
}

.h-3 {
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -0.018em;
  line-height: 1.15;
}

.lede {
  font-size: clamp(18px, 1.4vw, 22px);
  color: var(--ink-2);
  line-height: 1.5;
  max-width: 56ch;
  text-wrap: pretty;
}

.body-lg {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
}

.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); }

.accent { color: var(--primary); }
.accent-bg { background: var(--primary); color: var(--primary-ink); }

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  box-sizing: border-box;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 12px 28px -8px color-mix(in oklab, var(--primary) 70%, transparent);
}
.btn--primary:hover {
  background: var(--primary-deep);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 16px 36px -8px color-mix(in oklab, var(--primary) 80%, transparent);
}

/* Pulse — applied to important primary CTAs */
@keyframes wivoo-pulse {
  0%   { box-shadow: 0 1px 0 rgba(255,255,255,.35) inset,
                     0 12px 28px -8px color-mix(in oklab, var(--primary) 70%, transparent),
                     0 0 0 0 color-mix(in oklab, var(--primary) 55%, transparent); }
  70%  { box-shadow: 0 1px 0 rgba(255,255,255,.35) inset,
                     0 12px 28px -8px color-mix(in oklab, var(--primary) 70%, transparent),
                     0 0 0 14px color-mix(in oklab, var(--primary) 0%, transparent); }
  100% { box-shadow: 0 1px 0 rgba(255,255,255,.35) inset,
                     0 12px 28px -8px color-mix(in oklab, var(--primary) 70%, transparent),
                     0 0 0 0 color-mix(in oklab, var(--primary) 0%, transparent); }
}
@keyframes wivoo-pulse-soft {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.025); }
}

.btn--pulse {
  animation: wivoo-pulse 2.4s cubic-bezier(.2,.7,.2,1) infinite,
             wivoo-pulse-soft 2.4s ease-in-out infinite;
  will-change: transform, box-shadow;
}
.btn--pulse:hover,
.btn--pulse:focus-visible {
  animation: none;
}
.btn--pulse:active { transform: translateY(1px) scale(.98); }

@media (prefers-reduced-motion: reduce) {
  .btn--pulse { animation: none !important; }
}

.btn--gradient {
  background: var(--brand-gradient);
  color: #FFFFFF;
  box-shadow: 0 12px 28px -8px rgba(47, 192, 98, 0.5);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--ink); }

.btn--dark {
  background: var(--ink);
  color: var(--bg);
}
.btn--dark:hover { background: var(--ink-2); }

.btn--lg { padding: 22px 32px; font-size: 17px; }
.btn--sm { padding: 12px 18px; font-size: 14px; }

.btn-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-top: 12px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.btn-meta span { display: inline-flex; align-items: center; gap: 6px; }
.btn-meta .dot { width: 4px; height: 4px; background: var(--ink-mute); border-radius: 50%; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 560px) {
  .card { padding: 20px; border-radius: var(--radius); }
  .h-display { font-size: clamp(40px, 11vw, 64px) !important; }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--line);
}

/* Anchor link offsets */
[id] { scroll-margin-top: 80px; }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s cubic-bezier(.2,.7,.2,1), transform 0.8s cubic-bezier(.2,.7,.2,1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* Marquee */
@keyframes wivoo-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee {
  display: flex;
  gap: 64px;
  width: max-content;
  animation: wivoo-scroll 40s linear infinite;
}

/* Utilities */
.flow > * + * { margin-top: 1em; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.divider {
  height: 1px;
  background: var(--line-strong);
  border: 0;
  margin: 0;
}

/* Sticky CTA bar */
.sticky-cta {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 32px);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, transform .35s cubic-bezier(.2,.7,.2,1);
  font-weight: 500;
  font-size: 13px;
  max-width: calc(100vw - 24px);
}
.sticky-cta.in {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.sticky-cta .btn--primary {
  padding: 10px 18px;
  font-size: 13px;
  white-space: nowrap;
}
.sticky-cta-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

@media (max-width: 720px) {
  .sticky-cta {
    left: 10px;
    right: 10px;
    bottom: 10px;
    transform: translateY(40px);
    max-width: none;
    width: auto;
    padding: 6px 6px 6px 14px;
    gap: 8px;
  }
  .sticky-cta.in { transform: translateY(0); }
  .sticky-cta-text {
    font-size: 11.5px;
    color: rgba(255,255,255,.7);
    flex: 1 1 auto;
    min-width: 0;
  }
  .sticky-cta .btn--primary {
    padding: 9px 14px !important;
    font-size: 12px !important;
    flex-shrink: 0;
    white-space: nowrap !important;
  }
  .section { padding: 56px 0; }
  .wrap { padding: 0 18px; }
  .h-display { font-size: clamp(36px, 10vw, 56px) !important; }
  .h-1 { font-size: clamp(28px, 7.6vw, 44px) !important; }
  .h-2 { font-size: clamp(22px, 6.2vw, 32px) !important; }
  .lede { font-size: 16px !important; }
  .body-lg { font-size: 16px !important; }

  /* CRITICAL: Mobile button sizing fix — buttons must respect viewport */
  .btn {
    padding: 14px 18px;
    font-size: 14px;
    gap: 8px;
  }
  .btn--lg {
    padding: 16px 20px !important;
    font-size: 15px !important;
  }
  .btn--sm {
    padding: 10px 14px;
    font-size: 13px;
  }
  /* CTA wrappers — never exceed container */
  .cta-wrap {
    width: 100%;
    max-width: 100%;
  }
  .cta-wrap .btn {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .sticky-cta-text { display: none; }
  .sticky-cta {
    justify-content: center;
    padding: 6px;
  }
  .sticky-cta .btn--primary {
    width: 100%;
    justify-content: center;
  }
  .wrap { padding: 0 14px; }
  .btn { padding: 12px 14px; font-size: 13px; }
  .btn--lg { padding: 14px 18px !important; font-size: 14px !important; }
  .h-display { font-size: clamp(30px, 9.4vw, 48px) !important; }
  .h-1 { font-size: clamp(24px, 7vw, 38px) !important; }
  .section { padding: 44px 0; }
}

@media (max-width: 340px) {
  .wrap { padding: 0 12px; }
  .btn { padding: 11px 12px; font-size: 12.5px; gap: 6px; }
  .btn--lg { padding: 13px 16px !important; font-size: 13px !important; }
}

/* Phone mockup — dark device chassis on any theme */
.phone-shell {
  --w: 320px;
  width: var(--w);
  aspect-ratio: 9 / 19.5;
  border-radius: 42px;
  background: linear-gradient(180deg, #1a1a1c, #0a0a0b);
  padding: 7px;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08),
    0 0 0 4px #0a0a0b,
    0 0 0 5px rgba(255,255,255,.06),
    0 40px 80px -20px rgba(18, 32, 53, .35),
    0 20px 40px -10px rgba(18, 32, 53, .25);
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 36px;
  background: #FAF7EF;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Brand gradient blob — soft hero glow */
.brand-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 50% at 75% 30%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(45% 50% at 25% 70%, color-mix(in oklab, var(--primary) 14%, transparent), transparent 60%);
  z-index: 0;
}
