/* melo website · brand: MeloTheme.swift palette (cream, porcelain, coral, lilac, sage) and the app icon's M
 * type: Chillax (Indian Type Foundry, self-hosted under its Free Font License, files unmodified) for the wordmark and headlines,
 *   over the system text face for body copy
 * signature: the live Friends widget in the hero, rebuilt from Widgets/FriendsWidget.swift; app screens are simulator captures
 * critique: one coral action, pastel fields as material instead of washes, the page follows one moment (Maya's Blue Bottle run) */

@font-face {
  font-family: "Chillax";
  src: url("fonts/chillax-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Chillax";
  src: url("fonts/chillax-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --font-display: "Chillax", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

  --paper: #FFF7EF;
  --paper-raised: #FFFCF8;
  --ink: #221F2D;
  --ink-2: #4D4757;
  --muted: #716A76;
  --rule: rgb(34 31 45 / 0.12);
  --coral: #FF705B;
  --coral-hover: #FF8271;
  --coral-pressed: #F66B57;
  --on-coral: #221F2D;
  --coral-text: #B74635;
  --coral-pale: #FCEAE3;
  --lilac-pale: #EEE8FA;
  --lilac-text: #69558E;
  --sage-pale: #E7EDDF;
  --sage-text: #506447;
  --track: rgb(34 31 45 / 0.10);
  --switch-off: rgb(34 31 45 / 0.22);
  --switch-thumb: #FFFDFA;
  --shadow-pop: 0 0 0 1px rgb(34 31 45 / 0.08), 0 16px 36px -16px rgb(34 31 45 / 0.45);
  --shadow-thumb: 0 2px 6px rgb(34 31 45 / 0.3);
  --sheen: rgb(255 255 255 / 0.62);
  --tilt-shadow: rgb(34 31 45 / 0.24);
  --sheen-clear: rgb(255 255 255 / 0);
  --plate: #C7BAF2;
  --widget-paper: #FBF7F0;
  --widget-paper-2: #F3ECE0;
  --widget-accent: #A84538;
  --focus: #69558E;
  --band-ink-bg: #221F2D;
  --band-ink-text: #FFF7EF;
  --band-ink-text-2: #DDD5E0;
  --band-ink-muted: #BEB4C4;
  --band-ink-rule: rgb(255 247 239 / 0.16);
  --band-ink-focus: #C7BAF2;
  --band-ink-switch-off: rgb(255 247 239 / 0.3);
  --card-edge: rgb(34 31 45 / 0.08);
  --shot-edge: rgb(34 31 45 / 0.10);
  --shot-shadow: 0 28px 60px -34px rgb(34 31 45 / 0.45);

  --text-display: clamp(2.75rem, 3.6vw + 1.9rem, 5.25rem);
  --text-section: clamp(2.125rem, 2.1vw + 1.35rem, 3.5rem);
  --text-title: clamp(1.3125rem, 0.45vw + 1.1rem, 1.625rem);
  --text-lead: clamp(1.125rem, 0.4vw + 0.98rem, 1.375rem);
  --text-body: 1.0625rem;
  --text-small: 0.9375rem;

  --gutter: clamp(20px, 4.45vw, 64px);
  --col-gap: clamp(16px, 2.2vw, 32px);
  --section-pad: clamp(88px, 9.5vw, 144px);
  --radius-plate: clamp(28px, 3vw, 44px);
  --radius-card: 28px;
  --radius-button: 18px;
  --nav-h: 72px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #19171F;
    --paper-raised: #27232E;
    --ink: #FFF7EF;
    --ink-2: #DDD5E0;
    --muted: #BEB4C4;
    --rule: rgb(255 247 239 / 0.14);
    --coral-text: #FF9A88;
    --coral-pale: #3C2728;
    --lilac-pale: #332B45;
    --lilac-text: #C7BAF2;
    --sage-pale: #232B21;
    --sage-text: #B8C9AD;
    --track: rgb(255 247 239 / 0.14);
    --switch-off: rgb(255 247 239 / 0.3);
    --shadow-pop: 0 0 0 1px rgb(255 247 239 / 0.1), 0 16px 36px -16px rgb(0 0 0 / 0.7);
    --tilt-shadow: rgb(0 0 0 / 0.6);
    --plate: #3B3154;
    --widget-paper: #26232E;
    --widget-paper-2: #1E1C25;
    --widget-accent: #FAA38A;
    --focus: #C7BAF2;
    --band-ink-bg: #2A2534;
    --card-edge: rgb(255 247 239 / 0.08);
    --shot-edge: rgb(255 247 239 / 0.12);
    --shot-shadow: 0 28px 60px -34px rgb(0 0 0 / 0.8);
  }
}

/* Base */

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

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  overflow-x: clip;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-synthesis: none;
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
  min-width: 0;
  text-wrap: balance;
}

