/* BearBit web — modern with a pixel soul (ADR-100): Headspace calm, the day sky on top, pixel art only in the panda,
   postcards, achievements and Space Mono digits. Tokens mirror ios/BearBit/Brand/Theme.swift. */

@font-face {
  font-family: "Space Mono";
  src: url("/fonts/SpaceMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #fdf7ee;
  --surface: #fffdf8;
  --raised: #f6eee2;
  --stroke: rgba(44, 38, 42, 0.09);
  --text: #2c262a;
  --secondary: #5e575b;
  --tint: #2a64a8;
  --ember: #6bc4fd;
  --ember-deep: #4aaeef;
  --on-ember: #2c262a;
  --shadow: 0 1px 2px rgba(91, 58, 30, 0.06), 0 12px 32px rgba(91, 58, 30, 0.1);
  --sky: linear-gradient(180deg, #ffc233 0%, #ffcc42 35%, #ffd35a 70%, #ffdb72 100%);
  --sky-ink: #2c262a;
  --frame: #231e22;
  --success: #2eb98c;
  --pro: linear-gradient(135deg, #4f4ce6, #7a45d8);
  --radius: 24px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --digits: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1420;
    --surface: #251e2b;
    --raised: #312838;
    --stroke: rgba(255, 255, 255, 0.1);
    --text: #f7f1ea;
    --secondary: #b2a9ad;
    --tint: #80d5fd;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    --sky: linear-gradient(180deg, #120f2a 0%, #1b1638 30%, #241d48 55%, #2e2558 80%, #3a2f66 100%);
    --sky-ink: #fceee1;
    --frame: #0d0a10;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--tint); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.5em; font-weight: 800; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 4.5vw + 1rem, 3.7rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 2.6vw + 1rem, 2.5rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: 0.35em; }
.digits { font-family: var(--digits); font-weight: 700; letter-spacing: -0.02em; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left)); }
@media (min-width: 700px) { .wrap { padding-inline: 32px; } }

.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: 12px; }
.skip:focus { top: 12px; }

/* ---------- The sky ---------- */
.sky { position: relative; overflow-x: clip; background: var(--sky); color: var(--sky-ink); padding-bottom: 56px; }
.sky::after {
  content: ""; position: absolute; left: -15%; right: -15%; bottom: -1px; height: 56px;
  background: var(--bg); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.sky a:not(.btn) { color: inherit; }
.sky-short { padding-bottom: 44px; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; position: relative; z-index: 3; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand img { border-radius: 11px; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-wide { display: none; }
.nav-wide, .menu ul { gap: 4px; }
.site-nav li + li { margin-top: 0; }
.site-nav ul a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 12px; border-radius: 999px; text-decoration: none; font-weight: 650; }
.site-nav ul a:hover, .site-nav ul a[aria-current="page"] { background: rgba(255, 255, 255, 0.4); }
@media (prefers-color-scheme: dark) { .site-nav ul a:hover, .site-nav ul a[aria-current="page"] { background: rgba(255, 255, 255, 0.1); } }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: rgba(255, 255, 255, 0.45); }
@media (prefers-color-scheme: dark) { .menu summary { background: rgba(255, 255, 255, 0.12); } }
.menu summary::-webkit-details-marker { display: none; }
.menu summary svg { width: 24px; height: 24px; }
.menu ul { position: absolute; right: 0; top: 52px; min-width: 220px; display: grid; padding: 8px; background: var(--surface); color: var(--text); border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--stroke); }
.menu ul a { width: 100%; color: var(--text) !important; }
.menu ul a:hover, .menu ul a[aria-current="page"] { background: var(--raised) !important; }
@media (min-width: 900px) {
  .menu { display: none; }
  .nav-wide { display: flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 24px; border-radius: 999px; border: 0;
  font: inherit; font-weight: 700; font-size: 1.05rem; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--ember); color: var(--on-ember) !important; box-shadow: 0 8px 22px rgba(74, 174, 239, 0.35); }
.btn-primary:hover { background: var(--ember-deep); }
.btn-ghost { background: var(--surface); color: var(--text) !important; border: 1px solid var(--stroke); }
.sky .btn-ghost { background: rgba(255, 255, 255, 0.55); border-color: transparent; }
@media (prefers-color-scheme: dark) { .sky .btn-ghost { background: rgba(255, 255, 255, 0.12); } }
.btn-small { min-height: 44px; padding: 8px 18px; font-size: 0.98rem; box-shadow: none; }
.btn-icon { width: 20px; height: 20px; flex: none; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Hero ---------- */
.hero { display: grid; gap: 32px; align-items: center; padding-block: 24px 8px; position: relative; z-index: 1; }
.hero-copy { max-width: 620px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px; }
.lede { font-size: clamp(1.1rem, 0.6vw + 1rem, 1.3rem); line-height: 1.55; max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 14px; }
.note { font-size: 0.92rem; opacity: 0.85; margin: 0; }
.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-visual .screen { width: min(300px, 72vw); transform: rotate(2deg); }
.hero-visual .panda { display: none; position: absolute; bottom: 24px; width: 120px; height: 120px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18)); }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; padding-block: 40px 0; }
  .hero-visual .screen { margin-bottom: -96px; }
  .hero-visual .panda { display: block; left: -10px; }
}
.page-hero { padding-block: 24px 12px; position: relative; z-index: 1; max-width: 820px; }
.page-hero .lede { margin-bottom: 0; }

