/*
breevee.app. One page in three layers: the Home sky (hero), a sheet of warm paper that slides up over it, and the sky again.
Colors, radii and card shadows mirror the app's Light Theme; keep them in step:
  colors      src/appearance/appearance.ts (light: Theme, HOME_SCENES_LIGHT, SESSION_SKIES_LIGHT, SOUND_SKIES_LIGHT)
  radii       src/ui/radius.consts.ts
  card shadow src/ui/card-shadow.consts.ts
The display type (Fraunces) is the site's own: a soft serif beside the round logo. Pieces that copy the app's UI keep Nunito.

Contents: tokens, base, shared pieces, top bar, hero, session and Reward, sheet, manifesto, moods stage, taps,
sounds, habit, screens, plans, trust, final call, footer, player, reveal, reduced motion.
*/

/* Tokens */

:root {
  color-scheme: light;

  --ink: #182b45;
  --ink-soft: #525f70;
  --muted: #788397;
  --paper: #fff9f0;
  --card: #ffffff;
  --on-ink: #ffffff;
  --lilac: #b7a5f5;
  --violet: #5b3fd6;
  --control: #eae4f3;
  --done: #81d2bd;
  --frozen: #d6ecfb;
  --plus-card: #efe6fb;
  --relax-card: #e8f2e8;
  --energy-card: #fbebdd;
  --on-night: #f2f0ff;
  --hairline: #78839740;
  --shadow-contact: #182b4512;
  --shadow-lift: #182b4521;
  --card-shadow:
    0 1px 2px 0 var(--shadow-contact), 0 10px 22px -6px var(--shadow-lift);

  --font-display:
    'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-ui: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-sheet: 40px;
  --radius-stage: 40px;
  --radius-card: 28px;
  --radius-picture: 24px;
  --radius-pill: 999px;

  --gutter: clamp(20px, 4.4vw, 48px);
  --wrap: 1200px;
  --section: clamp(88px, 11vw, 168px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --breath: 10s; /* 4 s in, 6 s out: Slow Breathing */

  /* The Home sky of the afternoon; the other parts of the day follow below. */
  --sky-top: #bfddfb;
  --sky-bottom: #eaf4fe;
  --on-sky: #182b45;
  --on-sky-soft: #182b45c7;
  --glass: #ffffff73;
  --glass-line: #ffffff99;
}

:root[data-part='morning'] {
  --sky-top: #cfe3fa;
  --sky-bottom: #fde7d3;
}

:root[data-part='evening'] {
  /* Deeper than the app's evening at the top: the page sets long lines of white text there, the app only a greeting. */
  --sky-top: #5a52a3;
  --sky-mid: #8f7ab3;
  --sky-bottom: #f6c3b3;
  --on-sky: #ffffff;
  --on-sky-soft: #ffffffeb;
  --glass: #3a2c8047;
  --glass-line: #ffffff59;
}

:root[data-part='night'] {
  --sky-top: #1d2650;
  --sky-bottom: #4a4f8c;
  --on-sky: #f2f0ff;
  --on-sky-soft: #f2f0ffcc;
  --glass: #ffffff1f;
  --glass-line: #ffffff40;
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* `clip`, not `hidden`: `hidden` would make <main> a scroll box and the hero could not stick. */
main {
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
.manifesto__text {
  font-family: var(--font-display);
  font-weight: 380;
  font-variation-settings: 'SOFT' 100;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.75rem, 6vw, 5.75rem);
  line-height: 0.98;
}

h2 {
  font-size: clamp(2.125rem, 4.5vw, 4rem);
  line-height: 1.04;
}

h1 em,
h2 em {
  font-style: italic;
  font-weight: 340;
}

.sheet h2 em {
  color: var(--violet);
}

h3 {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 50;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-ui);
  font-weight: 700;
}

.skip:focus {
  top: 16px;
}

/* Shared pieces */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px #182b4580;
}

.button--small {
  padding: 9px 20px;
  font-size: 15px;
}

/* A small label above a heading. */
.kicker,
.eyebrow {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
}

.head {
  display: grid;
  justify-items: center;
  gap: 20px;
  max-width: 760px;
  margin: 0 auto clamp(40px, 5vw, 72px);
  text-align: center;
}

.head > p:not(.kicker) {
  max-width: 560px;
  font-size: clamp(16px, 1.4vw, 18px);
  color: var(--ink-soft);
}

.head--left {
  justify-items: start;
  margin-inline: 0;
  text-align: left;
}

.section {
  padding-block: calc(var(--section) / 2);
}

.card {
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.card__text {
  display: grid;
  gap: 6px;
}

.card__text p {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.aside {
  max-width: 560px;
  margin: 32px auto 0;
  font-size: 15px;
  text-align: center;
  color: var(--ink-soft);
}

/* An App Store badge, as a link. */
.store {
  position: relative;
  display: inline-block;
  flex: none;
  border-radius: 12px;
  transition: transform 0.4s var(--ease);
}

a.store:hover {
  transform: translateY(-2px);
}

.store img {
  width: auto;
  height: 56px;
}

/* A store that is not live yet: the badge is dimmed and not a link. */
.store--soon img {
  opacity: 0.45;
}

.store--soon small {
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--card-shadow);
}

.checks {
  display: grid;
  gap: 12px;
}

.checks li {
  position: relative;
  padding-left: 36px;
  font-size: 16px;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--done);
}

.checks li::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  width: 6px;
  height: 11px;
  border: solid var(--on-ink);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* A phone around a real capture. */
.phone {
  overflow: hidden;
  padding: 7px;
  border-radius: 40px;
  background: var(--ink);
  box-shadow: 0 30px 60px -30px #182b4573;
}

.phone img {
  width: 100%;
  border-radius: 33px;
}

/* Standing in a card, cut off by its lower edge. */
.phone--cut {
  padding-bottom: 0;
  border-radius: 40px 40px 0 0;
  box-shadow: none;
}

.phone--cut img {
  border-radius: 33px 33px 0 0;
}

/* Top bar: clear over the sky, a glass pill once the paper is under it. */

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--gutter) 0;
  color: var(--on-sky);
  pointer-events: none;
  transition:
    opacity 0.5s ease,
    transform 0.6s var(--ease);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 10px 10px 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  pointer-events: auto;
  transition:
    background-color 0.5s ease,
    border-color 0.5s ease,
    box-shadow 0.5s ease,
    max-width 0.7s var(--ease);
}

.topbar__logo img {
  width: 104px;
  transition: filter 0.5s ease;
}

.topbar__nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
}

