/* pixeljim.com - product landing: cream, glass, scroll, real app shots */
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/barlow-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/barlow-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('../fonts/source-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('../fonts/source-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --bg: #f2eee3;
  --ink: #141311;
  --ink-muted: #4a463d;
  --ink-faint: rgba(20, 19, 17, .45);
  --ink-soft: rgba(20, 19, 17, .72);
  --line-soft: rgba(20, 19, 17, .08);
  --line-mid: rgba(20, 19, 17, .12);
  --line-strong: rgba(20, 19, 17, .22);
  --line-btn: rgba(20, 19, 17, .28);
  --hover-fill: rgba(20, 19, 17, .06);
  --accent: #f2c40f;
  /* Same as fill (matches dark + preferred flat yellow buttons). */
  --accent-deep: #f2c40f;
  /* Links/kickers on cream need darker gold for contrast. */
  --accent-text: #8a6a00;
  --accent-ink: #141311;
  --surface: #fffdf7;
  --glass: rgba(255, 253, 247, .62);
  --glass-line: rgba(20, 19, 17, .12);
  --phone-screen: #f5f2ea;
  --shadow-soft: rgba(31, 26, 12, .1);
  --shadow-panel: rgba(31, 26, 12, .08);
  --footer-wash: rgba(236, 231, 218, .92);
  --glow-a: rgba(242, 196, 15, .42);
  --glow-b: rgba(242, 196, 15, .22);
  --glow-c: rgba(242, 196, 15, .18);
  --glow-d: rgba(242, 196, 15, .14);
  --font-display: 'Barlow Condensed', 'Oswald', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* Match app dark tokens (#121110 / #1d1b18). */
[data-theme='dark'] {
  --bg: #121110;
  --ink: #f0ede6;
  --ink-muted: #b3ada0;
  --ink-faint: rgba(240, 237, 230, .45);
  --ink-soft: rgba(240, 237, 230, .72);
  --line-soft: rgba(240, 237, 230, .08);
  --line-mid: rgba(240, 237, 230, .12);
  --line-strong: rgba(240, 237, 230, .22);
  --line-btn: rgba(240, 237, 230, .28);
  --hover-fill: rgba(240, 237, 230, .08);
  --accent: #f2c40f;
  --accent-deep: #f2c40f;
  --accent-text: #f2c40f;
  --accent-ink: #141311;
  --surface: #1d1b18;
  --glass: rgba(29, 27, 24, .72);
  --glass-line: rgba(240, 237, 230, .12);
  --phone-screen: #121110;
  --shadow-soft: rgba(0, 0, 0, .35);
  --shadow-panel: rgba(0, 0, 0, .35);
  --footer-wash: rgba(18, 17, 16, .92);
  --glow-a: rgba(242, 196, 15, .16);
  --glow-b: rgba(242, 196, 15, .09);
  --glow-c: rgba(242, 196, 15, .07);
  --glow-d: rgba(242, 196, 15, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font: 400 16px/1.55 var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Moving yellow wash behind the page. Fixed so scroll feels alive. */
.glow {
  position: fixed;
  inset: -25% -15%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 48% 42% at 72% 8%, var(--glow-a), transparent 62%),
    radial-gradient(ellipse 36% 32% at 8% 42%, var(--glow-b), transparent 58%),
    radial-gradient(ellipse 40% 28% at 92% 68%, var(--glow-c), transparent 55%),
    radial-gradient(ellipse 50% 36% at 28% 92%, var(--glow-d), transparent 55%);
  animation: glowDrift 22s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes glowDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  35%  { transform: translate3d(-5%, 3%, 0) scale(1.06); }
  70%  { transform: translate3d(4%, -4%, 0) scale(1.04); }
  100% { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

#scroll-track,
footer.site,
main { position: relative; z-index: 2; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--ink); }

.skip-link {
  position: fixed; top: 0; left: 0; transform: translateY(-200%);
  width: 1px; height: 1px; clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; z-index: 1000; pointer-events: none;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.skip-link:focus, .skip-link:focus-visible {
  transform: none; clip: auto; clip-path: none; width: auto; height: auto;
  top: 8px; left: 8px; padding: 12px 20px; pointer-events: auto;
  outline: 3px solid var(--accent); outline-offset: 2px;
}

.mark {
  display: block; width: 36px; height: 36px;
  border-radius: 10px; object-fit: cover; flex: none;
}

header.glass {
  position: fixed;
  top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: 0 10px 32px var(--shadow-soft);
  max-width: calc(100vw - 20px);
}
header.glass a.brand { display: flex; line-height: 0; }
header.glass nav { display: flex; gap: 2px; margin: 0 2px; }
header.glass nav a {
  padding: 8px 11px; border-radius: 9px;
  font: 600 .8rem var(--font-body);
  color: var(--ink-soft); white-space: nowrap;
}
header.glass nav a:hover { background: var(--hover-fill); color: var(--ink); }
.lang-seg {
  display: inline-flex; border: 1px solid var(--glass-line);
  border-radius: 9px; overflow: hidden; flex: none;
}
.lang-seg a {
  padding: 7px 10px; font: 700 .72rem var(--font-body);
  letter-spacing: .06em; color: var(--ink-faint);
}
.lang-seg a.on { background: rgba(242, 196, 15, .3); color: var(--accent-text); }
header.glass .cta {
  display: inline-flex; align-items: center; height: 34px; padding: 0 13px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 .82rem var(--font-body); border-radius: 9px;
  border: 1.5px solid var(--accent-deep);
  box-shadow: 0 1px 0 rgba(255,255,255,.28) inset, 0 2px 8px rgba(138,106,0,.2);
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  header.glass .cta:hover {
    color: var(--accent-ink);
    filter: brightness(1.03);
    box-shadow: 0 1px 0 rgba(255,255,255,.34) inset, 0 4px 12px rgba(138,106,0,.2);
  }
}
@media (max-width: 760px) { header.glass nav { display: none; } }
@media (max-width: 430px) {
  header.glass { gap: 6px; padding: 6px; }
  .lang-seg a { padding: 7px 8px; }
  header.glass .cta { padding: 0 10px; font-size: .78rem; }
}

.chapter {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 110px 24px 12vh;
  max-width: 1120px;
  margin: 0 auto;
}
.chapter.hero {
  grid-template-columns: 1.05fr .95fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 900px) {
  .chapter.hero { grid-template-columns: 1fr; }
}

/* Phone story beats: mockup → card → mockup (Apple/product-page pattern,
   vanilla IO + snap; no GSAP). Desktop layout untouched above. */
@media (max-width: 900px) {
  html.mobile-story {
    scroll-snap-type: y mandatory;
    scroll-padding-top: 12px;
  }
  html.mobile-story .chapter {
    min-height: 0;
    height: auto;
    max-height: none;
    display: block;
    padding: 0;
    max-width: none;
  }
  /* Unwrap feature rows so panel and phone are separate scroll pages. */
  html.mobile-story .feature-row,
  html.mobile-story .feature-row.reverse {
    display: contents;
  }
  html.mobile-story .hero-copy,
  html.mobile-story .chapter > .iphone,
  html.mobile-story .feature-row > .iphone {
    min-height: 100svh;
    min-height: 100dvh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 88px 20px 56px;
    margin: 0 auto;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  html.mobile-story .hero-copy {
    width: 100%;
    max-width: 34rem;
    align-items: flex-start;
    text-align: left;
  }
  /* Cards keep content height (same as before); snap centers the box. */
  html.mobile-story .feature-row > .panel {
    box-sizing: border-box;
    width: calc(100% - 40px);
    max-width: 28rem;
    margin: 10vh auto;
    padding: 16px 16px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }
  /* Phone beats keep a real device width; full-bleed width collapsed the bezel. */
  html.mobile-story .chapter > .iphone,
  html.mobile-story .feature-row > .iphone {
    width: min(236px, 62vw);
    max-width: min(236px, 62vw);
    padding: 72px 0 40px;
    transform: none;
  }
  html.mobile-story .iphone .iphone-device {
    width: 100%;
    flex: none;
  }
  html.mobile-story h1.mega {
    font-size: clamp(2.6rem, 11vw, 3.6rem);
  }
  /* Scroll-linked fade (no CSS transition): outgoing beat fades as the next fills. */
  html.mobile-story .hero-copy,
  html.mobile-story .chapter > .iphone,
  html.mobile-story .feature-row > .panel,
  html.mobile-story .feature-row > .iphone,
  html.mobile-story .chapter.is-active .panel,
  html.mobile-story .chapter.hero .panel,
  html.mobile-story .chapter.is-active .iphone,
  html.mobile-story .chapter.hero .iphone,
  html.mobile-story .chapter.hero .hero-copy {
    opacity: var(--beat-fade, 0);
    transform: translateY(calc((1 - var(--beat-fade, 0)) * 16px));
    transition: none;
  }
  html.mobile-story footer.site {
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .iphone { opacity: 1; transform: none; transition: none; }
  .glow { animation: none; }
  .iphone-frames .iphone-app { transition: none; }
  html.mobile-story {
    scroll-snap-type: none;
  }
  html.mobile-story .hero-copy,
  html.mobile-story .chapter > .iphone,
  html.mobile-story .feature-row > .panel,
  html.mobile-story .feature-row > .iphone,
  html.mobile-story .chapter.is-active .panel,
  html.mobile-story .chapter.is-active .iphone,
  html.mobile-story .chapter.hero .iphone,
  html.mobile-story .chapter.hero .hero-copy {
    opacity: 1;
    transform: none;
  }
}

.hero-copy { max-width: 34rem; }
.mega-kick {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 .78rem var(--font-mono);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink); margin-bottom: 14px;
}
.mega-kick::before {
  content: '';
  width: .55em; height: .55em;
  background: var(--accent);
  flex: none;
}
h1.mega {
  font-family: var(--font-display);
  font-weight: 600; text-transform: uppercase;
  line-height: .9; letter-spacing: .01em;
  font-size: clamp(3.4rem, 9vw, 6.8rem);
  color: var(--ink); margin-bottom: 18px;
}
.hero-copy > p {
  color: var(--ink-muted); font-size: 1.08rem;
  line-height: 1.6; max-width: 38ch; margin-bottom: 22px;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 10px;
  font: 600 .98rem var(--font-body);
  border: 1.5px solid transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 2px 8px rgba(20,19,17,.08);
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.btn.primary {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent-deep);
}
.btn.ghost {
  border: 1px solid var(--line-btn); color: var(--ink);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.btn:active {
  transform: scale(.97);
  box-shadow: 0 1px 0 rgba(255,255,255,.16) inset, 0 1px 4px rgba(20,19,17,.1);
}
@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover {
    color: var(--accent-ink);
    filter: brightness(1.03);
    box-shadow: 0 1px 0 rgba(255,255,255,.34) inset, 0 5px 14px rgba(138,106,0,.2);
  }
  .btn.ghost:hover {
    border-color: var(--accent-deep);
    color: var(--accent-text);
    box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 6px 16px rgba(20,19,17,.12);
  }
}
.fine { font-size: .8rem; color: var(--ink-muted); margin: 14px 0 0; }
.store-teaser {
  display: inline-flex; align-items: center;
  height: 42px; padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: 600 .88rem var(--font-body);
  color: var(--ink-muted);
}

/* iPhone mock - official Apple iPhone 16 bezel overlay + CSS status chrome.
   Screen cutout from bezel PNG (1359×2736): hole 90,90 → 1268,2645.
   Shots are flush (no extra lip); cream pad in the PNG is the PWA safe-area. */
.iphone {
  width: min(268px, 70vw);
  margin: 0 auto;
  position: relative;
  transform: translateY(12px);
  transition: transform .7s var(--ease);
}
.chapter.is-active .iphone,
.chapter.hero .iphone { transform: none; }

.iphone-device {
  position: relative;
  width: 100%;
  aspect-ratio: 1359 / 2736;
}

.iphone-bezel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 3;
  user-select: none;
  /* Shadow on the bezel only. A filter on .iphone-device flattens
     screen children and breaks opacity swaps between mockup frames. */
  filter: drop-shadow(0 22px 48px var(--shadow-panel))
          drop-shadow(0 6px 14px rgba(0, 0, 0, .2));
}

/* Cutout percentages match Apple bezel screen hole. */
.iphone-screen {
  position: absolute;
  left: calc(90 / 1359 * 100%);
  top: calc(90 / 2736 * 100%);
  width: calc(1179 / 1359 * 100%);
  height: calc(2556 / 2736 * 100%);
  overflow: hidden;
  background: var(--phone-screen);
  border-radius: calc(47 / 1179 * 100%);
  line-height: 0;
  isolation: isolate;
  container-type: inline-size;
  container-name: phone;
  z-index: 1;
  /* Status ink: dark on cream pad, light on dark pad. */
  --status-ink: #141311;
}
[data-theme='dark'] .iphone-screen {
  --status-ink: #f0ede6;
}

/* Status chrome - layout from Figma iOS Status bar - iPhone (402×62),
   scaled to capture width 390. Icons are official vectors (levels.svg). */
.iphone-status {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(60 / 390 * 100cqi); /* 62 @ 402 */
  z-index: 2;
  pointer-events: none;
  color: var(--status-ink);
}
.iphone-time {
  position: absolute;
  /* Time glyph left ≈ 52.25 @ 402 → 50.7 @ 390 */
  left: calc(51 / 390 * 100cqi);
  /* Vertical center of Levels row ≈ 32.2 @ 402 → 31.2 @ 390 */
  top: calc(31 / 390 * 100cqi);
  transform: translateY(-50%);
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
  font-size: calc(17 / 390 * 100cqi);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--status-ink);
  font-variant-numeric: tabular-nums;
}
/* Cellular + Wifi + Battery strip (85.33×13 @ 402). Right inset ≈ 39.6. */
.iphone-levels {
  position: absolute;
  right: calc(38 / 390 * 100cqi);
  top: calc(31 / 390 * 100cqi);
  transform: translateY(-50%);
  width: calc(83 / 390 * 100cqi);
  height: calc(13 / 390 * 100cqi);
  background-color: var(--status-ink);
  -webkit-mask: url('/icons/status/levels.svg') no-repeat center / contain;
  mask: url('/icons/status/levels.svg') no-repeat center / contain;
}

/* Shots flush in the cutout (PNG already includes safe-area pad). */
.iphone-app {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
}

.iphone-frames {
  position: absolute;
  inset: 0;
}
.iphone-frames .iphone-app {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
}
.iphone-frames .iphone-app.on { opacity: 1; }

/* Single-shot phones (workout / progress). */
.iphone-screen > .iphone-app {
  position: absolute;
  inset: 0;
}

/* Feature rows */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  width: 100%;
}
.feature-row.reverse { direction: rtl; }
.feature-row.reverse > * { direction: ltr; }
@media (max-width: 860px) {
  .feature-row, .feature-row.reverse {
    grid-template-columns: 1fr; gap: 18px; direction: ltr;
  }
  .feature-row.reverse > .iphone { order: 2; }
  .feature-row.reverse > .panel { order: 1; }
  .iphone { width: min(200px, 52vw); }
  .panel { max-width: none; width: 100%; padding: 16px 16px; }
}

.panel {
  max-width: 28rem;
  padding: 22px 24px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: 0 14px 40px var(--shadow-panel);
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .65s var(--ease), transform .65s var(--ease);
}
.chapter.is-active .panel,
.chapter.hero .panel,
.chapter.hero .hero-copy { opacity: 1; transform: none; }
.chapter.hero .hero-copy {
  opacity: 1; transform: none;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .7rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent-text);
  margin-bottom: 8px;
}
.kicker::before {
  content: '';
  width: .55em; height: .55em;
  background: var(--accent);
  flex: none;
}
.chapter h2 {
  font-family: var(--font-display);
  font-weight: 600; text-transform: uppercase;
  line-height: 1.02; letter-spacing: .02em;
  margin-bottom: 10px;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
}
.chapter p {
  color: var(--ink-muted); font-size: 1.02rem;
  line-height: 1.6; max-width: 40ch; margin-bottom: 12px;
}
.feature-list { list-style: none; display: grid; gap: 10px; margin: 8px 0 0; }
.feature-list li {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--line-soft);
  font-size: .92rem; color: var(--ink-muted);
}
.feature-list strong {
  font-family: var(--font-display);
  font-weight: 600; font-size: .95rem;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent-text);
}
@media (max-width: 520px) {
  .feature-list li { grid-template-columns: 1fr; gap: 2px; }
}

