/*
 * hyPer's landing page. Colours, type roles and the gutter come from
 * /assets/blanc.css; this file lays the page out and draws the app's own
 * pieces (a live set and its tally, the day's food, Monday's target update,
 * an agent's activity) as the iPhone app draws them, at the app's sizes.
 *
 * Blanc's rules hold: content sits on the ground, ordered by type, space and
 * hairlines; the system font; one red, for the P and what is live. The two
 * approved exceptions are here too, as in the app: the molten glass behind
 * the page (assets/glass.js) and the light a press leaves in a glass button.
 */

/* ── Appearance ───────────────────────────────────────────────────────── */

/* A chosen appearance (the switch in the tab bar) names the app's palette
   itself, since blanc.css only follows the system. Every colour is one of
   native/src/theme/blanc.ts's; tests/homePage.test.ts holds them to it. */
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #F2F1ED;
  --label: #FFFFFF;
  --label-edge: rgba(0, 0, 0, 0.06);
  --ink: #0B0B0B;
  --graphite: #66665F;
  --upcoming: #707069;
  --hairline: rgba(0, 0, 0, 0.09);
  --track: #DCDBD6;
  --mark: #878680;
  --fill: #ECEBE6;
  --chosen: #FFFFFF;
  --pressed: #E7E6E1;
  --capsule: #0B0B0B;
  --on-capsule: #FFFFFF;
  --switch-on: #0B0B0B;
  --switch-thumb-on: #FFFFFF;
  --live: #A8352A;
  --brand: #A8352A;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #000000;
  --label: #1C1C1B;
  --label-edge: rgba(255, 255, 255, 0.07);
  --ink: #F4F4F2;
  --graphite: #A3A39C;
  --upcoming: #8C8C86;
  --hairline: rgba(255, 255, 255, 0.11);
  --track: #363634;
  --mark: #7A7A73;
  --fill: #2C2C2A;
  --chosen: #4A4A47;
  --pressed: #30302E;
  --capsule: #E6E6E2;
  --on-capsule: #0B0B0B;
  --switch-on: #E6E6E2;
  --switch-thumb-on: #0B0B0B;
  --live: #E0604F;
  --brand: #E0604F;
}

@media (prefers-contrast: more) {
  :root[data-theme="light"] {
    --ground: #F2F1ED;
    --label: #FFFFFF;
    --label-edge: rgba(0, 0, 0, 0.2);
    --ink: #000000;
    --graphite: #4A4A44;
    --upcoming: #57574F;
    --hairline: rgba(0, 0, 0, 0.22);
    --track: #BDBCB6;
    --mark: #7A7973;
    --fill: #E3E2DC;
    --chosen: #FFFFFF;
    --pressed: #D8D7D1;
    --capsule: #000000;
    --on-capsule: #FFFFFF;
    --switch-on: #000000;
    --switch-thumb-on: #FFFFFF;
    --live: #A8352A;
    --brand: #A8352A;
  }

  :root[data-theme="dark"] {
    --ground: #000000;
    --label: #222221;
    --label-edge: rgba(255, 255, 255, 0.24);
    --ink: #FFFFFF;
    --graphite: #C9C9C3;
    --upcoming: #B2B2AC;
    --hairline: rgba(255, 255, 255, 0.28);
    --track: #4D4D4A;
    --mark: #85857D;
    --fill: #38383A;
    --chosen: #5A5A57;
    --pressed: #424240;
    --capsule: #FFFFFF;
    --on-capsule: #000000;
    --switch-on: #FFFFFF;
    --switch-thumb-on: #000000;
    --live: #FF6F61;
    --brand: #E0604F;
  }
}

/* What the page adds to the palette: glass for what is pressed, and the light
   a press leaves in it. The app's buttons are Apple's Liquid Glass; here it
   is the page seen through frost. The light's colours are the app's own
   (TapBloom): neutral for most buttons, warm for the workout's. */
:root {
  --glass: rgba(255, 255, 255, 0.66);
  --glass-edge: rgba(0, 0, 0, 0.08);
  --glass-quiet: rgba(255, 255, 255, 0.24);
  --glass-quiet-edge: rgba(0, 0, 0, 0.16);
  --glass-bar: rgba(244, 243, 240, 0.82);
  --glass-lift: 0 10px 30px rgba(0, 0, 0, 0.08);
  --pick: rgba(0, 0, 0, 0.07);
  --bloom: radial-gradient(circle closest-side, rgba(0, 0, 0, 0.14) 0%, rgba(0, 0, 0, 0.08) 45%, rgba(0, 0, 0, 0) 100%);
  --bloom-effort: radial-gradient(circle closest-side, rgba(228, 138, 95, 0.72) 0%, rgba(228, 140, 95, 0.5) 45%, rgba(228, 140, 95, 0) 100%);
  --chip-lift: 0 1px 3px rgba(0, 0, 0, 0.08);

  /* The P as a relief (the sculpture's stand-in): the light its chamfer
     catches, the shade on its other side, the sheen across it, the shadow
     under it. */
  --sculpt-lit: rgba(255, 255, 255, 0.4);
  --sculpt-shade: rgba(52, 6, 2, 0.34);
  --sculpt-sheen: 0.2;
  --sculpt-cast: rgba(70, 22, 14, 0.22);

  /* The app's curves. The springs are stand-ins until the script writes the
     real ones (assets/home.js works them out from the app's own numbers). */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-rise: cubic-bezier(0.22, 0.8, 0.24, 1);
  --ease-track: cubic-bezier(0.33, 1, 0.68, 1);
  --spring-press: cubic-bezier(0.3, 1.5, 0.5, 1);
  --spring-press-ms: 320ms;
  --spring-tally: cubic-bezier(0.3, 1.6, 0.5, 1);
  --spring-tally-ms: 460ms;
  --spring-draw: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-draw-ms: 380ms;
  --spring-roll: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-roll-ms: 420ms;
  --spring-bar: cubic-bezier(0.3, 1.2, 0.4, 1);
  --spring-bar-ms: 520ms;

  /* The page's own edge and width. */
  --page-x: max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --wide: 1200px;

  /* One app point. The app's pieces are drawn in these, a little larger on a desk. */
  --k: 1;
  --u: calc(1rem * var(--k) / 17);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass: rgba(255, 255, 255, 0.1);
    --glass-edge: rgba(255, 255, 255, 0.13);
    --glass-quiet: rgba(255, 255, 255, 0.065);
    --glass-quiet-edge: rgba(255, 255, 255, 0.12);
    --glass-bar: rgba(22, 22, 21, 0.8);
    --glass-lift: 0 0 0 rgba(0, 0, 0, 0);
    --pick: rgba(255, 255, 255, 0.11);
    --bloom: radial-gradient(circle closest-side, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0) 100%);
    --bloom-effort: radial-gradient(circle closest-side, rgba(255, 158, 108, 0.85) 0%, rgba(255, 143, 106, 0.35) 50%, rgba(255, 143, 106, 0) 100%);
    --chip-lift: 0 0 0 rgba(0, 0, 0, 0);
    --sculpt-lit: rgba(255, 238, 228, 0.55);
    --sculpt-shade: rgba(0, 0, 0, 0.46);
    --sculpt-sheen: 0.16;
    --sculpt-cast: rgba(0, 0, 0, 0);
  }
}

