/* BB's landing page (ADR landing-page). */
html:has(.snap) {
  /* Every scroll ends on a chapter, never halfway through the phone turning into the next one. Only the page with
     chapters snaps: 404.html shares this stylesheet. */
  scroll-snap-type: y mandatory;
}
body {
  margin: 0;
}
/* Layout: one pinned black stage, the phone in 3D at its centre; each stretch of scroll turns the phone and
   transforms the app inside it (one surface becomes the next), with one feature's words beside it. */
:root {
  color-scheme: dark;
  --bg: #0a0a0a; /* BbBackground, dark */
  --fg: #fafafa; /* BbForeground, dark */
  --muted: #a1a1a1; /* BbMutedForeground, dark */
  --line: rgba(255, 255, 255, 0.14);
  --solid: #e5e5e5; /* BbPrimary, dark */
  --on-solid: #171717;
  --due: #fbbf24; /* the app's state colours, dark values */
  --paid: #4ade80;
  --progress: #60a5fa;
  --titanium: #9a9a9f;
  --display: -apple-system, 'SF Pro Display', system-ui, 'Helvetica Neue', Arial, sans-serif;
  --body: -apple-system, 'SF Pro Text', system-ui, 'Helvetica Neue', Arial, sans-serif;
  --vh: 1vh;
  --chapter: calc(
    var(--vh) * 95
  ); /* the scroll one chapter takes; landing.js reads the same span */
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --ph: min(calc(var(--vh) * 50), 470px);
  --pw: calc(var(--ph) / 2.09);
  --pt: calc(var(--pw) * 0.1);
  --pr: calc(var(--pw) * 0.15);
}
@supports (height: 1svh) {
  :root {
    --vh: 1svh;
  }
}
@media (min-width: 900px) {
  :root {
    --ph: min(calc(var(--vh) * 64), 620px);
  }
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
h1,
h2,
p {
  margin: 0;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

/* ---------- top bar ---------- */
.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
  padding-bottom: 12px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  background: linear-gradient(var(--bg) 30%, transparent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 600 1.125rem/1 var(--display);
  letter-spacing: -0.01em;
}
.bean {
  display: block;
  background: currentColor;
  -webkit-mask: url(assets/poroto.svg) center / contain no-repeat;
  mask: url(assets/poroto.svg) center / contain no-repeat;
}
.brand .bean {
  width: 28px;
  height: 28px;
}
.pill {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--solid);
  color: var(--on-solid);
  font-weight: 600;
  font-size: 0.875rem;
}
.pill.big {
  padding: 13px 24px;
  font-size: 1rem;
}

/* ---------- the pinned story ---------- */
.story {
  position: relative;
  height: calc(var(--vh) * 100 + var(--chapter) * 10);
}
/* One snap point per chapter (landing.js adds them, one per caption), where its scene stands still. */
.snap {
  position: absolute;
  left: 0;
  top: calc(var(--chapter) * var(--k));
  width: 1px;
  height: 1px;
  pointer-events: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.stage {
  position: sticky;
  top: 0;
  height: calc(var(--vh) * 100);
  overflow: hidden;
  display: grid;
  place-items: center;
  perspective: 1500px;
}
.glow {
  position: absolute;
  width: calc(var(--ph) * 1.5);
  aspect-ratio: 1;
  max-width: none;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgb(var(--glow, 255 255 255) / 0.2),
    rgb(var(--glow, 255 255 255) / 0)
  );
  pointer-events: none;
}
.rig {
  position: relative;
  transform: translate3d(0, 12%, 0) scale(0.88);
  transform-style: preserve-3d;
  will-change: transform;
}
.phone {
  position: relative;
  width: var(--pw);
  height: var(--ph);
  transform-style: preserve-3d;
  transform-origin: 50% 50% calc(var(--pt) / -2);
  transform: rotateX(16deg) rotateY(-26deg) rotateZ(5deg);
  will-change: transform;
}
.phone > * {
  position: absolute;
}
.slab {
  inset: 0;
  border-radius: var(--pr);
  background: linear-gradient(100deg, #6c6c71, #c4c4c9 14%, #87878c 50%, #cfcfd4 86%, #707075);
}
.side {
  background: linear-gradient(#b9b9be, #8b8b90 30%, #a9a9ae 70%, #77777c);
}
.side.l,
.side.r {
  top: var(--pr);
  width: var(--pt);
  height: calc(100% - var(--pr) * 2);
  transform-origin: left center;
  transform: rotateY(90deg);
}
.side.l {
  left: 0;
}
.side.r {
  left: 100%;
}
.side.t,
.side.b {
  left: var(--pr);
  height: var(--pt);
  width: calc(100% - var(--pr) * 2);
  transform-origin: center top;
  transform: rotateX(-90deg);
  background: linear-gradient(90deg, #77777c, #c4c4c9 20%, #8b8b90 60%, #b9b9be);
}
.side.t {
  top: 0;
}
.side.b {
  top: 100%;
}
.face {
  inset: 0;
  border-radius: var(--pr);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.front {
  background: #050505;
  box-shadow: inset 0 0 0 1.5px var(--titanium);
  transform: translateZ(0.5px);
}
.screen {
  position: absolute;
  inset: calc(var(--pw) * 0.03);
  border-radius: calc(var(--pw) * 0.122);
  overflow: hidden;
  background: #f5f5f5;
}
.front::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
      105deg,
      transparent 32%,
      rgba(255, 255, 255, 0.13) 46%,
      transparent 60%
    )
    calc(50% + var(--gl, 0) * 1%) 0 / 260% 100% no-repeat;
}
.back {
  transform: translateZ(calc(var(--pt) * -1 - 0.5px)) rotateY(180deg);
  background: linear-gradient(140deg, #303034, #17171a 70%);
  box-shadow: inset 0 0 0 1.5px var(--titanium);
  display: grid;
  place-items: center;
}
.back .bean {
  width: 40%;
  aspect-ratio: 1;
  color: rgba(255, 255, 255, 0.26);
}
.lens {
  position: absolute;
  top: 4%;
  left: 7%;
  width: 40%;
  aspect-ratio: 1;
  border-radius: 28%;
  background: #222226;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.lens::before,
.lens::after {
  content: '';
  position: absolute;
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(#1b2a44, #050506 62%);
  box-shadow: 0 0 0 2px #3a3a3f;
}
.lens::before {
  top: 9%;
  left: 9%;
}
.lens::after {
  bottom: 9%;
  right: 9%;
}

/* ---------- the app: the design canvas's boards, on a 390 x 844 board scaled to the screen ----------
   The pieces and their own CSS (`screens.css`) are generated by tools/build-screens.py; here is only what places them. */
.ui {
  position: absolute;
  left: 0;
  top: 0;
  width: 390px;
  height: 844px;
  transform-origin: 0 0;
  overflow: hidden;
  --u-bg: 245 245 245;
  --u-card: 255 255 255;
  background: rgb(var(--u-bg));
  color: #0a0a0a;
  text-align: left;
  pointer-events: none;
  font:
    400 17px/1.3 -apple-system,
    'SF Pro Text',
    'SF Pro Display',
    system-ui,
    'Helvetica Neue',
    sans-serif;
}
.ui [data-s] {
  will-change: opacity, transform;
}
/* A piece in its place; one that carries its own place on the board; a surface that travels, and what it shows. */
.u-p {
  position: absolute;
  display: flex;
  flex-direction: column;
}
.u-o {
  position: absolute;
  inset: 0;
}
.u-surf {
  position: absolute;
  overflow: hidden;
  border-radius: 26px;
  background: rgb(var(--u-card));
}
.u-f {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
}
/* Glass without the blur: a piece that fades is its own backdrop, so the blur would show nothing behind it. */
.ui .glass {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.ui .glass-light {
  background: rgba(255, 255, 255, 0.94) !important;
}
.ui .glass-dark {
  background: rgba(44, 44, 46, 0.94) !important;
}
/* The lock screen and its notifications: drawn here, the canvas has no board for them. */
.u-wall {
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 70% at 25% 0%, #3b4157, #17181f 62%, #0a0a0a);
}
.u-lock {
  position: absolute;
  left: 0;
  right: 0;
  top: 76px;
  text-align: center;
  color: #fafafa;
}
.u-lock small {
  display: block;
  font-size: 17px;
  font-weight: 500;
  opacity: 0.85;
}
.u-lock b {
  display: block;
  font-size: 86px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.u-surf.u-note {
  border-radius: 24px;
  background: rgb(62 62 66 / 0.96);
}
.u-banner {
  z-index: 7;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.4);
}
.u-notif {
  position: relative;
  width: 100%;
  height: 78px;
  box-sizing: border-box;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fafafa;
  background: rgb(62 62 66 / 0.96);
}
.u-app {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 9px;
  background: #0a0a0a;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.16);
  display: grid;
  place-items: center;
}
.u-app .bean {
  width: 30px;
  height: 30px;
  color: #fafafa;
}
.u-notif-text {
  flex: 1;
  min-width: 0;
}
.u-notif-text b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
.u-notif-text small {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}
.u-when {
  align-self: flex-start;
  margin-top: 14px;
  font-size: 12px;
  color: #a1a1a1;
}

/* ---------- store badges ---------- */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}
.store {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 50px;
  padding: 0 16px 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: #000;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}
.store small {
  display: block;
  font-size: 0.6875rem;
  line-height: 1.15;
  color: var(--muted);
  white-space: nowrap;
}
.store b {
  display: block;
  font: 600 1.0625rem/1.15 var(--display);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.store .mark {
  width: 26px;
  height: 26px;
  flex: none;
}
.store .apple {
  font:
    400 28px/26px -apple-system,
    'SF Pro Display',
    system-ui,
    sans-serif;
  text-align: center;
  margin-top: -3px;
}
.store.soon {
  cursor: default;
  border-style: dashed;
  border-color: var(--line);
}
.store.soon .mark,
.store.soon b {
  opacity: 0.55;
}

/* ---------- words ---------- */
.cap {
  position: absolute;
  opacity: 0;
  will-change: opacity, transform;
  left: var(--gutter-l);
  right: var(--gutter-r);
  bottom: 5%;
  margin-inline: auto;
  max-width: 26rem;
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.cap[data-k='0'] {
  opacity: 1;
}
.cap.on {
  pointer-events: auto;
}
.eyebrow {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--acc, var(--muted));
}
.cap h1,
.cap h2 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}
.cap h1 {
  font-size: clamp(1.9rem, 4.6vw, 3.5rem);
}
.cap h2 {
  font-size: clamp(1.6rem, 5.6vw, 2.75rem);
}
.cap p {
  color: var(--muted);
  font-size: 1.0625rem;
  text-wrap: pretty;
  max-width: 34ch;
}
.hint {
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.hint::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: rotate(45deg) translate(-2px, -2px);
}

@media (min-width: 900px) {
  .cap {
    bottom: auto;
    inset-block: 0;
    height: fit-content;
    margin-block: auto;
    max-width: 21rem;
    text-align: left;
    align-items: flex-start;
    gap: 12px;
  }
  .cap.right {
    left: calc(50% + 3vw);
    right: auto;
    margin-inline: 0;
  }
  .cap.left {
    right: calc(50% + 3vw);
    left: auto;
    margin-inline: 0;
  }
  .cap.top {
    inset-block: 10% auto;
    margin-block: 0;
    left: var(--gutter-l);
    right: var(--gutter-r);
    max-width: 60rem;
    text-align: center;
    align-items: center;
  }
  .cap.top p {
    max-width: 46ch;
  }
  .cap.top .hint {
    display: none;
  }
}

/* ---------- chapter rail ---------- */
.rail {
  position: absolute;
  right: var(--gutter-r);
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
}
.rail button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.rail button::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg);
  opacity: 0.28;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.rail button[aria-current='true']::before {
  opacity: 1;
  transform: scale(1.5);
}
@media (min-width: 900px) {
  .rail {
    display: flex;
  }
}

/* ---------- foot: the bottom of the closing screen ---------- */
.foot {
  position: absolute;
  inset: auto 0 0;
  z-index: 6;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding-block: 14px calc(14px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.foot div {
  max-width: 60rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}
.foot p + p {
  display: none;
}
.legal {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.legal a {
  color: var(--fg);
  font-weight: 600;
  font-size: 0.8125rem;
  text-underline-offset: 3px;
}
/* The closing words sit above the foot on a phone, where every caption is at the bottom. */
.cap.end {
  bottom: 7.5rem;
}
@media (min-width: 900px) {
  .foot {
    padding-block: 18px 20px;
  }
  .foot div {
    font-size: 0.8125rem;
    gap: 8px;
  }
  .foot p + p {
    display: block;
  }
  .legal a {
    font-size: 0.875rem;
  }
  .cap.end {
    bottom: auto;
  }
}

/* ---------- 404 ---------- */
.lost {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
}
.lost h1 {
  font: 600 2rem/1.1 var(--display);
  letter-spacing: -0.02em;
}
.lost a {
  color: var(--fg);
  font-weight: 600;
}
