/* ==========================================================================
   BP Log — marketing site
   Design language: warm paper canvas, one maroon accent used as punctuation,
   compressed grotesk display type, hairline elevation, ECG line as the
   signature decorative motif. Palette is taken 1:1 from the app's own asset
   catalogue (BP Log/Images.xcassets/Colors) so web and app never drift apart.
   ========================================================================== */

/* Fonts are self-hosted: no request leaves the visitor's browser for a
   third-party server. Both families are variable fonts covering the whole
   weight range the site uses (Inter 400–700, Inter Tight 500–700), so each
   subset is a single file. The latin-ext files are declared but only fetched
   if a glyph in that range is ever rendered — no current page needs one. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/inter-tight-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/inter-tight-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* surfaces & ink — light */
  --paper:        #faf6f3;
  --paper-raised: #ffffff;
  --paper-sunk:   #f3ece7;
  --cream:        #fff1e6;
  --ink:          #241f1d;
  --pencil:       #55504b;
  --graphite:     #8c8178;
  --line:         #e7ddd5;
  --line-strong:  #d8cabf;

  /* brand */
  --brand:        #840005;
  --brand-soft:   #b52626;
  --brand-ink:    #5c0003;
  --amber:        #e8a93d;
  --on-brand:     #fffaf6;

  /* measurement series — identical to the app's chart tokens */
  --sys:    #b52626;
  --dia:    #2e6fd9;
  --pulse:  #e8a93d;
  --weight: #8e5fd1;
  --pp:     #17824d;
  --map:    #df2089;

  /* WHO classification ramp — identical to bplLevel0…6 */
  --l0: #4fa8d8;
  --l1: #4fb88f;
  --l2: #2e9c74;
  --l3: #e8b23d;
  --l4: #d9722e;
  --l5: #b8391f;
  --l6: #6e0000;

  --tint-brand:  rgba(132, 0, 5, .08);
  --tint-amber:  rgba(232, 169, 61, .16);
  --glass:       rgba(255, 255, 255, .72);
  --glass-line:  rgba(255, 255, 255, .6);

  --shadow-hair: 0 1px 0 rgba(36, 31, 29, .04);
  --shadow-soft: 0 1px 2px rgba(36, 31, 29, .05), 0 10px 26px -16px rgba(36, 31, 29, .22);
  --shadow-lift: 0 2px 4px rgba(36, 31, 29, .06), 0 22px 48px -22px rgba(36, 31, 29, .34);
  --shadow-cta:  0 10px 22px -12px rgba(132, 0, 5, .6);

  --r:      10px;
  --r-lg:   16px;
  --r-img:  18px;
  --r-pill: 999px;

  --max: 1200px;
  --gutter: 26px;

  --display: 'Inter Tight', 'Helvetica Neue', system-ui, sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  color-scheme: light;
}

