/* marple.css — the shared look for marplecoaching.com and the tools.
 *
 * Source of truth is design/marple.css at the repo root. Don't edit the copies
 * in website/public/ or tools/ by hand; run design/script/sync.
 *
 * The direction ("Marker"): a white board, heavy black ink, one coral brand
 * color that is the same exact value in light and dark, and teal for links
 * and secondary state. Gabarito for headings and big numbers, Figtree for
 * everything else. Nothing on a phone screen smaller than 16px.
 */

@font-face {
  font-family: "Gabarito";
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url("./fonts/gabarito.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("./fonts/figtree.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("./fonts/figtree-italic.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  /* Brand. Identical in both themes on purpose. */
  --coral: #ff6b5b;
  --on-coral: #161514;

  /* Light: the board. */
  --bg: #ffffff;
  --surface: #ffffff;
  --fg: #161514;
  --muted: #6a6864;
  --ink: #161514;      /* borders and rules — drawn in ink, not grey */
  --track: #ececea;    /* empty part of a bar */
  --teal: #0f7c86;     /* links, labels, secondary state */
  --teal-soft: #dcf1f3;
  --good: #1f7a3a;
  --fair: #9a6a00;
  --warn: #c8281f;

  --font-display: "Gabarito", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --rule: 2px;         /* ink line weight */
  --radius: 10px;
  --radius-button: 12px;
  --radius-card: 18px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151413;
    --surface: #151413;
    --fg: #f6f3ee;
    --muted: #9e9a93;
    --ink: #f6f3ee;
    --track: #2e2c29;
    --teal: #5fd1dc;
    --teal-soft: #173b3f;
    --good: #6fd68a;
    --fair: #f0c24a;
    --warn: #ff8a80;
  }
}
:root[data-theme="dark"] {
  --bg: #151413;
  --surface: #151413;
  --fg: #f6f3ee;
  --muted: #9e9a93;
  --ink: #f6f3ee;
  --track: #2e2c29;
  --teal: #5fd1dc;
  --teal-soft: #173b3f;
  --good: #6fd68a;
  --fair: #f0c24a;
  --warn: #ff8a80;
}

/* ---- Base ---- */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: 1.5rem; }

/* Coral marker stroke under a word: <h1>Get on <u>the pitch</u></h1> */
h1 u, h2 u, .display u {
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.12em;
  text-decoration-color: var(--coral);
}

p { margin: 0; }
p + p { margin-top: 1em; }

a { color: var(--teal); font-weight: 500; text-decoration-thickness: 0.08em; text-underline-offset: 0.15em; }
a:hover { color: var(--fg); }

.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---- Controls ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font: inherit; font-weight: 600; font-size: 1.0625rem; line-height: 1.2;
  padding: 0.75em 1.25em;
  color: var(--fg); background: transparent;
  border: var(--rule) solid var(--ink); border-radius: var(--radius-button);
  cursor: pointer; text-decoration: none;
  touch-action: manipulation; /* no double-tap-to-zoom, so a second tap is a second tap */
}
.btn.primary { background: var(--coral); color: var(--on-coral); border-color: var(--coral); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.35; cursor: default; transform: none; }
.btn.block { width: 100%; }
.btn.big { font-size: 1.5rem; padding: 0.8em 1em; }

.tag {
  display: inline-block; font-size: 0.875rem; font-weight: 600; line-height: 1.2;
  padding: 0.3em 0.8em; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal);
}

.card {
  background: var(--surface);
  border: var(--rule) solid var(--ink);
  border-radius: var(--radius-card);
}

input[type="number"], input[type="text"], select {
  font: inherit; font-weight: 600; color: var(--fg); background: var(--surface);
  border: var(--rule) solid var(--ink); border-radius: var(--radius);
  padding: 0.4em 0.6em; min-height: 2.75rem;
}
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible {
  outline: 3px solid var(--coral); outline-offset: 2px;
}

/* A step button: a square outlined − or +. Big enough for a thumb.
 * On its own beside a slider, or paired around a number in a .stepper:
 *   <div class="stepper">
 *     <button class="step" type="button" aria-label="Less">−</button>
 *     <output class="num">70</output>
 *     <button class="step" type="button" aria-label="More">+</button>
 *   </div>
 * Tapping is the way to set a number on a phone; typing is the fallback. */
.step {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 3rem; height: 3rem; padding: 0;
  font: inherit; font-size: 1.75rem; font-weight: 600; line-height: 1;
  color: var(--fg); background: transparent;
  border: var(--rule) solid var(--ink); border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation; /* tapping + twice fast must step twice, not zoom */
}
.step:active { background: var(--track); }
/* Disabled: grey the sign only. The border stays ink so the stepper reads as one control. */
.step:disabled { color: var(--muted); cursor: default; }
.step:disabled:active { background: transparent; }
.stepper { display: inline-flex; align-items: center; }
.stepper .step { border-radius: 0; }
.stepper .step:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.stepper .step:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.stepper output {
  display: flex; align-items: center; justify-content: center; align-self: stretch;
  min-width: 4rem; padding: 0 0.5em;
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em;
  border-top: var(--rule) solid var(--ink); border-bottom: var(--rule) solid var(--ink);
}

/* A bar: <div class="bar"><i style="width:60%"></i></div> */
.bar { height: 12px; background: var(--track); border: var(--rule) solid var(--ink); border-radius: 999px; overflow: hidden; position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--coral); }

hr { border: 0; border-top: var(--rule) solid var(--ink); margin: 1.5rem 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
