/* Spendpip website. Palette and type follow /brand/README.md. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/BricolageGrotesque-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/BricolageGrotesque-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --coral: #ff6b4a;
  --ink: #1d1b3a;
  --cream: #fff6ee;
  --mint: #22c39a;
  --sun: #ffc145;

  --bg: #fff6ee;
  --surface: #ffffff;
  --surface-alt: #fbeadf;
  --text: #1d1b3a;
  --muted: #6b6880;
  --border: #eedfd3;
  --link: #c73e1d;
  --panel: #1d1b3a;
  --panel-text: #fff6ee;
  --panel-muted: #b9b5d6;
  --panel-line: #3a3763;

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --page: 70rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121127;
    --surface: #1e1c3b;
    --surface-alt: #29264c;
    --text: #fff6ee;
    --muted: #aba7c7;
    --border: #302d58;
    --link: #ff9a80;
    --panel: #2a2752;
    --panel-muted: #aba7c7;
    --panel-line: #45417a;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 var(--body);
}

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

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
}

.wrap {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -100rem;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
}

/* ---- header and footer ------------------------------------------------ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}
.brand {
  display: block;
  flex: none;
}
.brand img {
  height: 2.25rem;
  width: auto;
}
.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  font-weight: 600;
  font-size: 1rem;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--coral);
}

.site-footer {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  border-top: 1px solid var(--border);
  padding-block: 2rem 3rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer a {
  color: var(--text);
}

/* ---- hero -------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(3rem, 8vw, 6rem);
}
.hero h1 {
  font-weight: 800;
  font-size: clamp(2.75rem, 7vw, 5.25rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
}
.hero .lede {
  margin-top: 1.5rem;
  max-width: 32rem;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.5;
}
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}
.store {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 1.15rem 0.7rem;
  border-radius: 0.9rem;
  background: var(--coral);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
}
.store small {
  font-size: 0.8125rem;
}
.store strong {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
}
.store.soon {
  background: none;
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--text);
}
.hero .note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* The phone is a drawing of the app's month view, in the app's own light theme
   whatever the page theme is. */
