/* Copied from the brand files with two changes for the app: the font url()s name the files in app/assets/fonts
   directly, so Propshaft finds and fingerprints them; and the base defaults at the end sit in @layer base, so
   Tailwind utilities can override them. Keep both changes when the brand tokens are copied again. */

/* Steady brand tokens. Light theme only.
   Contrast (WCAG 2.2): every text pair below is AAA (7:1) unless noted.
   Font: Atkinson Hyperlegible Next, SIL Open Font License 1.1 (fonts/OFL.txt).
   In the Rails app: copy fonts/*.woff2 to app/assets/fonts and keep the relative url() below,
   or point it at the asset path. The variables can also be pasted into a Tailwind v4 @theme block. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/AtkinsonHyperlegibleNext-Variable-22163f78.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/AtkinsonHyperlegibleNext-Italic-Variable-cc8f150c.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* ---------- Colour ---------- */
  --color-bg: #FBF7F8;            /* rose-white paper, page background */
  --color-surface: #FFFFFF;       /* cards, sheets, inputs */
  --color-surface-2: #F3ECEE;     /* wells, table stripes, sunk areas */
  --color-ink: #2A1C22;           /* body text and headings: 15.3:1 on bg */
  --color-muted: #5E4952;         /* secondary text: 7.7:1 on bg, 7.1:1 on surface-2 */
  --color-line: #E8DDE1;          /* dividers only (decorative, 1.3:1 on surface) */
  --color-line-strong: #8A7880;   /* input and control borders: 3.9:1 on bg */

  --color-primary: #7A1F3D;       /* claret: main actions, links, logo: 9.4:1 on bg */
  --color-primary-hover: #661833;
  --color-primary-press: #4A1025; /* press-and-hold fill on primary buttons */
  --color-primary-soft: #F6E6EC;  /* selected rows, hold fill on secondary buttons */
  --color-primary-ink: #FFFFFF;   /* text on primary: 10.0:1 */

  --color-accent: #E79AAE;        /* blush: the logo ball and small highlights. Never text, never the only signal */
  --color-accent-ink: #8E2F4D;    /* blush text, if ever needed: 7.4:1 on bg */

  --color-hold: #D8E6F6;          /* powder blue: "on hold, not taken" chips and banners */
  --color-hold-ink: #163A61;      /* text on hold: 9.1:1 */
  --color-hold-soft: #EFF5FC;     /* background of a held purchase card */
  --color-hold-strong: #2F5F93;   /* border and icon of held items: 6.2:1 on bg */

  --color-success: #1D5A33;       /* paid, done: 7.7:1 on bg */
  --color-success-soft: #EAF4EC;
  --color-danger: #96220C;        /* vermilion: errors, delete everything: 7.8:1 on bg. Always with the warning sign
                                     (app_icon :alert) and words, so it never reads as the claret primary */
  --color-danger-soft: #FDEFEB;

  --color-focus: #2A1C22;         /* focus ring, the ink colour: 15.3:1 on bg */

  /* ---------- Type ---------- */
  --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: var(--font-body); /* same family, heavier weight */
  --weight-regular: 400;
  --weight-medium: 550;
  --weight-semibold: 650;           /* buttons, labels, the wordmark */
  --weight-bold: 720;               /* headings */

  --text-xs: 1rem;      /* 16px: ids and fine print only */
  --text-sm: 1.125rem;  /* 18px: smallest normal text */
  --text-base: 1.25rem; /* 20px: body */
  --text-lg: 1.5rem;    /* 24px */
  --text-xl: 1.875rem;  /* 30px */
  --text-2xl: 2.375rem; /* 38px */
  --text-3xl: 3rem;     /* 48px */
  --text-4xl: 3.75rem;  /* 60px: landing hero only */

  --leading: 1.55;        /* body */
  --leading-tight: 1.2;   /* headings */
  --tracking-display: -0.01em;
  --measure: 62ch;        /* longest comfortable line */

  /* ---------- Space (4px base) ---------- */
  --space-1: 0.25rem;  /* 4 */
  --space-2: 0.5rem;   /* 8 */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.5rem;   /* 24 */
  --space-6: 2rem;     /* 32 */
  --space-7: 3rem;     /* 48 */
  --space-8: 4rem;     /* 64 */
  --space-9: 6rem;     /* 96: landing sections */

  /* ---------- Shape ---------- */
  --radius-sm: 8px;      /* chips' inner parts, inputs */
  --radius: 14px;        /* cards */
  --radius-lg: 22px;     /* sheets, big panels, app tile */
  --radius-pill: 999px;  /* buttons, chips */
  --border-width: 2px;

  /* ---------- Elevation (warm ink, soft) ---------- */
  --shadow-1: 0 1px 2px rgb(42 28 34 / 0.06), 0 2px 8px rgb(42 28 34 / 0.06);
  --shadow-2: 0 2px 4px rgb(42 28 34 / 0.06), 0 12px 32px rgb(42 28 34 / 0.10);

  /* ---------- Controls ---------- */
  --target-min: 48px;          /* every tap target */
  --button-height: 56px;
  --button-height-lg: 64px;    /* the one main action on a screen */
  --button-padding-x: 1.75rem;
  --input-height: 56px;
  --hold-duration: 800ms;      /* press and hold to confirm money actions */
  --focus-ring: 3px solid var(--color-focus);
  --focus-offset: 3px;

  /* ---------- Motion ---------- */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 120ms;
  --duration: 200ms;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration: 0ms;
  }
}

/* Base defaults that every page should get */
@layer base {
  html { font-size: 100%; -webkit-text-size-adjust: 100%; }
  body {
    background: var(--color-bg);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading);
    font-weight: var(--weight-regular);
  }
  h1, h2, h3 { font-family: var(--font-display); font-weight: var(--weight-bold); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); }
  :focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
  .money, .num { font-variant-numeric: tabular-nums; }
}