.topbar__nav a {
  position: relative;
  text-decoration: none;
  opacity: 0.86;
  transition: opacity 0.3s ease;
}

.topbar__nav a:hover {
  opacity: 1;
}

.topbar .button {
  transition:
    background-color 0.5s ease,
    color 0.5s ease,
    transform 0.4s var(--ease);
}

/* On the dark skies the logo and the button turn light. */
:root[data-part='evening'] .topbar:not(.is-stuck) .topbar__logo img,
:root[data-part='night'] .topbar:not(.is-stuck) .topbar__logo img {
  filter: brightness(0) invert(1);
}

:root[data-part='evening'] .topbar:not(.is-stuck) .button,
:root[data-part='night'] .topbar:not(.is-stuck) .button {
  background: var(--on-ink);
  color: var(--ink);
}

.topbar.is-stuck {
  color: var(--ink);
}

.topbar.is-stuck .topbar__inner {
  max-width: 860px;
  border-color: #ffffffb3;
  background: #fff9f0c7;
  box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
}

/* During the minute on the page, nothing else asks for attention. */
.is-session .topbar,
.is-session .skyswitch {
  opacity: 0;
  pointer-events: none;
}

.is-session .topbar__inner {
  pointer-events: none;
}

section[id] {
  scroll-margin-top: 72px;
}

/* Hero: the Home scene */

.hero {
  --hero-h: max(100svh, 720px);
  --strip: max(1500px, 146vw);
  --scene-x: 72%;
  --ball: clamp(230px, 38vh, 380px);
  /* How much of the strip's height hangs below the hero's lower edge. */
  --sink: 0.055;
  position: sticky;
  /* Sticks at the top; if it is taller than the window, it sticks once its bottom shows. */
  top: min(0px, calc(100svh - var(--hero-h)));
  z-index: 0;
  height: var(--hero-h);
  overflow: hidden;
  isolation: isolate;
  color: var(--on-sky);
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
  transition: color 0.8s ease;
}

.hero__sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* The page under the paper does not need to draw (main.js sets it). */
.is-covered .hero__sky {
  visibility: hidden;
}

/* One layer per part of the day, cross-faded. */
.daypart {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}