.chapter.center {
  justify-items: center; text-align: center;
}
.chapter.center .panel { margin: 0 auto; }
.chapter.center p, .chapter.center .fine { margin-left: auto; margin-right: auto; }
.chapter.center .cta-row { justify-content: center; }

.jim-aside {
  display: flex; align-items: flex-end; gap: 14px; margin-top: 8px;
}
.jim-aside img {
  width: 56px; height: auto; image-rendering: pixelated;
  flex: none;
}
.jim-aside .bubble {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line-mid);
  border-radius: 14px;
  padding: 12px 14px;
  margin-left: 8px;
  margin-bottom: 12px;
  font-size: .92rem; color: var(--ink);
  box-shadow: 0 8px 24px var(--shadow-panel);
}

.jim-aside .bubble::before,
.jim-aside .bubble::after {
  content: '';
  position: absolute;
  top: 30px;
  width: 0;
  height: 0;
  border-style: solid;
  pointer-events: none;
}

.jim-aside .bubble::before {
  left: -14px;
  border-width: 9px 14px 9px 0;
  border-color: transparent var(--line-mid) transparent transparent;
}

.jim-aside .bubble::after {
  left: -11px;
  border-width: 7px 11px 7px 0;
  border-color: transparent var(--surface) transparent transparent;
}