h2 {
  font-size: var(--text-section);
}

h3 {
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p,
dl,
dd,
ul,
ol,
figure {
  margin: 0;
}

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

p,
dd {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

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

.container {
  width: 100%;
  max-width: 1440px;
  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));
}

.lead {
  font-size: var(--text-lead);
  line-height: 1.45;
  color: var(--ink-2);
}

.fine {
  font-size: var(--text-small);
  color: var(--muted);
}

.emoji {
  margin-right: 0.16em;
}

.card {
  display: block;
  border-radius: var(--radius-card);
  background: var(--paper-raised);
  box-shadow: 0 0 0 1px var(--card-edge);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  border-radius: var(--radius-button);
  background: var(--coral);
  color: var(--on-coral);
  font-family: var(--font-text);
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}

.button:hover {
  background: var(--coral-hover);
}

.button:active {
  background: var(--coral-pressed);
  transform: scale(0.98);
}

.button:focus-visible {
  outline-offset: 4px;
}

.button-small {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 14px;
  font-size: var(--text-small);
}

/* Header */

/* With viewport-fit=cover, the sticky header sits below the status bar, and this band covers what scrolls under it. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 21;
  height: env(safe-area-inset-top, 0px);
  background: var(--paper);
}

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--paper);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow 200ms ease;
}

.site-header[data-scrolled] {
  box-shadow: 0 1px 0 var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: auto;
  fill: var(--coral);
}

.brand-word {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
}

.site-nav ul {
  display: flex;
  gap: 4px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: var(--text-small);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.site-nav a:hover {
  background: var(--coral-pale);
}

.site-nav a:active {
  background: var(--lilac-pale);
}

/* Hero */

.hero {
  padding-block: clamp(12px, 2.5vw, 32px) clamp(16px, 2vw, 24px);
}

/* The hero and the first section share the cream paper, so their paddings would stack into
   one wide empty band. */
.hero + .section {
  padding-top: clamp(48px, 4.5vw, 72px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(40px, 5.5vw, 96px);
  align-items: center;
}

.hero-text {
  display: grid;
  justify-items: start;
  gap: 24px;
}

.hero h1 {
  font-size: var(--text-display);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero .lead {
  max-width: 30ch;
}

.hero-actions {
  display: grid;
  justify-items: start;
  gap: 16px;
  margin-top: 12px;
}

.hero-visual {
  container-type: inline-size;
  min-width: 0;
}

.plate {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: clamp(28px, 8cqi, 76px) clamp(20px, 6cqi, 60px);
  border-radius: var(--radius-plate);
  background: var(--plate);
}

/* The plate runs off the right edge of the page; html and body clip it. */
.plate::before {
  content: "";
  position: absolute;
  inset: 0 -100vw 0 50%;
  z-index: -1;
  background: var(--plate);
}

.hero-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  margin-top: 16px;
  font-size: var(--text-small);
  color: var(--muted);
}

/* Widgets: iOS points scaled by --pt. Sizes follow FriendsWidget.swift. */

.home {
  --pt: min(1.6px, calc(100cqi / 420), calc((100svh - 250px) / 360));
  display: grid;
  gap: calc(22 * var(--pt));
  width: calc(338 * var(--pt));
  transform-style: preserve-3d;
}

.widget {
  position: relative;
  height: calc(158 * var(--pt));
  padding: calc(16 * var(--pt));
  overflow: hidden;
  border-radius: calc(22 * var(--pt));
  background: linear-gradient(var(--widget-paper), var(--widget-paper-2));
  color: var(--ink);
  font-family: var(--font-text);
  transform: translateZ(var(--z, 0px));
}

.w-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(6 * var(--pt));
  font-size: calc(12 * var(--pt));
  font-weight: 600;
  line-height: 1.3;
}

