/* ============================================================
   CammBot — design tokens & base
   ============================================================ */

:root {
  --bg:            #FAF9F5;
  --bg-warm:       #F5F2E9;
  --surface:       #FFFFFF;
  --ink:           #0B0F1A;
  --ink-soft:      #475569;
  --muted:         #94A3B8;
  --line:          #E5E1D8;
  --accent:        #2563EB;
  --accent-glow:   #3B82F6;
  --accent-soft:   #DBEAFE;
  --success:       #10B981;

  --r-pill: 999px;
  --r-card: 28px;
  --r-phone: 40px;

  --font-display: 'Fraunces', Georgia, serif;
  --font-sans:    'Geist', system-ui, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* Lenis integration overrides */
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

html.lenis,
html.lenis body {
  height: auto;
}

body {
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(37,99,235,0.05), transparent 60%),
    radial-gradient(60% 40% at 0% 40%, rgba(37,99,235,0.04), transparent 60%),
    linear-gradient(180deg, #FAF9F5 0%, #FFFFFF 60%, #FAF9F5 100%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

::selection { background: var(--accent); color: white; }

/* ---------- Layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.wrap-tight { max-width: 880px; margin: 0 auto; padding: 0 32px; }

.section { padding: 120px 0; position: relative; }
@media (min-width: 768px) { .section { padding: 160px 0; } }

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 6px 18px rgba(11,15,26,0.18);
}
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }
.btn-primary.big { padding: 22px 34px; font-size: 19px; }
.btn-ghost {
  color: var(--ink);
  background: transparent;
  padding: 16px 22px;
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(11,15,26,0.03); }

/* ---------- Pill / badge ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  background: white;
  border: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(11,15,26,0.03);
}
.pill-dark { background: var(--ink); color: white; border-color: var(--ink); }
.pill-accent { background: var(--accent-soft); border-color: var(--accent-soft); color: #1d4ed8; }

/* ---------- CammBot placeholder ---------- */
.cammbot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.2,0.8,0.2,1);
  user-select: none;
  flex-shrink: 0;
}
.cammbot .face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  line-height: 1.2;
}
.cammbot .eyes {
  display: flex;
  gap: 14%;
  align-items: center;
  justify-content: center;
  width: 50%;
  margin-bottom: 4px;
}
.cammbot .eye {
  width: 14%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #0B0F1A;
  min-width: 6px;
  min-height: 6px;
  transform-origin: center;
}
.cammbot .mouth {
  width: 26%;
  height: 8%;
  min-height: 3px;
  border-radius: 6px;
  background: #0B0F1A;
}
.cammbot .label {
  font-size: 10px;
  opacity: 0.75;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 6px;
}
.cammbot .antenna {
  position: absolute;
  top: -8%;
  left: 50%;
  width: 2px;
  height: 14%;
  background: #1e40af;
  border-radius: 2px;
  transform: translateX(-50%);
}
.cammbot .antenna::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
  box-shadow: 0 0 12px var(--accent);
}

@keyframes cammbot-float {
  0%, 100% { transform: translateY(-3px); }
  50%      { transform: translateY(3px); }
}
.cammbot-float { animation: cammbot-float 4s ease-in-out infinite; }

@keyframes cammbot-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%, 97%      { transform: scaleY(0.1); }
}
.cammbot .eye { animation: cammbot-blink 6s ease-in-out infinite; }
.cammbot .eye:nth-child(2) { animation-delay: 0.05s; }

@keyframes cammbot-bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-14px); }
  60% { transform: translateY(0); }
  80% { transform: translateY(-4px); }
}
.cammbot-bounce { animation: cammbot-bounce 1.4s cubic-bezier(0.3,1.6,0.5,1) 1; }

/* ---------- Reveal helpers ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2,0.8,0.2,1);
}
.fade-up.in { opacity: 1; transform: none; }

.word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2,0.8,0.2,1);
}
.word.in { opacity: 1; transform: none; }

/* Safety net: if IntersectionObserver / animations / transitions are suspended
   (hidden tab, background iframe), this class force-reveals every animated
   element WITHOUT relying on a transition (which is also paused when hidden). */
body.force-revealed .fade-up,
body.force-revealed .word,
body.force-revealed .step .num {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}
body.force-revealed .float-pill {
  opacity: 1 !important;
}

/* ---------- Noise overlay ---------- */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Halo backgrounds ---------- */
.halo {
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.18), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  opacity: 0.6;
}

/* ---------- Top nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(250,249,245,0.92), rgba(250,249,245,0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nav .logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-style: italic; font-size: 22px;
}
.nav .logo .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent);
  position: relative;
}
.nav .logo .dot::after {
  content: ""; position: absolute; inset: 7px;
  background: white; border-radius: 50%;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  html { scroll-behavior: auto; }
}
