/* Demos project page.
   Black and white, like the app. The one colour, --agree, only ever marks common ground. */

:root,
[data-theme="dark"] {
  --ground: #000000;
  --ground-2: #0b0b0b;
  --ground-3: #141413;
  --ink: #f5f5f3;
  --ink-2: #a3a3a0;
  --ink-3: #6f6f6c;
  --line: #262624;
  --line-2: #3a3a37;
  --agree: #7bebae;
  --agree-fill: #7bebae;
  --dot: rgba(245, 245, 243, 0.66);
  /* the inverse, for the section that speaks for the other side */
  --inv-ground: #f5f5f3;
  --inv-ink: #0b0b0a;
  --inv-ink-2: #5c5c59;
  --inv-line: #dcdcd8;
  --shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  color-scheme: dark;
}

[data-theme="light"] {
  --ground: #f5f5f3;
  --ground-2: #ececea;
  --ground-3: #e4e4e1;
  --ink: #0b0b0a;
  --ink-2: #5c5c59;
  --ink-3: #8a8a86;
  --line: #dcdcd8;
  --line-2: #c8c8c3;
  --agree: #1e9e66;
  --agree-fill: #3fcf8e;
  --dot: rgba(11, 11, 10, 0.55);
  --inv-ground: #000000;
  --inv-ink: #f5f5f3;
  --inv-ink-2: #a3a3a0;
  --inv-line: #262624;
  --shadow: 0 40px 80px -36px rgba(0, 0, 0, 0.35);
  color-scheme: light;
}

:root {
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(16px, 4.5vw, 56px);
  --max: 1200px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --nav: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav) + 16px); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 18px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color 0.6s var(--ease), color 0.6s var(--ease);
}
img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
code { font-family: var(--mono); font-size: 0.88em; }
::selection { background: var(--ink); color: var(--ground); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--ground); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

.eyebrow, .data, .fine, dt {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; margin-bottom: 22px; }
.fine { letter-spacing: 0.02em; line-height: 1.6; }
.agree { color: var(--agree); }