.w-title {
  overflow: hidden;
  color: var(--widget-accent);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.w-brand {
  flex: none;
  color: var(--muted);
  font-size: calc(11 * var(--pt));
}

.w-challenge {
  margin-top: calc(8 * var(--pt));
  overflow: hidden;
  font-size: calc(12 * var(--pt));
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.w-rows {
  position: relative;
  height: calc(94 * var(--pt));
  margin-top: calc(10 * var(--pt));
}

.w-rows-static {
  height: calc(60 * var(--pt));
}

.w-row {
  --s: 1;
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  gap: calc(8 * var(--pt));
  height: calc(26 * var(--pt));
  font-size: calc(15 * var(--pt));
  line-height: 1.2;
  transform: translateY(calc(var(--i, 0) * 34 * var(--pt))) scale(var(--s));
  transform-origin: left center;
  transition: transform 700ms var(--ease-out), opacity 450ms ease;
}

.w-row.is-new {
  --s: 0.94;
  opacity: 0;
}

.w-row.is-out {
  opacity: 0;
}

.w-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: calc(26 * var(--pt));
  height: calc(26 * var(--pt));
  border-radius: calc(9.4 * var(--pt));
  background: color-mix(in srgb, var(--widget-accent) 14%, var(--widget-paper));
  box-shadow: inset 0 0 0 calc(0.75 * var(--pt)) var(--widget-paper);
  color: var(--widget-accent);
  font-family: var(--font-display);
  font-size: calc(10.5 * var(--pt));
  font-weight: 700;
  line-height: 1;
}

.w-name {
  flex: none;
  font-weight: 600;
  white-space: nowrap;
}

.w-line {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.w-age {
  flex: none;
  margin-left: auto;
  padding-left: calc(4 * var(--pt));
  color: var(--muted);
  font-size: calc(12 * var(--pt));
  white-space: nowrap;
}

/* Sections */

.section {
  padding-block: var(--section-pad);
}

.section-head {
  display: grid;
  gap: 20px;
  max-width: 46rem;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.section-head .lead {
  max-width: 38ch;
}

.section-head-split {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: end;
  column-gap: var(--col-gap);
  max-width: none;
}

.band-sage {
  background: var(--sage-pale);
}

/* Moments, never money */

.compare-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.compare-table .c-label {
  width: 18%;
}

.compare-table thead th {
  padding: 0 var(--col-gap) 28px 0;
  font-weight: 400;
  text-align: left;
  vertical-align: bottom;
}

.compare-table thead th:last-child,
.compare-table tbody td:last-child {
  padding-right: 0;
}

.col-label {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
}

.ledger-card,
.moment-card {
  min-height: 148px;
  padding: 24px 28px;
}

.ledger-card {
  display: grid;
  align-content: center;
  gap: 2px;
}

.ledger-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.ledger-place,
.ledger-amount,
.moment-title {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1vw + 1rem, 1.875rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.ledger-amount {
  font-variant-numeric: tabular-nums;
}

.ledger-meta,
.moment-caption {
  display: block;
  color: var(--muted);
  font-size: var(--text-small);
}

.moment-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  column-gap: 20px;
  background: var(--coral-pale);
  box-shadow: none;
}

.moment-emoji {
  grid-row: span 2;
  font-size: 44px;
  line-height: 1;
}

.compare-table tbody th,
.compare-table tbody td {
  padding: 20px var(--col-gap) 20px 0;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: baseline;
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: 1px solid var(--rule);
}

.compare-table tbody th {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
}

.compare-table .never {
  color: var(--coral-text);
  font-weight: 600;
}

/* How a moment gets there */

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--col-gap);
}

.step {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  gap: 12px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}

.step-time {
  margin-bottom: 8px;
  color: var(--coral-text);
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 3vw + 1.25rem, 4.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.step > p:not(.step-time) {
  max-width: 34ch;
  color: var(--ink-2);
}

.step-visual {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 12px;
  margin-top: 20px;
}

.mini-ledger,
.mini-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(100%, 340px);
  padding: 16px 20px;
  border-radius: 22px;
}

.mini-emoji {
  font-size: 30px;
  line-height: 1;
}

.mini-text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.mini-text strong {
  font-weight: 600;
}

.mini-text span {
  color: var(--muted);
  font-size: var(--text-small);
}

.mini-row .mini-text span {
  color: var(--ink);
  font-size: var(--text-body);
}

.mini-amount,
.mini-age {
  margin-left: auto;
  white-space: nowrap;
}

.mini-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mini-age {
  color: var(--muted);
  font-size: var(--text-small);
}

.mini-row .w-avatar {
  --pt: 1.45px;
}

.notice {
  width: min(100%, 360px);
  padding: 16px 20px 8px;
  border-radius: 26px;
}

.notice-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.notice-head img {
  width: 20px;
  height: 20px;
}

.notice-time {
  margin-left: auto;
}

.notice-title {
  margin-top: 8px;
  font-weight: 600;
}

.notice-body {
  color: var(--ink-2);
  font-size: var(--text-small);
  line-height: 1.4;
}

.notice-actions {
  display: grid;
  margin-top: 12px;
}

.notice-actions button,
.notice-undo {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--rule);
  background: none;
  color: var(--coral-text);
  font-family: var(--font-text);
  font-size: var(--text-small);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, opacity 160ms ease;
}

