/* FIELD NOTES tokens: the single source of truth. Re-skin starts here.
   The metaphor is a card catalog: manila grounds, typewriter ink, fig accents. */

@font-face {
  font-family: "Zilla Slab";
  src: url("../fonts/zilla-slab-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-var.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* primitives. A few steps are unused on the shipped pages on purpose;
     they hold the scale open for a re-skin. */
  --manila: #f1e7d3;      /* the drawer's paper ground */
  --manila-2: #e6d8bd;    /* divider stock, one shade down */
  --manila-3: #d8c8a8;    /* worn edge */
  --card: #faf4e6;        /* a fresh index card */
  --card-2: #f6eeda;      /* a card that has been handled */
  --drawer: #221c18;      /* the inside of the drawer, lights off */
  --drawer-2: #2e2620;    /* one step up from the drawer floor */
  --typewriter: #2e2a26;  /* ink */
  --pencil: #6a6157;      /* the muted hand */
  --fig: #7a4b2e;         /* deep: for manila grounds, 5.96:1 on --manila */
  --fig-bright: #b07a52;  /* bright: for the drawer dark, 4.61:1 on --drawer */
  --rule: #b8a98c;        /* the printed ruling on a card */
  --pen-blue: #26557f;    /* the annotating hand's other pen */
  --pen-blue-soft: #9cc4e4;

  /* semantic (the manila theme is the default) */
  --bg: var(--manila);
  --bg-2: var(--manila-2);
  --surface: var(--card);
  --fg: var(--typewriter);
  --muted: var(--pencil);
  --line: rgba(46, 42, 38, 0.18);
  --line-strong: rgba(46, 42, 38, 0.5);
  --ruling: rgba(122, 75, 46, 0.16);
  --accent: var(--fig);
  --accent-ink: var(--card);
  --focus: var(--pen-blue);

  /* type */
  --font-display: "Zilla Slab", "Rockwell", Georgia, serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --t-display: clamp(2.5rem, 7.4vw, 5.6rem);
  --t-h1: clamp(2.1rem, 5.6vw, 4.1rem);
  --t-h2: clamp(1.6rem, 3.2vw, 2.6rem);
  --t-h3: clamp(1.2rem, 1.9vw, 1.55rem);
  --t-lead: clamp(1.12rem, 1.5vw, 1.34rem);
  --t-body: 1.0625rem;
  --t-small: 0.9rem;
  --t-label: 0.72rem;
  --lh-tight: 1.02;
  --lh-heading: 1.12;
  --lh-body: 1.68;
  --track-label: 0.16em;
  --track-display: -0.012em;
  --wght-body: 400;
  --wght-strong: 620;

  /* the ruling rhythm of a card: body line-height in px terms */
  --rule-step: 1.78rem;

  /* space */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;
  --section-pad: clamp(3.75rem, 9vh, 7rem);
  --gutter: clamp(1rem, 2.4vw, 1.75rem);
  --edge: clamp(1.1rem, 4vw, 3.25rem);
  --measure: 36rem;
  --max-w: 78rem;
  --tab-h: 2.05rem;

  /* shape + depth: cards are stock, not glass. Radii stay small. */
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 8px;
  --r-pill: 999px;
  --lift-0: 0 1px 0 rgba(46, 42, 38, 0.1);
  --lift-1: 0 1px 1px rgba(46, 42, 38, 0.09), 0 6px 14px rgba(46, 42, 38, 0.09);
  --lift-2: 0 2px 3px rgba(46, 42, 38, 0.11), 0 16px 34px rgba(46, 42, 38, 0.14);

  /* motion */
  --dur-1: 130ms;
  --dur-2: 280ms;
  --dur-3: 520ms;
  --dur-4: 900ms;
  --ease-out: cubic-bezier(0.22, 0.9, 0.24, 1);
  --ease-inout: cubic-bezier(0.66, 0, 0.34, 1);

  /* layers */
  --z-annot: 5;
  --z-rail: 40;
  --z-drawer-out: 50;
  --z-skip: 60;
}

/* the drawer theme: any element with data-theme="drawer" flips the semantic set */
[data-theme="drawer"] {
  --bg: var(--drawer);
  --bg-2: var(--drawer-2);
  --surface: var(--drawer-2);
  --fg: var(--manila);
  --muted: #b3a894;
  --line: rgba(241, 231, 211, 0.2);
  --line-strong: rgba(241, 231, 211, 0.55);
  --ruling: rgba(241, 231, 211, 0.14);
  --accent: var(--fig-bright);
  --accent-ink: var(--drawer);
  --focus: var(--pen-blue-soft);
}