/* dark — system preference, unless the visitor forced light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #17130f;
    --paper-raised: #221c18;
    --paper-sunk:   #120f0c;
    --cream:        #2a211b;
    --ink:          #fbf6f2;
    --pencil:       #b8ada3;
    --graphite:     #7a6f66;
    --line:         #332b25;
    --line-strong:  #453a32;

    --brand:        #c43a3a;
    --brand-soft:   #e0655f;
    --brand-ink:    #f0a5a0;
    --amber:        #f5c25c;
    --on-brand:     #fffaf6;

    --sys:    #f26a6a;
    --dia:    #6fa8f4;
    --pulse:  #f5c25c;
    --weight: #b497e8;
    --pp:     #3dbf7a;
    --map:    #f062aa;

    --l0: #6fc3f0;
    --l1: #6fd9ae;
    --l2: #3dc28f;
    --l3: #f5c25c;
    --l4: #f08c4a;
    --l5: #e0552f;
    --l6: #d9463d;

    --tint-brand: rgba(196, 58, 58, .14);
    --tint-amber: rgba(245, 194, 92, .14);
    --glass:      rgba(34, 28, 24, .68);
    --glass-line: rgba(255, 250, 246, .1);

    --shadow-hair: 0 1px 0 rgba(0, 0, 0, .3);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 30px -18px rgba(0, 0, 0, .8);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .4), 0 26px 54px -24px rgba(0, 0, 0, .9);
    --shadow-cta:  0 12px 26px -12px rgba(196, 58, 58, .7);

    color-scheme: dark;
  }
}

/* dark — explicitly chosen */
:root[data-theme="dark"] {
  --paper:        #17130f;
  --paper-raised: #221c18;
  --paper-sunk:   #120f0c;
  --cream:        #2a211b;
  --ink:          #fbf6f2;
  --pencil:       #b8ada3;
  --graphite:     #7a6f66;
  --line:         #332b25;
  --line-strong:  #453a32;

  --brand:        #c43a3a;
  --brand-soft:   #e0655f;
  --brand-ink:    #f0a5a0;
  --amber:        #f5c25c;
  --on-brand:     #fffaf6;

  --sys:    #f26a6a;
  --dia:    #6fa8f4;
  --pulse:  #f5c25c;
  --weight: #b497e8;
  --pp:     #3dbf7a;
  --map:    #f062aa;

  --l0: #6fc3f0;
  --l1: #6fd9ae;
  --l2: #3dc28f;
  --l3: #f5c25c;
  --l4: #f08c4a;
  --l5: #e0552f;
  --l6: #d9463d;

  --tint-brand: rgba(196, 58, 58, .14);
  --tint-amber: rgba(245, 194, 92, .14);
  --glass:      rgba(34, 28, 24, .68);
  --glass-line: rgba(255, 250, 246, .1);

  --shadow-hair: 0 1px 0 rgba(0, 0, 0, .3);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 30px -18px rgba(0, 0, 0, .8);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .4), 0 26px 54px -24px rgba(0, 0, 0, .9);
  --shadow-cta:  0 12px 26px -12px rgba(196, 58, 58, .7);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--pencil);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

img, svg { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
[hidden] { display: none !important; }

::selection { background: var(--brand); color: var(--on-brand); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

/* --------------------------------------------------------------------------
   3. Type
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 600;
  margin: 0;
  letter-spacing: -.022em;
  line-height: 1.1;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.4vw, 3.6rem); letter-spacing: -.032em; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); letter-spacing: -.028em; }
h3 { font-size: 1.16rem; letter-spacing: -.014em; }
h4 { font-size: .98rem; letter-spacing: -.01em; }

.lede { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--pencil); max-width: 56ch; text-wrap: pretty; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brand); margin: 0 0 16px;
}
.eyebrow::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex: none;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse-dot 2.6s var(--ease-io) infinite;
}
@keyframes pulse-dot {
  0%, 70%, 100% { box-shadow: 0 0 0 0 rgba(132, 0, 5, .45); }
  35%           { box-shadow: 0 0 0 7px rgba(132, 0, 5, 0); }
}

.section-head { max-width: 64ch; margin-bottom: 44px; }
.section-head p { color: var(--pencil); margin-top: 14px; font-size: 1.04rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }

strong { color: var(--ink); font-weight: 600; }
em.mark { font-style: normal; color: var(--brand); font-weight: 600; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

/* --------------------------------------------------------------------------
   4. Sections & dividers
   -------------------------------------------------------------------------- */
section { padding: clamp(64px, 8vw, 108px) 0; position: relative; }
.section-tight { padding: clamp(40px, 5vw, 64px) 0; }
.section-alt { background: var(--paper-sunk); }
.section-cream { background: var(--cream); }

.ecg-divider {
  display: block; width: 100%; height: 54px; overflow: hidden;
  color: var(--brand); opacity: .28;
}
.ecg-divider svg { width: 100%; height: 54px; }
.ecg-divider path {
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   5. Buttons & chips
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px; border-radius: var(--r);
  font-family: var(--body); font-weight: 600; font-size: .98rem; line-height: 1.1;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease),
              background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(0) scale(.985); }

.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-cta); }
.btn-primary:hover { background: var(--brand-ink); transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(132, 0, 5, .68); }

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