.notice-actions button:hover,
.notice-undo:hover {
  color: var(--ink);
}

.notice-actions button:active,
.notice-undo:active {
  opacity: 0.6;
}

.notice-done {
  display: grid;
  margin-top: 8px;
}

.notice-done[hidden] {
  display: none;
}

.notice-undo {
  width: auto;
  margin-top: 4px;
  border-top: 0;
}

.reactions {
  display: flex;
  gap: 8px;
}

.reactions {
  position: relative;
  flex-wrap: wrap;
}

.reaction,
.reaction-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--paper-raised);
  box-shadow: 0 0 0 1px var(--card-edge);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}

.reaction:hover,
.reaction-add:hover {
  background: var(--coral-pale);
}

.reaction:active,
.reaction-add:active {
  transform: scale(0.94);
}

.reaction[aria-pressed="true"] {
  background: var(--coral-pale);
  box-shadow: inset 0 0 0 2px var(--coral-text);
}

.reaction:disabled,
.reaction-add:disabled {
  background: var(--track);
  box-shadow: none;
  color: var(--muted);
  opacity: 0.7;
  cursor: not-allowed;
}

.reaction.is-popped {
  animation: pop 420ms var(--ease-out);
}

@keyframes pop {
  35% {
    transform: scale(1.18);
  }
}

.reaction-add {
  justify-content: center;
  width: 40px;
  padding: 0;
}

.reaction-add svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.reaction-picker {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper-raised);
  box-shadow: var(--shadow-pop);
}

.reaction-picker[hidden] {
  display: none;
}

.reaction-picker button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 20px;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}

.reaction-picker button:hover {
  background: var(--coral-pale);
  transform: scale(1.12);
}

.reaction-picker button:active {
  transform: scale(0.94);
}

.mini-row {
  transition: opacity 300ms ease;
}

.mini-row.is-hidden {
  opacity: 0.45;
}

.mini-row.is-hidden .mini-text span {
  text-decoration: line-through;
}

/* Challenges */

.challenge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--col-gap);
}

.challenge {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: clamp(24px, 2.6vw, 36px);
  box-shadow: none;
}

.challenge h3 {
  font-size: clamp(1.375rem, 0.8vw + 1rem, 1.75rem);
}

.challenge > p {
  color: var(--ink-2);
}

.challenge-status {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.status-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.join {
  flex: none;
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--coral);
  color: var(--on-coral);
  font-family: var(--font-text);
  font-size: var(--text-small);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}

.join:hover {
  background: var(--coral-hover);
}

.join:active {
  transform: scale(0.96);
}

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

