/* ============================================================
   The Inmost Moment — brand layer
   ------------------------------------------------------------
   This file is the single source of truth for the brand: the
   palette, the type stacks and the page reset. Everything else
   the app draws lives in app.css, which is built on these tokens.

   Both faces and every colour below were read from the Figma export
   in `inmostcrown-export`: the frames carry real <text> nodes, so the
   font families are named in the file rather than guessed from a
   render — `font-family="Newsreader"` 7,247 times and
   `font-family="Figtree"` 20,111 times — and the swatches are exact
   fills, counted across all 136 frames.
   ============================================================ */

/* ---------------- the display face ----------------
   Newsreader is the serif the design actually names. It carries every
   heading, every big numeral (the 72, the 0, the 2:10 timer) and the
   lead paragraphs, so it is the brand's voice rather than a title face.

   It travels with the app instead of being hoped for, it is a variable
   font so one file per subset covers the whole weight range, it is
   licensed under the SIL Open Font License (the licence sits beside it,
   in assets/fonts/OFL-newsreader.txt), and the service worker precaches
   it — so the type is identical on every device and never waits on a
   network request. */
@font-face{
  font-family:"Newsreader";
  src:url('../fonts/newsreader-latin.woff2') format('woff2');
  font-weight:300 700;
  font-style:normal;
  font-display:swap;
  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;
}
@font-face{
  font-family:"Newsreader";
  src:url('../fonts/newsreader-latin-ext.woff2') format('woff2');
  font-weight:300 700;
  font-style:normal;
  font-display:swap;
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* ---------------- the body and UI face ----------------
   Figtree is the design's sans: labels, body copy, buttons, the tab
   bar and every control. It was named in the stack but never shipped,
   so on most devices the copy quietly fell back to the system face —
   close enough to look fine, and never the brand's own type. */
@font-face{
  font-family:"Figtree";
  src:url('../fonts/figtree-latin.woff2') format('woff2');
  font-weight:300 800;
  font-style:normal;
  font-display:swap;
  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;
}
@font-face{
  font-family:"Figtree";
  src:url('../fonts/figtree-latin-ext.woff2') format('woff2');
  font-weight:300 800;
  font-style:normal;
  font-display:swap;
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root{
  /* ---- brand ----
     The three swatches the design scatters through the file: clay
     (#683817) for every call to action, deep ink (#30190F) for
     headings and body, and a warm sand (#E6DACB) for hairlines,
     chips and the tinted cards. */
  --cream:#E6DACB;
  --tan:#9A5F32;          /* accent: links, chart fills, keys */
  --brown:#30190F;        /* headings, primary ink */
  --espresso:#2E1C12;     /* deepest text */
  --paper:#FFFDF9;

  /* ---- warm neutrals derived from the palette ---- */
  --cream-50:#FBF6EF;
  --cream-100:#F7F0E7;
  --cream-200:#E6DACB;
  --cream-300:#DAD2C6;
  --line:#E6DACB;
  --line-soft:#EDE5DB;

  --ink:#30190F;
  --ink-2:#5A4A3C;
  --ink-3:#A89B90;

  /* ---- semantic, kept warm rather than neon ---- */
  --up:#7A5B2E;
  --down:#8C6A55;
  --ok:#3F6B6A;
  --warn:#9A5F32;
  --danger:#9B3D2B;

  /* ---- shape ---- */
  --radius:18px;
  --radius-sm:12px;
  --radius-lg:28px;
  --shadow:0 1px 2px rgba(48,25,15,.05), 0 8px 24px rgba(48,25,15,.06);
  --shadow-lg:0 2px 4px rgba(48,25,15,.06), 0 18px 48px rgba(48,25,15,.10);

  /* ---- The Inmost Moment — read from the Figma export ----------
     Every value here is an exact fill from the export (see the note at
     the top of this file), counted across all 136 frames rather than
     sampled from one render. Contrast is checked in tests/tokens.test.mjs.

     The design runs two accents. Clay (#683817) carries the brand and
     every call to action; green (#2F5554) and teal (#3F6B6A) carry the
     practice itself — the Moment screens, the progress rings, the
     Journey line, the offline banner. They are separate families,
     kept apart by name so one is never used for the other's job. */
  --paper-warm:#FBF6EF;      /* the page */
  --paper-raised:#FFFDF9;    /* cards, sheets, the app bar */
  --paper-sunk:#FAF6F1;      /* the field a card sits on */
  --tint-warm:#E6DACB;       /* the Inner Richness card */
  --tint-rose:#F7F0E7;       /* "Choose where to begin" */
  --tint-sand:#DAD2C6;       /* secondary cards, milestone chips */
  --field-moment:#EEF4F3;    /* Silence, and the Moment screens */
  --tint-journey:#EDE5DB;    /* "This month · in progress" */

  --brand-brown:#683817;     /* every primary button */
  --brand-brown-deep:#4E2911;
  --brand-ink:#30190F;
  --brand-ink-deep:#2E1C12;
  /* Secondary copy. The design's own grey measures 3.31:1 on the page,
     under the 4.5:1 floor for body text, so the role carries the darker
     swatch the file already uses everywhere: 6.11:1 on paper. */
  --brand-ink-muted:#5A4A3C;
  --brand-green:#2F5554;     /* the promise band, the offline banner */
  --brand-teal:#3F6B6A;      /* progress rings, the Journey line */
  --brand-hair:#E6DACB;
  --brand-hair-soft:#EDE5DB;

  /* ---- type ----
     Newsreader and Figtree are the two faces the design names, and both
     are loaded from assets/fonts above. The rest of each stack is only
     what shows for the moment before the file arrives. */
  --serif:"Newsreader",Georgia,"Times New Roman",serif;
  --serif-display:"Newsreader",Georgia,"Times New Roman",serif;
  --sans:"Figtree",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
}

/* ---------------- reset ---------------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}

body{
  margin:0;
  font-family:var(--sans);
  font-size:15px;
  line-height:1.6;
  color:var(--ink);
  background:var(--cream-50);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

img,svg,canvas{max-width:100%}
button{font-family:inherit}
h1,h2,h3,h4{line-height:1.2}
p{margin:0 0 1em}

/* available to assistive technology, invisible on screen — used for the
   one heading every screen must carry regardless of its visual design */
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* ---------------- the one shared component ----------------
   A single toast serves both the app and the admin. It is the
   only piece of chrome that is identical in every context. */
.toast{
  position:fixed;left:50%;bottom:26px;transform:translate(-50%,16px);
  background:var(--espresso);color:var(--cream-100);
  padding:12px 22px;border-radius:999px;font-size:.87rem;font-weight:500;
  box-shadow:var(--shadow-lg);opacity:0;pointer-events:none;
  transition:opacity .22s,transform .22s;z-index:200;
  max-width:min(90vw,420px);text-align:center;
}
.toast.show{opacity:1;transform:translate(-50%,0)}