.btn-sm { padding: 9px 16px; font-size: .86rem; border-radius: 8px; }
.btn-lg { padding: 16px 30px; font-size: 1.04rem; }

.btn-store {
  background: var(--ink); color: var(--paper); box-shadow: var(--shadow-soft);
}
.btn-store:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: var(--r-pill);
  background: var(--paper-raised); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 500; color: var(--pencil);
  box-shadow: var(--shadow-hair);
}
.chip svg { width: 14px; height: 14px; color: var(--brand); flex: none; }
.chip-new {
  background: var(--tint-brand); border-color: transparent; color: var(--brand);
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .68rem;
  padding: 4px 10px;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* --------------------------------------------------------------------------
   6. Navigation
   -------------------------------------------------------------------------- */
.site-nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-nav.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 14px 26px -26px rgba(36, 31, 29, .5); }
.site-nav .wrap {
  display: flex; align-items: center; gap: 18px;
  height: 72px; transition: height .3s var(--ease);
}
.site-nav.is-scrolled .wrap { height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand .mark {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  background: var(--brand); padding: 4px;
  box-shadow: var(--shadow-hair);
  transition: transform .3s var(--ease);
}
.brand:hover .mark { transform: rotate(-4deg) scale(1.06); }
.brand .name {
  font-family: var(--display); font-weight: 700; font-size: 1.06rem;
  color: var(--ink); letter-spacing: -.02em; white-space: nowrap;
}
@media (max-width: 430px) { .brand .name { font-size: .95rem; } }
@media (max-width: 360px) { .brand .name { display: none; } }

.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a {
  font-family: var(--display); font-weight: 600; font-size: .93rem; color: var(--pencil);
  position: relative; padding: 4px 0;
  transition: color .2s var(--ease);
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--brand); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-right { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 2px; background: var(--paper-raised);
}
.lang-switch button {
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--body); font-size: .74rem; font-weight: 700; letter-spacing: .05em;
  color: var(--graphite); padding: 5px 11px; border-radius: var(--r-pill);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.lang-switch button.active { background: var(--brand); color: var(--on-brand); }

.theme-toggle {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--paper-raised); color: var(--pencil); cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .3s var(--ease);
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); transform: rotate(18deg); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
}

.nav-toggle {
  display: none; width: 38px; height: 38px; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: var(--paper-raised);
  color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* scroll progress */
.scroll-progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  transform: scaleX(var(--p, 0)); transform-origin: left;
  background: linear-gradient(90deg, var(--brand), var(--amber));
}

/* mobile drawer */
.mobile-nav {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(20, 15, 12, .45); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.mobile-nav.open { opacity: 1; pointer-events: auto; }
.mobile-nav-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(330px, 84vw);
  background: var(--paper); border-left: 1px solid var(--line);
  padding: 74px 26px 26px; display: flex; flex-direction: column; gap: 4px;
  transform: translateX(100%); transition: transform .42s var(--ease);
  overflow-y: auto;
}
.mobile-nav.open .mobile-nav-panel { transform: none; }
.mobile-nav-panel a {
  font-family: var(--display); font-weight: 600; font-size: 1.06rem; color: var(--ink);
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.mobile-nav-panel a.btn { border-bottom: 0; justify-content: center; margin-top: 18px; }
.mobile-nav-close {
  position: absolute; top: 20px; right: 22px; width: 38px; height: 38px;
  display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper-raised); color: var(--ink); cursor: pointer;
}
.mobile-nav-close svg { width: 19px; height: 19px; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
  .nav-right .btn-primary { display: none; }
}

/* --------------------------------------------------------------------------
   7. Motion primitives
   -------------------------------------------------------------------------- */
.js-motion [data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--d, 0) * 80ms);
  will-change: opacity, transform;
}
.js-motion [data-reveal="left"]  { transform: translateX(-32px); }
.js-motion [data-reveal="right"] { transform: translateX(32px); }
.js-motion [data-reveal="zoom"]  { transform: scale(.94); }
.js-motion [data-reveal].is-visible { opacity: 1; transform: none; }

