/* =========================================================================
   Claudia at Boop — the kit: tokens and the small parts every window uses.
   Two colours and one: Boop's ink and cream, her clay. Faces, from anabology's curated
   set: Nimbus Sans Bold (as TeX Gyre Heros, the cut her own site uses) for the
   big lines; Junicode for her spoken lines and the old texts of 1693 and 1738;
   IBM Plex Mono for labels and numbers; Roobert is Boop's own voice.
   Graphics are drawn from real numbers.
   The shell (desktop, dock, floors) is in claudia.css; each app adds its own
   stylesheet beside its module.
   ========================================================================= */

@font-face { font-family: "Roobert"; src: url("../fonts/Roobert-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Roobert"; src: url("../fonts/Roobert-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Roobert"; src: url("../fonts/Roobert-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "TeX Gyre Heros"; src: url("../fonts/TeXGyreHeros-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Junicode"; src: url("../fonts/Junicode-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Junicode"; src: url("../fonts/Junicode-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --ink: #0f0f0d;
  --cream: #faf7f1;
  --paper: #ffffff;
  --clay: #d97757;
  --clay-deep: #b85a3c;
  --muted: #6f6f6a;
  --subtle: #cfc4b5;
  --hairline: #e6ded4;
  --band: #eeebdd;

  --display: "TeX Gyre Heros", "Nimbus Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Junicode", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Roobert", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.6, 0, .2, 1);
  --r: 10px;
}

/* A surface sets its own two colours; everything inside reads --fg and --bg,
   so one drawing serves a paper window and an ink one. */
.on-paper { --bg: var(--cream); --fg: var(--ink); --card: var(--paper); --rule: var(--hairline); --dim: var(--muted); --faint: var(--subtle); color: var(--fg); background: var(--bg); }
.on-ink   { --bg: var(--ink); --fg: var(--cream); --card: #171714; --rule: #2a2925; --dim: #a09c92; --faint: #4a4842; color: var(--fg); background: var(--bg); }

/* ---- type ---- */
.k { font: 400 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.k b, .k strong { font-weight: 500; color: var(--fg); }
.k--clay { color: var(--clay); }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.004em; }
.serif i, .serif em { font-style: italic; }
.h-xl { font: 700 clamp(44px, 6.4vw, 124px)/.94 var(--display); letter-spacing: -.04em; }
.h-l  { font: 700 clamp(32px, 4.1vw, 74px)/1 var(--display); letter-spacing: -.035em; }
.h-m  { font: 700 clamp(24px, 2.3vw, 36px)/1.06 var(--display); letter-spacing: -.028em; }
.h-s  { font: 700 20px/1.14 var(--display); letter-spacing: -.02em; }
.body { font: 400 16px/1.5 var(--sans); }
.small { font: 400 13px/1.45 var(--sans); color: var(--dim); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "zero" 1; }
.clay { color: var(--clay); }

/* ---- rows of a spec sheet: label left, value right, a hairline between ---- */
.spec { display: grid; grid-template-columns: 1fr; margin: 0; }
.spec > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid var(--rule); }
.spec > div:last-child { border-bottom: 1px solid var(--rule); }
.spec dt { font: 400 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.spec dd { margin: 0; font: 500 13px/1.3 var(--mono); font-variant-numeric: tabular-nums; text-align: right; }

/* ---- buttons: sentence case, one line, a hairline box; the main one is ink ---- */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 1px solid var(--fg); border-radius: 999px; background: transparent; color: var(--fg); cursor: pointer;
  font: 500 13px/1 var(--sans); letter-spacing: -.005em; white-space: nowrap; user-select: none; text-decoration: none;
  transition: background .18s var(--ease), color .18s var(--ease), transform .12s var(--ease), border-color .18s var(--ease); }
.btn:hover { background: var(--fg); color: var(--bg); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .chip:focus-visible, .rng:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.btn--fill { background: var(--fg); color: var(--bg); }
.btn--fill:hover { background: var(--clay); border-color: var(--clay); color: var(--ink); }
.btn--clay { border-color: var(--clay); color: var(--clay); }
.btn--clay:hover { background: var(--clay); color: var(--ink); }
.btn--sm { height: 28px; padding: 0 11px; font-size: 12px; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn .num { font-size: 11px; opacity: .7; }

/* chips: a choice among a few */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { appearance: none; height: 28px; padding: 0 11px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--dim);
  font: 400 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: all .15s var(--ease); }
.chip:hover { border-color: var(--fg); color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* a range: a hairline with a round ink thumb */
.rng { appearance: none; -webkit-appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0; }
.rng::-webkit-slider-runnable-track { height: 1px; background: var(--fg); }
.rng::-moz-range-track { height: 1px; background: var(--fg); }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--bg); border: 1px solid var(--fg); box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 9px var(--clay); }
.rng::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--clay); border: 1px solid var(--fg); }
.field { display: grid; gap: 4px; }
.field > label { display: flex; justify-content: space-between; align-items: baseline; }

/* a plot: a canvas that fills its box; apps draw at devicePixelRatio */
.plot { position: relative; width: 100%; border: 1px solid var(--rule); border-radius: 6px; background: var(--card); overflow: hidden; }
.plot > canvas { display: block; width: 100%; height: 100%; }
.plot__cap { position: absolute; left: 10px; top: 8px; pointer-events: none; }
.plot__cap--r { left: auto; right: 10px; text-align: right; }

/* what she says inside a window: her own line, set in the serif */
.says { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 12px 0 0; }
.says::before { content: ""; width: 14px; height: 14px; margin-top: 5px; background: var(--clay);
  clip-path: polygon(50% 0, 60.5% 24.7%, 85.4% 14.6%, 75.3% 39.5%, 100% 50%, 75.3% 60.5%, 85.4% 85.4%, 60.5% 75.3%, 50% 100%, 39.5% 75.3%, 14.6% 85.4%, 24.7% 60.5%, 0 50%, 24.7% 39.5%, 14.6% 14.6%, 39.5% 24.7%); }
.says p { margin: 0; font: 400 19px/1.3 var(--serif); letter-spacing: 0; }

/* the legal small print under any toy that touches insurance arithmetic */
.fine { font: 400 10px/1.4 var(--mono); letter-spacing: .04em; color: var(--dim); text-transform: uppercase; }

.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
