
/* A sign-out control must be a POST form, so make the button read as a link. */
.nav-logout { display: inline; margin: 0; }
.nav-logout button {
  font: inherit;
  color: var(--fog);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .18em;
}
.nav-logout button:hover { color: var(--hazel); }
.nav-who {
  font-size: .78rem;
  color: var(--fog-dim);
  font-variant-numeric: tabular-nums;
}
/* Reyna theme — hazel, red, black.
 *
 * The single source of design truth. The public site and the operator interface
 * both link this first, then their own page sheet.
 *
 * The ground is a *warm* black, not neutral: hazel is a warm brown-gold, and on
 * a cold grey it reads muddy. Red is the action colour and is spent sparingly —
 * it means "this does something". Semantic state (ok / warn / danger) is kept
 * distinct from it, so "success" never competes with "primary action".
 *
 * Never hard-code a colour in a page sheet; a test fails the build if you do.
 */
:root {
  /* Ground and surfaces, darkest to lightest. Warm, not neutral. */
  --ink: #0c0a09;
  --ink-2: #16110d;
  --panel: #1b1511;
  --panel-2: #241c16;
  --line: rgba(233, 220, 205, 0.11);
  --line-strong: rgba(233, 220, 205, 0.2);

  /* Type */
  --paper: #f4ece2;
  --fog: #b0a093;
  --fog-dim: #857566;

  /* Hazel — the warm identity tone. Carries headings, rules and quiet accents. */
  --hazel: #d9b88f;
  --hazel-dim: #a8845c;
  --hazel-wash: rgba(217, 184, 143, 0.12);

  /* Red — the action colour. Sparing by design. */
  --signal: #e0342c;
  --signal-dim: #a5221d;
  --signal-wash: rgba(224, 52, 44, 0.14);
  --signal-hot: #ff5a4f;

  /* Semantic state, deliberately separate from the action colour. */
  --warm: #e0a341;
  --danger: #e0342c;
  --ok: #86b87a;

  --font-display: "Bricolage Grotesque", "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  /* Mono is the agentic signal: anything the machine produced or counted wears
     it — labels, ids, figures. Used as a texture, not just for code. */
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1120px;
  --radius: 2px;
  --gap: 1rem;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--paper);
  background: var(--ink);
  background-image:
    radial-gradient(ellipse 85% 55% at 10% -12%, rgba(224, 52, 44, 0.16), transparent 58%),
    radial-gradient(ellipse 70% 50% at 92% 4%, rgba(217, 184, 143, 0.12), transparent 55%),
    linear-gradient(168deg, #120d0a 0%, var(--ink) 46%, #0a0807 100%);
  background-attachment: fixed;
}

a { color: var(--hazel); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--paper); }
img { max-width: 100%; }

h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; line-height: 1.15; margin: 0 0 .5rem; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

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

/* --- primitives shared by every surface --------------------------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--hazel-dim);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}

.muted { color: var(--fog); }
.mono { font-family: var(--font-mono); font-size: .86em; }

/* Digits that line up in columns */
.num { font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font: 600 .88rem/1 var(--font-body);
  padding: .6rem .95rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: rgba(232, 240, 228, .06); border-color: var(--signal-dim); color: var(--paper); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.primary:hover { background: var(--signal-hot); color: var(--paper); }
.btn.danger { border-color: rgba(224, 122, 95, .5); color: var(--danger); }
.btn.danger:hover { background: rgba(224, 122, 95, .12); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.pill {
  display: inline-block;
  font: 600 .7rem/1 var(--font-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  color: var(--fog);
}
.pill.ok { color: var(--ok); border-color: rgba(143, 214, 148, .4); }
.pill.warn { color: var(--warm); border-color: rgba(240, 194, 122, .4); }
.pill.danger { color: var(--danger); border-color: rgba(224, 122, 95, .4); }
.pill.signal { color: var(--signal); border-color: var(--signal-dim); }

/* Wide content scrolls inside its own box; the page never scrolls sideways. */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
th {
  font: 500 .7rem/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fog-dim);
  background: var(--ink-2);
  position: sticky;
  top: 0;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(232, 240, 228, .03); }

input, select, textarea {
  font: inherit;
  color: var(--paper);
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: .55rem .7rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--signal-dim); outline: none; }
label { display: block; font-size: .8rem; color: var(--fog); margin-bottom: .3rem; }

.flash {
  border-left: 2px solid var(--signal);
  background: var(--signal-wash);
  padding: .7rem .9rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
}

.empty { color: var(--fog-dim); font-style: italic; padding: 1.5rem 0; }

.grid-2 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* --- motion --------------------------------------------------------------
 *
 * Two primitives only: an entrance for above-the-fold content, and a reveal
 * for anything scrolled to. Both are opt-in per element so motion stays where
 * it earns attention rather than everything sliding at once.
 *
 * `.reveal` starts hidden **only** when JS is available to un-hide it — the
 * `.js` class is set by the script itself. Without JS the content is simply
 * visible, so a failed script can never leave the page blank.
 */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.rise { animation: rise .7s var(--ease) both; }
.fade { animation: fade .9s var(--ease) both; }

.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.seen {
  opacity: 1;
  transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

/* Interactive surfaces lift slightly; the shadow is warm so it belongs to the
   ground rather than looking like a grey card dropped on top. */
.lift { transition: transform .25s var(--ease), border-color .25s var(--ease); }
.lift:hover {
  transform: translateY(-2px);
  border-color: var(--hazel-dim);
}

@media (prefers-reduced-motion: reduce) {
  /* Not just "faster" — no transform at all. Vestibular triggers are movement,
     not duration, so a 1ms slide is still a slide. */
  .rise, .fade { animation: none; }
  .js .reveal, .js .reveal.seen {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .lift:hover { transform: none; }
}