.daypart--morning {
  background: linear-gradient(#cfe3fa, #fde7d3);
}

.daypart--afternoon {
  background: linear-gradient(#bfddfb, #eaf4fe);
}

/* The dusk stays deep through the upper half and on the left, away from the sun, so white text holds its contrast. */
.daypart--evening {
  background:
    linear-gradient(100deg, #4a3f8f80, #4a3f8f00 58%),
    linear-gradient(#5a52a3, #6f63ae 45%, #a98bb6 70%, #f6c3b3);
}

.daypart--night {
  background: linear-gradient(#1d2650, #4a4f8c);
}

:root[data-part='morning'] .daypart--morning,
:root[data-part='afternoon'] .daypart--afternoon,
:root[data-part='evening'] .daypart--evening,
:root[data-part='night'] .daypart--night,
:root:not([data-part]) .daypart--afternoon {
  opacity: 1;
}

/*
The scene is one wide strip, as in the app: sky details on top, far hills, Breevee, then the near hill in front of it.
Its middle (where the near hill crests) is placed at --scene-x, and everything scales with --strip.
*/
.scene {
  position: absolute;
  left: var(--scene-x);
  bottom: calc(var(--strip) * var(--sink) * -1);
  width: var(--strip);
  height: calc(var(--strip) * 0.42);
  translate: -50% 0;
}

.scene img {
  position: absolute;
  left: 0;
  width: 100%;
  max-width: none;
}

.scene img:not([src]) {
  visibility: hidden;
}

/* The layers shift a little against the pointer, the far ones more (hero.js sets --px and --py from -1 to 1). */
.scene__sky,
.scene__back {
  translate: calc(var(--px, 0) * var(--depth) * -1px)
    calc(var(--py, 0) * var(--depth) * -0.5px);
  transition: translate 0.9s var(--ease);
}

.scene__sky {
  --depth: 22;
}

.scene__back {
  --depth: 9;
}

/*
The sun or moon and its clouds: smaller than the hills, and hung from the top of the hero (30px down), not from the hills,
so they stay high in any window. They fade out on the left, where the words are.
*/
.scene img.scene__sky {
  left: 16%;
  top: calc(30px - var(--hero-h) + var(--strip) * (0.42 - var(--sink)));
  width: 68%;
  -webkit-mask-image: linear-gradient(to right, transparent 41%, #000 48%);
  mask-image: linear-gradient(to right, transparent 41%, #000 48%);
}

.scene__back,
.scene__front {
  bottom: 0;
}

/* The near hill is 428 / 2400 of the strip tall, and the Ball's body ends 17.5% above the bottom of its picture. */
.scene__ball {
  position: absolute;
  left: 50%;
  bottom: calc(var(--strip) * 0.1783 - var(--ball) * 0.215);
  width: var(--ball);
  aspect-ratio: 1;
  translate: -50% 0;
}

.scene__ball img {
  position: absolute;
  inset: 0;
  transform-origin: 50% 80%;
}

/* Two soft rings around Breevee that open as it breathes in, like the Session Ball's. */
.ring {
  position: absolute;
  inset: 9%;
  top: 11%;
  bottom: 7%;
  border: 1.5px solid #ffffffb3;
  border-radius: 50%;
  opacity: 0;
}

.ring + .ring {
  inset: -3%;
  top: -1%;
  bottom: -5%;
  border-color: #ffffff73;
}

.hero__inner {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  height: 100%;
  margin-inline: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 96px) var(--gutter) 15vh;
}

.hero__copy {
  display: grid;
  justify-items: start;
  gap: 26px;
  width: min(100%, 660px);
  transition:
    opacity 0.6s ease,
    transform 0.8s var(--ease),
    visibility 0s linear 0s;
}

/* The line under the top bar that says the sky is live. */
.hero__live {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.hero__live i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7fd8b4;
  box-shadow: 0 0 0 4px #7fd8b440;
}

/* Each line of the headline rises from behind its own edge. */
h1 .line {
  display: block;
  overflow: hidden;
  /* Room for the descenders and the italic's overhang inside the clip. */
  margin: -0.04em -0.06em -0.14em;
  padding: 0.04em 0.06em 0.14em;
}

h1 .line > span {
  display: block;
}

.hero__lead {
  max-width: 470px;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.5;
  color: var(--on-sky-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

/* "Breathe with me": the second way in, for people not ready to download. */
.try {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 24px 0 20px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.4s var(--ease),
    background-color 0.3s ease;
}

.try:hover {
  transform: translateY(-2px);
  background: #ffffffa6;
  color: var(--ink);
}

/* Without scripts there is no minute to start and no sky to switch. */
html:not(.js) :is(.try, .skyswitch, .stage__tabs, .stage__cue) {
  display: none;
}

.try--quiet {
  padding-inline: 24px;
}

.try__dot {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7c9e6, #b7a5f5 60%, #9fd0ff);
}

.try__dot::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  opacity: 0.4;
}

.hero__note {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-sky-soft);
}

/* The sky switch: the visitor can try the other parts of the day. */
.skyswitch {
  position: absolute;
  left: 50%;
  bottom: calc(var(--radius-sheet) + 20px);
  z-index: 2;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid #ffffff73;
  border-radius: var(--radius-pill);
  background: #ffffff4d;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  translate: -50% 0;
  transition: opacity 0.5s ease;
}

.skyswitch button {
  padding: 7px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}

:root[data-part='night'] .skyswitch button {
  color: var(--on-ink);
}

:root .skyswitch button[aria-pressed='true'] {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px #182b4526;
}

/* Breathing, while nobody has started the minute: 4 s in, 6 s out. */

@media (prefers-reduced-motion: no-preference) {
  .scene__ball img {
    animation: breathe var(--breath) ease-in-out infinite;
  }

  .scene__ball .ring {
    animation: ring var(--breath) ease-in-out infinite;
  }

  .scene__sky {
    animation: drift 60s ease-in-out infinite alternate;
  }

  .try__dot::after {
    animation: ripple 2.6s ease-out infinite;
  }

  /* The way in: the headline rises, the rest follows, Breevee comes up from behind the hill. */
  .js h1 .line > span {
    animation: line-up 1.1s var(--ease) both;
  }

  .js h1 .line:nth-child(2) > span {
    animation-delay: 0.1s;
  }

  .js h1 .line:nth-child(3) > span {
    animation-delay: 0.2s;
  }

  .js .hero__live,
  .js .hero__lead,
  .js .hero__actions,
  .js .hero__note,
  .js .skyswitch {
    animation: fade-up 1s var(--ease) both;
  }

  .js .hero__lead {
    animation-delay: 0.3s;
  }

  .js .hero__actions {
    animation-delay: 0.42s;
  }

  .js .hero__note {
    animation-delay: 0.54s;
  }

  .js .skyswitch {
    animation-name: fade-in;
    animation-delay: 0.9s;
  }

  .js .scene__ball {
    animation: pop-up 1.6s var(--ease) 0.15s both;
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.95);
  }
  40% {
    transform: scale(1.05);
  }
}

@keyframes ring {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.82);
  }
  40% {
    opacity: 1;
    transform: scale(1.06);
  }
  60% {
    opacity: 0.5;
  }
}

@keyframes drift {
  from {
    transform: translateX(-14px);
  }
  to {
    transform: translateX(14px);
  }
}

@keyframes ripple {
  from {
    opacity: 0.55;
    transform: scale(0.7);
  }
  to {
    opacity: 0;
    transform: scale(1.7);
  }
}

@keyframes line-up {
  from {
    transform: translateY(112%);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop-up {
  from {
    transform: translateY(46%);
  }
}

/* The minute on the page, and its Reward */

.session,
.reward {
  position: absolute;
  left: var(--gutter);
  top: 50%;
  display: grid;
  justify-items: start;
  width: min(calc(100% - 2 * var(--gutter)), 620px);
  translate: 0 -56%;
}

.session[hidden],
.reward[hidden] {
  display: none;
}

.session {
  gap: 18px;
}

.session__cue {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8.4vw, 7.5rem);
  font-weight: 340;
  font-variation-settings: 'SOFT' 100;
  line-height: 1;
  letter-spacing: -0.035em;
  animation: cue-in 0.9s var(--ease) both;
}

@keyframes cue-in {
  from {
    opacity: 0;
    transform: translateY(0.18em);
    filter: blur(6px);
  }
}

.session__count {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-sky-soft);
}

.session__track {
  width: min(280px, 60vw);
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--glass-line);
}

.session__track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
}

.session__end {
  margin-top: 10px;
  padding: 9px 22px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  background: var(--glass);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.reward {
  gap: 16px;
  animation: fade-up 0.9s var(--ease) both;
}

.reward .eyebrow {
  color: inherit;
  opacity: 0.8;
}

.reward h2 {
  font-size: clamp(2.75rem, 6vw, 5.25rem);
  outline: none;
}

.reward__body {
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--on-sky-soft);
}

.reward__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.reward__chips li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 8px 10px;
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 800;
  box-shadow: var(--card-shadow);
}

.reward__chips img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.reward__note {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--on-sky-soft);
}

/* While the minute runs, the words step aside and the script leads the breath, Phase by Phase. */
.hero.is-session .hero__copy,
.hero.is-reward .hero__copy {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition:
    opacity 0.5s ease,
    transform 0.6s var(--ease),
    visibility 0s linear 0.6s;
}

.hero.is-session .scene__ball img,
.hero.is-session .scene__ball .ring {
  animation: none;
  transition:
    transform var(--phase, 4s) cubic-bezier(0.45, 0.05, 0.55, 0.95),
    opacity var(--phase, 4s) ease;
}

.hero.is-session .scene__ball img {
  transform: scale(0.92);
}

.hero.is-session[data-phase='inhale'] .scene__ball img {
  transform: scale(1.12);
}

.hero.is-session .scene__ball .ring {
  opacity: 0.15;
  transform: scale(0.8);
}

.hero.is-session[data-phase='inhale'] .scene__ball .ring {
  opacity: 1;
  transform: scale(1.16);
}

.confetti {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* The sheet of paper */

.sheet {
  position: relative;
  z-index: 2;
  margin-top: calc(var(--radius-sheet) * -1);
  border-radius: var(--radius-sheet);
  background: var(--paper);
  box-shadow: 0 -20px 60px -30px #182b4559;
}

/* A fine grain, so the paper is not a flat fill. */
.sheet::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .17 0 0 0 0 .27 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
  pointer-events: none;
}

.sheet > * {
  position: relative;
}

/* Manifesto */

.manifesto {
  padding-block: var(--section) calc(var(--section) / 2);
}

.manifesto .kicker {
  margin-bottom: 28px;
}

.manifesto__text {
  max-width: 1040px;
  font-size: clamp(1.75rem, 3.9vw, 3.5rem);
  line-height: 1.14;
  letter-spacing: -0.022em;
  text-wrap: pretty;
}

