/* Moneta's landing page. Colours, type and corners are the app's tokens (design/tokens/tokens.json, light and
   dark), copied by hand: update them here when the tokens change. */

@font-face { font-family: "Anybody Condensed"; font-weight: 800; font-display: swap; src: url("fonts/anybody-condensed-800.woff2") format("woff2"); }
@font-face { font-family: "Anybody Condensed"; font-weight: 700; font-display: swap; src: url("fonts/anybody-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "Anybody"; font-weight: 400; font-display: swap; src: url("fonts/anybody-400.woff2") format("woff2"); }
@font-face { font-family: "Anybody SemiExpanded"; font-weight: 500; font-display: swap; src: url("fonts/anybody-semiexpanded-500.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --app: #FFFFFF;
  --surface: #EDEDE8;
  --ink: #161616;
  --muted: #5C5C58;
  --toast: #161616;
  --on-toast: #FFFFFF;
  --note-ink: #161616;

  --le: #CFCFC8; --n10: #D9B45A; --n20: #7FA6D9; --n50: #E59BB8; --n100: #A9BE7A; --n200: #E39A73; --n500: #7CC3C4;

  --red: #E55F5A; --orange: #C46712; --amber: #BA8D0E; --jade: #2A9B7F; --blue: #5C93EE;
  --orchid: #CF74BD; --rose: #C75E7A; --mocha: #A0826E;

  --corner: 6px;
  --margin: clamp(16px, 4vw, 56px);
  --measure: 1180px;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --condensed: "Anybody Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --text: "Anybody", system-ui, -apple-system, "Segoe UI", sans-serif;
  --keys: "Anybody SemiExpanded", "Anybody", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --app: #0B0B0B;
    --surface: #222220;
    --ink: #F2F2EE;
    --muted: #A3A39D;
    --toast: #F2F2EE;
    --on-toast: #0B0B0B;
    --red: #EE7770; --orange: #CE7B3D; --amber: #C69E43; --jade: #4FA88F; --blue: #72A4F5;
    --orchid: #DA89C9; --rose: #D1738A; --mocha: #9B8273;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--app);
  color: var(--ink);
  font: 400 18px/1.55 var(--text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--condensed); font-weight: 800; letter-spacing: 0.02em; line-height: 0.95; }
.wrap { max-width: var(--measure); margin-inline: auto; padding-inline: var(--margin); }
.muted { color: var(--muted); }
.nb { white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--margin); top: 12px; background: var(--app); padding: 8px 12px; z-index: 10; }

/* Top */
.top { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: var(--corner); display: block; }
.brand b { font: 800 24px/1 var(--condensed); letter-spacing: 0.02em; }
.brand span { font-size: 14px; color: var(--muted); }
.lang { font-size: 15px; color: var(--muted); }

/* Hero */
.hero > * { min-width: 0; }
.hero { display: grid; gap: 48px; padding-top: clamp(32px, 7vw, 96px); padding-bottom: clamp(72px, 10vw, 136px); }
.hero h1 { font-size: clamp(64px, 11.5vw, 156px); }
.lede { margin-top: 28px; font-size: clamp(19px, 1.6vw, 22px); max-width: 30ch; }
.soon { margin-top: 32px; font-size: 16px; color: var(--muted); max-width: 32ch; }
.soon b { color: var(--ink); font-weight: 400; }
@media (min-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr) 400px; align-items: center; gap: 72px; }
  .hero h1 { max-width: 8.5ch; }
}