@media (min-width: 900px) {
  .jim-aside .bubble::before { top: calc(50% - 9px); }
  .jim-aside .bubble::after { top: calc(50% - 7px); }
}

.scroll-ticks {
  position: fixed; right: 16px; top: 50%; transform: translateY(-50%);
  z-index: 30; display: flex; flex-direction: column; gap: 9px;
}
.scroll-ticks span {
  width: 5px; height: 5px; background: var(--line-strong);
}
.scroll-ticks span.on {
  background: var(--accent-deep);
  box-shadow: 0 0 0 2px rgba(242,196,15,.3);
}
@media (max-width: 640px) { .scroll-ticks { display: none; } }

footer.site {
  position: relative; z-index: 2;
  background: var(--footer-wash);
  border-top: 1px solid var(--glass-line);
  backdrop-filter: blur(12px);
  padding: 36px 24px 28px;
}
footer.site .cols {
  max-width: 960px; margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px;
}
footer.site .mark { margin-bottom: 10px; }
footer.site p { color: var(--ink-muted); font-size: .88rem; max-width: 34ch; line-height: 1.55; }
.footer-store {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
}
.footer-badge {
  display: block;
  width: 120px;
  height: auto;
}
/* footer.site p wins on specificity: re-assert the chip's inverted text. */
footer.site p.ios-coming { color: var(--bg); max-width: none; }
.footer-launch {
  margin: 0;
  font: 600 .78rem var(--font-body);
  letter-spacing: .04em;
  color: var(--ink-muted);
}
footer.site h4 {
  font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 10px;
}
footer.site .col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
footer.site .col a { color: var(--ink); font-size: .9rem; }
footer.site .legal {
  max-width: 960px; margin: 28px auto 0; padding-top: 18px;
  border-top: 1px solid var(--line-mid);
  font-size: .76rem; color: var(--ink-faint);
}
body.landing footer.site .footer-line-jim {
  /* Same crop recipe as app .topbar-jim (54×32), scaled to 80px for the footer. */
  --jim-w: 80px;
  --jim-crop-h: calc(var(--jim-w) * 32 / 54);
  position: absolute;
  right: 26px;
  top: calc(-1 * var(--jim-crop-h));
  width: var(--jim-w);
  height: var(--jim-crop-h);
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
  display: grid;
  align-items: end;
  justify-items: center;
  line-height: 0;
}
body.landing footer.site .footer-line-jim .line-jim-avatar {
  grid-area: 1 / 1;
  display: grid;
  align-items: end;
  justify-items: center;
  line-height: 0;
}
body.landing footer.site .footer-line-jim .coach-avatar {
  grid-area: 1 / 1;
  line-height: 0;
}
body.landing footer.site .footer-line-jim .coach-avatar svg {
  display: block;
  width: var(--jim-w);
  height: auto;
  image-rendering: pixelated;
}
/* Idle = bar at chin. Tap/auto-rep lifts lockout via mid, same as topbar. */
body.landing footer.site .footer-line-jim .line-jim-frame-up,
body.landing footer.site .footer-line-jim .line-jim-frame-mid {
  visibility: hidden;
}
body.landing footer.site .footer-line-jim.rep-mid .line-jim-frame-down,
body.landing footer.site .footer-line-jim.rep-up .line-jim-frame-down {
  visibility: hidden;
}
body.landing footer.site .footer-line-jim.rep-mid .line-jim-frame-mid {
  visibility: visible;
}
body.landing footer.site .footer-line-jim.rep-up .line-jim-frame-up {
  visibility: visible;
}
/* Barbell must lighten in dark mode (same as app .topbar-jim). */
[data-theme='dark'] body.landing footer.site .footer-line-jim .px-b { fill: var(--ink); }
[data-theme='dark'] body.landing footer.site .footer-line-jim .px-k { fill: var(--ink-muted); }
@media (max-width: 700px) {
  footer.site .cols { grid-template-columns: 1fr; }
  body.landing footer.site .footer-line-jim {
    right: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.landing footer.site .footer-line-jim .line-jim-frame-up,
  body.landing footer.site .footer-line-jim .line-jim-frame-mid { visibility: hidden; }
  body.landing footer.site .footer-line-jim .line-jim-frame-down { visibility: visible; }
}

/* Legal pages (unchanged surface) */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: var(--footer-wash);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--accent);
}
header.site .inner {
  display: flex; align-items: center; gap: 12px;
  max-width: 1120px; margin: 0 auto; padding: 12px 24px;
}
header.site .brand { line-height: 0; }
header.site .spacer { flex: 1; }
header.site .btn {
  display: inline-flex; align-items: center;
  height: 40px; padding: 0 18px; border-radius: 10px;
  font: 600 .95rem var(--font-body);
}
header.site .btn.ghost { border: 1px solid var(--line-btn); color: var(--ink); }
header.site .lang-switch, header.site .nav-burger, header.site .main-nav, header.site .mobile-nav { display: none; }
header.site .monogram.sm {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: .95rem;
}
.legal-page {
  position: relative; z-index: 2;
  max-width: 640px; margin: 0 auto;
  padding: 100px 24px 64px; line-height: 1.6;
}
.legal-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: 600; text-transform: uppercase; margin-bottom: 6px;
}
.legal-page h2 {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 600; text-transform: uppercase;
  margin: 32px 0 10px;
}
.legal-page p { margin: 0 0 12px; }
.legal-page p.muted { color: var(--ink-muted); }
.legal-page p.small { font-size: .82rem; }
.legal-page a { text-decoration: underline; }
.legal-page code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--hover-fill); padding: 1px 6px; border-radius: 5px;
}