/* Each word comes to full ink as the paragraph is scrolled through (words.js sets --lit from 0 to 1). */
.manifesto__text .word {
  opacity: calc(0.16 + 0.84 * var(--lit, 1));
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  margin-top: clamp(56px, 8vw, 112px);
}

.principles li {
  display: grid;
  align-content: start;
  gap: 10px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}

.principles__num {
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
  color: var(--violet);
}

.principles h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 400;
  font-variation-settings: 'SOFT' 100;
  letter-spacing: -0.02em;
}

.principles p {
  max-width: 34ch;
  font-size: 16px;
  color: var(--ink-soft);
}

/* Moods: the Session screen as a stage */

.stage {
  --stage-on: var(--ink);
  --stage-soft: var(--ink-soft);
  --stage-glass: #ffffff8c;
  --stage-line: #ffffffb3;
  --stage-bar: #b7a5f5; /* The app's accent, on each sky below. */
  --bar-width: clamp(40px, 5vw, 72px);
  --bar-rest: 0.28;
  --phase: 4s;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 24px;
  min-height: clamp(560px, 52vw, 660px);
  padding: clamp(20px, 3vw, 36px);
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-stage);
  color: var(--stage-on);
  transition: color 0.8s ease;
}

.stage[data-mood='sleep'] {
  --stage-on: var(--on-night);
  --stage-soft: #f2f0ffcc;
  --stage-glass: #1a1f4a73;
  --stage-line: #ffffff33;
  --stage-bar: #9a8cf0;
}

.stage[data-mood='energy'] {
  --stage-bar: #f5a97a;
}

.stage__skies {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.stage__sky {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

/* The landscape fills the lower half; its own lower part is plain ground and is cut off. */
.stage__sky img {
  position: absolute;
  left: 0;
  top: 24%;
  width: 100%;
  max-width: none;
}

/*
The side bars of the app's Session screen (session-side-bars.tsx): soft glows on both edges that rise with the breath in
and fall with the breath out. Drawn inside each sky, under the hills, so the hills cover their lower end as in the app.
They follow the stage's data-phase, with the app's gentle, almost straight easing (BAR_EASING).
*/
.stage__sky::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--stage-bar), transparent) left / var(--bar-width) 100% no-repeat,
    linear-gradient(270deg, var(--stage-bar), transparent) right / var(--bar-width) 100% no-repeat;
  /* Clear at the very top, solid from 40px down. */
  -webkit-mask-image: linear-gradient(transparent, #000 40px);
  mask-image: linear-gradient(transparent, #000 40px);
  opacity: 0.85;
  /* Rests low, with its tip at the hills' edge; grows from the bottom. */
  transform: scaleY(var(--bar-rest));
  transform-origin: bottom;
  transition: transform var(--phase) cubic-bezier(0.4, 0.1, 0.6, 0.9);
  pointer-events: none;
}

.stage[data-phase='inhale'] .stage__sky::before,
.stage[data-phase='holdIn'] .stage__sky::before {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .stage__sky::before {
    transition: none;
  }
}

/* The first Session scene of each Category, with its own sky. */
.stage__sky--energy {
  background: linear-gradient(#fbcfc0, #ffe9b8);
}

.stage__sky--focus {
  background: linear-gradient(#c9e2f8, #edf6fd);
}

.stage__sky--relax {
  background: linear-gradient(#d9ddf3, #ffe3c8);
}

.stage__sky--sleep {
  background: linear-gradient(#232b55, #4a4f8c);
}

.stage[data-mood='energy'] .stage__sky--energy,
.stage[data-mood='focus'] .stage__sky--focus,
.stage[data-mood='relax'] .stage__sky--relax,
.stage[data-mood='sleep'] .stage__sky--sleep {
  opacity: 1;
}

.stage__tabs {
  grid-column: 1 / -1;
  justify-self: start;
  display: flex;
  gap: 2px;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-pill);
  background: var(--stage-glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.stage__tabs button {
  padding: 10px 20px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}

.stage__tabs button[aria-selected='true'] {
  background: var(--ink);
  color: var(--on-ink);
}

.stage[data-mood='sleep'] .stage__tabs button[aria-selected='true'] {
  background: var(--on-night);
  color: var(--ink);
}

/* The Session Ball, with the cue under it. */
.stage__orb {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  justify-self: center;
  width: clamp(190px, 24vw, 280px);
  aspect-ratio: 1;
  /* Centred on the stage, not on its column. */
  margin-right: min(404px, 34vw);
}

.stage__orb img {
  position: absolute;
  inset: 0;
  width: 100%;
  transform: scale(0.84);
  transition: transform var(--phase) cubic-bezier(0.45, 0.05, 0.55, 0.95);
  filter: drop-shadow(0 18px 30px #5b3fd626);
}

.stage__orb .ring {
  inset: -9%;
  border-color: var(--stage-line);
  opacity: 0.35;
  transform: scale(0.8);
  transition:
    transform var(--phase) cubic-bezier(0.45, 0.05, 0.55, 0.95),
    opacity var(--phase) ease;
}

.stage__orb .ring + .ring {
  inset: -22%;
}

.stage[data-phase='inhale'] .stage__orb img,
.stage[data-phase='holdIn'] .stage__orb img {
  transform: scale(1.08);
}

.stage[data-phase='inhale'] .stage__orb .ring,
.stage[data-phase='holdIn'] .stage__orb .ring {
  opacity: 1;
  transform: scale(1.04);
}

.stage__cue {
  position: absolute;
  top: calc(100% + 26%);
  left: 50%;
  width: max-content;
  translate: -50% 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 38px);
  font-variation-settings: 'SOFT' 100;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stage__cue.is-new {
  animation: cue-in 0.7s var(--ease) both;
}

/* What the chosen Technique is, and its rhythm, with the running Phase filled in. */
.stage__panels {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  display: grid;
}

.mood {
  display: grid;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-card);
  background: var(--stage-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}

.js .mood {
  grid-area: 1 / 1;
}

.js .mood:not(.is-on) {
  display: none;
}

.js .mood.is-on {
  animation: fade-up 0.7s var(--ease) both;
}

.mood__moment {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stage-soft);
}

.mood h3 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 380;
  font-variation-settings: 'SOFT' 100;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.mood__text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--stage-soft);
}

.rhythm {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.rhythm li {
  position: relative;
  overflow: hidden;
  padding: 6px 14px;
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  isolation: isolate;
}

.rhythm b {
  font-weight: 800;
}

/* The running Phase fills from left to right over its seconds. */
.rhythm li::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--lilac);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
}

.rhythm li.is-running::before {
  opacity: 0.75;
  transform: scaleX(1);
  transition: transform var(--phase) linear;
}

/* Sections on ink */

.section--ink {
  margin-block: calc(var(--section) / 2);
  padding-block: var(--section);
  background: var(--ink);
  color: var(--on-ink);
}

.section--ink .kicker {
  color: var(--lilac);
}

.section--ink h2 em {
  color: #d9cdff;
}

.section--ink .head > p:not(.kicker) {
  color: #ffffffb8;
}

/* Taps: the Phase cue drawn on a line of ten seconds */

.touch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}

.touch .head {
  margin-bottom: 0;
}

.taps {
  display: grid;
  gap: 18px;
}

.taps__track {
  position: relative;
  height: 132px;
  border-bottom: 1px solid #ffffff33;
}

.taps__track i {
  position: absolute;
  left: var(--x);
  bottom: 28px;
  width: 4px;
  height: 34px;
  border-radius: 2px;
  background: var(--lilac);
  opacity: 0.28;
  transform-origin: bottom;
}

/* The Voice cue: the word it says at the start of each Phase. */
.taps__voice {
  position: absolute;
  left: var(--x);
  top: 6px;
  padding: 5px 12px;
  border: 1px solid #ffffff40;
  border-radius: var(--radius-pill);
  background: #ffffff14;
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0.4;
}

.taps__track .taps__firm {
  bottom: 22px;
  width: 46px;
  height: 46px;
  margin-left: -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbe3f2, #b7a5f5 55%, #8b7cff);
  opacity: 0.5;
  transform-origin: center;
}

/* Where the breath is now. */
.taps__head {
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--on-ink);
}

.taps__labels {
  display: grid;
  grid-template-columns: 60% 40%;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 800;
}

.taps__labels span + span {
  padding-left: 12px;
}

.taps__labels small {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: #ffffff99;
}

@media (prefers-reduced-motion: no-preference) {
  .taps__track i {
    animation: tap var(--breath) linear var(--t) infinite backwards;
  }

  .taps__track .taps__firm {
    animation-name: tap-firm;
  }

  .taps__voice {
    animation: voice var(--breath) ease-out var(--t) infinite backwards;
  }

  .taps__head {
    animation: head var(--breath) linear infinite;
  }
}

@keyframes voice {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  3%,
  14% {
    opacity: 1;
    transform: none;
  }

  26%,
  100% {
    opacity: 0.4;
    transform: none;
  }
}

@keyframes tap {
  0% {
    opacity: 1;
    transform: scaleY(1.7);
  }
  5%,
  100% {
    opacity: 0.28;
    transform: scaleY(1);
  }
}

@keyframes tap-firm {
  0% {
    opacity: 1;
    transform: scale(1.35);
    box-shadow: 0 0 0 0 #b7a5f5b3;
  }
  14% {
    opacity: 0.9;
    transform: scale(1);
  }
  40%,
  100% {
    opacity: 0.5;
    transform: scale(1);
    box-shadow: 0 0 0 46px #b7a5f500;
  }
}

/* The breath in takes 4 of the 10 seconds but 60% of the width, so the quiet breath out is the short part. */
@keyframes head {
  40% {
    left: 60%;
  }

  to {
    left: 100%;
  }
}

/* Sounds: the Listen tab on a stage that takes the chosen sound's place and sky */

.listen {
  --ground: clamp(170px, 19vw, 250px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  padding: clamp(28px, 5vw, 72px);
  padding-bottom: calc(var(--ground) + 24px);
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-stage);
  color: var(--ink);
  transition: color 0.8s ease;
}

.listen__scenes {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.scene-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--top), var(--bottom));
  opacity: 0;
  transition: opacity 1.2s ease;
}