.challenge-status .status {
  color: var(--coral-text);
  font-weight: 600;
}

.challenge-status .who {
  color: var(--muted);
  font-size: var(--text-small);
}

/* Your group, on one screen */

.group-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  column-gap: clamp(40px, 6vw, 112px);
}

.group-text {
  display: grid;
  gap: 20px;
}

.facts {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.facts div {
  display: grid;
  gap: 2px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.facts dt {
  font-weight: 600;
}

.facts dd {
  color: var(--ink-2);
}

.group-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--col-gap);
  width: min(100%, 720px);
  justify-self: end;
}

.shot {
  overflow: hidden;
  border-radius: 12% / 5.53%;
  background: var(--paper-raised);
  box-shadow: 0 0 0 1px var(--shot-edge), var(--shot-shadow);
}

.shot img {
  width: 100%;
}

.shot-lower {
  margin-top: clamp(40px, 8vw, 112px);
}

/* Comfortable by default */

.band-ink {
  --ink: var(--band-ink-text);
  --ink-2: var(--band-ink-text-2);
  --muted: var(--band-ink-muted);
  --rule: var(--band-ink-rule);
  --focus: var(--band-ink-focus);
  --switch-off: var(--band-ink-switch-off);
  background: var(--band-ink-bg);
  color: var(--ink);
}

.privacy-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start;
  column-gap: clamp(40px, 6vw, 112px);
}

.privacy-head {
  position: sticky;
  top: calc(var(--nav-h) + 32px);
  display: grid;
  gap: 20px;
}

.shot-crop {
  width: min(100%, 340px);
  margin-top: 20px;
  aspect-ratio: 720 / 700;
  border-radius: 40px;
}

.shot-crop img {
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 8px var(--col-gap);
  padding-block: 28px;
  border-top: 1px solid var(--rule);
}

.row:last-child {
  border-bottom: 1px solid var(--rule);
}

.row dt {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.2;
}

.row dd {
  color: var(--ink-2);
}

/* Close */

.close-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(28px, 5vw, 80px);
}

.close-icon {
  display: block;
  width: clamp(120px, 14vw, 200px);
  border-radius: 22.5%;
}

.close-icon img {
  width: 100%;
}

.close-text {
  display: grid;
  justify-items: start;
  gap: 20px;
  max-width: 44rem;
}

.close-text h2 {
  font-size: clamp(2.5rem, 3vw + 1.5rem, 4.5rem);
}

.close-text .lead {
  max-width: 40ch;
}

.close-text .button {
  margin-top: 8px;
}

/* Footer */

.site-footer {
  padding-block: clamp(56px, 6vw, 88px) 40px;
  box-shadow: inset 0 1px 0 var(--rule);
}