:root[data-theme="dark"] {
  --glass: rgba(255, 255, 255, 0.1);
  --glass-edge: rgba(255, 255, 255, 0.13);
  --glass-quiet: rgba(255, 255, 255, 0.065);
  --glass-quiet-edge: rgba(255, 255, 255, 0.12);
  --glass-bar: rgba(22, 22, 21, 0.8);
  --glass-lift: 0 0 0 rgba(0, 0, 0, 0);
  --pick: rgba(255, 255, 255, 0.11);
  --bloom: radial-gradient(circle closest-side, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0) 100%);
  --bloom-effort: radial-gradient(circle closest-side, rgba(255, 158, 108, 0.85) 0%, rgba(255, 143, 106, 0.35) 50%, rgba(255, 143, 106, 0) 100%);
  --chip-lift: 0 0 0 rgba(0, 0, 0, 0);
  --sculpt-lit: rgba(255, 238, 228, 0.55);
  --sculpt-shade: rgba(0, 0, 0, 0.46);
  --sculpt-sheen: 0.16;
  --sculpt-cast: rgba(0, 0, 0, 0);
}

@media (min-width: 720px) {
  :root {
    --page-x: clamp(28px, 5vw, 72px);
  }
}

@media (min-width: 1100px) {
  :root {
    --k: 1.1;
  }
}

@media (min-width: 1600px) {
  :root {
    --wide: 1360px;
    --k: 1.2;
  }
}

/* ── Page ─────────────────────────────────────────────────────────────── */

html {
  background: var(--ground);
  overflow-x: clip;
  scroll-padding-top: 24px;
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

/* Changing appearance: the ground, the ink and the glass turn over together. */
.look-turning,
.look-turning * {
  transition: background-color 420ms var(--ease-in-out), color 420ms var(--ease-in-out), fill 420ms var(--ease-in-out),
    border-color 420ms var(--ease-in-out), box-shadow 420ms var(--ease-in-out) !important;
}

.top,
main,
.foot {
  position: relative;
  z-index: 1;
}

/* The glass fills the window behind the page, as it fills the screen behind
   the app's tabs. It holds the tallest window, so a phone's bars coming and
   going never resize it. Until its first frame it is not there at all. */
.glass {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
  visibility: hidden;
}

.glass.is-live {
  visibility: visible;
}

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 80;
  padding: 10px 16px;
  border-radius: 22px;
  background: var(--capsule);
  color: var(--on-capsule);
  font-size: calc(15rem / 17);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus-visible {
  transform: none;
}

/* ── Top: the mark ────────────────────────────────────────────────────── */

.top {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: calc(var(--wide) + 2 * var(--page-x));
  min-height: 44px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) var(--page-x) 0;
}

/* The P's foot sits on the gutter, inside a 44 px target. */
.brand {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
}

/* One P to a screen. While the script runs, the hero's sculpture is the mark,
   so the corner's gives way to it (the tab bar keeps the small one in reach).
   It is still there for a keyboard, and shows when it takes the focus. */
.js .brand {
  pointer-events: none;
}

.js .brand .mark {
  opacity: 0;
  transition: opacity 160ms ease;
}

.js .brand:focus-visible .mark {
  opacity: 1;
}

.top__date {
  margin: 0;
  color: var(--graphite);
  font-size: calc(15rem / 17);
  line-height: calc(20 / 15);
  font-variant-numeric: tabular-nums;
}

/* ── The P, and the name in one line ──────────────────────────────────── */

/* The first screen: the P standing as a sculpture on the page's bare ground,
   where the glass shows, over one line that says what hyPer is. The stage
   takes whatever height the words leave. */
.hero {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-width: calc(var(--wide) + 2 * var(--page-x));
  min-height: calc(100vh - 62px);
  min-height: calc(100svh - 62px - env(safe-area-inset-top, 0px));
  margin: 0 auto;
  padding: 4px var(--page-x) calc(96px + env(safe-area-inset-bottom, 0px));
}

.hero__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: clamp(180px, 30vh, 300px);
}

/* The words stand over the stage, so the sculpture's shadow falls under them. */
.hero__body,
.hero__facts {
  position: relative;
  z-index: 1;
}

.hero__body {
  display: grid;
  gap: 16px;
}

/* Two lines on a phone and on a desk: the P is the picture, this its caption. */
.hero__title {
  max-width: 11.5em;
  margin: 0;
  font-size: clamp(2.5rem, 0.9rem + 8.3vw, 5rem);
  line-height: 1.01;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero__lead {
  max-width: 27em;
  margin: 0;
  font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.3125rem);
  line-height: 1.32;
  letter-spacing: -0.006em;
  text-wrap: pretty;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 20px;
  margin: 26px 0 0;
  padding: 14px 0 0;
  border-top: var(--hairline-width) solid var(--hairline);
  list-style: none;
  color: var(--graphite);
  font-family: var(--mono);
  font-size: calc(12rem / 17);
  line-height: calc(16 / 12);
}

/* The way on: to Train, the first part of the app. 16 px drawn, 44 to touch. */
.hero__next a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease;
}