.phone {
  justify-self: center;
  width: min(100%, 21rem);
  padding: 0.6rem;
  border-radius: 2.9rem;
  background: var(--ink);
  box-shadow:
    0 0 0 1px #3a3763,
    1.25rem 1.5rem 0 var(--coral);
  rotate: 2.5deg;
}
.screen {
  --t: #1d1b3a;
  --m: #6b6880;
  position: relative;
  overflow: hidden;
  border-radius: 2.35rem;
  background: #fff6ee;
  color: var(--t);
  padding: 1.1rem 0.9rem 0;
  font-size: 0.8125rem;
  line-height: 1.3;
}
.screen-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.book {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.0625rem;
}
.sync {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 99rem;
  background: #fbeadf;
  color: var(--m);
  font-size: 0.6875rem;
}
.sync::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #22c39a;
}
.month {
  margin: 0.9rem 0 0.7rem;
  text-align: center;
  font-weight: 600;
}
.summary {
  border-radius: 1.375rem;
  background: #1d1b3a;
  color: #fff6ee;
  padding: 1.1rem 1.1rem 1.2rem;
}
.summary .label {
  color: #b9b5d6;
}
.summary .total {
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.375rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.summary .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-top: 0.15rem;
  color: #b9b5d6;
  font-size: 0.75rem;
}
.summary .pill {
  padding: 0.15rem 0.55rem;
  border-radius: 99rem;
  background: rgb(34 195 154 / 0.2);
  color: #6fe3c2;
}
.split {
  display: flex;
  gap: 2px;
  height: 0.6rem;
  margin-top: 0.9rem;
  border-radius: 99rem;
  overflow: hidden;
}
.split i {
  background: var(--c);
  flex: var(--w) 0 0;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.6875rem;
  color: #b9b5d6;
}
.legend li::before,
.pip::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--c);
}
.day {
  display: flex;
  justify-content: space-between;
  margin: 0.95rem 0.25rem 0.4rem;
  color: var(--m);
  font-size: 0.75rem;
  font-weight: 600;
}
.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 1rem;
  background: #fff;
}
.rows li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
}
.rows li + li {
  border-top: 1px solid #f3e7dd;
}
.rows .dot {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--c) 18%, #fff);
  display: grid;
  place-items: center;
}
.rows .dot::after {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--c);
}
.rows b {
  display: block;
  font-weight: 600;
}
.rows span {
  color: var(--m);
  font-size: 0.6875rem;
}
.rows .amt {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.screen-end {
  height: 3.25rem;
}
.fab {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  background: #ff6b4a;
  display: grid;
  place-items: center;
  box-shadow: 0 0.4rem 1rem rgb(199 62 29 / 0.35);
}
.fab::before,
.fab::after {
  content: "";
  grid-area: 1 / 1;
  width: 1.15rem;
  height: 0.2rem;
  border-radius: 1rem;
  background: #1d1b3a;
}
.fab::after {
  rotate: 90deg;
}

/* ---- sections ---------------------------------------------------------- */

.section {
  padding-block: clamp(3rem, 8vw, 5.5rem);
}
.section h2 {
  font-weight: 800;
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  max-width: 18ch;
}
.section .intro {
  margin-top: 1rem;
  max-width: 38rem;
  font-size: 1.125rem;
}

/* Each feature is marked with a pip in one of the app's category colours. */
.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem clamp(2rem, 6vw, 5rem);
  margin: clamp(2rem, 5vw, 3.25rem) 0 0;
  padding: 0;
  list-style: none;
}
.features li {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  column-gap: 0.9rem;
}
.features li::before {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.3rem;
  border-radius: 50%;
  background: var(--c);
}
.features h3 {
  grid-column: 2;
  font-weight: 700;
  font-size: 1.4375rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.features p {
  grid-column: 2;
  margin-top: 0.4rem;
  color: var(--muted);
  max-width: 30rem;
}
.also {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  max-width: 44rem;
}

/* Privacy: what the phone holds next to what the server holds. */
.private {
  background: var(--panel);
  color: var(--panel-text);
  border-radius: clamp(1.5rem, 4vw, 2.5rem);
  padding: clamp(1.75rem, 6vw, 4.5rem);
}
.private h2 {
  max-width: 16ch;
}
.private .intro {
  color: var(--panel-muted);
}
.private a {
  color: #ffb39f;
}
.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: clamp(2rem, 5vw, 3rem);
}
.compare figure {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.compare figcaption {
  order: -1;
  margin-bottom: 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1875rem;
}
.compare .box {
  flex: 1;
  border-radius: 1.25rem;
  padding: 1.25rem;
  font-size: 0.9375rem;
}
.box.clear {
  background: var(--cream);
  color: var(--ink);
}
.box.sealed {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--panel-line);
  color: var(--panel-muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.box dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0;
}
.box dt {
  opacity: 0.7;
}
.box dd {
  margin: 0;
  font-weight: 600;
}
.box.sealed dd {
  font-weight: 400;
  color: var(--panel-text);
}
.private .after {
  margin-top: 1.5rem;
  max-width: 40rem;
  color: var(--panel-muted);
}

.share {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.steps {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  column-gap: 1rem;
  padding-block: 1rem;
  border-top: 1px solid var(--border);
}
.steps li:last-child {
  border-bottom: 1px solid var(--border);
}
.steps li::before {
  content: counter(step);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--link);
}

/* ---- document pages (privacy, terms, support, delete account) ---------- */

.doc {
  max-width: 44rem;
  margin-inline: auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) var(--gutter) 0;
}
.doc h1 {
  font-weight: 800;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  letter-spacing: -0.03em;
}
.doc .updated {
  margin-top: 0.75rem;
  color: var(--muted);
}
.doc .summary-box {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.doc .summary-box > :first-child {
  margin-top: 0;
}
.doc h2 {
  font-weight: 700;
  font-size: 1.625rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-top: 2.75rem;
}
.doc h3 {
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-top: 1.75rem;
}
.doc p,
.doc ul,
.doc ol,
.doc table {
  margin-top: 0.9rem;
}
.doc ul,
.doc ol {
  padding-left: 1.3rem;
}
.doc li + li {
  margin-top: 0.4rem;
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.doc th {
  font-weight: 600;
}
.table-scroll {
  overflow-x: auto;
}
.doc .mail {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.375rem, 4vw, 1.875rem);
  letter-spacing: -0.015em;
}

/* ---- small screens ----------------------------------------------------- */

@media (max-width: 52rem) {
  .hero,
  .share,
  .compare,
  .features {
    grid-template-columns: minmax(0, 1fr);
  }
  .phone {
    margin-top: 1rem;
    rotate: 0deg;
    box-shadow:
      0 0 0 1px #3a3763,
      0.75rem 0.9rem 0 var(--coral);
  }
  .site-nav {
    font-size: 0.9375rem;
  }
}
@media (max-width: 30rem) {
  .brand img {
    height: 1.9rem;
  }
  /* Three links don't fit next to the wordmark; Features is one scroll away anyway. */
  .site-nav a[href$="#features"] {
    display: none;
  }
}
