/* Meridian Aesthetics: identity tokens
   The one source the site, the guide, the posts and the film titles read from.
   Faces: Instrument Serif (display), Instrument Sans (text, UI, wordmark), IBM Plex Mono (chart labels).
   All three are SIL Open Font License 1.1: free to self-host, embed and use commercially.
   Font files ship beside this sheet in fonts/. */

@font-face { font-family: "Instrument Serif"; src: url("fonts/InstrumentSerif-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/InstrumentSerif-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* ---------- Colour ---------- */
  /* Grounds */
  --m-white:        #FFFFFF;  /* Clinic White: cards, forms, the brightest plane */
  --m-paper:        #FAFAF8;  /* Exam Paper: the page ground */
  /* Stone (honed limestone, never beige) */
  --m-stone-50:     #F2F1EE;
  --m-stone-100:    #E8E6E1;  /* alternate section ground */
  --m-stone-300:    #D4D0C8;  /* hairlines on paper */
  --m-stone-500:    #A39E94;  /* decorative only; fails text contrast */
  /* Instrument steel */
  --m-steel-300:    #C9CDD1;  /* text on Ink ground, secondary */
  --m-steel-500:    #8A9097;  /* rules, disabled, large type only (3.1:1 on paper) */
  --m-steel-600:    #5B6168;  /* secondary text (6:1 on paper) */
  --m-steel-800:    #33383D;  /* dark panels */
  /* Ink */
  --m-ink:          #16181A;  /* primary text, primary button, footer ground */
  /* The one accent: Chart Ink. The clinician's pen line. */
  --m-chart-ink:       #24456F;  /* 9.3:1 on paper. The meridian line, links, focus, one rule a page */
  --m-chart-ink-light: #9DB4D3;  /* the accent on Ink grounds only */

  /* Semantic */
  --m-bg:           var(--m-paper);
  --m-bg-alt:       var(--m-stone-100);
  --m-surface:      var(--m-white);
  --m-text:         var(--m-ink);
  --m-text-muted:   var(--m-steel-600);
  --m-rule:         var(--m-stone-300);
  --m-accent:       var(--m-chart-ink);
  --m-focus:        var(--m-chart-ink);

  /* ---------- Type ---------- */
  --m-font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --m-font-text:    "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --m-font-label:   "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Phone-first sizes: floor at 390px, rem-anchored curve, hard rem ceiling */
  --m-size-display-xl: clamp(2.75rem, 1.9rem + 2.6vw, 4.5rem);    /* 44 -> 72px. H1 / hero. Never above 80px over media */
  --m-size-display-l:  clamp(2.125rem, 1.7rem + 1.4vw, 3.25rem);  /* 34 -> 52px. H2 */
  --m-size-display-m:  clamp(1.625rem, 1.4rem + 0.7vw, 2.125rem); /* 26 -> 34px. H3, pull quote */
  --m-size-lede:       clamp(1.1875rem, 1.1rem + 0.3vw, 1.375rem);/* 19 -> 22px. Opening paragraph */
  --m-size-body:       1.0625rem;  /* 17px */
  --m-size-small:      0.875rem;   /* 14px. Captions, legal */
  --m-size-label:      0.75rem;    /* 12px. Mono caps chart labels */
  --m-size-wordmark-header: 2rem;   /* 32px tall: the COMPACT lockup (wordmark-compact.svg) in the site header, about 124px wide */
  --m-size-wordmark-full-min: 15rem; /* 240px: narrowest the full lockup with AESTHETICS may run */

  --m-leading-display: 1.04;
  --m-leading-heading: 1.12;
  --m-leading-text:    1.6;
  --m-tracking-display: -0.01em;
  --m-tracking-label:   0.08em;
  --m-measure:          64ch;   /* body measure ceiling */
  --m-measure-lede:     36ch;

  /* ---------- Space: 4px base ---------- */
  --m-space-1: 0.25rem;  /* 4 */
  --m-space-2: 0.5rem;   /* 8 */
  --m-space-3: 0.75rem;  /* 12 */
  --m-space-4: 1rem;     /* 16 */
  --m-space-5: 1.5rem;   /* 24 */
  --m-space-6: 2rem;     /* 32 */
  --m-space-7: 3rem;     /* 48 */
  --m-space-8: 4rem;     /* 64 */
  --m-space-9: 6rem;     /* 96 */
  --m-space-10: 8rem;    /* 128 */
  --m-space-11: 10rem;   /* 160 */
  --m-section: clamp(4rem, 2.5rem + 6vw, 10rem); /* vertical rhythm between sections: 64 -> 160px */

  /* ---------- Grid ---------- */
  --m-cols: 4;            /* phone */
  --m-gutter: 1rem;       /* 16 */
  --m-margin: 1.25rem;    /* 20 */
  --m-max: 90rem;         /* 1440 container */
  --m-max-content: 82rem; /* 1312 content */

  /* ---------- Form ---------- */
  --m-radius: 2px;        /* instruments are exact: no pills, no soft cards */
  --m-hairline: 1px;
  --m-meridian-width: 2px; /* the accent axis line at UI sizes */
  --m-touch: 3.25rem;     /* 52px minimum tap target, primary CTA height */
  --m-ease: cubic-bezier(0.2, 0, 0, 1);
  --m-dur: 240ms;
  --m-dur-slow: 600ms;
}

@media (min-width: 48rem) {   /* 768: tablet */
  :root { --m-cols: 8; --m-gutter: 1.5rem; --m-margin: 2.5rem; }
}
@media (min-width: 75rem) {   /* 1200: desktop */
  :root { --m-cols: 12; --m-gutter: 1.5rem; --m-margin: 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --m-dur: 0ms; --m-dur-slow: 0ms; }
}
