/* ==========================================================================
   Daybook -- design tokens
   SAFIYA. One system, three destinations.
   Colour means state. Five hues and nothing else.
   Spec: /DESIGN-RATIONALE.md section 2.1 - 2.5
   ========================================================================== */

:root {
  /* ---- material -------------------------------------------------------- */
  --paper:        #F7F3EC;
  --sheet:        #FFFDF8;
  --rule:         #E6DECF;
  --rule-strong:  #D8CDBB;

  /* Every text colour below was measured against its ground, not estimated.
     Ratios are WCAG 2.1 contrast against --paper #F7F3EC / --night #15130F:
       --ink        15.01    --ink-muted   6.35    --ink-faint   4.76
       --struck      5.29    --promised    4.60    --decided     9.97
       --ivory-muted 9.01    --ivory-faint 6.30    --promised-rule on night 4.95
     All pass AA (4.5:1). The earlier values for --ink-faint (3.50), --struck
     (2.28) and --ivory-faint (3.70) did not, and were corrected. */
  --ink:          #211E1A;
  --ink-muted:    #5F584D;
  --ink-faint:    #726B60;

  --night:        #15130F;
  --night-sheet:  #1D1A15;
  --night-rule:   rgba(242, 237, 228, 0.14);
  --ivory:        #F2EDE4;
  --ivory-muted:  rgba(242, 237, 228, 0.74);
  --ivory-faint:  rgba(242, 237, 228, 0.60);

  /* ---- state ----------------------------------------------------------- */
  --decided:        #2B3A67;
  --promised:       #9A6212;
  --promised-rule:  #B6761F;
  /* Withdrawn is carried by the strike line, which is the form channel. The
     colour only has to stay readable -- a day you cannot audit is not a
     record, so struck text is never faded below AA. */
  --struck:         #6B6459;
  --struck-rule:    #A8A29E;
  --mine:           #3B4A6B;

  /* ---- type ------------------------------------------------------------ */
  --serif: ui-serif, "New York", "Iowan Old Style", Palatino, Georgia, "Times New Roman", serif;
  --sans:  ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --t-display: clamp(38px, 5.2vw, 66px);
  --t-h2:      clamp(26px, 3vw, 38px);
  --t-h3:      20px;
  --t-prose:   clamp(18px, 1.15vw, 20px);
  --t-body:    16.5px;
  --t-ui:      13.5px;
  --t-micro:   11px;
  --t-mono:    12.5px;

  --lh-display: 1.06;
  --lh-h2:      1.18;
  --lh-prose:   1.72;
  --lh-body:    1.6;

  --track-micro: 0.16em;

  /* ---- measure and layout --------------------------------------------- */
  --measure: 64ch;      /* serif prose */
  --measure-ui: 52ch;   /* sans body */
  --wrap: 1120px;
  --wrap-narrow: 780px;
  --gutter: clamp(20px, 4vw, 56px);

  /* ---- space ----------------------------------------------------------- */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;
  --s10: 128px;

  /* ---- geometry: printed matter, not software chrome ------------------- */
  --r-structure: 0;
  --r-control: 2px;
  --r-stamp: 50%;
  --hair: 1px;

  /* ---- motion ---------------------------------------------------------- */
  --ease: cubic-bezier(0.2, 0.8, 0.3, 1);
  --d-control: 180ms;
  --d-reset: 260ms;
  --d-resolve: 400ms;
}

/* Reduced motion collapses duration. No information is carried by motion
   alone anywhere in these three sites, so this is a safe no-op for meaning. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --d-control: 1ms;
    --d-reset: 1ms;
    --d-resolve: 1ms;
  }
}
