/* Paper: warm paper, white cards, a filled leading card, a floating tab bar.
   Home is plum, business is graphite, and the two together are slate blue. */

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/rubik-hebrew-wght-normal.bda074a677ba.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/rubik-latin-wght-normal.b65daadded74.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font: "Rubik", "Segoe UI", system-ui, sans-serif;
  --line: 1.35;
  --fs-base: 1.0625rem;
  --fs-tiny: 0.72rem;
  --fs-small: 0.8125rem;
  --fs-note: 0.9375rem;
  --fs-body: 1rem;
  --fs-figure: 1.375rem;
  --fs-h2: 1.25rem;
  --fs-title: 2.125rem;
  --fs-hero: 3.5rem;
  --w-strong: 700;
  --w-h2: 700;
  --w-title: 800;
  --w-figure: 800;
  --w-hero: 800;

  --ground: #f5f2ec;
  --text: #1c1b19;
  --muted: #5f5a52;
  --surface: #fff;
  --hairline: rgb(60 54 44 / 0.12);
  --edge: rgb(60 54 44 / 0.3);
  --track: rgb(118 110 95 / 0.14);
  --soft: rgb(118 110 95 / 0.12);
  --good: #1f7a45;
  --good-fill: #2e9e5b;
  --spent: #c0396f;
  --spent-fill: #e5528a;
  --alert: #c2331f;
  --alert-text: #a12a19;
  --book-home: #6f3f73;
  --book-business: #3d3a36;
  --book-combined: #2c4a6e;

  --gutter: 16px;
  --gap: 14px;
  --nav-space: 100px;
  --radius-card: 22px;
  --radius-control: 14px;
  --shadow-card: 0 1px 2px rgb(40 34 24 / 0.04), 0 8px 24px rgb(40 34 24 / 0.06);
  --meter-height: 6px;
  --meter-radius: 999px;
}

[data-book="home"] {
  --accent: #6f3f73;
  --accent-deep: #522a55;
  --accent-ink: #3f2142;
  --on-accent: #fff;
  --lead: #5a2f5e;
}

[data-book="business"] {
  --accent: #3d3a36;
  --accent-deep: #23211e;
  --accent-ink: #2e2b28;
  --on-accent: #fff;
  --lead: #2e2b28;
}

[data-book="combined"] {
  --accent: #365a85;
  --accent-deep: #24405f;
  --accent-ink: #1d3350;
  --on-accent: #fff;
  --lead: #2c4a6e;
}

/* --- Header ----------------------------------------------------------------- */

.top__settings {
  background: var(--accent-tint);
  color: var(--accent);
}

.monthpicker {
  padding: 0 2px;
  border-radius: 999px;
  background: var(--soft);
}

.monthpicker__label {
  min-width: 64px;
}

.books {
  gap: 2px;
  padding: 3px;
  border-radius: 13px;
  background: var(--soft);
}

.books__item {
  border-radius: 10px;
}

.books__item[aria-current] {
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(40 34 24 / 0.14);
}

/* --- Leading card ----------------------------------------------------------- */

.lead {
  padding: 20px 20px 18px;
  border-radius: 26px;
  background: var(--lead);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--lead) 24%, transparent);
  color: #fff;
  --focus: #fff;
}

.lead .meter {
  height: 10px;
  background: rgb(255 255 255 / 0.24);
}

.lead .meter__fill,
.lead .meter__mark {
  background: #fff;
}

.lead .meter__mark {
  inset-block: -6px;
  box-shadow: 0 0 0 2px var(--lead);
}

.lead .meter__mark-label {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.2);
  font-size: 0.75rem;
}

.lead__ends {
  margin-top: 2px;
}

.stat {
  border-radius: 20px;
}

.stat__figure {
  line-height: 1.3;
}

/* --- Tab bar: a pill that floats over the page, with a round button beside it */

@media (max-width: 59.99rem) {
  .top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      ". settings"
      "title month"
      "books books";
    align-items: end;
  }

  .top__settings {
    justify-self: end;
  }

  .nav {
    max-width: 40rem;
    margin-inline: auto;
    gap: 10px;
    padding: 8px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
    border: 0;
    background: linear-gradient(to top, var(--ground) 45%, transparent);
  }

  .nav__tabs {
    padding: 5px;
    border-radius: 26px;
    background: var(--surface);
    box-shadow: 0 2px 8px rgb(30 26 20 / 0.1);
  }

  .nav__tab {
    gap: 2px;
    height: 52px;
    border-radius: 21px;
  }

  .nav__tab[aria-current] {
    background: var(--accent-tint);
  }

  .nav__badge {
    top: 3px;
  }

  .nav__cash {
    width: 56px;
    height: 56px;
    box-shadow: 0 2px 8px rgb(30 26 20 / 0.18);
  }
}

@media (min-width: 60rem) {
  .monthpicker {
    padding: 3px 2px;
  }

  .nav__cash {
    box-shadow: 0 2px 8px rgb(30 26 20 / 0.18);
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #3d3a36;
    --hairline: rgb(60 54 44 / 0.5);
    --edge: #3d3a36;
  }
}
