/* Rendus : design tokens. FINAL.
   One accent (flare). Dark first, light first-class. Two typefaces (OFL, self-hosted).
   Themes are scoped: any element with data-theme="light|dark" re-themes its subtree (the gallery uses this). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark light;

  /* ---------- type ---------- */
  --font-display: "Bricolage Grotesque", "Familjen Grotesk", ui-rounded, system-ui, sans-serif;
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-code: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; /* code blocks on /developers only */

  --fs-amt-1: 128px;  /* amount steps: RN.fit picks the largest that fits width and height */
  --fs-amt-2: 112px;
  --fs-amt-3: 96px;
  --fs-amt-4: 64px;
  --fs-amt-5: 44px;
  --fs-title: 32px;   /* screen title, every screen */
  --fs-h2: 24px;      /* sheet / section title */
  --fs-row: 17px;     /* row primary, pill label */
  --fs-body: 15px;    /* secondary */
  --fs-cap: 13px;     /* caption: THE FLOOR. Nothing in the product is smaller. */

  /* ---------- space (4 pt) ---------- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 48px; --s12: 64px;
  --gut: clamp(16px, 5.2vw, 24px);
  --tap: 48px;

  /* ---------- radius ---------- */
  --r-pill: 999px;
  --r-sheet: 28px;
  --r-card: 24px;       /* the recap card, the option tiles and the meme preview only */
  --cut: .364;          /* tan(20deg): the slice cut, times the element height */

  /* ---------- motion ---------- */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-io: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --ease-pour: cubic-bezier(.45, .05, .15, 1);
  --ease-spring: cubic-bezier(.34, 1.5, .5, 1);
  --t-press: 90ms;
  --t-fast: 160ms;
  --t-base: 240ms;
  --t-sheet: 420ms;
  --t-moment: 1200ms;

  /* ---------- safe areas ---------- */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

/* ---------- colour: dark (default) ---------- */
:root, [data-theme="dark"] {
  --bg: #0A0A0B;
  --bg-outer: #000000;
  --bg-raised: #161618;
  --fill: rgb(255 255 255 / .08);
  --fill-hi: rgb(255 255 255 / .15);
  --ink: #F7F5F1;
  --ink-2: rgb(247 245 241 / .68);   /* secondary text, >= 4.5:1 */
  --ink-3: rgb(247 245 241 / .40);   /* decoration only, never text */
  --flare: #FF5B1F;                  /* THE accent */
  --flare-text: #FF6A32;             /* the accent used as text on the canvas */
  --on-flare: #0A0A0B;
  --scrim: rgb(0 0 0 / .6);
  /* people: tinted neutrals, never competing with the flare */
  --p0: #EBDCC6; --p1: #CFE1EC; --p2: #DDD3EE; --p3: #D1E8D5; --p4: #EEE3AE;
  --on-p: #17140F;
}

/* ---------- colour: light ---------- */
[data-theme="light"] {
  --bg: #FBFAF7;
  --bg-outer: #ECE9E2;
  --bg-raised: #FFFFFF;
  --fill: rgb(14 14 16 / .06);
  --fill-hi: rgb(14 14 16 / .11);
  --ink: #0E0E10;
  --ink-2: rgb(14 14 16 / .68);
  --ink-3: rgb(14 14 16 / .38);
  --flare-text: #C23A05;
  --scrim: rgb(14 14 16 / .42);
  --p0: #E3D0B4; --p1: #BCD6E7; --p2: #D0C2E8; --p3: #BDDDC4; --p4: #E8D98E;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #FBFAF7;
    --bg-outer: #ECE9E2;
    --bg-raised: #FFFFFF;
    --fill: rgb(14 14 16 / .06);
    --fill-hi: rgb(14 14 16 / .11);
    --ink: #0E0E10;
    --ink-2: rgb(14 14 16 / .68);
    --ink-3: rgb(14 14 16 / .38);
    --flare-text: #C23A05;
    --scrim: rgb(14 14 16 / .42);
    --p0: #E3D0B4; --p1: #BCD6E7; --p2: #D0C2E8; --p3: #BDDDC4; --p4: #E8D98E;
  }
}
/* a themed subtree paints its own canvas */
[data-theme]:not(html) { background: var(--bg); color: var(--ink); }

/* ---------- preview helper: simulate a notched iPhone ---------- */
:root[data-safe] { --sat: 47px; --sab: 34px; }

@media (prefers-reduced-motion: reduce) {
  :root { --t-press: 1ms; --t-fast: 1ms; --t-base: 1ms; --t-sheet: 1ms; --t-moment: 1ms; }
}