/* The picture's hills start 13% down; the line sits --ground above the stage's lower edge. */
.scene-layer img {
  position: absolute;
  left: 0;
  top: calc(100% - var(--ground) - 30%);
  width: 100%;
  max-width: none;
}

.listen[data-scene='none'] .scene-layer--home,
.listen[data-scene='rain'] .scene-layer--rain,
.listen[data-scene='waves'] .scene-layer--waves,
.listen[data-scene='waterfall'] .scene-layer--waterfall,
.listen[data-scene='wind-in-trees'] .scene-layer--wind-in-trees,
.listen[data-scene='campfire'] .scene-layer--campfire,
.listen[data-scene='night-crickets'] .scene-layer--night-crickets {
  opacity: 1;
}

/* Sound scene skies, from SOUND_SKIES_LIGHT in appearance.ts. */
.scene-layer--home {
  --top: #d9ddf3;
  --bottom: #ffe3c8;
}

.scene-layer--rain {
  --top: #c9d3e3;
  --bottom: #e8eaee;
}

.scene-layer--waves {
  --top: #bfe3f0;
  --bottom: #f6ebdd;
}

.scene-layer--waterfall {
  --top: #cfe6e8;
  --bottom: #edf6f2;
}

.scene-layer--wind-in-trees {
  --top: #cde3f2;
  --bottom: #edf6f4;
}

.scene-layer--campfire {
  --top: #2e2b58;
  --bottom: #6b4f68;
}

.scene-layer--night-crickets {
  --top: #1e2b5a;
  --bottom: #35507a;
}

.listen__copy {
  display: grid;
  gap: 20px;
  max-width: 480px;
}

.listen__copy > p:not(.kicker) {
  color: var(--ink-soft);
  transition: color 0.8s ease;
}

.listen .kicker,
.listen h2 em {
  transition: color 0.8s ease;
}

.listen__hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  color: inherit !important;
}

.listen__hint i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 0 4px #5b3fd633;
}

/* The night scenes are dark, so the text turns light (the scene's onSky), as on the Session screen. */
.listen[data-scene='campfire'],
.listen[data-scene='night-crickets'] {
  color: var(--on-night);
}

.listen[data-scene='campfire'] .listen__copy > p:not(.kicker),
.listen[data-scene='night-crickets'] .listen__copy > p:not(.kicker) {
  color: #f2f0ffcc;
}

.listen[data-scene='campfire'] :is(.kicker, h2 em),
.listen[data-scene='night-crickets'] :is(.kicker, h2 em) {
  color: #d9cdff;
}

.listen[data-scene='campfire'] .listen__hint i,
.listen[data-scene='night-crickets'] .listen__hint i {
  background: #d9cdff;
}

.sounds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 16px;
}