/* Bottom-right theme toggle (matches app cream/dark). */
.theme-toggle {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 50;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: var(--ink);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: 0 8px 24px var(--shadow-soft);
  display: grid; place-items: center;
  cursor: pointer;
  padding: 0;
}
.theme-toggle .theme-icon { width: 20px; height: 20px; display: none; }
[data-theme='light'] .theme-toggle .theme-icon-moon,
html:not([data-theme]) .theme-toggle .theme-icon-moon { display: block; }
[data-theme='dark'] .theme-toggle .theme-icon-sun { display: block; }
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover { border-color: var(--accent-deep); color: var(--accent-text); }
}
.theme-toggle:active { transform: scale(.96); }

/* Landing teaser: mark drops, squashes, settles, fades out. */
.teaser {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Transparent so body + .glow match the page behind. */
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.teaser.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  cursor: pointer;
}
.teaser.is-out {
  animation: teaserFadeOut .95s ease forwards;
}
body.teaser-active {
  overflow: hidden;
}
body.teaser-active header.glass,
body.teaser-active main,
body.teaser-active footer.site,
body.teaser-active .scroll-ticks,
body.teaser-active .theme-toggle {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
body.teaser-active.teaser-out header.glass,
body.teaser-active.teaser-out main,
body.teaser-active.teaser-out footer.site,
body.teaser-active.teaser-out .scroll-ticks,
body.teaser-active.teaser-out .theme-toggle {
  opacity: 1;
  visibility: visible;
  transition: opacity .95s ease;
}
.teaser-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Floor sits lower than true center. */
  transform: translateY(14vh);
  width: min(420px, 92vw);
}
.teaser-stage {
  position: relative;
  width: 120px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.teaser-shadow {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 78px;
  height: 16px;
  margin-left: -39px;
  border-radius: 50%;
  background: var(--teaser-shadow, rgba(20, 19, 17, .28));
  filter: blur(5px);
  transform: scaleX(.18);
  opacity: 0;
  transform-origin: center;
}
[data-theme='dark'] .teaser-shadow {
  --teaser-shadow: rgba(0, 0, 0, .55);
}
.teaser-mark {
  position: relative;
  z-index: 1;
  width: 92px;
  height: 92px;
  border-radius: 22px;
  overflow: hidden;
  transform: translate3d(0, -56vh, 0);
  /* Soft depth only, no light rim / stroke. */
  box-shadow: 0 16px 32px rgba(20, 19, 17, .18);
  will-change: transform;
  background: var(--accent);
  line-height: 0;
}
.teaser-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Full-bleed yellow asset; slight scale crops any edge AA. */
  transform: scale(1.02);
  transform-origin: center;
}
.teaser-store {
  margin-top: 28px;
  width: 100%;
  max-width: min(340px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0;
  text-align: center;
}
.teaser.is-on .teaser-store {
  animation: teaserStoreIn .7s ease .9s forwards;
}
/* Rule wider than the copy so it frames the line. */
.teaser-rule {
  width: 100%;
  max-width: none;
  border: 0;
  border-top: 1.5px solid var(--line-mid);
  margin: 0;
}
@media (min-width: 700px) {
  .teaser-store {
    max-width: 420px;
    gap: 16px;
  }
  .teaser-rule {
    border-top-width: 2px;
  }
}
/* Text chip in the App Store badge slot until the app is submitted:
   Apple's badge license covers only apps live (or in real pre-order)
   on the App Store. Deliberately NOT a badge lookalike: no Apple logo,
   no "App Store" wording, site fonts. Swap back to .teaser-badge /
   .footer-badge on release day (see icons/apple/README.md). */
.ios-coming {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font: 600 1rem var(--font-display);
  letter-spacing: .05em;
  white-space: nowrap;
}
@media (min-width: 700px) {
  .teaser-store .ios-coming { min-height: 44px; padding: 0 22px; font-size: 1.08rem; }
}

/* Official Apple badge (unmodified SVG). */
.teaser-badge {
  display: block;
  width: 120px;
  height: auto;
}
@media (min-width: 700px) {
  .teaser-badge {
    width: 140px;
  }
}
.teaser-jim {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(18px) scale(.92);
}
.teaser.is-on .teaser-jim {
  animation: teaserJimIn .55s var(--ease) 1.55s forwards;
}
.teaser-jim img {
  width: 52px;
  height: auto;
  image-rendering: pixelated;
  flex: none;
}
.teaser-jim .bubble {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line-mid);
  border-radius: 14px;
  padding: 10px 12px;
  margin-left: 6px;
  margin-bottom: 10px;
  font: 600 .9rem var(--font-body);
  color: var(--ink);
  box-shadow: 0 8px 24px var(--shadow-panel);
  white-space: nowrap;
}
.teaser-jim .bubble::before,
.teaser-jim .bubble::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  pointer-events: none;
  transform: translateY(-50%);
}
.teaser-jim .bubble::before {
  left: -12px;
  border-width: 8px 12px 8px 0;
  border-color: transparent var(--line-mid) transparent transparent;
}
.teaser-jim .bubble::after {
  left: -9px;
  border-width: 6px 9px 6px 0;
  border-color: transparent var(--surface) transparent transparent;
}
@keyframes teaserJimIn {
  from { opacity: 0; transform: translateY(18px) scale(.92); }
  to   { opacity: 1; transform: none; }
}
.teaser.is-on .teaser-mark {
  animation: teaserDrop 1.7s cubic-bezier(.2, .7, .2, 1) forwards;
}
.teaser.is-on .teaser-shadow {
  animation: teaserShadow 1.7s cubic-bezier(.2, .7, .2, 1) forwards;
}
@keyframes teaserDrop {
  0%   { transform: translate3d(0, -56vh, 0) scale(1, 1); }
  44%  { transform: translate3d(0, 0, 0) scale(1, 1); }
  50%  { transform: translate3d(0, 0, 0) scale(1.16, .78); }
  64%  { transform: translate3d(0, -38px, 0) scale(.96, 1.08); }
  76%  { transform: translate3d(0, 0, 0) scale(1.08, .88); }
  86%  { transform: translate3d(0, -11px, 0) scale(.99, 1.03); }
  100% { transform: translate3d(0, 0, 0) scale(1, 1); }
}
@keyframes teaserShadow {
  0%   { transform: scaleX(.18); opacity: 0; }
  44%  { transform: scaleX(1); opacity: .38; }
  50%  { transform: scaleX(1.2); opacity: .44; }
  64%  { transform: scaleX(.5); opacity: .16; }
  76%  { transform: scaleX(1.08); opacity: .34; }
  86%  { transform: scaleX(.72); opacity: .22; }
  100% { transform: scaleX(.92); opacity: .28; }
}
@keyframes teaserStoreIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes teaserFadeOut {
  to { opacity: 0; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .teaser { display: none !important; }
}