/* ---------- the mark ---------- */
.mark { position: relative; display: inline-block; width: 30px; height: 18px; flex: none; }
.mark i { position: absolute; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); opacity: 0.55; transition: transform 0.5s var(--ease); }
.mark i + i { left: 12px; }
.brand:hover .mark i:first-child { transform: translateX(3px); }
.brand:hover .mark i + i { transform: translateX(-3px); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 24px;
  border-radius: 999px;
  font: 500 16px/1 var(--body);
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: transform 0.25s var(--ease), background-color 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--ground); }
.btn-ghost { color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-small { height: 38px; padding: 0 16px; font-size: 14px; gap: 8px; border-color: var(--line-2); }
.btn-small:hover { border-color: var(--ink); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav);
  background: color-mix(in srgb, var(--ground) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  color: var(--ink);
  transition: border-color 0.3s, background-color 0.6s var(--ease), color 0.6s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
/* over the white section the nav turns too */
.nav.inv { --ground: var(--inv-ground); --ink: var(--inv-ink); --ink-2: var(--inv-ink-2); --line: var(--inv-line); --line-2: var(--inv-line); }
.nav-in { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 19px/1 var(--display); }
.links { display: flex; gap: 26px; margin-left: 12px; }
.links a { font-size: 15px; color: var(--ink-2); text-decoration: none; transition: color 0.2s; }
.links a:hover { color: var(--ink); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.theme {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px 0 10px;
  border-radius: 999px; border: 1px solid var(--line-2); background: transparent;
  font-size: 14px;
  transition: border-color 0.2s;
}
.theme:hover { border-color: var(--ink); }
.theme-icon {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%);
  transition: transform 0.6s var(--ease);
}
[data-theme="light"] .theme-icon { transform: rotate(180deg); }

/* ---------- phone frame ---------- */
.phone {
  position: relative;
  padding: 3.2%;
  border-radius: 15% / 7%;
  background: linear-gradient(145deg, #2a2a29, #121212 40%, #1c1c1b);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.6),
    var(--shadow);
}
.phone > img, .phone > video {
  width: 100%; height: auto; aspect-ratio: 414 / 900;
  border-radius: 12% / 5.6%;
  background: #000;
  object-fit: cover;
}
.island {
  position: absolute; left: 50%; top: 4.1%;
  width: 29%; height: 3.6%;
  transform: translateX(-50%);
  border-radius: 999px; background: #000;
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 96px) 0 clamp(64px, 9vw, 120px); --p: 0; }
.hero-in { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero h1 {
  font-size: clamp(52px, 8.2vw, 116px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 96;
  max-width: 9.5ch;
}
.lede { margin-top: 28px; font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5; color: var(--ink-2); max-width: 36ch; }
.cta { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero .fine { margin-top: 28px; }

.hero-demo { margin: 0; justify-self: center; width: min(340px, 100%); }
.phone-lg { width: 100%; }
.demo-cap { margin-top: 22px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: baseline; min-height: 3.2em; }
.demo-cap .data b { color: var(--ink); font-weight: 400; }
.demo-t { font-size: 16px; color: var(--ink-2); transition: opacity 0.3s; }

/* two faint rings behind the hero that close up as you scroll */
.rings { position: absolute; inset: 0; pointer-events: none; }
.rings span {
  position: absolute; top: 50%; left: 72%;
  width: min(74vw, 900px); aspect-ratio: 1;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  transform: translate(calc(-50% + (1 - var(--p)) * var(--dir) * 26%), -50%);
  opacity: 0.75;
}
.rings span:first-child { --dir: -1; }
.rings span:last-child { --dir: 1; }

/* ---------- sections ---------- */
section { position: relative; }
.sec-head { max-width: 760px; margin-bottom: clamp(40px, 5vw, 72px); }
h2 { font-size: clamp(38px, 5.2vw, 72px); line-height: 1; letter-spacing: -0.03em; font-variation-settings: "opsz" 96; }
.sec-lede { margin-top: 24px; font-size: clamp(18px, 1.4vw, 20px); color: var(--ink-2); max-width: 52ch; }
h3 { font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }

/* ---------- the crowd ---------- */
.crowd-sec { padding: clamp(72px, 9vw, 140px) 0 clamp(48px, 6vw, 80px); border-top: 1px solid var(--line); }
.crowd { position: relative; height: clamp(380px, 52vw, 620px); }
.crowd-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: pan-y; }
.crowd-ui { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.readout { margin: 0; display: flex; gap: clamp(24px, 4vw, 56px); flex-wrap: wrap; }
.readout div { min-width: 0; }
.readout dt { text-transform: uppercase; letter-spacing: 0.14em; font-size: 11.5px; }
.readout dd { margin: 6px 0 0; font: 400 clamp(22px, 2.6vw, 34px)/1 var(--mono); letter-spacing: -0.02em; }
.speak {
  pointer-events: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 20px 0 14px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--ground) 70%, transparent);
  backdrop-filter: blur(8px);
  font-size: 15px;
  transition: border-color 0.2s, transform 0.25s var(--ease);
}
.speak:hover { border-color: var(--ink); transform: translateY(-2px); }
.speak-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); position: relative; }
.speak-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--ink); opacity: 0.4; animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(0.7); opacity: 0.6; } 100% { transform: scale(1.5); opacity: 0; } }
.crowd-note { margin-top: 18px; }

/* ---------- how ---------- */
.how { padding: clamp(80px, 10vw, 150px) 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); }
.step { display: flex; flex-direction: column; gap: 32px; }
.phone-sm { width: min(260px, 82%); }
.step-n { display: block; margin-bottom: 12px; }
.step-copy p { margin-top: 12px; color: var(--ink-2); }
.steps .step:nth-child(2) { transition-delay: 0.1s; }
.steps .step:nth-child(3) { transition-delay: 0.2s; }