/* A Soundscape tile: the picture with its preview button in the corner, and the name under it. */
.tile {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.tile__picture {
  position: relative;
  display: block;
  border-radius: var(--radius-picture);
  box-shadow: var(--card-shadow);
  transition: transform 0.5s var(--ease);
}

.tile:hover .tile__picture {
  transform: translateY(-4px) scale(1.02);
}

.tile__picture img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-picture);
}

/* The chosen tile: a border drawn over the picture's edge, as in the app. */
.tile__picture::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--lilac);
  border-radius: var(--radius-picture);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tile.is-chosen .tile__picture::after {
  opacity: 1;
}

.tile__button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--card-shadow);
}

.tile__button > * {
  grid-area: 1 / 1;
}

/* The play triangle, drawn from borders as in the app. */
.tile__play {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid var(--ink);
}

/* While it plays: three bars that rise and fall. */
.tile__bars {
  display: none;
  align-items: center;
  gap: 3px;
  height: 14px;
}

.tile__bars i {
  width: 3px;
  height: 12px;
  border-radius: 1.5px;
  background: var(--ink);
  animation: bars 1.1s ease-in-out infinite;
}

.tile__bars i:nth-child(2) {
  animation-delay: -0.4s;
}

.tile__bars i:nth-child(3) {
  animation-delay: -0.8s;
}

@keyframes bars {
  0%,
  100% {
    transform: scaleY(0.4);
  }
  50% {
    transform: scaleY(1);
  }
}

.tile.is-playing .tile__play {
  display: none;
}

.tile.is-playing .tile__bars {
  display: flex;
}

.tile__name {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 800;
}

/* Habit bento */

.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    'status status journey'
    'freeze nudge journey'
    'badges badges widget';
  gap: 20px;
}

.bento > .card {
  display: grid;
  align-content: space-between;
  gap: 28px;
  min-width: 0;
  padding: 32px;
  overflow: hidden;
  transition:
    transform 0.6s var(--ease),
    box-shadow 0.6s var(--ease);
}

.bento > .card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 1px 2px 0 var(--shadow-contact),
    0 22px 36px -14px var(--shadow-lift);
}

.bento h3 {
  font-size: 22px;
}

.bento__status {
  grid-area: status;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  align-content: center;
  background: var(--relax-card);
}

.bento__freeze {
  grid-area: freeze;
  background: var(--frozen);
}

.bento__freeze-icon {
  width: 53px;
}

@media (prefers-reduced-motion: no-preference) {
  .bento__freeze-icon {
    animation: bob 5s ease-in-out infinite;
  }
}

@keyframes bob {
  50% {
    transform: translateY(-6px) rotate(-4deg);
  }
}

