/* =====================================================================
   Oathful design system, for the website (docs/design-system.md).

   One look for the app and oathful.app. Every value here is a copy of
   src/theme/tokens.ts (the base `light` and `dark` palettes, `type`,
   `radius`); if a token changes there, it changes here too. Pages use these
   variables and classes rather than their own copies.

   Light is the default. Dark is the dashboard's own choice
   (<html data-theme="dark">), and `.on-dark` turns the dark set on for one
   part of a light page (a dark card, an app mockup), so `var(--ink)` there
   is the dark theme's ink.
   ===================================================================== */

:root,
.on-light {
  /* Grounds */
  --bg: #FFFFFF;
  --bg2: #F5F5F5;
  --panel: #F5F5F5;      /* anything you read: a card, a list, a notice */
  --panel2: #FFFFFF;     /* a panel inside a panel */
  --paneRim: rgba(10, 10, 10, .05);
  /* Ink, strongest to weakest (each clears 4.5:1 on both panels) */
  --ink: #0A0A0A;
  --ink2: #4D4D4D;
  --ink3: #6B6B6B;
  --ink4: #6D6D6D;
  --icon: #4D4D4D;
  --iconHi: #0A0A0A;
  /* Hairlines and quiet grounds */
  --line: #E6E6E6;
  --line2: #D4D4D4;
  --hov: #EDEDED;
  --hovline: #A8A8A8;
  --track: #E6E6E6;
  --tagBg: rgba(10, 10, 10, .05);
  /* The primary action */
  --fill: #0A0A0A;
  --onFill: #FFFFFF;
  /* Floating chrome (header pill) */
  --gFill: rgba(255, 255, 255, .84);
  --gRim: rgba(10, 10, 10, .10);
  --scrim: rgba(10, 10, 10, .40);
  /* The three accents: the state of a promise, and nothing else */
  --kept: #1F6B57;
  --due: #8A6415;
  --missed: #A83E3E;
  --kept-rgb: 31, 107, 87;
  --due-rgb: 138, 100, 21;
  --missed-rgb: 168, 62, 62;
  color-scheme: light;
}

:root[data-theme=dark],
.on-dark {
  --bg: #0A0A0A;
  --bg2: #111111;
  --panel: #161616;
  --panel2: #1F1F1F;
  --paneRim: rgba(255, 255, 255, .06);
  --ink: #F5F5F5;
  --ink2: #B3B3B3;
  --ink3: #8C8C8C;
  --ink4: #888888;
  --icon: #B3B3B3;
  --iconHi: #F5F5F5;
  --line: #242424;
  --line2: #333333;
  --hov: #1C1C1C;
  --hovline: #555555;
  --track: #262626;
  --tagBg: rgba(255, 255, 255, .07);
  --fill: #F5F5F5;
  --onFill: #0A0A0A;
  --gFill: rgba(26, 26, 26, .80);
  --gRim: rgba(255, 255, 255, .12);
  --scrim: rgba(0, 0, 0, .62);
  --kept: #86CBB9;
  --due: #E3B85C;
  --missed: #E88A8A;
  --kept-rgb: 134, 203, 185;
  --due-rgb: 227, 184, 92;
  --missed-rgb: 232, 138, 138;
}
:root[data-theme=dark] { color-scheme: dark; }

:root {
  /* Type: Public Sans at 400 / 500 / 600 / 700 only. Jost is the wordmark,
     Mrs Saint Delafield a signature, and nothing else. */
  --font: 'Public Sans', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-brand: 'Jost', var(--font);
  --font-sign: 'Mrs Saint Delafield', cursive;
  /* Shape: 24 panel · 20 tile and choice · 14 inset · 10 icon tile · pill */
  --r-panel: 24px;
  --r-tile: 20px;
  --r-inset: 14px;
  --r-icon: 10px;
  --r-pill: 999px;
  --h-button: 52px;
  --h-button-sm: 40px;
}

/* ── The logo: the drawn mark beside the wordmark, as the app's header sets
   them (mark 30 beside a 19px wordmark tracked 3.4, so the mark is 1.58× the
   type and the tracking .18em). One size on every page. ───────────────── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-brand);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}
.brand .mk { display: block; width: 1.58em; height: 1.58em; flex-shrink: 0; fill: currentColor; }
.brand .wm { margin-right: -.18em; }

/* ── Section label: the eyebrow, the only label style ─────────────────── */
.eyebrow {
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink3);
}