/* ---------- Phone screenshots ---------- */
.screen { border-radius: 42px; border: 7px solid var(--frame); box-shadow: 0 24px 60px rgba(44, 38, 42, 0.28); background: var(--frame); }

/* ---------- Sections and cards ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section-tight { padding-block: clamp(32px, 5vw, 56px); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head p { color: var(--secondary); font-size: 1.12rem; }
.center { text-align: center; margin-inline: auto; }
.card { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 24px; }
.raised { box-shadow: var(--shadow); }
.muted { color: var(--secondary); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.card h3 { margin-top: 8px; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .panda { width: 72px; height: 72px; }
.tag { display: inline-block; font-size: 0.8rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tint); }

.definition { font-size: clamp(1.15rem, 0.8vw + 1rem, 1.4rem); line-height: 1.55; max-width: 860px; }
.definition strong { font-weight: 800; }

/* Feature rows: copy beside a phone */
.feature { display: grid; gap: 32px; align-items: center; }
.feature + .feature { margin-top: clamp(56px, 8vw, 96px); }
.feature .screen { width: min(280px, 70vw); margin-inline: auto; }
.feature ul { padding-left: 0; list-style: none; }
.feature li { position: relative; padding-left: 30px; }
.feature li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 14px; height: 14px; border-radius: 4px; background: var(--ember); }
@media (min-width: 860px) {
  .feature { grid-template-columns: 1fr 1fr; gap: 64px; }
  .feature.flip > :first-child { order: 2; }
}

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 16px; }
.steps > li { counter-increment: step; position: relative; padding: 22px 22px 22px 76px; margin: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 22px; top: 22px; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; background: var(--ember); color: var(--on-ember); font-family: var(--digits); font-weight: 700;
}
.steps h3 { margin: 4px 0 6px; }
.steps p { margin: 0; }