.bento__journey {
  grid-area: journey;
  padding-bottom: 0 !important;
  background: linear-gradient(#bfddfb, #eaf4fe);
}

.bento__journey .phone {
  align-self: end;
  width: min(250px, 86%);
  max-height: 430px;
  margin-inline: auto;
}

.bento__nudge {
  grid-area: nudge;
  background: var(--plus-card);
}

.bento__badges {
  grid-area: badges;
}

.bento__widget {
  grid-area: widget;
  background: var(--energy-card);
}

/* The Home status card: Level with its bar, then the Streak with its Days. */
.status {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.status__row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status__icon {
  flex: none;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.status__level {
  flex: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.status__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.status__head strong,
.status__streak strong {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.status__head span {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 16px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--control);
}

.bar__fill {
  width: 46%;
  height: 100%;
  border-radius: 8px;
  background: var(--lilac);
}

/* The bar fills when the card scrolls into view (reveal.js adds .is-in), then the last check pops in. */
.js .status:not(.is-in) .bar__fill {
  width: 0;
}

.js .bar__fill {
  transition: width 1.4s var(--ease) 0.3s;
}

.status__divider {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--hairline);
}

.status__streak {
  flex: 1;
  min-width: 0;
}

.days {
  display: flex;
  gap: 4px;
}

.days i {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--done);
}

.days i::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  width: 5px;
  height: 9px;
  border: solid var(--on-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.js .days i:last-child {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1.7s;
}

.js .status:not(.is-in) .days i:last-child {
  transform: scale(0);
}

/* A Reminder, as iOS shows it. */
.notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 22px;
  background: #ffffffcc;
  box-shadow: var(--card-shadow);
}

.notice img {
  width: 40px;
  border-radius: 10px;
}

.notice p {
  font-size: 14px;
  line-height: 1.35;
}

.notice strong {
  display: block;
  font-weight: 500;
  color: var(--ink);
}

.notice p {
  color: var(--ink-soft);
}

.notice span {
  align-self: start;
  font-size: 12px;
  color: var(--muted);
}

/* Every badge in the app, in two rows that slide in opposite directions (badges.js fills them, twice, so the loop has no jump). */
.badges {
  display: grid;
  gap: 10px;
  margin-inline: -32px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
}

.badges__row {
  display: flex;
  width: max-content;
  animation: badges-slide 170s linear infinite;
}

.badges__row--reverse {
  animation-direction: reverse;
}

.badges img {
  flex: none;
  width: 72px;
  height: 72px;
  margin-right: 10px;
}

@keyframes badges-slide {
  to {
    transform: translateX(-50%);
  }
}

/* The widgets side by side, scrolled or swiped by hand. */
.widgets {
  display: flex;
  gap: 14px;
  margin-inline: -32px;
  padding: 4px 32px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.widgets::-webkit-scrollbar {
  display: none;
}

.widgets li {
  flex: none;
}

.widgets img {
  width: 148px;
  height: 148px;
  border-radius: 32px;
  box-shadow: var(--card-shadow);
}

/* Screens */

.section--screens {
  overflow: hidden;
}

.screens {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 3vw, 44px);
  padding: 8px var(--gutter) 24px;
}

.screen {
  flex: 0 1 236px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

/* Every second phone stands a little lower. */
.screen:nth-child(even) {
  margin-top: 48px;
}

.screen .phone {
  margin-bottom: 18px;
  transition: transform 0.7s var(--ease);
}

.screen:hover .phone {
  transform: translateY(-8px) rotate(-1deg);
}

.screen:nth-child(even):hover .phone {
  transform: translateY(-8px) rotate(1deg);
}

.screen p {
  max-width: 22ch;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* Plans */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 960px;
  margin-inline: auto;
}

.plan {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 28px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
}

.plan header {
  display: grid;
  gap: 6px;
}

.plan h3 {
  font-size: 17px;
  letter-spacing: 0.02em;
}

.plan__price {
  font-family: var(--font-display);
  font-size: clamp(40px, 4.4vw, 56px);
  font-variation-settings: 'SOFT' 100;
  line-height: 1;
  letter-spacing: -0.03em;
}

.plan__price small {
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.plan--plus {
  border-color: transparent;
  background:
    radial-gradient(120% 90% at 100% 0%, #ffe3f1 0%, #ffe3f100 60%),
    linear-gradient(160deg, #efe6fb, #e3dbff);
  box-shadow: var(--card-shadow);
}

.plan--plus .checks li::before {
  background: var(--lilac);
}

.plan__cta {
  justify-self: start;
  align-self: end;
}

.plan__note {
  font-size: 14px;
  color: var(--ink-soft);
}

/* Privacy and the maker note */

.section--trust {
  padding-bottom: var(--section);
}

.trust {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}

.trust__private {
  display: grid;
  gap: 24px;
}

.trust__private h2 {
  font-size: clamp(2rem, 3.6vw, 3.25rem);
}

.note {
  position: relative;
  display: grid;
  gap: 32px;
  padding: clamp(28px, 4.4vw, 56px);
  border-radius: var(--radius-stage);
  background: var(--plus-card);
}

.note__ball {
  position: absolute;
  top: -44px;
  right: 36px;
  width: 104px;
}

@media (prefers-reduced-motion: no-preference) {
  .note__ball {
    animation: bob 6s ease-in-out infinite;
  }
}

.note blockquote {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  font-style: italic;
  font-weight: 340;
  font-variation-settings: 'SOFT' 100;
  line-height: 1.32;
  letter-spacing: -0.015em;
}

.note figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
}

.note figcaption img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.note figcaption span {
  display: grid;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-soft);
}

.note figcaption strong {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

/* Final call: the sky again, coming out from under the paper */

.final {
  position: relative;
  z-index: 1;
  margin-top: calc(var(--radius-sheet) * -1);
  padding-top: calc(var(--radius-sheet) + var(--section));
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(
    var(--sky-top),
    var(--sky-mid, var(--sky-bottom)) 55%,
    var(--sky-bottom)
  );
  color: var(--on-sky);
  text-align: center;
}

.final__sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.final__cloud {
  position: absolute;
  opacity: 0.9;
}

:root[data-part='evening'] .final__cloud {
  opacity: 0.5;
}

:root[data-part='night'] .final__cloud {
  opacity: 0.14;
}

.final__cloud--1 {
  top: 22%;
  left: -4%;
  width: clamp(180px, 24vw, 340px);
}

.final__cloud--2 {
  top: 12%;
  right: 6%;
  width: clamp(150px, 18vw, 260px);
}

.final__cloud--3 {
  top: 48%;
  right: -3%;
  width: clamp(120px, 14vw, 210px);
}

@media (prefers-reduced-motion: no-preference) {
  .final__cloud {
    animation: drift 40s ease-in-out infinite alternate;
  }

  .final__cloud--2 {
    animation-duration: 55s;
    animation-direction: alternate-reverse;
  }
}

.final__inner {
  display: grid;
  justify-items: center;
  gap: 22px;
}

.final h2 {
  max-width: 14ch;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
}

.final__inner > p {
  max-width: 420px;
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--on-sky-soft);
}

.final__get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}

/* A QR code for visitors on a computer, who cannot install from the page. Hidden on touch screens. */
.qr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px 6px 6px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
}

.qr img {
  width: 44px;
  height: 44px;
  padding: 3px;
  border-radius: 8px;
  background: var(--card);
}

@media (hover: none), (max-width: 760px) {
  .qr {
    display: none;
  }
}

/* Breevee waves from the near hill of the visitor's part of the day. */
.final__ground {
  --strip: max(1500px, 120vw);
  position: relative;
  height: calc(var(--strip) * 0.15 + 150px);
  margin-top: 40px;
}

.final__ball {
  position: absolute;
  left: 50%;
  bottom: calc(var(--strip) * 0.15 - 14px);
  width: 170px;
  translate: -50% 0;
  transform-origin: 50% 90%;
}

@media (prefers-reduced-motion: no-preference) {
  .final__ball {
    animation: breathe var(--breath) ease-in-out infinite;
  }
}

.final__hill {
  position: absolute;
  left: 50%;
  top: 150px;
  width: var(--strip);
  max-width: none;
  translate: -50% 0;
}

.final__hill--back {
  top: calc(150px - var(--strip) * 0.012);
}

.final__hill:not([src]) {
  visibility: hidden;
}

/* Footer: paper again, over the hill */

.footer {
  position: relative;
  z-index: 2;
  margin-top: calc(var(--radius-sheet) * -1);
  padding-block: 56px calc(44px + env(safe-area-inset-bottom, 0px));
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  background: var(--paper);
  font-size: 15px;
  color: var(--muted);
}

.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px 40px;
}

.footer__brand {
  display: grid;
  gap: 12px;
  max-width: 544px;
}

.footer__brand img {
  width: 96px;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 8px 24px;
}

.footer nav :is(a, button) {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-ui);
  font-size: inherit;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.footer nav :is(a, button):hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer__legal {
  grid-column: 1 / -1;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
}

/* The Now playing bar */

.player {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(420px, calc(100% - 32px));
  padding: 8px;
  border-radius: var(--radius-pill);
  background: var(--card);
  box-shadow:
    var(--card-shadow),
    0 18px 40px -12px var(--shadow-lift);
  translate: -50% 0;
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transform-origin: bottom center;
  transition:
    opacity 0.35s var(--ease),
    transform 0.45s var(--ease),
    bottom 0.4s var(--ease);
}

/* While the cookie card is open (consent.js sets --consent-h), the bar sits above it where they would meet. */
@media (max-width: 860px) {
  .player {
    bottom: calc(16px + var(--consent-h, 0px) + env(safe-area-inset-bottom, 0px));
  }
}

/* sounds.js adds .is-open a frame after un-hiding, and takes it off before hiding again, so the bar slides both ways. */
.player.is-open {
  opacity: 1;
  transform: none;
}

.player[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .player {
    transition: none;
  }
}

.player__picture {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.player__text {
  flex: 1;
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.player__text span {
  font-size: 13px;
  color: var(--ink-soft);
}

.player__text strong {
  overflow: hidden;
  font-family: var(--font-ui);
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player__toggle,
.player__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.player__toggle {
  background: var(--ink);
}

.player__toggle > i {
  grid-area: 1 / 1;
}

.player__play {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid var(--on-ink);
}

/* Pause: two bars, drawn with borders. */
.player__pause {
  display: none;
  width: 12px;
  height: 14px;
  border-left: 4px solid var(--on-ink);
  border-right: 4px solid var(--on-ink);
}

.player.is-playing .player__play {
  display: none;
}

.player.is-playing .player__pause {
  display: block;
}

.player__close {
  background: var(--control);
}

/* A cross from two turned bars. */
.player__close i {
  position: relative;
  width: 14px;
  height: 14px;
}

.player__close i::before,
.player__close i::after {
  content: '';
  position: absolute;
  left: 6px;
  top: -1px;
  width: 2px;
  height: 16px;
  border-radius: 1px;
  background: var(--ink);
  transform: rotate(45deg);
}

.player__close i::after {
  transform: rotate(-45deg);
}

/* Reveal: pieces rise into place the first time they are scrolled to (reveal.js adds .is-in). */

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition:
      opacity 0.9s ease var(--delay, 0s),
      transform 1.1s var(--ease) var(--delay, 0s);
  }

  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }
}

/* Motion off: nothing moves by itself. The cue words and the rhythm still change, since they are the guide. */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .manifesto__text .word {
    opacity: 1;
  }

  .js .status:not(.is-in) .bar__fill {
    width: 46%;
  }

  .js .bar__fill,
  .js .days i:last-child {
    transition: none;
  }

  .js .status:not(.is-in) .days i:last-child {
    transform: none;
  }

  .badges__row,
  .tile__bars i,
  .session__cue,
  .stage__cue.is-new,
  .reward,
  .js .mood.is-on {
    animation: none;
  }

  .badges {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .stage__orb img,
  .stage__orb .ring,
  .rhythm li.is-running::before {
    transition: none;
  }

  .ring {
    opacity: 0.6;
  }
}

/* Tablet */

@media (max-width: 1020px) {
  .topbar__nav {
    display: none;
  }

  .topbar__inner {
    justify-content: space-between;
  }

  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      'status status'
      'freeze nudge'
      'badges badges'
      'widget journey';
  }

  .bento__journey .phone {
    max-height: 300px;
  }

  .touch,
  .trust {
    grid-template-columns: minmax(0, 1fr);
  }

  .listen {
    grid-template-columns: minmax(0, 1fr);
  }

  .listen__copy {
    max-width: 560px;
  }

  .note {
    margin-top: 32px;
  }
}

