/* theme.css -- the look and feel, in one place.

   Every colour the app and the public site paint with is named here, and
   nowhere else: app.css, marketing.css, the templates and the charts (app.js
   reads the --chart-* values) only ever refer to these names. To restyle,
   change the values below; nothing else needs to move.

   Loaded first by base.html and by every marketing page, before app.css /
   marketing.css.

   Two forms per base colour, kept side by side:
     --accent      the colour itself, for plain fills, text and borders
     --accent-rgb  the same colour as "r, g, b", for see-through tints:
                   rgba(var(--accent-rgb), .15)
   Change one, change its twin -- that's what keeps every tint, glow and badge
   following the colour instead of staying behind as the old one.

   Deliberately NOT here:
   * emails (templates/email/) -- mail clients ignore CSS variables, so they
     keep literal colours inline;
   * the print pages (admin/invoice.html, legal_print.html) -- paper is white
     whatever the screen theme is. */

/* IBM Plex Sans, self-hosted (OFL -- see static/fonts/OFL.txt). Latin only;
   swap keeps text visible in the system font while the file loads. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  /* The app is dark by design. Declaring it keeps Chrome's auto-dark from
     re-theming our colours (it flips the dark ink on gold to white) and gets
     native controls -- select popups, scrollbars, date pickers -- drawn dark. */
  color-scheme: dark;

  /* --- Page and surfaces, darkest to lightest ---------------------------- */
  /* "Carbon": neutral greys with no blue cast, so the brass reads as the only
     colour on the page. Each step is about 7 points lighter than the last. */
  /* Google Play's own logo colours -- a third party's mark, not ours, so they
     stay the same in any theme. */
  --play-blue: #00d7fe;
  --play-green: #00f076;
  --play-red: #ff3a44;
  --play-yellow: #ffd500;
  --bg: #0e0f11;
  --bg-rgb: 14, 15, 17;
  --surface-deep: #111214;      /* bottom-right end of the card/stat gradients */
  --surface-mid: #16171a;       /* middle stop of the stat-tile gradient */
  --surface: #17181b;
  --surface-rgb: 23, 24, 27;
  --surface-2: #1e2024;
  --surface-3: #27292e;
  --media-bg: #0b0b0c;          /* behind photos while they load / letterboxed */

  /* --- Lines -------------------------------------------------------------- */
  --border: #2d2f34;
  --border-hover: #3c3f45;      /* plan-changes popup card edge */
  --border-strong: rgba(var(--highlight-rgb), .14);
  /* Zebra stripe for data tables -- enough to stop the eye sliding onto the
     wrong row across a wide sheet, not enough to read as two kinds of row
     (issues #37/#40). Row hover sits on --surface-3, a step above it. */
  --stripe: #1b1c20;

  /* --- Text --------------------------------------------------------------- */
  --text: #ecedef;
  --muted: #9c9ea5;
  --muted-rgb: 156, 158, 165;
  --muted-2: #6f727a;
  --overlay-text: #fff;         /* text/icons on top of a photo (lightbox, overlays) */

  /* --- Brand: gold ------------------------------------------------------- */
  --accent: #c7a35d;            /* muted brass -- was #e0b64d, toned down platform-wide */
  --accent-rgb: 199, 163, 93;
  --accent-hi: #dcbf85;         /* a gold button hovered (marketing); the app's own
                                   buttons, pills and tabs are flat --accent now */
  --accent-sheen: #e6c98d;      /* light end of the marketing headline gradient */
  --accent-deep: #b8862a;       /* dark end of the logo-mark gradient */
  --accent-ink: #1a1206;        /* text on gold */

  /* --- Brand: blue (links, secondary data) ------------------------------- */
  --accent-2: #4ea1ff;
  --accent-2-rgb: 78, 161, 255;

  /* --- Status ------------------------------------------------------------ */
  --green: #47c479;
  --green-rgb: 71, 196, 121;
  --green-text: #a6e9c4;        /* text inside a green notice */
  --red: #e5484d;
  --red-rgb: 229, 72, 77;
  --red-text: #ffb4b6;          /* text inside a red alert */
  --warn: #b8860b;              /* outline of a "please read / action needed" card */

  /* Countdown and accent stat tiles: three-stop fills, light to dark. */
  --tile-gold-1: #3a3020;
  --tile-gold-2: #221c11;
  --tile-gold-3: #171310;
  --tile-red-1: #3a2020;
  --tile-red-2: #221414;
  --tile-red-3: #171010;

  /* --- Light and shadow --------------------------------------------------
     Highlights (bevels, sheen, faint fills) are white at low alpha; shadows
     and backdrops are black. Named so a light theme can retune them. */
  --highlight-rgb: 255, 255, 255;
  --shadow-rgb: 0, 0, 0;
  --shadow: 0 2px 8px rgba(var(--shadow-rgb), .35);

  /* --- Charts (read by app.js and the workout progression chart) --------- */
  --chart-1: var(--accent);
  --chart-2: var(--accent-2);
  --chart-3: var(--green);
  --chart-text: var(--muted);
  --chart-grid: rgba(var(--highlight-rgb), .06);

  /* --- Toasts (app.js toast(), base.html for ?msg= / ?err=) -------------- */
  --toast-bg: var(--surface-3);
  --toast-text: var(--text);
  --toast-success: var(--green);
  --toast-error: var(--red);

  /* --- Loading placeholders (app.js skeletonRows(), photo thumbnails) ---- */
  --skeleton: var(--surface-3);
  --skeleton-shine: rgba(var(--highlight-rgb), .07);

  /* --- Marketing device mock-ups (the framed screenshots on the landing page) */
  --device-bezel: #10141a;
  --device-chrome: #1a2029;
  --device-dot: #3a4452;
  --device-dot-close: #e0605a;
  --device-dot-min: #e3b341;
  --device-dot-min-rgb: 227, 179, 65;
  --device-screen: #05070a;
  --device-notch: #1f252e;

  /* --- Type --------------------------------------------------------------- */
  --font-ui: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* --- Shape ------------------------------------------------------------- */
  --radius: 12px;
  --radius-lg: 18px;
}