/* words in the hero headline slide up individually */
.js-motion .word-anim > span {
  display: inline-block; opacity: 0; transform: translateY(.55em) rotate(1.5deg);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms);
}
.js-motion .word-anim.is-visible > span { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-motion [data-reveal],
  .js-motion .word-anim > span {
    transition: none !important; opacity: 1 !important; transform: none !important;
  }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */
.hero { position: relative; padding: clamp(48px, 7vw, 86px) 0 clamp(56px, 7vw, 96px); overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background:
    radial-gradient(58% 46% at 78% 20%, var(--tint-brand), transparent 70%),
    radial-gradient(46% 40% at 12% 70%, var(--tint-amber), transparent 72%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  gap: clamp(32px, 5vw, 68px); align-items: center;
}
.hero-copy { max-width: 34ch; }
.hero h1 { margin-bottom: 20px; }
.hero .lede { margin-bottom: 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }
.hero-note { font-size: .84rem; color: var(--graphite); }

/* the ECG trace that runs behind the hero */
.hero-ecg {
  position: absolute; left: 0; right: 0; top: 52%; height: 190px;
  pointer-events: none; color: var(--brand); opacity: .16; z-index: 0;
}
.hero-ecg svg { width: 200%; height: 100%; animation: ecg-scroll 26s linear infinite; }
.hero-ecg path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes ecg-scroll { to { transform: translateX(-50%); } }

/* --------------------------------------------------------------------------
   9. Device frames
   -------------------------------------------------------------------------- */
.phone {
  /* The bezel takes its height from the screen inside it rather than from an
     aspect-ratio + height:100% chain. That way the frame can never come out
     shorter than the screenshot it is wrapping, in any engine. */
  position: relative; width: 100%; max-width: 310px; margin: 0 auto;
  border-radius: 46px; padding: 11px;
  background: linear-gradient(160deg, #34302c, #100d0b 45%, #3b3733);
  box-shadow: var(--shadow-lift), inset 0 0 0 1px rgba(255, 255, 255, .09);
}
.phone::after {
  content: ''; position: absolute; inset: 11px; border-radius: 36px; pointer-events: none;
  background: linear-gradient(148deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, 0) 34%);
  z-index: 3;
}
.phone .screen {
  position: relative; display: block; width: 100%;
  aspect-ratio: 1320 / 2868;
  border-radius: 36px; overflow: hidden;
  background: var(--paper-sunk);
  isolation: isolate;
}
.phone .screen img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  /* rounded on the image itself: Safari does not apply an ancestor's rounded
     overflow clip to absolutely-positioned children once that ancestor animates
     a transform, which let the screenshot spill past the bottom of the bezel */
  border-radius: 36px;
}
.phone-float { animation: float 7s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-14px) rotate(-.5deg); }
}

.tablet {
  position: relative; width: 100%; max-width: 720px; margin: 0 auto;
  border-radius: 26px; padding: 11px;
  background: linear-gradient(160deg, #34302c, #100d0b 45%, #3b3733);
  box-shadow: var(--shadow-lift), inset 0 0 0 1px rgba(255, 255, 255, .09);
}
.tablet .screen {
  position: relative; display: block; width: 100%;
  aspect-ratio: 2752 / 2064;
  border-radius: 16px; overflow: hidden;
  background: var(--paper-sunk);
  isolation: isolate;
}
.tablet .screen img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 16px;
}

/* floating glass cards next to the hero phone */
.hero-stage { position: relative; }
.float-card {
  position: absolute; z-index: 4;
  background: var(--glass); border: 1px solid var(--glass-line);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-radius: 14px; padding: 12px 15px;
  box-shadow: var(--shadow-lift);
  min-width: 152px;
}
.float-card .label {
  font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--graphite); margin-bottom: 4px;
}
.float-card .value {
  font-family: var(--display); font-size: 1.6rem; font-weight: 700; color: var(--ink);
  letter-spacing: -.03em; line-height: 1;
}
.float-card .sub { font-size: .76rem; color: var(--pencil); margin-top: 3px; }
.float-card.top { top: 4%; left: -13%; animation: float 8s ease-in-out infinite; }
.float-card.bottom { bottom: 9%; right: -11%; animation: float 8s ease-in-out .9s infinite; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: none; }
  .float-card.top { left: 0; }
  .float-card.bottom { right: 0; }
}
@media (max-width: 560px) {
  .float-card { display: none; }
}