/* ── Buttons: 52 pills. Primary is solid ink; secondary is the chip ground
   under a hairline with an ink label; small is 40. ─────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--h-button);
  padding: 0 24px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--fill);
  color: var(--onFill);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, box-shadow .15s, color .15s, opacity .15s, transform .15s;
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.98); }
.btn.secondary {
  background: var(--tagBg);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line2);
}
.btn.secondary:hover { opacity: 1; box-shadow: inset 0 0 0 1px var(--hovline); }
/* A destructive action: the secondary pill with its label in `missed`. */
.btn.danger { background: var(--tagBg); color: var(--missed); box-shadow: inset 0 0 0 1px var(--line2); }
.btn.danger:hover { opacity: 1; box-shadow: inset 0 0 0 1px var(--hovline); }
.btn.sm { min-height: var(--h-button-sm); padding: 0 16px; font-size: 14.5px; }
/* Not ready is the same pill, quiet. */
.btn:disabled, .btn[aria-disabled=true] {
  background: var(--tagBg);
  color: var(--ink3);
  box-shadow: none;
  opacity: 1;
  cursor: default;
  transform: none;
}

/* A text link: meta weight 600 in ink2. */
.tlink {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink2);
  text-decoration: none;
  cursor: pointer;
}
.tlink:hover { color: var(--ink); }

/* ── Fields: 52 pills on the chip ground (or panel2 inside a panel) under
   a line2 hairline. ───────────────────────────────────────────────────── */
.field {
  display: block;
  width: 100%;
  min-height: var(--h-button);
  padding: 0 20px;
  border: 1px solid var(--line2);
  border-radius: var(--r-pill);
  background: var(--tagBg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition: border-color .15s;
}
.panel .field, .field.in-panel { background: var(--panel2); }
.field::placeholder { color: var(--ink4); opacity: 1; }
.field:focus { border-color: var(--ink3); }

/* ── Surfaces ───────────────────────────────────────────────────────────
   Panel: anything you read. The panel colour under a hairline at the app's
   paneRim, radius 24, no shadow. A panel inside a panel is panel2. An inset
   (a box inside a panel) is panel2 at 14. */
.panel {
  background: var(--panel);
  border-radius: var(--r-panel);
  box-shadow: inset 0 0 0 1px var(--paneRim);
}
.panel .panel, .panel.nested { background: var(--panel2); }
.inset { background: var(--panel2); border-radius: var(--r-inset); }

/* ── Status: the app's StatusPill. 22 high, the state's tint at 13% under a
   30% ring, a 5px dot, 11.5px bold in the state's colour. `neutral` is
   quiet: a hairline and ink. ─────────────────────────────────────────── */
.status {
  --st: var(--ink3);
  --st-rgb: 107, 107, 107;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border: 1px solid rgba(var(--st-rgb), .3);
  border-radius: var(--r-pill);
  background: rgba(var(--st-rgb), .13);
  color: var(--st);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  vertical-align: middle;
}
.status::before {
  content: "";
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--st);
}
.status.kept { --st: var(--kept); --st-rgb: var(--kept-rgb); }
.status.due { --st: var(--due); --st-rgb: var(--due-rgb); }
.status.missed { --st: var(--missed); --st-rgb: var(--missed-rgb); }
.status.neutral { border-color: var(--line); background: transparent; color: var(--ink2); }
.status.neutral::before { background: var(--ink3); }

/* ── Icons: the app's own, from /assets/icons.svg (scripts/build-web-icons.mjs).
   <svg class="ic"><use href="/assets/icons.svg#i-NAME"/></svg>
   Sizes: 14 inline and chevrons (stroke 2.2) · 16 in a row tile · 20 in
   buttons and headers · 24 for a list glyph · 28 for a card's glyph. ──── */
.ic { display: inline-block; width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; overflow: visible; }
.ic.s14 { width: 14px; height: 14px; --ic-sw: 2.2; }
.ic.s16 { width: 16px; height: 16px; }
.ic.s24 { width: 24px; height: 24px; }
.ic.s28 { width: 28px; height: 28px; }
/* A list row's chevron: 14, stroke 2.2, ink4. */
.ic.chev { width: 14px; height: 14px; --ic-sw: 2.2; color: var(--ink4); }