.footer-word {
  margin-bottom: clamp(24px, 3vw, 40px);
  color: var(--coral);
  font-family: var(--font-display);
  font-size: clamp(6rem, 21vw, 21rem);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.06em;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: -12px;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: var(--text-small);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.site-footer nav a:hover {
  background: var(--coral-pale);
}

.legal {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Small widgets: Spending at a glance and Quick log, from Widgets/MeloWidgets.swift */

.widget-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(22 * var(--pt));
  transform-style: preserve-3d;
}

.widget-small {
  display: flex;
  flex-direction: column;
}

.w-head-spend {
  align-items: center;
}

.w-wordmark {
  color: var(--widget-accent);
  font-size: calc(17 * var(--pt));
  font-weight: 600;
  line-height: 1.2;
}

.w-icon {
  flex: none;
  width: calc(17 * var(--pt));
  height: calc(17 * var(--pt));
  fill: var(--widget-accent);
}

.w-caption {
  margin-top: calc(9 * var(--pt));
  color: var(--muted);
  font-size: calc(12 * var(--pt));
  line-height: 1.25;
}

.w-amount {
  margin-top: calc(2 * var(--pt));
  font-family: var(--font-display);
  font-size: calc(28 * var(--pt));
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.w-foot {
  margin-top: calc(7 * var(--pt));
  overflow: hidden;
  color: var(--muted);
  font-size: calc(11 * var(--pt));
  white-space: nowrap;
  text-overflow: ellipsis;
}

.w-quick-title {
  font-family: var(--font-display);
  font-size: calc(17 * var(--pt));
  font-weight: 700;
  line-height: 1.2;
}

.w-quick-action {
  display: flex;
  align-items: center;
  gap: calc(6 * var(--pt));
  margin-top: calc(12 * var(--pt));
  color: var(--widget-accent);
  font-size: calc(15 * var(--pt));
  font-weight: 600;
  line-height: 1.2;
}

.w-quick-action .w-icon {
  width: calc(20 * var(--pt));
  height: calc(20 * var(--pt));
}

.w-icon-cut {
  fill: none;
  stroke: var(--widget-paper);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.widget-quick .w-brand {
  margin-top: auto;
  font-size: calc(12 * var(--pt));
  font-weight: 600;
}

/* Tilt: site.js sets --rx and --ry (degrees), --mx and --my (where the light falls) and --sheen,
   from the cursor or the phone's motion. Everything rests flat without script. */

[data-tilt] {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
}

/* Flat planes: a shadow that slides opposite the tilt, and inner layers that float above the card. */
.card[data-tilt],
.tile[data-tilt],
.shot[data-tilt],
.close-icon[data-tilt] {
  box-shadow: var(--edge, 0 0 0 0 transparent), calc(var(--sx, 0) * 1px) calc(var(--sy, 0) * 1px + 22px) 44px -22px var(--tilt-shadow);
}

.card[data-tilt] {
  --edge: 0 0 0 1px var(--card-edge);
}

.moment-card[data-tilt],
.challenge[data-tilt] {
  --edge: 0 0 0 0 transparent;
}

.shot[data-tilt] {
  --edge: 0 0 0 1px var(--shot-edge);
}

.widget {
  box-shadow: calc(var(--sx, 0) * 1px) calc(var(--sy, 0) * 1px + 16px) 36px -18px var(--tilt-shadow);
}

.challenge[data-tilt] > *,
.ledger-card[data-tilt] > *,
.moment-card[data-tilt] > *,
.notice[data-tilt] > *,
.mini-ledger[data-tilt] > *,
.mini-row[data-tilt] > * {
  transform: translateZ(18px);
}

.challenge[data-tilt] > h3,
.moment-card[data-tilt] > .moment-emoji {
  transform: translateZ(34px);
}

.close-icon[data-tilt] img {
  transform: translateZ(28px);
}

[data-tilt]:not(.home) {
  position: relative;
}

[data-tilt]:not(.home)::after,
.widget::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), var(--sheen), var(--sheen-clear) 58%);
  opacity: var(--sheen-on, 0);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.home {
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

/* Hover a row of the comparison to light up the same detail on both cards. */

[data-field] {
  border-radius: 6px;
  transition: background-color 200ms ease, box-shadow 200ms ease;
}

[data-field].is-lit {
  background: color-mix(in srgb, var(--coral) 24%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 24%, transparent);
}

.compare-table tbody tr {
  transition: background-color 200ms ease;
}

.compare-table tbody tr.is-lit {
  background: color-mix(in srgb, var(--coral) 8%, transparent);
}

/* The logo's dot hops on hover. */

.brand-mark circle {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .brand:hover .brand-mark circle {
    animation: hop 640ms var(--ease-out);
  }
}

@keyframes hop {
  30% {
    transform: translateY(-80%) scaleY(1.06);
  }

  55% {
    transform: translateY(0) scaleY(0.9);
  }

  72% {
    transform: translateY(-20%);
  }
}

/* A spending tracker that fills itself in */

.band-lilac {
  background: var(--lilac-pale);
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--col-gap);
}

.tile {
  display: grid;
  align-content: start;
  gap: 24px;
  padding: clamp(24px, 2.8vw, 40px);
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--paper-raised);
}

.tile-week {
  grid-column: span 7;
}

.tile-where {
  grid-column: span 5;
}

.tile-plan {
  grid-column: span 5;
}

.tile-subs {
  grid-column: span 7;
}

.tile-text {
  display: grid;
  gap: 8px;
  max-width: 34rem;
}

.tile-text p {
  color: var(--ink-2);
}

