/* KeyFollow — sticker-on-pastel-paper system (see DESIGN.md). No gradients, no shadows:
   depth comes from color bands and black hand-cut outlines. */

@font-face {
  font-family: "Bowlby One";
  src: url("/fonts/bowlby-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --carbon: #000000;
  --paper: #ffffff;
  --sky: #dceeff;
  --concrete: #cccccc;
  --mist: #e9e9e9;
  --blue: #4da2ff;
  --mint: #55db9c;
  --lavender: #e9ccff;
  --ember: #fb4903;
  --sun: #ffd731;
  --violet: #5c4ade;

  --display: "Bowlby One", "Druk", "Antonio", ui-sans-serif, system-ui, sans-serif;
  --ui: "Inter", "Aeonik Pro", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --line: 1.5px solid var(--carbon);
  --radius-card: 20px;
  --radius-card-lg: 40px;
  --pill: 1600px;
  --max: 1440px;
  --gutter: clamp(16px, 4vw, 48px);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--carbon);
  font-family: var(--ui);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  font-feature-settings: "ss01" on, "tnum";
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; }
img, svg { display: block; }
::selection { background: var(--sun); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Marquee ---------- */
.marquee {
  background: var(--carbon);
  color: var(--paper);
  overflow: hidden;
  white-space: nowrap;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.032em;
  text-transform: uppercase;
  line-height: 34px;
}
.marquee__track { display: inline-flex; animation: marquee 38s linear infinite; }
.marquee__track span { padding-right: 48px; }
.marquee__track span::after { content: "✦"; margin-left: 48px; color: var(--sun); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0;
  background: var(--sky);
  transition: background-color .3s var(--ease);
}
.nav--paper { background: var(--paper); }
.nav.is-scrolled { background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: 0; }
.logo__mark {
  width: 40px; height: 40px; border-radius: 50%; border: var(--line); background: var(--paper);
  display: grid; place-items: center; font-family: var(--display); font-size: 18px; line-height: 1;
  transition: transform .5s var(--spring);
}
.logo:hover .logo__mark { transform: rotate(-12deg) scale(1.06); }
.nav__links { display: flex; gap: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: var(--pill); border: var(--line);
  background: var(--paper); color: var(--carbon);
  font-weight: 700; font-size: 13px; letter-spacing: 0.032em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .25s var(--spring), background-color .2s;
}
.pill:hover { transform: translateY(-2px) rotate(-1deg); background: var(--sun); }
.pill--dark { background: var(--carbon); color: var(--paper); }
.pill--dark:hover { background: var(--carbon); color: var(--sun); }
.pill--lg { padding: 18px 26px; font-size: 15px; }

/* ---------- Bands ---------- */
.band { position: relative; overflow: clip; }
.band--sky { background: var(--sky); }
.band--paper { background: var(--paper); }
.band--concrete { background: var(--concrete); }
.band--violet { background: var(--violet); color: var(--paper); }
.band__inner { padding-block: clamp(72px, 10vw, 160px); position: relative; z-index: 2; }

.display {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.8;
  letter-spacing: 0;
  margin: 0;
}
.display--hero { font-size: clamp(76px, 13.2vw, 210px); }
.display--xl { font-size: clamp(64px, 12vw, 200px); }
.display--lg { font-size: clamp(52px, 8.5vw, 140px); }
.display--md { font-size: clamp(40px, 5.6vw, 88px); }
.display .line { display: block; overflow: hidden; padding-bottom: .04em; }
.display .line > span { display: inline-block; }

.lede { font-size: clamp(19px, 2vw, 26px); line-height: 1.25; font-weight: 500; max-width: 30ch; margin: 28px 0 0; }
.eyebrow {
  display: inline-block; font-weight: 700; font-size: 12px; letter-spacing: 0.032em; text-transform: uppercase;
  border: var(--line); border-radius: var(--pill); padding: 7px 12px; background: var(--paper); margin-bottom: 22px;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; align-items: center; }
.fine { font-size: 13px; margin-top: 16px; opacity: .75; }

/* ---------- Hero ---------- */
.hero .band__inner { padding-block: clamp(40px, 6vw, 90px) clamp(90px, 12vw, 180px); }
.hero__grid { position: relative; }
.hero .display { position: relative; z-index: 3; }
.hero__copy { position: relative; z-index: 3; }

/* The inflatable ribbon: a fat blue tube with a black outline, drawn on scroll. */
.ribbon { position: absolute; z-index: 1; pointer-events: none; overflow: visible; }
.ribbon path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ribbon .ribbon__outline { stroke: var(--carbon); }
.ribbon .ribbon__body { stroke: var(--blue); }
.ribbon .ribbon__shine { stroke: rgba(255, 255, 255, .35); }
.hero .ribbon { left: -6%; right: -6%; top: 14%; width: 112%; height: auto; }

/* ---------- Stickers ---------- */
.sticker {
  position: absolute; z-index: 4; pointer-events: none;
  will-change: transform;
}
.sticker svg { width: 100%; height: auto; overflow: visible; }
.sticker__inner { transform: rotate(var(--rot, 0deg)); transition: transform .9s var(--spring); }
.js .sticker .sticker__inner { transform: rotate(var(--rot, 0deg)) scale(0); }
.js .sticker.in .sticker__inner { transform: rotate(var(--rot, 0deg)) scale(1); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(36px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.js .display .line > span { transform: translateY(105%); transition: transform 1s var(--ease); transition-delay: var(--d, 0s); }
.js .display.in .line > span { transform: none; }

/* ---------- Scroll demo ---------- */
.demo { height: 380vh; position: relative; }
.demo__stage {
  position: sticky; top: 0; height: 100vh; display: grid; grid-template-rows: auto 1fr auto;
  padding-block: clamp(84px, 10vh, 124px) clamp(28px, 5vh, 56px);
}
.demo__head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.demo__steps { display: flex; gap: 6px; }
.demo__steps i { width: 34px; height: 8px; border-radius: var(--pill); border: var(--line); background: linear-gradient(90deg, var(--carbon) var(--fill, 0%), var(--paper) 0); }
.desk { position: relative; align-self: center; width: min(100%, 1080px); margin: 0 auto; aspect-ratio: 16 / 7.4; }
.screen {
  position: absolute; border: var(--line); border-radius: 22px; background: var(--paper);
  transition: background-color .45s var(--ease), transform .6s var(--spring);
  overflow: hidden;
}
.screen__bar { height: 26px; border-bottom: var(--line); display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--paper); }
.screen__bar b { width: 9px; height: 9px; border-radius: 50%; border: 1.2px solid var(--carbon); }
.screen__body { white-space: pre-wrap; padding: 18px 22px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: clamp(11px, 1.15vw, 15px); line-height: 1.6; }
.screen__body .caret { display: inline-block; width: .55em; height: 1.1em; background: var(--carbon); vertical-align: text-bottom; opacity: 0; }
.screen.is-focused { background: var(--blue); transform: translateY(-8px) rotate(var(--tilt, 0deg)); }
.screen.is-focused .screen__body .caret { opacity: 1; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.screen--laptop { left: 0; bottom: 4%; width: 37%; height: 58%; --tilt: -1.5deg; }
.screen--monitor { right: 0; top: 0; width: 56%; height: 82%; --tilt: 1deg; }
.screen__label {
  position: absolute; bottom: 12px; right: 12px; font-weight: 700; font-size: 11px; letter-spacing: .032em; text-transform: uppercase;
  background: var(--paper); border: var(--line); border-radius: var(--pill); padding: 5px 10px;
}
/* The person, gaze beam, spot and pointer are driven frame by frame from app.js (scroll + idle). */
.person { position: absolute; left: 41.5%; bottom: -12%; width: 17%; aspect-ratio: 160 / 170; z-index: 3; }
.person svg { width: 100%; height: 100%; overflow: visible; display: block; }
#person-head, #person-face, #person-body, #person-eyes { transform-box: view-box; }
.gaze { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.gaze polygon { fill: #fff; fill-opacity: .4; stroke: var(--carbon); stroke-opacity: .5; stroke-width: 1.5; stroke-dasharray: 5 6; stroke-linejoin: round; }
.screen { z-index: 1; }
.gaze-spot { position: absolute; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 2px dashed var(--carbon); border-radius: 50%; z-index: 4; pointer-events: none; }
.pointer { position: absolute; left: 0; top: 0; width: 22px; z-index: 5; pointer-events: none; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.18)); }
.phone {
  position: absolute; left: 61%; bottom: -14%; width: 6%; aspect-ratio: 9/17; border: var(--line); border-radius: 12px;
  background: var(--sun); z-index: 3; opacity: 0; transform-origin: 50% 100%;
}
.phone i { position: absolute; left: 30%; right: 30%; top: 6%; height: 4%; border-radius: 4px; background: var(--carbon); }
.demo__caption p { transition: opacity .25s var(--ease), transform .25s var(--ease); }
.demo__caption p.is-swapping { opacity: 0; transform: translateY(6px); }
.demo__caption { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.demo__caption p { margin: 0; font-size: clamp(20px, 2.3vw, 32px); font-weight: 700; line-height: 1.15; max-width: 26ch; min-height: 2.3em; }
.demo__caption .tag { justify-self: end; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 56px; }
.card {
  border: var(--line); border-radius: var(--radius-card); padding: 28px; background: var(--paper);
  min-height: 250px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  transition: transform .45s var(--spring);
}
.card:hover { transform: translateY(-6px) rotate(-.6deg); }
.card h3 { margin: 0 0 10px; font-size: clamp(22px, 2vw, 30px); line-height: 1.1; font-weight: 700; letter-spacing: -0.015em; }
.card p { margin: 0; font-size: 15px; line-height: 1.45; }
.card__num { font-family: var(--display); font-size: 64px; line-height: .8; }
.card__icon { width: 64px; height: 64px; }
.card--lavender { background: var(--lavender); }
.card--mint { background: var(--mint); }
.card--sun { background: var(--sun); }
.card--sky { background: var(--sky); }
.card--paper { background: var(--paper); }
.card--ember { background: var(--ember); color: var(--paper); }
.card--violet { background: var(--violet); color: var(--paper); }

/* ---------- Privacy ---------- */
.privacy-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: end; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li {
  display: flex; align-items: center; gap: 12px; background: var(--paper); color: var(--carbon);
  border: var(--line); border-radius: var(--pill); padding: 12px 18px 12px 12px; font-weight: 700; font-size: 15px;
}
.checks li::before {
  content: "✓"; flex: 0 0 28px; height: 28px; border-radius: 50%; border: var(--line); background: var(--mint);
  display: grid; place-items: center; font-size: 14px;
}

/* ---------- Pricing ---------- */
.price-card {
  border: var(--line); border-radius: var(--radius-card-lg); background: var(--paper);
  display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden; margin-top: 48px;
}
.price-card__left { padding: clamp(28px, 4vw, 56px); background: var(--lavender); border-right: var(--line); position: relative; }
.price-card__right { padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.price { font-family: var(--display); font-size: clamp(90px, 13vw, 210px); line-height: .78; }
.price small { font-size: .32em; vertical-align: top; line-height: 1; }
.price-card .checks li { background: var(--paper); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; margin-top: 48px; max-width: 980px; }
.faq details { border: var(--line); border-radius: var(--radius-card); background: var(--paper); transition: background-color .25s; }
.faq details[open] { background: var(--sky); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 26px; font-weight: 700; font-size: clamp(17px, 1.6vw, 22px);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: 0 0 36px; height: 36px; border-radius: 50%; border: var(--line); background: var(--paper);
  display: grid; place-items: center; font-size: 20px; transition: transform .4s var(--spring);
}
.faq details[open] summary::after { transform: rotate(45deg); background: var(--sun); }
.faq details p { margin: 0; padding: 0 26px 24px; font-size: 16px; max-width: 70ch; }

/* ---------- Footer ---------- */
.footer { background: var(--carbon); color: var(--paper); padding-top: 72px; overflow: clip; }
.footer__top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: end; }
.footer__top h2 { font-size: clamp(28px, 3vw, 44px); line-height: 1.05; margin: 0; max-width: 18ch; font-weight: 700; }
.footer .pill { border-color: var(--paper); }
.footer__links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; margin: 48px 0 0; }
.footer__links a { text-decoration: none; opacity: .75; }
.footer__links a:hover { opacity: 1; text-decoration: underline; }
.footer__mark {
  font-family: var(--display); text-transform: uppercase; line-height: .74; font-size: clamp(48px, 13.2vw, 200px);
  margin: 40px 0 -0.06em; white-space: nowrap; color: var(--paper); letter-spacing: -0.01em;
}
.footer__mark span { color: var(--blue); }

/* ---------- Document pages ---------- */
.doc-hero .band__inner { padding-block: clamp(48px, 7vw, 110px) clamp(40px, 5vw, 70px); }
.doc { max-width: 760px; padding: clamp(40px, 6vw, 80px) 0 clamp(80px, 10vw, 140px); }
.doc h2 { font-size: 24px; line-height: 1.2; margin: 44px 0 10px; font-weight: 700; }
.doc p, .doc li { font-size: 17px; line-height: 1.6; }
.doc a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.doc ol { padding-left: 1.2em; }
.doc .card { min-height: 0; margin: 28px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .privacy-grid, .price-card { grid-template-columns: 1fr; }
  .price-card__left { border-right: 0; border-bottom: var(--line); }
}
@media (max-width: 720px) {
  .nav__links .pill:not(.pill--dark) { display: none; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .demo { height: 320vh; }
  .desk { aspect-ratio: 4 / 4.5; }
  .screen--laptop { width: 50%; height: 36%; bottom: 17%; }
  .screen--monitor { width: 66%; height: 46%; }
  .person { width: 25%; left: 37.5%; bottom: -6%; }
  .phone { left: 66%; bottom: -8%; width: 9%; }
  .gaze-spot { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .demo__caption { grid-template-columns: 1fr; }
  .demo__caption .tag { justify-self: start; }
  .sticker--hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .display .line > span, .js .sticker .sticker__inner { opacity: 1 !important; transform: none !important; }
}

/* ---------- Cookie consent ---------- */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100; max-width: 620px; margin-left: auto;
  background: var(--paper); border: var(--line); border-radius: var(--radius-card); padding: 18px 20px;
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.consent p { margin: 0; font-size: 14px; line-height: 1.45; flex: 1 1 280px; }
.consent__actions { display: flex; gap: 8px; }
.consent .pill { padding: 10px 16px; font-size: 12px; }
.price-was { font-family: var(--ui); font-weight: 700; font-size: clamp(18px, 2vw, 26px); text-decoration: line-through; opacity: .55; margin-bottom: 8px; display: block; }
.launch-badge { display: inline-block; font-weight: 700; font-size: 12px; letter-spacing: .032em; text-transform: uppercase; background: var(--sun); border: var(--line); border-radius: var(--pill); padding: 6px 12px; margin-bottom: 14px; }

/* ---------- Setup video ---------- */
.band--mint { background: var(--mint); }
.video-frame { margin-top: 48px; border: var(--line); border-radius: var(--radius-card-lg); overflow: hidden; background: var(--carbon); }
.video-frame video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* ---------- Phone visitors (KeyFollow is a Mac app) ---------- */
.phone-note { margin: 18px 0 0; max-width: 34ch; font-size: 17px; line-height: 1.35; font-weight: 600; background: var(--paper); border: var(--line); border-radius: 18px; padding: 12px 16px; }
.kf-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 50; background: var(--carbon); color: var(--paper); border-radius: 999px; padding: 14px 22px; font-weight: 700; font-size: 16px; transition: transform .35s cubic-bezier(.16,1,.3,1); max-width: calc(100vw - 32px); text-align: center; }
.kf-toast.is-on { transform: translate(-50%, 0); }

/* Compact consent bar on phones so it never hides the hero call to action */
@media (max-width: 600px) {
  .consent { left: 10px; right: 10px; bottom: 10px; padding: 10px 12px; gap: 8px; border-radius: 16px; flex-wrap: nowrap; align-items: center; }
  .consent p { font-size: 12px; line-height: 1.3; flex: 1 1 auto; }
  .consent p a { white-space: nowrap; }
  .consent__actions { flex-direction: column; gap: 6px; }
  .consent .pill { padding: 7px 12px; font-size: 11px; }
}

/* Phone: "Send to my Mac" sheet (visits.js) */
.kf-sheet { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.kf-sheet.is-on { opacity: 1; pointer-events: auto; }
.kf-sheet__card { position: relative; width: min(100%, 520px); background: var(--paper); border: var(--line); border-radius: 24px 24px 0 0; padding: 26px 20px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 12px; transform: translateY(24px); transition: transform .3s var(--spring); }
.kf-sheet.is-on .kf-sheet__card { transform: none; }
.kf-sheet__card h3 { margin: 0; font-size: 24px; line-height: 1.1; }
.kf-sheet__card p { margin: 0; font-size: 16px; line-height: 1.4; }
.kf-sheet__card input[type=email] { font-family: inherit; font-weight: 600; font-size: 17px; padding: 14px 16px; border: var(--line); border-radius: 14px; width: 100%; }
.kf-sheet__card .pill { justify-content: center; width: 100%; }
.kf-sheet__alt { background: none; border: 0; font-family: inherit; font-weight: 700; font-size: 15px; text-decoration: underline; cursor: pointer; padding: 4px; }
.kf-sheet__card small { font-size: 12.5px; opacity: .7; text-align: center; }
.kf-sheet__x { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; }
.kf-sheet__hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