/* --------------------------------------------------------------------------
   10. Cards & bento
   -------------------------------------------------------------------------- */
.card {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px;
  box-shadow: var(--shadow-hair);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.card-tilt:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); border-color: var(--line-strong); }

.feature-icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--tint-brand); color: var(--brand); margin-bottom: 16px;
  transition: transform .35s var(--ease), background-color .35s var(--ease);
}
.feature-icon svg { width: 21px; height: 21px; }
.card-tilt:hover .feature-icon { transform: scale(1.08) rotate(-5deg); }
.card h3 { margin-bottom: 8px; }
.card p { font-size: .93rem; }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.b-2 { grid-column: span 2; }
.b-3 { grid-column: span 3; }
.b-4 { grid-column: span 4; }
.b-6 { grid-column: span 6; }
@media (max-width: 900px) { .b-2, .b-3, .b-4 { grid-column: span 3; } }
@media (max-width: 620px) { .bento { grid-template-columns: 1fr; } .b-2, .b-3, .b-4, .b-6 { grid-column: auto; } }

/* --------------------------------------------------------------------------
   11. Split rows (image + copy, alternating)
   -------------------------------------------------------------------------- */
.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(30px, 5vw, 72px); align-items: center;
}
.split.reverse .split-media { order: 2; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split.reverse .split-media { order: 0; }
}

.checklist { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 13px; }
.checklist li { display: flex; gap: 11px; align-items: flex-start; font-size: .96rem; }
.checklist li svg { width: 19px; height: 19px; color: var(--brand); flex: none; margin-top: 2px; }

/* --------------------------------------------------------------------------
   12. Scrollytelling cockpit
   -------------------------------------------------------------------------- */
.scrolly { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.scrolly-steps { display: grid; gap: clamp(28px, 8vh, 64px); }
.scrolly-step {
  border-left: 2px solid var(--line); padding: 4px 0 4px 24px;
  transition: border-color .5s var(--ease), opacity .5s var(--ease);
  opacity: .45;
}
.scrolly-step.is-active { border-left-color: var(--brand); opacity: 1; }
.scrolly-step .step-no {
  font-family: var(--display); font-size: .74rem; font-weight: 700; letter-spacing: .1em;
  color: var(--brand); text-transform: uppercase; margin-bottom: 8px; display: block;
}
.scrolly-step h3 { margin-bottom: 8px; }
.scrolly-step p { font-size: .96rem; }
.scrolly-sticky { position: sticky; top: 110px; }
.scrolly-sticky .phone .screen img {
  opacity: 0; transition: opacity .7s var(--ease), transform .9s var(--ease);
  transform: scale(1.03);
}
.scrolly-sticky .phone .screen img.is-active { opacity: 1; transform: none; }
@media (max-width: 900px) {
  .scrolly { grid-template-columns: 1fr; }
  .scrolly-sticky { position: static; order: -1; margin-bottom: 30px; }
  .scrolly-step { opacity: 1; }
}

/* --------------------------------------------------------------------------
   13. Data-viz widgets
   -------------------------------------------------------------------------- */
.stat-panel {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-soft);
}
.stat-panel .panel-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.stat-panel .panel-head svg { width: 18px; height: 18px; color: var(--brand); }
.stat-panel .panel-head h4 { font-size: .95rem; }

.big-number {
  font-family: var(--display); font-size: clamp(2.6rem, 5vw, 3.4rem); font-weight: 700;
  color: var(--ink); letter-spacing: -.04em; line-height: 1;
}
.big-number small { font-size: .42em; font-weight: 600; color: var(--pencil); margin-left: 4px; letter-spacing: -.01em; }