.tile-shot {
  grid-template-rows: auto 1fr;
  padding-bottom: 0;
}

.tile-screen {
  align-self: end;
  justify-self: center;
  width: min(100%, var(--shot-w, 360px));
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 0 0 1px var(--shot-edge);
}

.tile-week .tile-screen {
  --shot-w: 420px;
}

.tile-where .tile-screen {
  --shot-w: 320px;
}

.tile-screen img {
  width: 100%;
}

.plan,
.subs {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--card-edge);
}

.plan-left {
  color: var(--coral-text);
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.plan-figure {
  color: var(--muted);
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
}

.plan-note {
  flex-wrap: wrap;
  gap: 2px 16px;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.plan-note span {
  white-space: nowrap;
}

.plan-state {
  color: var(--coral-text);
  font-weight: 600;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

.bar-small {
  height: 6px;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
  transition: transform 400ms var(--ease-out);
}

.plan-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  color: var(--ink-2);
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
}

.plan-slider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: var(--text-small);
}

.plan-slider label {
  color: var(--ink-2);
  font-weight: 600;
}

.plan-slider output {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.plan-slider input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 28px;
  margin: 0;
  accent-color: var(--coral);
  cursor: pointer;
}

.sub-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.sub-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--coral-pale);
  color: var(--coral-text);
  font-family: var(--font-display);
  font-weight: 700;
}

.sub-trial .sub-logo {
  background: var(--lilac-pale);
  color: var(--lilac-text);
}

.sub-text,
.sub-due {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.sub-text span,
.sub-due span {
  color: var(--muted);
  font-size: var(--text-small);
}

.sub-due {
  text-align: right;
}

.sub-due strong {
  font-weight: 600;
}

.reminder {
  min-width: 0;
  margin: 0;
  padding: 16px 0;
  border: 0;
  border-block: 1px solid var(--rule);
}

.reminder legend {
  float: left;
  width: 100%;
  margin-bottom: 12px;
  padding: 0;
  color: var(--ink-2);
  font-size: var(--text-small);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  clear: both;
  gap: 8px;
}

.chip {
  position: relative;
  display: inline-flex;
}

.chip input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--ink-2);
  font-size: var(--text-small);
  font-weight: 600;
  transition: background-color 160ms ease, color 160ms ease;
}

.chip:hover span {
  background: var(--lilac-pale);
}

.chip input:checked + span {
  background: var(--ink);
  box-shadow: none;
  color: var(--paper);
}

.chip input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Ghost mode, switched for real between two captures */

.ghost-demo {
  display: grid;
  justify-items: start;
  gap: 20px;
  margin-top: 8px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 8px 0 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-body);
  font-weight: 600;
  cursor: pointer;
}

.switch-track {
  position: relative;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: var(--switch-off);
  transition: background-color 200ms ease;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--switch-thumb);
  box-shadow: var(--shadow-thumb);
  transition: transform 220ms var(--ease-out);
}

.switch[aria-checked="true"] .switch-track {
  background: var(--coral);
}

.switch[aria-checked="true"] .switch-thumb {
  transform: translateX(20px);
}

.switch:active .switch-thumb {
  transform: scaleX(1.15);
}

.switch[aria-checked="true"]:active .switch-thumb {
  transform: translateX(16px) scaleX(1.15);
}

.ghost-demo .shot-crop {
  margin-top: 0;
}

.ghost-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: opacity 450ms ease;
}

.ghost-shots[data-ghost="on"] .ghost-off,
.ghost-shots[data-ghost="off"] .ghost-on {
  opacity: 0;
}

/* Privacy and support pages */

.doc {
  padding-block: clamp(48px, 6vw, 96px) var(--section-pad);
}

.doc .container > * {
  max-width: 46rem;
}