/* Phone, and any narrow or short window: the hero is one centred column and scrolls with the page. */

@media (max-width: 860px) {
  .hero {
    --strip: max(1080px, 150vw);
    --scene-x: 50%;
    --ball: clamp(170px, 46vw, 230px);
    --sink: 0.08;
    position: relative;
    top: auto;
    height: auto;
    min-height: 100svh;
  }

  .hero__inner {
    justify-content: center;
    min-height: 100svh;
    padding-top: calc(env(safe-area-inset-top, 0px) + 88px);
    /* Room for Breevee on the hill, and the sky switch under it. */
    padding-bottom: calc(
      var(--strip) * (0.1783 - var(--sink)) + var(--ball) * 0.86 + 16px
    );
  }

  .hero__copy {
    justify-items: center;
    gap: 16px;
    text-align: center;
  }

  /* The first view keeps Breevee in it; the final call says this line again. */
  .hero__note {
    display: none;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__lead {
    max-width: 340px;
  }

  .scene img.scene__sky {
    left: 10%;
    top: 0;
    width: 80%;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .try__more {
    display: none;
  }

  .session,
  .reward {
    left: 50%;
    top: calc(env(safe-area-inset-top, 0px) + 104px);
    justify-items: center;
    text-align: center;
    translate: -50% 0;
  }

  .reward__chips,
  .reward .hero__actions {
    justify-content: center;
  }

  .skyswitch button {
    padding: 6px 11px;
    font-size: 12px;
  }

  .principles {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 20px;
    min-height: 0;
    padding: 16px;
    border-radius: 32px;
  }

  .stage__tabs {
    justify-self: center;
  }

  .stage__tabs button {
    padding: 9px 14px;
    font-size: 15px;
  }

  .stage__orb {
    grid-column: 1;
    width: 180px;
    margin: 12px 0 84px;
  }

  .stage__panels {
    grid-column: 1;
    grid-row: 3;
  }

  .stage__sky img {
    top: auto;
    bottom: 0;
  }

  .mood {
    padding: 20px;
  }

  .listen {
    --ground: 150px;
    padding: 28px 20px calc(var(--ground) + 12px);
    border-radius: 32px;
  }

  .sounds {
    gap: 16px 12px;
  }

  .tile__name {
    font-size: 14px;
  }

  .bento {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'status'
      'freeze'
      'nudge'
      'journey'
      'badges'
      'widget';
    gap: 16px;
  }

  .bento > .card {
    padding: 24px;
  }

  .bento__status {
    grid-template-columns: minmax(0, 1fr);
  }

  .bento__journey .phone {
    max-height: 340px;
  }

  .badges,
  .widgets {
    margin-inline: -24px;
  }

  .widgets {
    padding-inline: 24px;
  }

  /* The screens become a row to swipe. */
  .screens {
    justify-content: flex-start;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .screens::-webkit-scrollbar {
    display: none;
  }

  .screen {
    flex: 0 0 min(62vw, 250px);
    scroll-snap-align: center;
  }

  .screen:nth-child(even) {
    margin-top: 0;
  }

  /* In a row that scrolls sideways, a phone off to the right must not wait to be revealed. */
  .js .screens [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .final__cloud--2 {
    display: none;
  }

  .final__cloud--1 {
    top: 46%;
  }

  .plans {
    grid-template-columns: minmax(0, 1fr);
  }

  .note__ball {
    top: -36px;
    right: 24px;
    width: 80px;
  }

  .footer__inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  :root {
    --radius-sheet: 32px;
  }

  .days i:nth-child(n + 4) {
    display: none;
  }

  .hero__actions .try {
    font-size: 16px;
  }
}

/* A short, wide window (a laptop with a low screen): the same layout, a little tighter. */
@media (min-width: 861px) and (max-height: 760px) {
  h1 {
    font-size: clamp(2.75rem, 5.2vw, 4.5rem);
  }

  .hero__copy {
    gap: 20px;
  }
}

/* The App Store button and the plan button, until the app is live: shown, but not links. */
.button--soon {
  background: var(--control);
  color: var(--ink-soft);
  cursor: default;
}

.button--soon:hover {
  transform: none;
  box-shadow: none;
}

/* The QR code is blurred until it points somewhere. */
.qr img {
  filter: blur(5px);
  opacity: 0.8;
}