/* time-in-range stacked bar */
.tir-bar { display: flex; height: 14px; border-radius: var(--r-pill); overflow: hidden; margin: 18px 0 10px; background: var(--paper-sunk); }
.tir-bar span {
  display: block; width: 0;
  transition: width 1.4s var(--ease); transition-delay: calc(var(--i, 0) * 110ms);
}
.is-visible .tir-bar span { width: var(--w); }
.tir-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .78rem; color: var(--pencil); }
.tir-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }

.trend { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--l4); font-weight: 600; }
.trend svg { width: 15px; height: 15px; }

/* dipper badge */
.dipper-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--l4); color: #fff; font-size: .78rem; font-weight: 700;
}

.metric-row { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 6px; }
.metric-row .metric .label { font-size: .78rem; color: var(--graphite); }
.metric-row .metric .val { font-family: var(--display); font-size: 1.7rem; font-weight: 700; color: var(--ink); letter-spacing: -.03em; line-height: 1.15; }

/* self-drawing summary chart */
.chart-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-soft); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; font-size: .8rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; color: var(--pencil); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-svg .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-svg .series {
  fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
  transition: stroke-dashoffset 2s var(--ease-io);
  transition-delay: calc(var(--i, 0) * 240ms);
}
.is-visible .chart-svg .series { stroke-dashoffset: 0; }
.chart-svg .dot { opacity: 0; transition: opacity .4s var(--ease); transition-delay: 1.6s; }
.is-visible .chart-svg .dot { opacity: 1; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.value-pill {
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 5px 13px 6px; border-radius: var(--r-pill);
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; color: #fff;
}
.value-pill b { font-family: var(--display); font-size: .98rem; letter-spacing: -.01em; }

/* WHO classification ramp */
.who-ramp { display: grid; gap: 8px; margin-top: 4px; }
.who-row { display: grid; grid-template-columns: 158px 1fr auto; gap: 12px; align-items: center; font-size: .85rem; }
.who-row .bar { height: 10px; border-radius: var(--r-pill); width: 0; transition: width 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.is-visible .who-row .bar { width: var(--w); }
.who-row .name { color: var(--ink); font-weight: 500; }
.who-row .range { color: var(--graphite); font-size: .78rem; white-space: nowrap; }
@media (max-width: 560px) { .who-row { grid-template-columns: 118px 1fr; } .who-row .range { display: none; } }

/* animated gauge */
.gauge { width: 100%; max-width: 260px; }
.gauge .needle {
  transform-origin: 100px 88px;
  transform: rotate(-90deg);
  transition: transform 1.6s var(--ease);
}
.is-visible .gauge .needle { transform: rotate(var(--angle, 0deg)); }

/* --------------------------------------------------------------------------
   14. App-icon picker
   -------------------------------------------------------------------------- */
.icon-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 520px; }
.icon-option {
  border: 1px solid var(--line); background: var(--paper-raised); border-radius: var(--r-lg);
  padding: 16px; cursor: pointer; text-align: center;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.icon-option img { width: 100%; border-radius: 22%; box-shadow: var(--shadow-soft); }
.icon-option span {
  display: block; margin-top: 11px; font-size: .82rem; font-weight: 600; color: var(--pencil);
}
.icon-option:hover { transform: translateY(-4px); }
.icon-option.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--tint-brand); }
.icon-option.is-active span { color: var(--brand); }

.icon-stage { display: grid; place-items: center; gap: 16px; }
.icon-stage .icon-big {
  width: 148px; height: 148px; border-radius: 22%;
  box-shadow: var(--shadow-lift);
  transition: opacity .45s var(--ease), transform .45s var(--ease), background-color .45s var(--ease);
}
/* The Dark variant is drawn with a transparent ground so the system's dark
   Home Screen plate shows through — the site has to supply that plate, or the
   icon would float on the page background with no shape at all. */
