/* The shared design system for HVI's standalone customer pages.
 *
 * Wave 0, slice 00C of docs/HVI_VERTICAL_SLICE_MASTER_PLAN.md.
 *
 * WHY THIS EXISTS. Thirteen standalone pages each carried their own copy of the
 * same :root block. The eleven tokens below were byte identical in all five of
 * the pages that define the full set, which is the only reason extracting them
 * is safe and is why it was checked before doing it. The fourteenth page would
 * have copied them again, and then one of the copies would have drifted, and the
 * product would look like it was built by strangers to each other.
 *
 * WHAT THIS IS NOT. It is not a redesign and it is not a new visual doctrine.
 * Every value here was already in the product. No colour, font, radius or size
 * was invented, changed or added. A slice that wants a new token adds it here,
 * once, and says so in its merge request.
 *
 * HOW TO USE IT. Link it before your page's own <style> block:
 *
 *   <link rel="stylesheet" href="/design-system.css">
 *
 * Then delete your :root block and anything below that this file already
 * provides. Keep only what is genuinely specific to your page.
 *
 * BINDING CONSTRAINTS, from standing Founder orders. These are not style
 * preferences:
 *   - No new colour, font, logo, price, offer or visual doctrine may be invented.
 *   - Customer facing prose may never contain a hyphen or any dash character.
 *     Rewrite the sentence instead. This applies to visible copy, not to code,
 *     CSS or attribute values.
 *   - Heirloom Vine Backbone appears only inside approved logo artwork. It is
 *     never loaded through @font-face.
 *   - Never render a provider failure, a raw diagnostic, an internal module or
 *     table name, or a secret where a customer can see it.
 */

:root {
  --bg: #0b0c0d;
  --fg: #e3dacc;
  --muted: #a89c86;
  --line: rgba(186, 174, 150, 0.2);
  --surface: rgba(0, 0, 0, 0.24);
  --accent: #aeb383;
  --accent-bg: rgba(79, 86, 60, 0.28);
  --on-accent: #101208;
  --ok: #8fae8f;
  --danger: #e0938c;
  --focus: #e4c988;
}

/* The serif stack the standalone pages already share. Named so a page states
 * the intent rather than repeating the list. */
:root {
  --font-body: Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, Menlo, Consolas, monospace;
}

/* ── Ground ─────────────────────────────────────────────────────────────── */

body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  margin: 0;
  line-height: 1.5;
}

a {
  color: var(--fg);
}

/* ── Focus ──────────────────────────────────────────────────────────────── */

/* One visible focus treatment everywhere. Keyboard users are not a state to be
 * handled per page, and a page that forgets this is one nobody can operate
 * without a mouse. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ── Type ───────────────────────────────────────────────────────────────── */

h1 { font-size: 1.35rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
h3 { font-size: 0.98rem; margin: 0 0 0.35rem; }

.muted { color: var(--muted); }
.ok    { color: var(--ok); }
.error,
.bad   { color: var(--danger); }

/* Sizes the pages already used for secondary copy. */
.hint  { font-size: 0.9rem; }
.small { font-size: 0.85rem; }

/* ── Surfaces ───────────────────────────────────────────────────────────── */

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 1rem 1.15rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

/* ── Controls ───────────────────────────────────────────────────────────── */

button {
  font: inherit;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
}

button.secondary {
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  color: var(--fg);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
}

label {
  display: block;
  margin: 0.9rem 0 0.3rem;
}

/* ── Status ─────────────────────────────────────────────────────────────── */

.pill {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.pill.ok     { color: var(--ok); border-color: var(--ok); }
.pill.danger { color: var(--danger); border-color: var(--danger); }

/* ── Data ───────────────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}

/* Figures that sit in a column line up. */
.num,
td.num,
th.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Wide content scrolls inside its own container so the page never scrolls
 * sideways on a phone. */
.scroll-x {
  overflow-x: auto;
}

/* ── Motion ─────────────────────────────────────────────────────────────── */

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