/* ---------- flip ---------- */
.flip {
  padding: clamp(80px, 10vw, 150px) 0;
  background: var(--ground);
  color: var(--ink);
  transition: background-color 0.9s var(--ease), color 0.9s var(--ease);
}
.flip.on, html:not(.js) .flip { background: var(--inv-ground); color: var(--inv-ink); --ink-2: var(--inv-ink-2); --line: var(--inv-line); }
.flip-in { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.flip .eyebrow { color: var(--ink-2); transition: color 0.9s var(--ease); }
.quote { font-size: clamp(34px, 4.2vw, 60px); line-height: 1.04; letter-spacing: -0.025em; margin-bottom: 36px; }
.flip-copy > p:not(.eyebrow):not(.fine) { font-size: 19px; color: var(--ink-2); max-width: 46ch; margin-top: 14px; transition: color 0.9s var(--ease); }
.flip-copy .fine { margin-top: 28px; color: var(--ink-2); }
.phone-md { width: min(320px, 100%); justify-self: center; }

/* ---------- features ---------- */
.features { padding: clamp(80px, 10vw, 150px) 0; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card {
  background: var(--ground-2);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px 24px 28px;
  transition: transform 0.35s var(--ease), border-color 0.35s, background-color 0.6s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: var(--line-2); }
.shot {
  height: 260px; margin: -24px -24px 24px; overflow: hidden;
  border-radius: 23px 23px 0 0;
  background: var(--ground-3);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 28px;
  border-bottom: 1px solid var(--line);
}
/* keep the real 414x900 shape; the card crops the bottom off */
.shot img {
  flex: none; width: 62%; height: auto; aspect-ratio: 414 / 900;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 0 0 1px var(--line-2), 0 24px 48px -20px rgba(0, 0, 0, 0.7);
  transition: transform 0.6s var(--ease);
}
.card:hover .shot img { transform: translateY(-10px); }
.card p { margin-top: 10px; color: var(--ink-2); font-size: 16.5px; }
.cards .card:nth-child(3n + 2) { transition-delay: 0.08s; }
.cards .card:nth-child(3n + 3) { transition-delay: 0.16s; }

/* ---------- install ---------- */
.install { padding: clamp(80px, 10vw, 150px) 0; border-top: 1px solid var(--line); }
.install-in { max-width: 880px; }
.code-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.code-steps li > p { margin-bottom: 12px; }
.code-steps .data { margin-right: 10px; }
.code { position: relative; }
.code pre {
  margin: 0; padding: 20px 96px 20px 22px;
  overflow-x: auto;
  background: var(--ground-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  font: 400 14.5px/1.75 var(--mono);
}
.copy {
  position: absolute; top: 12px; right: 12px;
  height: 32px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--ground);
  font: 400 12.5px/1 var(--mono); letter-spacing: 0.04em;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.copy:hover { border-color: var(--ink); }
.copy.done { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.install-note { margin-top: 32px; }
.install-note code { color: var(--ink); }

/* ---------- faq ---------- */
.faq { padding: clamp(80px, 10vw, 150px) 0; border-top: 1px solid var(--line); }
.faq-in { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.qs { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 24px 0;
  font: 500 21px/1.3 var(--display);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 14px 1.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 1.5px 14px no-repeat;
  transition: transform 0.35s var(--ease);
}
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 48px 26px 0; color: var(--ink-2); }

/* ---------- closing ---------- */
.end { position: relative; overflow: hidden; padding: clamp(100px, 13vw, 200px) 0; border-top: 1px solid var(--line); text-align: center; }
.end-in { position: relative; display: flex; flex-direction: column; align-items: center; }
.end h2 { font-size: clamp(48px, 7.4vw, 104px); line-height: 0.96; letter-spacing: -0.035em; }
.end .sec-lede { margin-left: auto; margin-right: auto; }
.end .cta { justify-content: center; }
.end-rings span {
  position: absolute; top: 50%; left: 50%;
  width: min(62vw, 640px); aspect-ratio: 1;
  border: 1px solid var(--line-2); border-radius: 50%;
  transform: translate(calc(-50% + var(--dir) * 20%), -50%);
  transition: transform 1.4s var(--ease);
}
.end-rings span:first-child { --dir: -1; }
.end-rings span:last-child { --dir: 1; }
.end:has(.reveal.in) .end-rings span { transform: translate(calc(-50% + var(--dir) * 14%), -50%); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 48px 0 64px; }
.foot-in { display: grid; gap: 14px; color: var(--ink-2); font-size: 15px; }
.foot-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .card.reveal.in:hover { transform: translateY(-6px); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .links { display: none; }
  .hero-in, .flip-in, .faq-in { grid-template-columns: minmax(0, 1fr); }
  .hero-demo { width: min(300px, 78%); }
  .rings span { left: 50%; top: 72%; width: 130vw; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 72px; }
  .step { flex-direction: row; align-items: center; gap: 28px; }
  .phone-sm { width: 42%; flex: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flip .phone-md { width: min(280px, 72%); }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .theme-label { display: none; }
  .theme { padding: 0 10px; }
  .btn-small span { display: none; }
  .btn-small { padding: 0 11px; }
  .cta .btn { flex: 1 1 auto; justify-content: center; }
  .step { flex-direction: column; align-items: flex-start; }
  .phone-sm { width: min(240px, 70%); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .readout { gap: 20px; }
  .code pre { font-size: 13px; padding-right: 22px; padding-top: 52px; }
  .end-rings span { width: 104vw; }
  details p { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .rings span { transform: translate(calc(-50% + var(--dir) * 13%), -50%); }
}
