/*
 * Life OS design tokens. One source for the sign-in page, the app and the blog.
 *
 * The palette is the brand guide's: Obsidian for surfaces, Soft White for type, and Signal Red
 * as the only accent. Red is emphasis and direction, never decoration and never the colour of a
 * paragraph: it marks the page you are on, money that needs an answer, and the one button that
 * cannot be taken back. The one other red is --expense: every amount that was spent, with its
 * minus sign. Anything that only means "this is live" or "this is now" is Soft White on dark and
 * Obsidian on light, so a running clock never reads as a problem.
 */
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geist-mono-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Type: words in Inter, data in Geist Mono */
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --text-11: 11px; --text-12: 12px; --text-13: 13px; --text-14: 14px;
  --text-16: 16px; --text-20: 20px; --text-24: 24px; --text-40: 40px;
  --text-hero: clamp(56px, 7.2vw, 104px);

  /* Spacing: 4 8 12 16 24 32 48 64 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px; --s12: 48px; --s16: 64px;

  /* Radius: 6 inner controls, 8 controls, 14 overlays and physical cards */
  --r-sm: 6px; --r-md: 8px; --r-lg: 14px;

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --fast: .16s; --base: .24s; --slow: .42s;

  /* Layout */
  --row: 56px;
  --measure: 760px;
  --page: 1240px;
  --side: 216px;
  --dock: 320px;

  /* The brand's own three, unchanged in both modes. Signal Red is kept on reverse. */
  --obsidian: #13111A;
  --signal-red: #FF2100;
  --soft-white: #FAF9FB;
}

:root, [data-theme='dark'] {
  color-scheme: dark;
  --bg: #0D0C12;
  --surface: #13111A;
  --raised: #1A1822;
  --t1: #FAF9FB;
  --t2: #9A94A6;
  --t3: #6F6A7C;
  --line: rgba(250, 249, 251, .08);
  --line2: rgba(250, 249, 251, .16);
  --field-line: rgba(250, 249, 251, .34);
  --fill: rgba(250, 249, 251, .035);
  --fill2: rgba(250, 249, 251, .075);
  --btn: #FAF9FB;
  --btn-t: #13111A;
  --sheet: #1A1822;
  --scrim: rgba(8, 7, 11, .62);
  /* A card lifts off the page. On dark that means lighter than the canvas; on light it means
     paper-white against the canvas, which is why this cannot simply be --raised. */
  --card: #1A1822;

  /* Emphasis. Fills and large figures take --accent; small red text takes --accent-text. */
  --accent: #FF2100;
  --accent-text: #FF6A4F;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(255, 33, 0, .13);
  --accent-line: rgba(255, 33, 0, .38);

  /* Live, now, in progress. Never red: a clock is not a warning. */
  --now: #FAF9FB;
  --glow: rgba(250, 249, 251, .26);

  /* Direction of travel in money and counts. */
  --up: #3BC97F;
  --down: #FF6A4F;
  --warn: #E5A23D;
  /* Money spent: the one colour for every expense, with its minus sign. At least AA on every surface it sits on. */
  --expense: #FF6A4F;

  --weight: 400;
  --weight-strong: 560;
}

[data-theme='light'] {
  color-scheme: light;
  --bg: #FAF9FB;
  --surface: #FFFFFF;
  --raised: #F2F0F5;
  --t1: #13111A;
  --t2: #5D5868;
  --t3: #857F93;
  --line: rgba(19, 17, 26, .09);
  --line2: rgba(19, 17, 26, .18);
  --field-line: rgba(19, 17, 26, .42);
  --fill: rgba(19, 17, 26, .025);
  --fill2: rgba(19, 17, 26, .06);
  --btn: #13111A;
  --btn-t: #FAF9FB;
  --sheet: #FFFFFF;
  --scrim: rgba(19, 17, 26, .3);
  --card: #FFFFFF;

  /* Signal Red stays Signal Red where it is a mark or a fill. Where it has to be read as small
     text it darkens, because #FF2100 on Soft White does not carry a 12px line. */
  --accent: #FF2100;
  --accent-text: #C41900;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(255, 33, 0, .09);
  --accent-line: rgba(255, 33, 0, .32);

  --now: #13111A;
  --glow: rgba(19, 17, 26, .18);

  --up: #107A48;
  --down: #C41900;
  --warn: #8F5208;
  /* Darker than --accent-text so it still reads on the calendar's hovered chip. */
  --expense: #B81700;

  --weight: 400;
  --weight-strong: 560;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--t1);
  font-family: var(--font);
  font-size: var(--text-14);
  font-weight: var(--weight);
  line-height: 1.45;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--t1); color: var(--bg); }
/* The red corner of the mark points at what comes next; so does the focus ring. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

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