.icon-stage.on-dark .icon-big,
.icon-stage.on-dark .icon-option img {
  background: linear-gradient(180deg, #1f1f21 0%, #151516 50%, #0b0b0c 100%);
  /* the plate is near-black, so on the dark page it needs a hairline of its own
     or the tile silhouette disappears into the background */
  box-shadow: var(--shadow-lift), inset 0 0 0 1px rgba(255, 250, 246, .12);
}
.icon-variants { display: flex; gap: 10px; }
.icon-variants button {
  border: 1px solid var(--line); background: var(--paper-raised); color: var(--pencil);
  border-radius: var(--r-pill); padding: 6px 14px; font-size: .78rem; font-weight: 600;
  font-family: var(--body); cursor: pointer; transition: all .2s var(--ease);
}
.icon-variants button.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* --------------------------------------------------------------------------
   15. Marquee
   -------------------------------------------------------------------------- */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: marquee 46s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* --------------------------------------------------------------------------
   16. Privacy band
   -------------------------------------------------------------------------- */
.privacy-band {
  background: var(--brand); color: var(--on-brand);
  border-radius: var(--r-lg); padding: clamp(30px, 5vw, 52px);
  position: relative; overflow: hidden;
}
.privacy-band h2, .privacy-band h3 { color: var(--on-brand); }
.privacy-band p { color: rgba(255, 250, 246, .84); }
.privacy-band .ecg-bg {
  position: absolute; inset: auto -5% -20% -5%; height: 200px; opacity: .18; color: var(--amber);
  pointer-events: none;
}
.privacy-band .ecg-bg path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.privacy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 26px; margin-top: 32px; position: relative; }
.privacy-grid .item svg { width: 22px; height: 22px; color: var(--amber); margin-bottom: 10px; }
.privacy-grid .item h3 { font-size: 1rem; margin-bottom: 6px; }
.privacy-grid .item p { font-size: .9rem; }

/* --------------------------------------------------------------------------
   17. Final CTA
   -------------------------------------------------------------------------- */
.cta-final { text-align: center; }
.cta-final .btn { margin-top: 8px; }
.cta-icon {
  width: 88px; height: 88px; border-radius: 22%; margin: 0 auto 24px;
  box-shadow: var(--shadow-lift); animation: float 6s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   18. Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--paper-sunk); border-top: 1px solid var(--line); padding: 56px 0 34px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 {
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--graphite); margin-bottom: 14px; font-family: var(--body); font-weight: 700;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-grid a { font-size: .92rem; color: var(--pencil); transition: color .2s var(--ease); }
.footer-grid a:hover { color: var(--brand); }
.footer-bottom {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: .82rem; color: var(--graphite);
}
.footer-disclaimer { font-size: .82rem; color: var(--graphite); max-width: 62ch; margin-top: 16px; }

/* --------------------------------------------------------------------------
   19. Legal / changelog pages
   -------------------------------------------------------------------------- */
.page-head { padding: clamp(46px, 6vw, 76px) 0 clamp(26px, 3vw, 40px); border-bottom: 1px solid var(--line); }
.page-head p.meta { color: var(--graphite); font-size: .88rem; margin-top: 12px; }

.prose { padding: clamp(34px, 5vw, 60px) 0 clamp(56px, 7vw, 90px); }
.prose h2 { font-size: 1.45rem; margin: 42px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.03rem; margin: 26px 0 8px; }
.prose p, .prose li { font-size: .97rem; }
.prose p + p { margin-top: 12px; }
.prose ul { margin: 12px 0; padding-left: 20px; display: grid; gap: 8px; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.prose .lead { font-size: 1.06rem; color: var(--pencil); }
.prose dl { margin: 12px 0; display: grid; gap: 10px; }
.prose dt { font-weight: 600; color: var(--ink); }
.prose dd { margin: 2px 0 0; }

/* changelog */
.release {
  border-left: 2px solid var(--line); padding: 0 0 34px 26px; position: relative;
}
.release::before {
  content: ''; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--line-strong);
}
.release.latest { border-left-color: var(--brand); }
.release.latest::before { background: var(--brand); border-color: var(--brand); }
.release:last-child { border-left-color: transparent; }
.release .ver {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.release .ver h3 { font-size: 1.22rem; }
.release ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.release li { position: relative; padding-left: 18px; font-size: .95rem; }
.release li::before {
  content: ''; position: absolute; left: 0; top: .62em; width: 6px; height: 6px;
  border-radius: 50%; background: var(--line-strong);
}
.release li.is-new::before { background: var(--brand); }

/* --------------------------------------------------------------------------
   20. Hero reading ticker
   -------------------------------------------------------------------------- */
.reading-card {
  --pill: var(--l2);
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-soft);
  position: relative; overflow: hidden;
}
.reading-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--pill); transition: background-color .6s var(--ease);
}
.reading-card .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.reading-card .bp {
  font-family: var(--display); font-size: 2.1rem; font-weight: 700; letter-spacing: -.04em;
  line-height: 1; display: flex; align-items: baseline; gap: 4px;
}
.reading-card .bp .s { color: var(--sys); }
.reading-card .bp .slash { color: var(--graphite); font-weight: 500; }
.reading-card .bp .d { color: var(--dia); }
.reading-card .bp .unit { font-family: var(--body); font-size: .78rem; font-weight: 500; color: var(--graphite); margin-left: 5px; letter-spacing: 0; }
.reading-card .who {
  font-size: .76rem; font-weight: 700; padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--pill); color: #fff; white-space: nowrap;
  transition: background-color .6s var(--ease);
}
.reading-card .meta { display: flex; gap: 16px; margin-top: 12px; font-size: .82rem; color: var(--pencil); }
.reading-card .meta b { font-family: var(--display); letter-spacing: -.01em; }
.reading-card .meta .p b { color: var(--pulse); }
.reading-card .meta .w b { color: var(--weight); }