.hero__next a::after {
  content: "";
  position: absolute;
  inset: -14px -12px;
}

.hero__next svg {
  flex: none;
  width: 10px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .hero__next a:hover {
    color: var(--ink);
  }
}

@media (min-width: 900px) {
  /* On a desk the tab bar floats at the head of the page: the P keeps clear of it. */
  .hero {
    min-height: calc(100vh - 62px);
    padding-top: 20px;
    padding-bottom: 40px;
  }

  .hero__facts {
    margin-top: 36px;
  }
}

@media (min-width: 1100px) {
  .hero__body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 19rem);
    align-items: end;
    gap: 48px;
  }

  .hero__title {
    font-size: clamp(5rem, 0.6rem + 6vw, 6.25rem);
  }

  .hero__lead {
    padding-bottom: 0.4em;
  }
}

/* ── The sculpture ────────────────────────────────────────────────────── */

/* The P's seat: its ink's own box, as tall as the stage allows and no wider
   than a phone can hold. The flat mark, the relief and the sculpture are all
   drawn on it, so one can become another without moving. */
.sculpt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sculpt__seat {
  position: relative;
  flex: none;
  height: min(90%, 82vw, 36rem);
  aspect-ratio: 1325 / 1400;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.sculpt__flat {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sculpt__body {
  fill: var(--brand);
}

/* The relief: a chamfer's lit side and its shaded one, and a sheen across the
   face. It stands in wherever the sculpture cannot be drawn; while the script
   is still deciding, the mark is simply flat. */
.sculpt__keep {
  fill: rgb(255, 255, 255);
}

.sculpt__cut {
  fill: rgb(0, 0, 0);
}

.sculpt__lit {
  fill: var(--sculpt-lit);
}

.sculpt__shade {
  fill: var(--sculpt-shade);
}

.sculpt__sheen-edge {
  stop-color: rgb(255, 255, 255);
  stop-opacity: 0;
}

.sculpt__sheen-mid {
  stop-color: rgb(255, 255, 255);
  stop-opacity: var(--sculpt-sheen);
}

.js .sculpt__relief {
  opacity: 0;
  transition: opacity 700ms var(--ease-out);
}

.js.no-sculpt .sculpt__relief {
  opacity: 1;
}

html:not(.js) .sculpt__flat,
.no-sculpt .sculpt__flat {
  filter: drop-shadow(0.5rem 1rem 0.9rem var(--sculpt-cast));
}

/* The sculpture's canvas hangs past the seat on every side: room for it to
   lean, and for the shadow it casts in the light. It never takes a press. */
.sculpt__canvas {
  position: absolute;
  top: -20%;
  left: -30%;
  display: block;
  width: 160%;
  height: 146%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.sculpt__seat.is-live .sculpt__canvas {
  opacity: 1;
}

.sculpt__seat.is-live .sculpt__flat {
  visibility: hidden;
  transition: visibility 0s linear 260ms;
}

/* ── A part of the app ────────────────────────────────────────────────── */

.pillar {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "text" "stage" "aside" "note";
  row-gap: 36px;
  max-width: calc(var(--wide) + 2 * var(--page-x));
  margin: 0 auto;
  padding: clamp(96px, 17vh, 176px) var(--page-x) 0;
  /* A link to a part lands with its title a little under the top, the part before out of sight. */
  scroll-margin-top: calc(40px - clamp(96px, 17vh, 176px));
}

.pillar__text {
  grid-area: text;
}

.pillar__stage {
  grid-area: stage;
}

.pillar__aside {
  grid-area: aside;
}

.pillar__note {
  grid-area: note;
  margin: 0;
  color: var(--upcoming);
  font-family: var(--mono);
  font-size: calc(12rem / 17);
  line-height: calc(16 / 12);
  text-wrap: pretty;
}

/* Named as the app's tabs are, in the app's large title. */
.pillar__title {
  margin: 0;
  font-size: clamp(2.125rem, 1.45rem + 3vw, 4rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.pillar__lead {
  max-width: 23em;
  margin: 18px 0 0;
  font-size: clamp(1.25rem, 1.08rem + 0.75vw, 1.75rem);
  line-height: 1.26;
  letter-spacing: -0.014em;
  text-wrap: pretty;
}

.pillar__quiet {
  max-width: 30em;
  margin: 14px 0 0;
  color: var(--graphite);
  font-size: 1rem;
  line-height: calc(22 / 17);
  text-wrap: pretty;
}

@media (min-width: 900px) {
  .pillar {
    grid-template-columns: minmax(0, 6fr) minmax(0, 1fr) minmax(0, 5fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "text . stage" "aside . stage" "note . stage";
    column-gap: 24px;
    row-gap: 44px;
    align-items: start;
    scroll-margin-top: calc(112px - clamp(96px, 17vh, 176px));
  }

  .pillar__stage {
    display: flex;
    justify-content: flex-end;
  }

  /* Fuel turns over: the day on the left, the words and Monday on the right. */
  .pillar--fuel {
    grid-template-columns: minmax(0, 5fr) minmax(0, 1fr) minmax(0, 6fr);
    grid-template-areas: "stage . text" "stage . aside" "stage . note";
  }

  .pillar--fuel .pillar__stage {
    justify-content: flex-start;
  }

  .pillar--agents {
    grid-template-rows: auto;
    grid-template-areas: "text . stage";
  }
}

/* ── The app's pieces, at the app's sizes ─────────────────────────────── */

.artifact {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: calc(390 * var(--u));
  font-size: calc(17 * var(--u));
  line-height: calc(22 / 17);
}

/* A rule opens each piece. It is drawn in from the text edge as the piece comes into view. */
.artifact::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: var(--hairline-width);
  background: var(--hairline);
  transform-origin: 0 50%;
}

.lock::before {
  content: none;
}

.artifact p,
.artifact h3 {
  margin: 0;
}

.artifact__foot {
  margin-top: calc(18 * var(--u)) !important;
  padding-top: calc(12 * var(--u));
  border-top: var(--hairline-width) solid var(--hairline);
  color: var(--upcoming);
  font-family: var(--mono);
  font-size: calc(12 * var(--u));
  line-height: calc(16 / 12);
}

/* A group's heading, as Section draws one. */
.sechead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(12 * var(--u));
  min-height: calc(44 * var(--u));
  padding-top: calc(8 * var(--u));
}

.sechead__title {
  font-size: calc(20 * var(--u));
  line-height: calc(25 / 20);
  font-weight: 600;
}

.sechead__note {
  color: var(--graphite);
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
}

.sechead--rows {
  margin-top: calc(26 * var(--u));
  padding-top: 0;
}

/* List rows: a medium title over one quiet line, rules between them. */
.rows {
  margin: calc(14 * var(--u)) 0 0;
  padding: 0;
  list-style: none;
}

.sechead--rows + .rows {
  margin-top: 0;
}

.row {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  min-height: calc(60 * var(--u));
  padding: calc(10 * var(--u)) 0;
  border-top: var(--hairline-width) solid var(--hairline);
}

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

.row__title {
  overflow: hidden;
  font-size: calc(17 * var(--u));
  line-height: calc(22 / 17);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row__detail {
  overflow: hidden;
  margin-top: calc(1 * var(--u)) !important;
  color: var(--graphite);
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row__value {
  align-self: flex-start;
  margin-top: calc(2 * var(--u));
  color: var(--graphite);
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
  font-variant-numeric: tabular-nums;
}

/* An agent's entry reads whole, on a second line when it must, as in the app. */
.row--action .row__title,
.row--action .row__detail {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  text-wrap: pretty;
}

/* An agent's entry once undone: it recedes through its words. */
.row.is-undone .row__title {
  color: var(--graphite);
  font-weight: 400;
}

/* A row arriving or leaving: it opens its own room, fades in, and leaves to
   the left as a swiped row does. */
.row.is-entering,
.row.is-leaving {
  overflow: hidden;
}

/* Capsule: what is pressed. Glass with an ink title; under the finger it
   gives a little and lights from the fingertip. */
.capsule {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: calc(44 * var(--u));
  margin: 0;
  padding: 0 calc(20 * var(--u));
  border: 0;
  border-radius: calc(22 * var(--u));
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  color: var(--ink);
  font-family: inherit;
  font-size: calc(16 * var(--u));
  line-height: calc(20 / 16);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  backdrop-filter: blur(18px) saturate(1.7);
  transition: transform var(--spring-press-ms) var(--spring-press);
}

.capsule__label {
  position: relative;
  transition: opacity 140ms ease;
}

.capsule--quiet {
  background: var(--glass-quiet);
  box-shadow: inset 0 0 0 1px var(--glass-quiet-edge);
  font-weight: 500;
}

.capsule--large {
  height: calc(54 * var(--u));
  padding: 0 calc(26 * var(--u));
  border-radius: calc(27 * var(--u));
  font-size: calc(17 * var(--u));
  line-height: calc(22 / 17);
}

.capsule--fill {
  display: flex;
  width: 100%;
}

/* Beside a line of text: 36 pt drawn, with a 44 pt target. */
.capsule--small {
  min-width: calc(72 * var(--u));
  height: calc(36 * var(--u));
  padding: 0 calc(14 * var(--u));
  border-radius: calc(18 * var(--u));
  overflow: visible;
}

.capsule--small::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

.capsule.is-down {
  transform: scale(0.96);
}

.capsule--fill.is-down {
  transform: scale(0.985);
}

.capsule[disabled] {
  background: var(--track);
  box-shadow: none;
  color: var(--upcoming);
  cursor: default;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* The light from the fingertip, clipped to the capsule's shape. */
.capsule__clip {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.capsule__bloom {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(834 * var(--u));
  height: calc(834 * var(--u));
  background-image: var(--bloom);
  opacity: 0;
  will-change: transform, opacity;
}

.capsule[data-tone="effort"] .capsule__bloom {
  background-image: var(--bloom-effort);
}

@media (hover: hover) {
  .capsule:not([disabled]):hover {
    background: color-mix(in srgb, var(--glass) 82%, var(--ink) 4%);
  }

  .capsule--quiet:not([disabled]):hover {
    background: color-mix(in srgb, var(--glass-quiet) 70%, var(--ink) 5%);
  }
}

/* Chip: a quiet action pill, lifted on the fill once chosen. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: calc(8 * var(--u));
}

.chip {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: calc(34 * var(--u));
  margin: 0;
  padding: 0 calc(14 * var(--u));
  border: 0;
  border-radius: calc(17 * var(--u));
  background: var(--fill);
  box-shadow: inset 0 0 0 var(--hairline-width) transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: calc(13 * var(--u));
  line-height: calc(18 / 13);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background-color 160ms ease, transform var(--spring-press-ms) var(--spring-press);
}

/* 34 pt drawn, 44 to touch. */
.chip::after {
  content: "";
  position: absolute;
  inset: -5px 0;
}

.chip:active {
  background: var(--pressed);
  transform: scale(0.96);
}

.chip[aria-pressed="true"] {
  background: var(--chosen);
  box-shadow: inset 0 0 0 var(--hairline-width) var(--label-edge), var(--chip-lift);
  font-weight: 700;
}

.chip[disabled] {
  color: var(--upcoming);
  cursor: default;
}

@media (hover: hover) {
  .chip:not([aria-pressed="true"]):not([disabled]):hover {
    background: var(--pressed);
  }
}

/* Choices on one shared track, as a segmented control: clear at rest, lifted when chosen. */
.chips--track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: calc(2 * var(--u));
  padding: calc(2 * var(--u));
  border-radius: calc(19 * var(--u));
  background: var(--fill);
}

.chips--track .chip {
  min-width: 0;
  padding: 0 calc(2 * var(--u));
  background: transparent;
}

.chips--track .chip:active {
  background: var(--pressed);
}

.chips--track .chip[aria-pressed="true"] {
  background: var(--chosen);
}

@media (hover: hover) {
  .chips--track .chip:not([aria-pressed="true"]):not([disabled]):hover {
    background: color-mix(in srgb, var(--ink) 5%, transparent);
  }
}

/* A thin progress line: ink, filling toward the target. */
.track {
  overflow: hidden;
  height: calc(3 * var(--u));
  margin-top: calc(8 * var(--u));
  border-radius: calc(2 * var(--u));
  background: var(--track);
}

.track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  transition: transform 650ms var(--ease-track);
}

[dir="rtl"] .track i {
  transform-origin: 100% 50%;
}

.track--kcal i {
  --p: 0.2038;
}

.track--protein i {
  --p: 0.2833;
}

/* A figure whose digits roll when it changes, as iOS's own do. */
.roll {
  display: inline-flex;
  white-space: pre;
}

.roll__cell {
  position: relative;
  display: inline-block;
}

.roll__ghost {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* ── Train: a live set ────────────────────────────────────────────────── */

.session__head {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  padding-top: calc(16 * var(--u));
}

.session__day {
  flex: 1;
  min-width: 0;
  color: var(--graphite);
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
  font-weight: 500;
}

.session__clock {
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
  font-variant-numeric: tabular-nums;
}

/* The set tally: one stroke a set, in fives. Logged strokes are ink, the next
   set's stands taller in the live red, sets still to do are in `mark`, and a
   finished five is closed with a diagonal. */
.tally {
  --h: 16;
  --rise: 8;
  --strike-len: 43.58;
  --strike-turn: -25.2deg;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: calc(14 * var(--u));
  row-gap: calc(10 * var(--u));
  min-height: calc((var(--h) + var(--rise)) * var(--u));
  margin-top: calc(14 * var(--u));
}

.tally--tall {
  --h: 22;
  --rise: 0;
  --strike-len: 46.5;
  --strike-turn: -32.9deg;
  margin-top: calc(20 * var(--u));
}

.tally__group {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: calc(6 * var(--u));
  min-height: calc((var(--h) + var(--rise)) * var(--u));
}

.stroke {
  display: block;
  width: calc(2 * var(--u));
  height: calc(var(--h) * var(--u));
  border-radius: calc(1.25 * var(--u));
  background: var(--mark);
  transform-origin: 50% 100%;
  transition: height var(--spring-tally-ms) var(--spring-tally), background-color 140ms ease;
}

.stroke.is-logged {
  background: var(--ink);
}

.stroke.is-next {
  width: calc(2.5 * var(--u));
  height: calc((var(--h) + var(--rise)) * var(--u));
  background: var(--live);
}

.strike {
  position: absolute;
  bottom: calc((var(--h) / 2 - 1) * var(--u));
  left: calc((17 - var(--strike-len) / 2) * var(--u));
  width: calc(var(--strike-len) * var(--u));
  height: calc(2 * var(--u));
  border-radius: calc(1 * var(--u));
  background: var(--ink);
  opacity: 0;
  transform: rotate(var(--strike-turn)) scaleX(0);
  transform-origin: 50% 50%;
  transition: transform var(--spring-tally-ms) var(--spring-tally), opacity 160ms ease;
  pointer-events: none;
}

.tally__group.is-closed .strike {
  opacity: 1;
  transform: rotate(var(--strike-turn)) scaleX(1);
}

.setcard {
  position: relative;
  margin-top: calc(20 * var(--u));
}

/* The finished session opens the piece itself, where the header line was. */
.session__head[hidden] + .tally[hidden] + .setcard {
  margin-top: 0;
  padding-top: calc(16 * var(--u));
}

.setcard__name {
  font-size: calc(24 * var(--u));
  line-height: calc(30 / 24);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.setcard__line {
  margin-top: calc(2 * var(--u)) !important;
  color: var(--graphite);
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
}

.setcard__range {
  color: var(--ink);
  font-weight: 500;
}

/* One quiet line: why the figures hold what they do, or for a moment after a
   log, that the target was hit. */
.setcard__slot {
  position: relative;
  min-height: calc(20 * var(--u));
  margin-top: calc(6 * var(--u));
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
}

.setcard__target strong {
  font-weight: 600;
}

.setcard__beat {
  position: absolute;
  inset: 0 auto auto 0;
  display: flex;
  align-items: center;
  gap: calc(4 * var(--u));
  font-variant-numeric: tabular-nums;
}

.setcard__beatmark {
  flex: none;
  width: calc(12 * var(--u));
  height: calc(12 * var(--u));
}

.figures {
  display: flex;
  align-items: flex-end;
  gap: calc(14 * var(--u));
  min-height: calc(97 * var(--u));
  margin-top: calc(14 * var(--u));
}

.figure__row {
  display: flex;
  align-items: baseline;
  gap: calc(6 * var(--u));
}

/* A ruled line under the figure, as in a paper log: it can be written in. */
.figure__value {
  display: block;
  margin-bottom: 0;
  border-bottom: 1px solid var(--mark);
  border-radius: 0;
  font-size: calc(88 * var(--u));
  line-height: calc(95 / 88);
  font-weight: 200;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: border-color 140ms ease;
}

.figure__value.is-editing {
  border-bottom-color: var(--ink);
  box-shadow: 0 1px 0 0 var(--ink);
}

.figure__value:focus-visible {
  outline-offset: 6px;
}

.figure__unit {
  color: var(--graphite);
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
}

/* Under a figure edited away from it, the target, as a paper log keeps the
   last session in the margin. */
.figure__caption {
  display: block;
  min-height: calc(16 * var(--u));
  margin-top: calc(5 * var(--u));
  color: var(--graphite);
  font-family: var(--mono);
  font-size: calc(12 * var(--u));
  line-height: calc(16 / 12);
}

.figures__by {
  margin-bottom: calc(47 * var(--u));
  color: var(--graphite);
  font-size: calc(35 * var(--u));
  line-height: 1;
  font-weight: 200;
}

.setcard__tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(12 * var(--u));
  min-height: calc(44 * var(--u));
  margin-top: calc(8 * var(--u));
}

/* − and +, as the app's key bar offers them while a figure is being typed. */
.keys {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
}

.keys__key {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  box-sizing: border-box;
  width: calc(52 * var(--u));
  height: calc(34 * var(--u));
  margin: 0;
  padding: 0 0 calc(2 * var(--u));
  border: 0;
  border-radius: calc(17 * var(--u));
  background: var(--fill);
  color: var(--ink);
  font-family: inherit;
  font-size: calc(20 * var(--u));
  line-height: 1;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background-color 140ms ease, transform var(--spring-press-ms) var(--spring-press);
}

.keys__key::after {
  content: "";
  position: absolute;
  inset: -5px 0;
}

.keys__key:active {
  background: var(--pressed);
  transform: scale(0.95);
}

.keys__step {
  min-width: 4ch;
  color: var(--graphite);
  font-family: var(--mono);
  font-size: calc(12 * var(--u));
  line-height: calc(16 / 12);
  text-align: center;
}

.setcard .capsule--fill {
  margin-top: calc(12 * var(--u));
}

.setcard__endtitle {
  font-size: calc(17 * var(--u));
  line-height: calc(22 / 17);
  font-weight: 600;
}

.setcard__end .capsule--fill {
  margin-top: calc(14 * var(--u));
}

.setcard__reward {
  margin-top: calc(20 * var(--u)) !important;
}

.facts {
  margin: calc(20 * var(--u)) 0 0;
  padding: calc(10 * var(--u)) 0;
  border-top: var(--hairline-width) solid var(--hairline);
  border-bottom: var(--hairline-width) solid var(--hairline);
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: calc(12 * var(--u));
  padding: calc(6 * var(--u)) 0;
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
}

.facts dt {
  color: var(--graphite);
}

.facts dd {
  margin: 0;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.setcard__done .capsule--fill {
  margin-top: calc(18 * var(--u));
}

/* The workout's Live Activity, on the surface the Lock Screen gives it. */
.lock__card {
  display: grid;
  gap: calc(12 * var(--u));
  padding: calc(16 * var(--u)) calc(18 * var(--u));
  border-radius: calc(24 * var(--u));
  background: var(--label);
  box-shadow: inset 0 0 0 1px var(--label-edge);
}

.lock__row {
  display: flex;
  align-items: center;
  gap: calc(14 * var(--u));
}

/* A 30 pt P, by its ink. */
.lock__mark {
  flex: none;
  width: calc(19.9 * var(--u));
  height: calc(21 * var(--u));
  fill: var(--brand);
}

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

.lock__name,
.lock__detail {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lock__name {
  font-size: calc(17 * var(--u));
  line-height: calc(22 / 17);
  font-weight: 600;
}

.lock__detail {
  margin-top: calc(2 * var(--u)) !important;
  color: var(--graphite);
  font-size: calc(13 * var(--u));
  line-height: calc(18 / 13);
  font-variant-numeric: tabular-nums;
}

.lock__figure {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.lock__time {
  font-size: calc(22 * var(--u));
  line-height: calc(26 / 22);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.lock.is-resting .lock__time {
  font-size: calc(40 * var(--u));
  line-height: calc(44 / 40);
  font-weight: 200;
  letter-spacing: -0.02em;
}

.lock__caption {
  color: var(--graphite);
  font-size: calc(13 * var(--u));
  line-height: calc(18 / 13);
}

.lock__bar {
  overflow: hidden;
  height: calc(4 * var(--u));
  border-radius: calc(2 * var(--u));
  background: var(--track);
}

.lock__bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transform: scaleX(var(--p, 1));
  transform-origin: 0 50%;
}

.lock__controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(8 * var(--u));
}

.lock__button {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  min-height: calc(36 * var(--u));
  margin: 0;
  padding: 0 calc(12 * var(--u));
  border: 0;
  border-radius: calc(10 * var(--u));
  background: color-mix(in srgb, var(--ink) 11%, transparent);
  color: var(--ink);
  font-family: inherit;
  font-size: calc(13 * var(--u));
  line-height: calc(18 / 13);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background-color 140ms ease;
}

.lock__button::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

.lock__button:active {
  background: color-mix(in srgb, var(--ink) 20%, transparent);
}

.lock__note {
  max-width: 24em;
  margin-top: calc(14 * var(--u)) !important;
  color: var(--graphite);
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
  text-wrap: pretty;
}

/* ── Fuel: the day, and Monday ────────────────────────────────────────── */

.kcal {
  display: flex;
  align-items: baseline;
  gap: calc(8 * var(--u));
  margin-top: calc(2 * var(--u)) !important;
}

/* The day's calories in SF's thin weight, its first digit's ink on the text edge. */
.kcal__figure {
  margin-left: calc(-2 * var(--u));
  font-size: calc(56 * var(--u));
  line-height: calc(60 / 56);
  font-weight: 200;
  letter-spacing: -0.022em;
}

.kcal__of {
  color: var(--graphite);
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
}

.meter {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(12 * var(--u));
  margin-top: calc(16 * var(--u));
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
}

.meter__label,
.meter__of {
  color: var(--graphite);
}

.meter__value {
  font-variant-numeric: tabular-nums;
}

.fuelday .chips {
  margin-top: calc(24 * var(--u));
}

.change {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  min-height: calc(60 * var(--u));
  padding: calc(6 * var(--u)) 0 calc(12 * var(--u));
}

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

.change__title {
  font-size: calc(17 * var(--u));
  line-height: calc(22 / 17);
  font-weight: 500;
}

.change__line {
  margin-top: calc(1 * var(--u)) !important;
  color: var(--graphite);
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
  text-wrap: pretty;
}

/* Body weight: the smoothed line in ink, each weigh-in a dot in `mark`. */
.trend {
  margin: calc(10 * var(--u)) 0 0;
  padding-top: calc(14 * var(--u));
  border-top: var(--hairline-width) solid var(--hairline);
}

.trend__read {
  min-height: calc(16 * var(--u));
  color: var(--graphite);
  font-family: var(--mono);
  font-size: calc(12 * var(--u));
  line-height: calc(16 / 12);
  font-variant-numeric: tabular-nums;
}

.trend__plot {
  display: block;
  width: 100%;
  height: calc(132 * var(--u));
  margin-top: calc(8 * var(--u));
  overflow: visible;
  border-radius: 6px;
  cursor: crosshair;
  touch-action: pan-y;
}

.trend__dot {
  fill: var(--mark);
}

.trend__line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend__end {
  fill: var(--ink);
  stroke: var(--ground);
  stroke-width: 2;
}

.trend__cross {
  stroke: var(--hairline);
  stroke-width: 1;
}

.trend__ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
}

.trend__label {
  fill: var(--graphite);
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ── Agents ───────────────────────────────────────────────────────────── */

/* The address an agent is given, and one tap to copy it: the app's own row. */
.address {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 30rem;
  min-height: 64px;
  margin-top: 34px;
  border-top: var(--hairline-width) solid var(--hairline);
  border-bottom: var(--hairline-width) solid var(--hairline);
}

.address__text {
  min-width: 0;
  padding: 10px 0;
}

.address__label {
  margin: 0;
  font-size: 1rem;
  line-height: calc(22 / 17);
  font-weight: 500;
}

.address__url {
  display: block;
  margin-top: 1px;
  color: var(--graphite);
  font-family: var(--mono);
  font-size: calc(14rem / 17);
  line-height: calc(20 / 14);
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}

.scope {
  max-width: 30rem;
  margin: 28px 0 0;
}

.scope div {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  column-gap: 12px;
  padding: 13px 0;
  border-bottom: var(--hairline-width) solid var(--hairline);
}

.scope dt {
  color: var(--graphite);
  font-size: calc(15rem / 17);
  line-height: calc(22 / 15);
}

.scope dd {
  margin: 0;
  font-size: 1rem;
  line-height: calc(22 / 17);
  text-wrap: pretty;
}

.agentlog .chips {
  padding-top: calc(16 * var(--u));
}

/* What was asked, what the agent called, what hyPer answered. */
.exchange {
  display: grid;
  gap: calc(8 * var(--u));
  min-height: calc(112 * var(--u));
  margin: calc(20 * var(--u)) 0 0;
  align-content: start;
}

.exchange__line {
  display: grid;
  grid-template-columns: calc(52 * var(--u)) minmax(0, 1fr);
  column-gap: calc(12 * var(--u));
  align-items: baseline;
}

.exchange dt {
  color: var(--graphite);
  font-family: var(--mono);
  font-size: calc(12 * var(--u));
  line-height: calc(20 / 12);
}

.exchange dd {
  margin: 0;
  font-size: calc(15 * var(--u));
  line-height: calc(20 / 15);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.exchange .exchange__tool {
  font-family: var(--mono);
  font-size: calc(13 * var(--u));
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: calc(4 * var(--u)) calc(14 * var(--u));
  margin: calc(20 * var(--u)) 0 0;
  padding: calc(14 * var(--u)) 0 0;
  border-top: var(--hairline-width) solid var(--hairline);
  list-style: none;
  color: var(--upcoming);
  font-family: var(--mono);
  font-size: calc(12 * var(--u));
  line-height: calc(16 / 12);
}

.tools li {
  transition: color 240ms ease;
}

.tools li.is-called {
  color: var(--ink);
}

.agentlog .artifact__foot {
  border-top: 0;
  padding-top: 0;
  margin-top: calc(12 * var(--u)) !important;
}

/* ── Where it stands ──────────────────────────────────────────────────── */

.closing {
  box-sizing: border-box;
  max-width: calc(var(--wide) + 2 * var(--page-x));
  margin: 0 auto;
  padding: clamp(120px, 22vh, 240px) var(--page-x) clamp(88px, 14vh, 150px);
}

/* The emblem: a 48 pt P, as on the app's sign-in. */
.closing__mark {
  display: block;
  width: 31.8px;
  height: 33.6px;
  fill: var(--brand);
}

.closing__title {
  max-width: 12em;
  margin: 22px 0 0;
  font-size: clamp(2.125rem, 1.45rem + 3vw, 4rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.closing .address {
  margin-top: 36px;
}

.closing__line {
  max-width: 28em;
  margin: 14px 0 0;
  color: var(--graphite);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.32;
  text-wrap: pretty;
}

.foot {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: calc(var(--wide) + 2 * var(--page-x));
  margin: 0 auto;
  padding: 18px var(--page-x) calc(104px + env(safe-area-inset-bottom, 0px));
  color: var(--graphite);
  font-size: calc(13rem / 17);
  line-height: calc(18 / 13);
}

.foot::before {
  content: "";
  flex: 0 0 100%;
  height: var(--hairline-width);
  margin-bottom: 8px;
  background: var(--hairline);
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}

/* A quiet link with a 44 px target. */
.foot__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--graphite);
  text-decoration: none;
  transition: color 160ms ease;
}

.foot__links a:hover {
  color: var(--ink);
}

.foot__fine {
  margin: 0;
}

@media (min-width: 900px) {
  .foot {
    padding-bottom: 40px;
  }
}

/* ── The page's tab bar ───────────────────────────────────────────────── */

/* Glass, floating over the page: at the foot on a phone, as the app's, and at
   the head on a desk, where a pointer finds it. It keeps to the current part
   while the page scrolls down and opens again on the way up. */
.dock {
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
}

.dock__bar,
.dock__look,
.dock__rest {
  background: var(--glass-bar);
  box-shadow: inset 0 0 0 1px var(--glass-edge), var(--glass-lift);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
}

.dock__bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 4px;
  border-radius: 26px;
}

.dock__item {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-width: 120px;
  height: 44px;
  padding: 0 15px;
  border-radius: 22px;
  color: var(--graphite);
  font-size: calc(15rem / 17);
  line-height: 1;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 200ms ease, max-width 260ms var(--ease-out), padding 260ms var(--ease-out), opacity 90ms ease;
}

.dock__item[aria-current="true"] {
  color: var(--ink);
}

.dock__item--home {
  flex: none;
  width: 44px;
  padding: 0;
}

/* A 22 pt P, by its ink. */
.dock__mark {
  width: 14.6px;
  height: 15.4px;
  fill: var(--brand);
}

/* The current part's lozenge, sliding from one to the next. */
.dock__pick {
  position: absolute;
  top: 4px;
  left: 0;
  width: var(--pick-w, 44px);
  height: 44px;
  border-radius: 22px;
  background: var(--pick);
  opacity: var(--pick-o, 0);
  transform: translateX(var(--pick-x, 4px));
  transition: transform var(--spring-bar-ms) var(--spring-bar), width var(--spring-bar-ms) var(--spring-bar), opacity 200ms ease;
}

.dock.is-small .dock__item:not([aria-current="true"]):not(.dock__item--home) {
  max-width: 0;
  padding: 0;
  opacity: 0;
}

.dock.is-small .dock__pick {
  opacity: 0;
}

/* The appearance switch: its own round of glass beside the bar. */
.dock__look {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 26px;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--spring-press-ms) var(--spring-press);
}

.dock__look:active {
  transform: scale(0.94);
}

.dock__look svg {
  width: 20px;
  height: 20px;
}

.look__ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.look__half,
.look__full {
  fill: currentColor;
  transition: opacity 200ms ease;
}

.look__full {
  opacity: 0;
}

.dock__look[data-look="light"] .look__half {
  opacity: 0;
}

.dock__look[data-look="dark"] .look__full {
  opacity: 1;
}

/* A rest in progress, kept in sight wherever the page is: the app's workout
   bar. The red dot is the app's mark for what is live. */
.dock__rest {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px 0 16px;
  border-radius: 26px;
  color: var(--ink);
  font-size: calc(15rem / 17);
  line-height: 1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  white-space: nowrap;
}

.dock__rest::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
}

@media (min-width: 900px) {
  .dock {
    top: 18px;
    bottom: auto;
  }
}

/* A narrow phone: the same bar, a little closer. */
@media (max-width: 360px) {
  .dock {
    gap: 6px;
  }

  .dock__item {
    padding: 0 10px;
  }

  .dock__look {
    width: 46px;
  }
}

/* ── The intro ────────────────────────────────────────────────────────── */

/* The app's cold launch, here: under a veil of the ground the red P blooms,
   spells hyPer, folds the word back into itself and flies to its corner as
   the page comes up. assets/home.js plays it; this only sets the stage. */
.intro {
  display: none;
}

.intro-on .intro {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: block;
  pointer-events: none;
}

.intro__veil {
  position: absolute;
  inset: 0;
  background: var(--ground);
}

.intro__flight {
  position: absolute;
  top: 40%;
  left: 50%;
  width: 0;
  height: 0;
  transform-origin: 0 0;
}

.intro__glyph {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  fill: var(--ink);
  opacity: 0;
  will-change: transform, opacity;
}

.intro__p {
  fill: var(--brand);
}

.intro__lift {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: var(--brand);
}

/* The sculpture's seat waits for the flying P to land. */
.intro-on .sculpt {
  opacity: 0;
}

/* ── Coming into view ─────────────────────────────────────────────────── */

/* A part of the page rises a little as it comes into view, as a screen's
   content does in the app. Without the script it is simply there. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms var(--ease-out), transform 760ms var(--ease-rise);
}

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

.js [data-reveal][data-i="1"] {
  transition-delay: 70ms;
}

.js [data-reveal][data-i="2"] {
  transition-delay: 140ms;
}

.js [data-reveal][data-i="3"] {
  transition-delay: 210ms;
}

.js [data-reveal][data-i="4"] {
  transition-delay: 280ms;
}

.js [data-reveal] .artifact::before {
  transform: scaleX(0);
  transition: transform 1100ms var(--ease-out) 160ms;
}

.js [data-reveal].is-in .artifact::before {
  transform: none;
}

/* ── Reduce Motion, Increase Contrast, less transparency, forced colours ── */

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

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

  .js [data-reveal] .artifact::before {
    transform: none;
    transition: none;
  }

  /* The sculpture holds one still frame, and stays where the page puts it. */
  .sculpt__seat {
    opacity: 1;
    transform: none;
  }

  .js .sculpt__relief,
  .sculpt__canvas {
    transition: none;
  }

  .capsule,
  .chip,
  .keys__key,
  .dock__look,
  .dock__item,
  .dock__pick,
  .stroke,
  .strike,
  .track i,
  .look-turning,
  .look-turning * {
    transition: none !important;
  }

  .capsule.is-down,
  .capsule--fill.is-down,
  .chip:active,
  .keys__key:active,
  .dock__look:active {
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* The way on nods a few times as the page opens, then rests with the rest of it. */
  .hero__next svg {
    animation: hero-next 2.6s var(--ease-in-out) 1.6s 5;
  }
}

@keyframes hero-next {
  0%,
  100% {
    transform: none;
  }

  50% {
    transform: translateY(2.5px);
  }
}

@media (prefers-contrast: more) {
  .capsule,
  .capsule--quiet {
    box-shadow: inset 0 0 0 1.5px var(--ink);
  }

  .chip {
    box-shadow: inset 0 0 0 1px var(--graphite);
  }

  .chip[aria-pressed="true"] {
    box-shadow: inset 0 0 0 1.5px var(--ink);
  }

  .dock__bar,
  .dock__look,
  .dock__rest {
    background: var(--ground);
    box-shadow: inset 0 0 0 1.5px var(--ink);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .lock__card {
    box-shadow: inset 0 0 0 1.5px var(--ink);
  }

  .dock__item {
    color: var(--ink);
  }

  .dock__pick {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--ink);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .capsule,
  .capsule--quiet {
    background: var(--fill);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .dock__bar,
  .dock__look,
  .dock__rest {
    background: var(--label);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  .capsule,
  .chip,
  .keys__key,
  .lock__button,
  .dock__bar,
  .dock__look,
  .dock__rest,
  .lock__card {
    border: 1px solid ButtonText;
  }

  .mark,
  .closing__mark,
  .lock__mark,
  .dock__mark,
  .sculpt__body {
    fill: CanvasText;
  }

  /* The P plain, in the reader's own ink: no sculpture, no relief. */
  .sculpt__canvas,
  .sculpt__relief {
    display: none;
  }

  .sculpt__seat.is-live .sculpt__flat {
    visibility: visible;
  }

  .sculpt__flat {
    filter: none;
  }

  .stroke,
  .strike,
  .track i,
  .lock__bar i {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .stroke:not(.is-logged):not(.is-next) {
    background: GrayText;
  }

  .stroke.is-next {
    background: Highlight;
  }

  .glass {
    display: none;
  }
}

@media print {
  .glass,
  .dock,
  .intro,
  .skip,
  .sculpt__canvas {
    display: none !important;
  }

  .sculpt__seat.is-live .sculpt__flat {
    visibility: visible;
  }

  .sculpt__seat {
    opacity: 1;
    transform: none;
  }

  .js .sculpt__relief {
    opacity: 1;
  }

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

  .intro-on .sculpt,
  .js .brand .mark {
    opacity: 1;
  }
}