/* The entry demo */
.demo { width: 100%; max-width: 400px; }
.demo:not(.ready) .keys, .demo:not(.ready) .cats { pointer-events: none; }
.demo-hint { font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.field {
  height: 176px;
  padding: 14px 18px 10px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--band, var(--app));
  color: var(--note-ink);
  transition: background-color 120ms var(--ease);
  overflow: hidden;
}
.field[data-band=""] { background: var(--surface); color: var(--ink); }
.field-kind { font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.amount { font: 800 96px/1 var(--condensed); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; }
.amount.m { font-size: 72px; }
.amount.s { font-size: 52px; }
.amount.xs { font-size: 36px; }
.amount .faded { opacity: 0.6; }
.amount .placeholder { opacity: 0.3; }
.field.out { animation: hand-over 280ms var(--ease); }
@keyframes hand-over { 50% { transform: translateY(-36px); opacity: 0; } 51% { transform: translateY(16px); opacity: 0; } }
.field.no { animation: refuse 180ms linear; }
@keyframes refuse { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.exact { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 17px; }
.exact .stamp { width: 22px; height: 22px; }

.stamp {
  flex: none; display: inline-grid; place-items: center;
  width: 28px; height: 28px;
  background: var(--k); border-radius: var(--corner);
  color: var(--note-ink);
}
.stamp svg { width: 70%; height: 70%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stamp.tam { background: repeating-linear-gradient(135deg, var(--app) 0 4px, var(--muted) 4px 6px); }

.cats { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.cat {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 6px 12px 6px 8px;
  border: 0; border-radius: var(--corner);
  background: var(--surface); color: var(--ink);
  font: 700 17px/1 var(--condensed); letter-spacing: 0.02em;
  cursor: pointer;
}
.cat .stamp { width: 26px; height: 26px; }
.cat[aria-pressed="true"] { background: var(--ink); color: var(--app); }
.cat[aria-pressed="true"] .stamp { color: var(--note-ink); }

.keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.key {
  height: 60px; border: 0; border-radius: 0;
  background: var(--surface); color: var(--ink);
  font: 500 28px/1 var(--keys);
  cursor: pointer; touch-action: manipulation;
  transition: filter 60ms linear;
}
.key:active { filter: brightness(0.9); }
.key.unit { font: 700 21px/1 var(--condensed); letter-spacing: 0.02em; }
.key.unit[aria-pressed="true"] { background: var(--ink); color: var(--app); }
.key svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.key.save { grid-column: span 2; background: var(--ink); color: var(--app); font: 700 21px/1 var(--condensed); border-radius: var(--corner); }
@media (prefers-color-scheme: dark) { .key:active { filter: brightness(1.3); } }

.today { margin-top: 24px; }
.today-head { display: flex; justify-content: space-between; font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.today-head b { color: var(--ink); font: 700 17px/1.2 var(--condensed); letter-spacing: 0.02em; }
.strip { display: flex; gap: 2px; height: 14px; border-radius: var(--corner); overflow: hidden; }
.strip > i { display: block; min-width: 4px; background: var(--k); }
.strip > i.tam { background: repeating-linear-gradient(135deg, var(--app) 0 4px, var(--muted) 4px 6px); }
.strip > i.new { animation: grow 200ms var(--ease); }
@keyframes grow { from { flex-grow: 0; } }

.toast {
  position: fixed; z-index: 5; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  width: min(400px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 16px; border-radius: 12px;
  background: var(--toast); color: var(--on-toast);
  font-size: 16px;
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 0s linear 180ms;
}
.toast.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto; transition-delay: 0s; }
.toast button {
  border: 0; background: transparent; color: inherit; min-height: 44px; padding: 0 10px;
  font: 700 17px/1 var(--condensed); letter-spacing: 0.02em; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer;
}

/* Sections */
section { padding-block: clamp(72px, 10vw, 136px); }
.wide-h2 { max-width: 16ch; font-size: clamp(44px, 6vw, 80px); }
.split { display: grid; gap: 48px; }
@media (min-width: 900px) { .split { grid-template-columns: 5fr 7fr; gap: 72px; align-items: start; } }
h2 { font-size: clamp(48px, 7vw, 96px); max-width: 9ch; }
.copy p + p { margin-top: 16px; }
.copy p { max-width: 38ch; font-size: 19px; }
.copy h2 + p { margin-top: 28px; }

/* Banknote bands */
.notes { display: flex; gap: 2px; margin-top: 56px; height: 168px; }
.notes > div {
  flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 10px 12px; color: var(--note-ink); background: var(--b);
}
.notes b { font: 800 clamp(28px, 4.4vw, 56px)/1 var(--condensed); letter-spacing: 0.02em; }
.notes small { font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.notes-caption { margin-top: 12px; font-size: 15px; color: var(--muted); }
.typed { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; margin-top: 32px; font-size: 19px; align-items: baseline; }
.typed dt { font: 800 34px/1 var(--condensed); letter-spacing: 0.02em; }
.typed dd { margin: 0; color: var(--muted); }

/* The month */
.month-title { font: 800 34px/1 var(--condensed); letter-spacing: 0.02em; }
.sentence { margin-top: 16px; font: 700 clamp(24px, 2.6vw, 30px)/1.2 var(--condensed); letter-spacing: 0.02em; max-width: 24ch; }
.sentence .stamp { width: 24px; height: 24px; vertical-align: -3px; margin-right: 4px; }
.pile { display: flex; gap: 2px; height: 56px; margin-top: 28px; border-radius: var(--corner); overflow: hidden; }
.pile > i { display: block; background: var(--k); }
.rows { list-style: none; margin: 24px 0 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.rows .name { flex: 1; }
.rows .pct { color: var(--muted); font-size: 15px; min-width: 3ch; text-align: right; }
.rows .amt { font: 700 20px/1 var(--condensed); letter-spacing: 0.02em; min-width: 6.5em; text-align: right; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 20px; padding-top: 16px; gap: 16px; }
.total span { color: var(--muted); }
.total b { font: 800 clamp(44px, 5vw, 60px)/1 var(--condensed); letter-spacing: 0.02em; }

/* Small things */
.things { display: grid; gap: 40px 56px; margin-top: 64px; }
@media (min-width: 760px) { .things { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .things { grid-template-columns: 1fr 1fr 1fr; } }
.things h3 { font-size: 30px; line-height: 1; }
.things p { margin-top: 10px; color: var(--muted); max-width: 34ch; }

/* Three zeros */
.zeros { background: var(--n50); color: var(--note-ink); }
.zeros h2 { max-width: 14ch; }
.zero-row { display: grid; gap: 40px; margin-top: 56px; }
@media (min-width: 820px) { .zero-row { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.zero-row b { display: block; font: 800 clamp(160px, 22vw, 280px)/0.8 var(--condensed); letter-spacing: 0.02em; }
.zero-row h3 { margin-top: 20px; font-size: 34px; }
.zero-row p { margin-top: 8px; max-width: 30ch; }
.zeros .after { margin-top: 64px; max-width: 52ch; font-size: 19px; }

/* End */
.end h2 { max-width: 12ch; }
.end p { margin-top: 24px; font-size: 19px; color: var(--muted); max-width: 40ch; }
footer { padding-top: 48px; padding-bottom: 56px; font-size: 15px; color: var(--muted); }
footer .wrap { display: grid; gap: 24px; }
@media (min-width: 900px) { footer .wrap { grid-template-columns: 7fr 5fr; } }
footer p { max-width: 56ch; }
footer .by { color: var(--ink); }

@media (max-width: 520px) {
  body { font-size: 17px; }
  .hero { gap: 36px; padding-top: 24px; }
  .hero h1 { font-size: clamp(52px, 16vw, 80px); }
  .lede { margin-top: 16px; }
  .soon { margin-top: 16px; }
  .cats { gap: 4px; }
  .cat { font-size: 15px; padding: 6px 10px 6px 6px; gap: 6px; }
  .cat .stamp { width: 24px; height: 24px; }
  .amount { font-size: 84px; }
  .amount.m { font-size: 64px; }
  .amount.s { font-size: 46px; }
  .amount.xs { font-size: 32px; }
  .field { height: 156px; }
  .key { height: 56px; }
  .notes { height: 128px; }
  .notes small { display: none; }
  .notes > div { padding: 8px 5px; }
  .notes b { font-size: 20px; }
  .rows .pct { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 100ms !important; }
  .field.out, .field.no, .strip > i.new { animation: none; }
}