.strip { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.strip-stack { display: grid; gap: 22px; }
.postcard { width: 132px; height: 132px; border-radius: 22px; box-shadow: var(--shadow); image-rendering: auto; }
.badge { width: 72px; height: 72px; }
.panda { image-rendering: auto; }

.panel-sky { background: var(--sky); color: var(--sky-ink); border-radius: calc(var(--radius) + 8px); padding: clamp(28px, 5vw, 56px); }
.panel-sky a:not(.btn) { color: inherit; }

.checks { list-style: none; padding: 0; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 34px; margin: 0; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.2em; width: 22px; height: 22px; border-radius: 7px; background: var(--success);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' rx='7'/%3E%3C/svg%3E");
}
.checks li::after { content: ""; position: absolute; left: 7px; top: calc(0.2em + 5px); width: 6px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

/* ---------- Pricing ---------- */
.plans { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 6px; }
.plan .price { font-family: var(--digits); font-weight: 700; font-size: 2.4rem; line-height: 1.1; margin: 6px 0 2px; }
.plan .price small { font-family: var(--font); font-size: 1rem; font-weight: 650; color: var(--secondary); }
.plan ul { margin: 12px 0 20px; }
.plan .btn { margin-top: auto; }
.plan-pro { background: var(--pro); color: #fff; border: 0; }
.plan-pro .price small, .plan-pro .muted { color: rgba(255, 255, 255, 0.85); }
.plan-pro .tag { color: #ffd98a; }
.plan-pro a:not(.btn) { color: #fff; }
.plan-pro .checks li::before { background: #ffd98a; }
.plan-pro .checks li::after { border-color: #3a2f66; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq-item { padding: 0; }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; min-height: 56px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { margin: 0; font-size: 1.08rem; font-weight: 750; }
.faq-mark { flex: none; width: 28px; height: 28px; border-radius: 9px; background: var(--raised); position: relative; }
.faq-mark::before, .faq-mark::after { content: ""; position: absolute; left: 8px; right: 8px; top: 13px; height: 2px; background: currentColor; border-radius: 2px; transition: transform 0.2s ease; }
.faq-mark::after { transform: rotate(90deg); }
.faq-item[open] .faq-mark::after { transform: rotate(0deg); }
.faq-body { padding: 0 22px 20px; color: var(--secondary); }
.faq-body p:last-child, .faq-body ul:last-child { margin-bottom: 0; }

/* ---------- Lead form ---------- */
.lead { display: grid; gap: 20px; align-items: center; padding: clamp(24px, 4vw, 44px); }
.lead-art .panda { width: 104px; height: 104px; }
@media (min-width: 760px) { .lead { grid-template-columns: 140px 1fr; } .lead-art .panda { width: 128px; height: 128px; } }
.lead h2 { font-size: clamp(1.5rem, 1.5vw + 1rem, 2rem); }
.lead p { color: var(--secondary); }
.field-label { display: block; font-weight: 700; margin-bottom: 6px; }
.lead-row { display: flex; flex-wrap: wrap; gap: 10px; }
.field {
  flex: 1 1 240px; min-height: 52px; padding: 12px 18px; border-radius: 999px; border: 1.5px solid var(--stroke);
  background: var(--bg); color: var(--text); font: inherit; font-size: 1.05rem;
}
.field:focus { outline: 3px solid var(--tint); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 0.95rem; color: var(--secondary); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--ember-deep); }
.form-msg { margin: 12px 0 0; font-weight: 650; min-height: 1.6em; }
.form-msg.ok { color: var(--success); }
.form-msg.bad { color: #c62828; }
@media (prefers-color-scheme: dark) { .form-msg.bad { color: #ff6b66; } }
textarea.field { border-radius: 18px; min-height: 120px; resize: vertical; width: 100%; }

/* ---------- Prose (legal, guides) ---------- */
.prose { max-width: 74ch; }
.prose h2 { font-size: clamp(1.4rem, 1.2vw + 1rem, 1.8rem); margin-top: 2em; scroll-margin-top: 20px; }
.prose h3 { margin-top: 1.6em; }
.prose li + li { margin-top: 0.5em; }
.prose blockquote { margin: 1.5em 0; padding: 16px 22px; border-radius: 18px; background: var(--raised); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.98rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--stroke); vertical-align: top; }
.prose .callout { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 20px 22px; margin: 1.5em 0; }
.toc { font-size: 0.98rem; }
.toc ol { margin: 0; }
.meta { font-size: 0.95rem; opacity: 0.85; margin-top: 12px; }
.layout-aside { display: grid; gap: 40px; }
@media (min-width: 980px) { .layout-aside { grid-template-columns: minmax(0, 1fr) 300px; } .layout-aside aside { position: sticky; top: 24px; align-self: start; } }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 14px; font-size: 0.92rem; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 6px; opacity: 0.7; }

.guide-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); transition: transform 0.15s ease; }
.guide-card:hover { transform: translateY(-2px); }
.guide-card h3 { color: var(--text); }
.guide-card p { color: var(--secondary); }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(56px, 8vw, 96px); background: var(--raised); padding-block: 48px 28px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.footer-brand { grid-column: 1 / -1; max-width: 420px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } .footer-brand { grid-column: auto; } }
.site-footer h2 { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; color: var(--secondary); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li a { color: var(--text); text-decoration: none; display: inline-block; padding: 4px 0; word-break: break-word; }
.site-footer li a:hover { text-decoration: underline; }
.site-footer .brand { color: var(--text); margin-bottom: 10px; }
.site-footer p { color: var(--secondary); }
.footer-small { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--stroke); font-size: 0.88rem; color: var(--secondary); }
.footer-small p { margin: 0 0 4px; }

.status-box { display: none; }
.status-box.show { display: block; }

/* =====================================================================================================================
   Motion. Everything below only applies when the script that drives it is on (.js) and the person hasn't asked the system
   to reduce motion (.still). Without either, the page is the same content, still. Only transform and opacity animate.
   ===================================================================================================================== */
:root { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-inout: cubic-bezier(0.76, 0, 0.24, 1); --hero-delay: 0.15s; }
.intro-on { --hero-delay: 2.15s; }
.intro-skip { --hero-delay: 0.35s; }

/* ---------- The opening ---------- */
.intro { display: none; }
.intro-on .intro {
  display: block; position: fixed; inset: 0; z-index: 100; background: #6bc4fd; color: #2c262a; cursor: pointer;
  animation: intro-lift 1s var(--ease-inout) 1.85s forwards;
}
.intro-on .intro::after { content: ""; position: absolute; left: -25%; right: -25%; bottom: -90px; height: 180px; border-radius: 50%; background: #6bc4fd; }
@media (prefers-color-scheme: dark) {
  .intro-on .intro, .intro-on .intro::after { background: #1b1638; color: #fceee1; }
}
.intro-skip .intro { animation: intro-lift 0.7s var(--ease-inout) forwards !important; }
@keyframes intro-lift { to { transform: translateY(calc(-100% - 100px)); visibility: hidden; pointer-events: none; } }
.intro-center { position: absolute; left: 50%; top: 46%; width: 280px; height: 280px; transform: translate(-50%, -50%); display: grid; place-items: center; }
.intro-sun {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #ffd35a 0%, #ffbe2e 45%, #f7931e 100%);
  animation: sun-rise 1.2s var(--ease-out) 0.05s both;
}
.intro-panda { position: relative; width: 210px; height: 210px; margin-top: 70px; animation: panda-in 0.9s var(--ease-out) 0.35s both; }
.intro-word {
  position: absolute; left: 0; right: 0; top: calc(46% + 170px); margin: 0; text-align: center;
  font-weight: 800; font-size: clamp(2.6rem, 6vw, 4.2rem); letter-spacing: -0.035em; animation: word-in 0.8s var(--ease-out) 0.65s both;
}
.intro-item {
  position: absolute; left: var(--x); top: var(--y); width: calc(var(--s) * 0.72); height: auto; border-radius: 18px;
  transform: translate(-50%, -50%) rotate(var(--r)); filter: drop-shadow(0 10px 18px rgba(20, 20, 40, 0.18));
  animation: item-in 1s var(--ease-out) var(--d) both, item-float 3.2s ease-in-out calc(var(--d) + 1s) infinite alternate;
}
@media (min-width: 760px) { .intro-item { width: var(--s); } }
@keyframes sun-rise { from { transform: translateY(160px) scale(0.55); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes panda-in { from { transform: translateY(40px) scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes word-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes item-in {
  from { transform: translate(-50%, -50%) translateY(90px) rotate(calc(var(--r) * -2)) scale(0.3); opacity: 0; }
  to { transform: translate(-50%, -50%) rotate(var(--r)); opacity: 1; }
}
@keyframes item-float { to { transform: translate(-50%, -50%) translateY(-14px) rotate(calc(var(--r) * -0.6)); } }

/* ---------- Hero entrance ---------- */
.js:not(.still) .hero-title .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.js:not(.still) .hero-title .line > span { display: inline-block; transform: translateY(108%); animation: line-up 1.05s var(--ease-out) var(--hero-delay) forwards; }
.js:not(.still) .hero-title .line + .line > span { animation-delay: calc(var(--hero-delay) + 0.12s); }
.js:not(.still) .hero .rise { opacity: 0; animation: rise-in 0.9s var(--ease-out) calc(var(--hero-delay) + 0.3s) forwards; }
.js:not(.still) .hero .rise.lede { animation-delay: calc(var(--hero-delay) + 0.35s); }
.js:not(.still) .hero .rise.cta-row { animation-delay: calc(var(--hero-delay) + 0.45s); }
.js:not(.still) .hero .rise.note { animation-delay: calc(var(--hero-delay) + 0.55s); }
.js:not(.still) .hero .rise.eyebrow { animation-delay: var(--hero-delay); }
.js:not(.still) .hero-phone { animation: phone-in 1.3s var(--ease-out) calc(var(--hero-delay) + 0.15s) both; }
.js:not(.still) .page-hero > * { animation: rise-in 0.8s var(--ease-out) both; }
.js:not(.still) .page-hero > :nth-child(2) { animation-delay: 0.08s; }
.js:not(.still) .page-hero > :nth-child(3) { animation-delay: 0.16s; }
.js:not(.still) .page-hero > :nth-child(n + 4) { animation-delay: 0.24s; }
@keyframes line-up { to { transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes phone-in { from { opacity: 0; transform: translateY(90px) rotate(7deg) scale(0.94); } to { opacity: 1; transform: none; } }

/* Things that float near the phone, and parallax (the script sets --py in px) */
.hero-phone { translate: 0 calc(var(--py, 0) * 1px); }
.floaty { position: absolute; display: none; z-index: 2; translate: 0 calc(var(--py, 0) * 1px); filter: drop-shadow(0 12px 18px rgba(44, 38, 42, 0.2)); animation: bob 5s ease-in-out infinite alternate; }
.floaty-a { left: -8px; bottom: 30px; width: 124px; height: auto; }
.floaty-b { right: 4%; top: 6%; width: 84px; height: auto; animation-delay: -2s; }
.floaty-c { right: -6px; bottom: 34%; width: 110px; height: auto; border-radius: 22px; animation-delay: -3.5s; }
@media (min-width: 900px) { .floaty { display: block; } }
.js:not(.still) .floaty { animation: pop-in 0.9s var(--ease-out) calc(var(--hero-delay) + 0.6s) both, bob 5s ease-in-out calc(var(--hero-delay) + 1.5s) infinite alternate; }
.js:not(.still) .floaty-b { animation-delay: calc(var(--hero-delay) + 0.75s), calc(var(--hero-delay) + 1.6s); }
.js:not(.still) .floaty-c { animation-delay: calc(var(--hero-delay) + 0.9s), calc(var(--hero-delay) + 1.7s); }
@keyframes bob { from { transform: translateY(-8px) rotate(-4deg); } to { transform: translateY(10px) rotate(4deg); } }
@keyframes pop-in { from { opacity: 0; scale: 0.3; } to { opacity: 1; scale: 1; } }
.bump, .drift, .finale-rocket { translate: 0 calc(var(--py, 0) * 1px); }

/* ---------- Sticky header: a floating pill once the sky is behind you ---------- */
.stuck .sky { padding-top: 72px; }
.stuck .site-header {
  position: fixed; top: 10px; left: 50%; translate: -50% 0; z-index: 50; width: min(1100px, calc(100% - 20px)); max-width: none;
  padding: 6px 8px 6px 14px; border-radius: 999px; color: var(--text);
  background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  box-shadow: var(--shadow); border: 1px solid var(--stroke);
}
.js:not(.still).stuck .site-header { animation: header-in 0.5s var(--ease-out); }
.stuck .site-nav ul a:hover, .stuck .site-nav ul a[aria-current="page"], .stuck .menu summary { background: var(--raised); }
.stuck .brand { font-size: 1.1rem; }
.stuck .brand img { width: 34px; height: 34px; }
@keyframes header-in { from { transform: translateY(-140%); } to { transform: none; } }

.read-progress { position: fixed; top: 0; left: 0; z-index: 60; width: 100%; height: 3px; background: var(--ember-deep); transform-origin: 0 50%; transform: scaleX(var(--read, 0)); }

/* ---------- Reveal on scroll ---------- */
.js:not(.still) .reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s var(--ease-out), transform 1s var(--ease-out); transition-delay: var(--rd, 0s); }
.js:not(.still) .reveal.in { opacity: 1; transform: none; }
@media (hover: hover) {
  .grid > .card { transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out); }
  .grid > .card:hover { transform: translateY(-4px); }
}

/* ---------- The statement: words light up as you scroll ---------- */
.statement { padding-block: clamp(56px, 9vw, 130px) clamp(16px, 3vw, 40px); }
.statement-text { margin: 0; max-width: 1040px; font-size: clamp(1.75rem, 3.3vw + 0.6rem, 3.35rem); line-height: 1.17; font-weight: 800; letter-spacing: -0.028em; text-wrap: pretty; }
.js:not(.still) [data-words] .w { opacity: 0.15; transition: opacity 0.4s ease; }
.js:not(.still) [data-words] .w.lit { opacity: 1; }

/* ---------- Numbers ---------- */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { min-height: 180px; padding: 18px; gap: 18px; border-radius: 20px; }
  .stat-num { font-size: 3rem; }
  .stat-label { font-size: 0.95rem; }
}
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 230px; padding: 26px 28px; border-radius: var(--radius); color: #2c262a; transform-origin: 50% 100%; }
.stat-num { margin: 0; font-size: clamp(3.6rem, 6vw, 5.4rem); line-height: 0.95; }
.stat-label { margin: 0; font-weight: 650; font-size: 1.08rem; line-height: 1.4; max-width: 26ch; }
.stat-sun { background: linear-gradient(160deg, #ffd35a, #ffc233); }
.stat-sky { background: linear-gradient(160deg, #8fd3fe, #6bc4fd); }
.stat-night { background: linear-gradient(160deg, #2e2558, #120f2a); color: #fceee1; }
.stat-sunset { background: linear-gradient(160deg, #fcd08a, #f5a25a); }
.stat-pro { background: var(--pro); color: #fff; }
.stat-leaf { background: linear-gradient(160deg, #6fdcb6, #3fc495); }
.js:not(.still) .stat.reveal { transform: translateY(70px) scaleY(0.82); }
.js:not(.still) .stat.reveal.in { transform: none; }

/* ---------- The story: the phone stays while the steps go by ---------- */
.story-num { display: inline-block; font-size: 0.95rem; color: var(--tint); margin-bottom: 4px; }
.story-step h3 { font-size: clamp(1.5rem, 1.6vw + 1rem, 2.1rem); }
.story-step ul { padding-left: 0; list-style: none; }
.story-step li { position: relative; padding-left: 30px; }
.story-step li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 14px; height: 14px; border-radius: 4px; background: var(--ember); }
.story-step + .story-step { margin-top: 64px; }
.story-inline .screen { width: min(280px, 70vw); margin: 28px auto 0; }
.story-stage { display: none; }
.story-phone { position: relative; width: min(300px, calc((100vh - 200px) * 0.46)); margin-inline: auto; }
.story-shot { position: absolute; inset: 0 auto auto 0; width: 100%; opacity: 0; transform: translateY(28px) scale(0.96); transition: opacity 0.6s ease, transform 0.8s var(--ease-out); }
.story-shot:first-child { position: relative; }
.story-shot.is-active { opacity: 1; transform: none; }
.story-dots { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.story-dots span { width: 8px; height: 8px; border-radius: 8px; background: var(--stroke); background: color-mix(in srgb, var(--text) 18%, transparent); transition: width 0.4s var(--ease-out), background-color 0.4s; }
.story-dots span.is-active { width: 30px; background: var(--ember-deep); }
@media (min-width: 900px) {
  .story { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; }
  .story-stage { display: block; position: sticky; top: max(90px, calc(50vh - 340px)); align-self: start; }
  .story-inline { display: none; }
  .story-step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; }
  .story-step + .story-step { margin-top: 0; }
  .js:not(.still) .story-step { opacity: 0.25; transition: opacity 0.5s ease; }
  .js .story-step.is-active { opacity: 1; }
}

/* ---------- The rewards panel grows into place ---------- */
.panel-sky { position: relative; }
.js:not(.still) [data-grow] { clip-path: inset(calc((1 - var(--p, 1)) * 7%) calc((1 - var(--p, 1)) * 9%) round 32px); }
.drift { position: absolute; display: none; z-index: 1; height: auto; filter: drop-shadow(0 10px 16px rgba(44, 38, 42, 0.18)); animation: bob 6s ease-in-out infinite alternate; }
.drift-1 { right: 5%; top: 18px; width: 80px; }
.drift-2 { right: 2%; bottom: 6px; width: 60px; animation-delay: -3s; }
.panel-sky .strip { gap: 12px; }
.panel-sky .badge { width: 62px; height: 62px; }
@media (min-width: 900px) { .drift { display: block; } }

/* ---------- The ending: the sky comes back ---------- */
.finale { position: relative; overflow-x: clip; margin-top: clamp(56px, 8vw, 96px); padding: clamp(110px, 13vw, 170px) 0 clamp(80px, 10vw, 130px); background: var(--sky); color: var(--sky-ink); }
.finale::before { content: ""; position: absolute; left: -15%; right: -15%; top: -1px; height: 64px; background: var(--bg); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.finale-title { font-size: clamp(2.2rem, 4.8vw + 0.6rem, 4.4rem); max-width: 17ch; margin-inline: auto; letter-spacing: -0.03em; }
.finale p { font-size: 1.15rem; }
.finale-rocket { width: 140px; height: auto; margin: 0 auto 14px; filter: drop-shadow(0 14px 20px rgba(44, 38, 42, 0.22)); }
main:has(> .finale:last-child) + .site-footer { margin-top: 0; }

/* Our own eased wheel scrolling drives the page frame by frame, so the browser must not smooth each step again. */
html.smooth { scroll-behavior: auto; }
