/* ============================================================
   MARGIN · design tokens
   Refined editorial minimalism — cool bone paper, pine ink,
   sage / slate accents, hairline structure, square geometry.
   ============================================================ */

:root {
  /* ---- surface: ivory / warm grey / paper ---- */
  --paper: #f8f4ed;          /* app canvas, warm ivory */
  --paper-deep: #e9e6dc;     /* recessed areas, focus tint */
  --panel: #faf8f2;          /* raised paper sheets, cards, modals */
  --panel-2: #f4f2ea;        /* hover wash */
  --panel-3: #e8e5db;        /* pressed / selected wash */
  --panel-warm: #f7f2e6;     /* sand-tinted zone (notes header, calendar) */
  --ink: #15201b;            /* primary text, deep ink green */
  --ink-soft: #38453d;       /* secondary text */
  --muted: #6b776c;          /* tertiary text */
  --faint: #96a094;          /* meta, disabled, captions */
  --line: #dad7cc;           /* hairline */
  --line-2: #e7e4da;         /* inner hairline */
  --line-strong: #c3c4b7;    /* emphasised hairline / focus ring */

  /* ---- accent ---- */
  --pine: #234639;           /* core action, key headings */
  --pine-600: #1b372d;
  --pine-700: #122a21;       /* hover / active / focus */
  --pine-100: #e6ede4;
  --pine-200: #cbdac9;
  --sage: #8ca389;           /* mist green */
  --sage-100: #e4ebdd;       /* secondary buttons, selected filters */
  --sage-200: #d2ddc9;
  --sage-soft: #dbe4d9;
  --slate: #4c6871;          /* grey-blue for B */
  --mist: #e7edea;
  --sand: #c9bfa9;           /* warm neutral accent, tertiary labels */
  --sand-100: #f0e9d8;

  /* ---- mastery states (A / B / C) ---- */
  --st-a: #234639;
  --st-a-bg: #e6ede4;
  --st-a-line: #b7c9b5;
  --st-b: #4a6670;
  --st-b-bg: #e5ecee;
  --st-b-line: #b5c6cc;
  --st-c: #66775c;
  --st-c-bg: #edefe2;
  --st-c-line: #c8cfb6;

  /* ---- semantic ---- */
  --brick: #8a4238;
  --brick-bg: #f2e6e0;
  --brick-line: #dec2b8;

  /* ---- geometry ---- */
  --r-0: 0px;
  --r-1: 2px;
  --r-2: 3px;
  --r-pill: 2px;

  /* ---- spacing scale ---- */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 40px;
  --s9: 56px;
  --s10: 72px;

  /* ---- type ---- */
  --font-ui: "Instrument Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-display: "Newsreader", "Times New Roman", "Songti SC", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-17: 17px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-28: 28px;
  --fs-34: 34px;

  /* ---- motion ---- */
  --ease: cubic-bezier(.22, .61, .24, 1);
  --ease-in-out: cubic-bezier(.5, 0, .2, 1);
  --dur-1: 120ms;
  --dur-2: 190ms;
  --dur-3: 300ms;

  /* ---- elevation (used sparingly: overlays only) ---- */
  --shadow-pop: 0 1px 0 rgba(21, 32, 27, .04), 0 24px 56px -30px rgba(21, 32, 27, .34);
  --shadow-sheet: 0 -18px 40px -32px rgba(21, 32, 27, .28);

  --rail-w: 236px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 0;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, ol, ul {
  margin: 0;
  padding: 0;
}

ol, ul { list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

a { color: inherit; text-decoration: none; }

input, textarea, select {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--pine-200);
  color: var(--pine-700);
}

:focus-visible {
  outline: 1px solid var(--pine);
  outline-offset: 2px;
}

/* thin, quiet scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--paper);
  border-radius: 0;
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------- shared type utilities ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}
.eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--line-strong);
  display: inline-block;
}
.eyebrow--bare::before { display: none; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-display); }
.italic { font-style: italic; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.brick { color: var(--brick); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.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;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
