/* The Confetti theme (docs/design.md), light and dark following the system.
   Every page loads this first; components and pages use only these tokens.
   The API's emails use the same light colors (web/api/src/Services/EmailLayout.php). */

/* Self-hosted fonts (no requests to Google): variable woff2 made from the
   google/fonts repo's TTFs, subset to Latin (en, it, de, fr, es), with their
   licenses in assets/fonts/OFL-*.txt. Bricolage keeps opsz 12–96 and
   wght 600–800 (width fixed at 100); Nunito keeps wght 400–800. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/nunito-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #FFF6EE;
  --surface: #FFFFFF;
  --ink: #1F1A2E;
  --muted: #6B6478;
  --primary: #D93644;
  --primary-hover: #BF2735;
  /* Primary as text on bg (4.5:1); --primary itself passes on surface only. */
  --primary-text: #BF2735;
  --on-primary: #FFFFFF;
  --chip: #FFE3DE;
  --good: #14806A;
  --line: #F0E3D8;
  --shadow: 0 1px 2px rgb(31 26 46 / 6%), 0 12px 32px rgb(31 26 46 / 7%);

  /* Category colors: solid tiles and chart segments, the same in both modes.
     Icons and text on them use --on-tile. */
  --coral: #FF6B6B;
  --sun: #FFC23C;
  --mint: #2EC4A0;
  --violet: #7B61FF;
  --sky: #3BA6FF;
  --pink: #FF8FCF;
  --on-tile: #1F1A2E;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --text: Nunito, "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Corners: cards 24, buttons and inputs 16, chips fully round. */
  --radius-card: 24px;
  --radius-control: 16px;

  /* The content column: 1120px wide, centred, with side gutters. */
  --gutter: 24px;
  --column: min(1120px, 100% - 2 * var(--gutter));
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #17131F;
    --surface: #241E30;
    --ink: #F6F1FA;
    --muted: #B3A9C2;
    --primary: #FF7A80;
    --primary-hover: #FF959A;
    --primary-text: #FF7A80;
    --on-primary: #2A0F14;
    --chip: #3A2433;
    --good: #4FDDB8;
    --line: #362D45;
    --shadow: none;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 400 17px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
}

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

p {
  margin: 0;
}

a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
}

a:hover {
  color: var(--primary-text);
}

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

main {
  display: block;
  width: var(--column);
  margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

html {
  scroll-behavior: smooth;
}