.doc-head {
  display: grid;
  gap: 20px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.doc-head h1 {
  font-size: var(--text-display);
  letter-spacing: -0.035em;
}

.doc-section {
  display: grid;
  gap: 16px;
  padding-block: 32px;
  border-top: 1px solid var(--rule);
}

.doc-section h2 {
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.doc-section p,
.doc-list li {
  color: var(--ink-2);
}

.doc-list {
  display: grid;
  gap: 12px;
  padding-left: 1.2em;
  list-style: disc;
}

.doc-list li::marker {
  color: var(--coral);
}

.site-footer nav a[aria-current="page"] {
  background: var(--coral-pale);
}

/* On touch screens a press is for tilting and tapping, not selecting: no text selection, no
   long-press menu and no grey tap flash on the home page. The footer and the Privacy and Support
   pages stay selectable, so the support address can still be copied. */

@media (hover: none), (pointer: coarse) {
  .site-header,
  main:not(.doc) {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  main:not(.doc) img {
    -webkit-user-drag: none;
  }

  a,
  button,
  label,
  input {
    -webkit-tap-highlight-color: transparent;
  }
}

/* Smaller screens */

@media (max-width: 1100px) {
  .section-head-split {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 20px;
  }

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

@media (max-width: 900px) {
  .hero-grid,
  .group-grid,
  .privacy-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 48px;
  }

  .hero-grid {
    padding-top: 24px;
  }

  .hero .lead {
    max-width: 36ch;
  }

  .plate {
    margin-left: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(var(--gutter), env(safe-area-inset-right, 0px)));
    border-radius: 0;
  }

  .plate::before {
    display: none;
  }

  .home {
    --pt: min(1.25px, calc((100vw - 40px) / 338));
  }

  .hero-caption {
    padding-inline: 0;
  }

  .timeline {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 56px;
  }

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

  .group-shots {
    justify-self: start;
  }

  .privacy-head {
    position: static;
  }
}

@media (max-width: 720px) {
  :root {
    --nav-h: 64px;
  }

  .site-nav {
    display: none;
  }

  .brand-mark {
    width: 40px;
  }

  .brand-word {
    font-size: 26px;
  }

  .compare-table .c-label {
    width: 26%;
  }

  .compare-table thead th {
    padding-right: 12px;
  }

  .compare-table tbody th,
  .compare-table tbody td {
    padding-right: 12px;
  }

  .ledger-card,
  .moment-card {
    min-height: 0;
    padding: 16px;
  }

  .ledger-top {
    flex-direction: column;
    gap: 0;
  }

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

  .moment-emoji {
    grid-row: auto;
    margin-bottom: 8px;
    font-size: 32px;
  }

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

  .hero-caption {
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .compare-table,
  .compare-table thead,
  .compare-table tbody,
  .compare-table tr,
  .compare-table th,
  .compare-table td {
    display: block;
  }

  .compare-table colgroup,
  .compare-table thead td {
    display: none;
  }

  .compare-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 12px;
  }

  .compare-table thead th {
    padding: 0 0 24px;
  }

  .compare-table tbody tr {
    padding-block: 16px;
    border-top: 1px solid var(--rule);
  }

  .compare-table tbody tr:last-child {
    border-bottom: 1px solid var(--rule);
  }

  .compare-table tbody th,
  .compare-table tbody td,
  .compare-table tbody tr:last-child th,
  .compare-table tbody tr:last-child td {
    padding: 0;
    border: 0;
  }

  .compare-table tbody th {
    grid-column: 1 / -1;
    padding-bottom: 4px;
  }

  .group-shots {
    gap: 12px;
  }
}

@media (max-width: 900px) {
  .tile-week,
  .tile-where,
  .tile-plan,
  .tile-subs {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .sub-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .sub-due {
    grid-column: 2;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .w-row,
  .button,
  .site-nav a,
  .site-footer nav a,
  .site-header,
  .bar-fill,
  .reaction,
  .reaction-add,
  .reaction-picker button,
  .join,
  .switch-track,
  .switch-thumb,
  .ghost-img,
  .mini-row,
  .chip span,
  .notice-actions button,
  .notice-undo,
  [data-field],
  .compare-table tbody tr {
    transition: none;
  }

  .reaction.is-popped {
    animation: none;
  }

  [data-tilt] {
    transform: none;
  }

  .button:active,
  .reaction:active,
  .reaction-add:active,
  .reaction-picker button:active,
  .reaction-picker button:hover,
  .join:active {
    transform: none;
  }
}