.reading-card.is-swapping .bp,
.reading-card.is-swapping .who { animation: swap-in .55s var(--ease); }
@keyframes swap-in {
  0%   { opacity: 0; transform: translateY(9px); }
  100% { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   21. Corrections & small refinements
   -------------------------------------------------------------------------- */

/* checklist entries without an icon get a plain brand dot instead */
.checklist li:not(:has(svg))::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); flex: none; margin-top: .58em;
}

/* the hero ticker sits on glass, not on solid card stock — and keeps the
   absolute positioning it inherits from .float-card */
.float-card.reading-card {
  position: absolute;
  background: var(--glass);
  border-color: var(--glass-line);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  min-width: 216px;
  padding-left: 22px;
}

/* the icon picker inside the stage stays compact */
.icon-stage .icon-picker { max-width: 420px; width: 100%; }

/* section anchors clear the sticky nav */
section[id] { scroll-margin-top: 84px; }

/* --------------------------------------------------------------------------
   22. Shot switchers — scrolly steps and tabbed device shots are also
       hoverable / clickable, not scroll-only
   -------------------------------------------------------------------------- */
.scrolly-step {
  cursor: pointer;
  padding-right: 8px;
  border-radius: 0 var(--r) var(--r) 0;
  transition: border-color .5s var(--ease), opacity .5s var(--ease), background-color .3s var(--ease);
}
.scrolly-step:hover { opacity: 1; background: color-mix(in srgb, var(--brand) 4%, transparent); }
.scrolly-step:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.scrolly-step .step-no { display: flex; align-items: center; gap: 8px; }
.scrolly-step .step-no::after {
  content: ''; width: 0; height: 1px; background: currentColor;
  transition: width .5s var(--ease);
}
.scrolly-step.is-active .step-no::after { width: 26px; }

/* tabbed device shot (Reports section) */
.shot-switch { display: grid; gap: 18px; justify-items: center; }
.shot-switch .phone .screen img {
  opacity: 0; transform: scale(1.03);
  transition: opacity .55s var(--ease), transform .8s var(--ease);
}
.shot-switch .phone .screen img.is-active { opacity: 1; transform: none; }

.shot-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  max-width: 340px;
}
.shot-tabs button {
  font-family: var(--body); font-size: .82rem; font-weight: 600;
  color: var(--pencil); background: var(--paper-raised);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 7px 15px; cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease),
              background-color .25s var(--ease), transform .25s var(--ease);
}
.shot-tabs button:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); }
.shot-tabs button.is-active {
  background: var(--brand); border-color: var(--brand); color: var(--on-brand);
}
/* a hairline progress line that shows the auto-advance is still running */
.shot-tabs button.is-active { position: relative; overflow: hidden; }
