/* MXNGOWARE final, designer 2. Shared tokens, type, buttons, fields.
   One brand for the front page and the app: a calm warm-ink ground you can sit in for a
   twelve-hour stream, cream text (never pure white), poster-loud Anton headlines, and the
   loud colour (mango) saved for the moments that matter. Palette family is the real
   MXNGOWARE dashboard's (ink, cream, mango, teal), plus one signature colour per tool so streamers learn
   the tools at a glance: Subtick red, Wheel yellow, Snoot blue. Used for icons, status and small
   accents in the app, and as the demo stages on the front page. */

:root {
  --ground: #16110d;      /* every page */
  --ground-2: #1d1712;    /* a quiet raised band, used rarely */
  --ground-3: #261e17;    /* fields, inline code, hover rows */
  --stage: #0d0a07;       /* where overlays are previewed (OBS-dark) */
  --line: rgba(255, 236, 214, .11);
  --line-2: rgba(255, 236, 214, .24);

  --text: #f4ebdf;        /* cream, not white */
  --text-2: #bcae9f;      /* secondary, 8.6:1 on ground */

  --mango: #f08236;       /* the loud one: primary action, the big moments */
  --mango-hi: #ff9a52;
  --on-mango: #1c0c00;
  --teal: #3fd9cb;        /* healthy: OBS is using it */
  --warn: #ff9a52;        /* needs you: do this next, not seen since */
  --focus: #fff6e6;       /* focus ring: cream, so it never reads as a tool colour */

  --subtick: #ff5247;     /* red: the clock */
  --wheel: #ffcc33;       /* yellow: the spinner */
  --snoot: #4da3ff;       /* blue: the question inbox */
  --on-tool: #1c0c00;
  --cream: #fff6e6;       /* the rare light moment */
  --on-cream: #21130b;
  --on-cream-2: #6b4f3d;

  --f-display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --f-text: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Space Mono", "Courier New", monospace;

  --gutter: clamp(16px, 4.45vw, 64px);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  overflow-x: clip; scroll-padding-top: 88px;
  background: var(--ground); color: var(--text);
}
body {
  margin: 0;
  font-family: var(--f-text); font-size: 17px; line-height: 1.55; font-weight: 400;
  background: var(--ground); color: var(--text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(240, 130, 54, .25);
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--mango); color: var(--on-mango); }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--mango); color: var(--on-mango); padding: 12px 20px; border-radius: var(--r-sm);
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.on-mango :focus-visible, .on-cream :focus-visible { outline-color: var(--on-mango); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Type ---------- */
.display {
  font-family: var(--f-display); font-weight: 400;
  text-transform: uppercase; line-height: .94; letter-spacing: .004em;
  text-wrap: balance;
}
.d-hero { font-size: clamp(60px, 9.4vw, 152px); }
.d-xl { font-size: clamp(48px, 6.4vw, 104px); }
.d-lg { font-size: clamp(40px, 4.4vw, 68px); }
.d-md { font-size: clamp(32px, 2.9vw, 44px); line-height: 1; }
.lede { font-size: clamp(18px, 1.45vw, 21px); line-height: 1.5; max-width: 40ch; }
.dim { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }
.tag {
  font-family: var(--f-mono); font-weight: 700; font-size: 11px; line-height: 1.3;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-2);
}
code, .code { font-family: var(--f-mono); font-size: .86em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border: 0; border-radius: var(--r-sm);
  font-family: var(--f-text); font-size: 16px; font-weight: 700; line-height: 1.2; letter-spacing: 0;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
  touch-action: manipulation;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-go { background: var(--mango); color: var(--on-mango); }
.btn-go:hover { background: var(--mango-hi); }
.btn-line { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-line:hover { box-shadow: inset 0 0 0 1px var(--text); }
.btn-ink { background: var(--on-mango); color: var(--cream); }
.btn-ink:hover { background: #3a210f; }
.btn-quiet { background: transparent; color: var(--text); padding-left: 12px; padding-right: 12px; }
.btn-quiet:hover { background: var(--ground-3); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] {
  background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2);
  border: 0; cursor: not-allowed; transform: none;
  background-image: none; outline-offset: 3px;
}

.arrow-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 700; text-decoration: none; color: var(--text);
  text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: var(--line-2);
  transition: text-decoration-color .15s ease, color .15s ease;
}
.arrow-link:hover { text-decoration-color: var(--mango); color: var(--mango-hi); }
.arrow-link svg { width: 16px; height: 16px; transition: transform .15s ease; }
.arrow-link:hover svg { transform: translateX(2px); }

/* ---------- Fields ---------- */
.field { display: grid; gap: 8px; align-content: start; }
.field > label, .field > .label { font-weight: 700; font-size: 15px; }
.field .hint { font-size: 14px; color: var(--text-2); }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--ground-3); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: 16px;
  transition: border-color .15s ease;
}
.input:hover { border-color: var(--text-2); }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.input[aria-invalid="true"] { border-color: var(--warn); }
.error { display: flex; gap: 8px; align-items: flex-start; color: var(--warn); font-size: 15px; font-weight: 500; }
.error svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* Segmented choice (radio buttons that look like a row of options) */
.seg { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.seg legend { font-weight: 700; font-size: 15px; margin-bottom: 8px; padding: 0; }
.seg label {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 14px; border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; font-weight: 500;
  transition: box-shadow .15s ease, background-color .15s ease;
}
.seg label:hover { box-shadow: inset 0 0 0 1px var(--text-2); }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--ground-3); box-shadow: inset 0 0 0 2px var(--mango); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.swatch { width: 18px; height: 18px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------- Status words (no pills): a dot and a word ---------- */
.state { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.state.ok { color: var(--teal); }
.state.wait { color: var(--text-2); }
.state.wait::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.state.warn { color: var(--warn); }
.state.dev { color: var(--text-2); }
.state.dev::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; border-radius: 2px; }

/* Sample marker: small, mono, always visible near sample values */
.sample { font-family: var(--f-mono); font-weight: 700; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80;
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  background: var(--cream); color: var(--on-cream); font-weight: 700;
  padding: 12px 18px; border-radius: var(--r-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transition: opacity .2s ease, transform .2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Tool colour hooks: any icon or element tagged with a tool picks up its colour */
.t-subtick, .ico-subtick, [data-icon="subtick"] { --tool: var(--subtick); }
.t-wheel, .ico-wheel, [data-icon="wheel"] { --tool: var(--wheel); }
.t-snoot, .ico-snoot, [data-icon="snoot"] { --tool: var(--snoot); }
.ico-subtick, .ico-wheel, .ico-snoot, [data-icon="subtick"] svg, [data-icon="wheel"] svg, [data-icon="snoot"] svg { color: var(--tool); }
.tool-name { color: var(--tool); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
