/* Ironnook design system shared by the player hub and the staff overview.
   Birch ground, forged-iron ink and plates; hearth amber means "running". */
@font-face {
  font-family: 'Young Serif';
  src: url('/assets/young-serif.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Familjen Grotesk';
  src: url('/assets/familjen-grotesk.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --birch: #eceee8;
  --paper: #fafbf7;
  --sunk: #e3e7e0;
  --ink: #22303a;
  --slate: #566571;
  --line: #d4d9d2;
  --line-strong: #b4beb7;
  --plate: #22303a;
  --plate-ink: #f2f0e9;
  --plate-dim: #a8b3b9;
  --plate-edge: transparent;
  --hearth: #e3a23b;
  --hearth-ink: #82540f;
  --hearth-wash: #f5e6c6;
  --moss: #3d7150;
  --moss-wash: #dcebdf;
  --rust: #a53f2b;
  --rust-wash: #f4ddd6;
  --button: #22303a;
  --button-ink: #fafbf7;
  --scrim: rgb(18 24 28 / .5);
  --display: 'Young Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --text: 'Familjen Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius-panel: 10px;
  --radius-control: 6px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 70ch;
}
@media (prefers-color-scheme: dark) {
  :root {
    --birch: #12181c;
    --paper: #1a2228;
    --sunk: #151c21;
    --ink: #e6e9e3;
    --slate: #9ba7af;
    --line: #2b363e;
    --line-strong: #3d4b55;
    --plate: #0b1013;
    --plate-ink: #f2f0e9;
    --plate-dim: #8f9ba2;
    --plate-edge: #34414a;
    --hearth: #f0b24f;
    --hearth-ink: #f0b24f;
    --hearth-wash: #33291a;
    --moss: #8dbf91;
    --moss-wash: #1d3125;
    --rust: #ee8b76;
    --rust-wash: #3a221d;
    --button: #e6e9e3;
    --button-ink: #12181c;
    --scrim: rgb(4 7 9 / .7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--birch);
  color: var(--ink);
  font: 400 1rem/1.5 var(--text);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font: 400 clamp(2rem, 4vw, 2.4375rem)/1.1 var(--display); letter-spacing: -.005em; }
h2 { font: 400 1.5625rem/1.2 var(--display); }
h3 { font: 600 1rem/1.35 var(--text); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
code { font: inherit; font-weight: 600; overflow-wrap: anywhere; }
strong { font-weight: 600; }
small { font-size: .875rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

.muted { color: var(--slate); }
.hint { color: var(--slate); font-size: .875rem; line-height: 1.45; max-width: var(--measure); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 50;
  background: var(--button); color: var(--button-ink);
  padding: .6rem .9rem; border-radius: var(--radius-control); font-weight: 600;
}
.skip:focus { top: .75rem; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
main:focus { outline: none; }

/* Brand: crossed longhouse rafters over a lit doorway. */
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font: 400 1.375rem/1 var(--display); color: var(--ink); text-decoration: none;
}
.brand-mark { width: 1.75rem; height: 1.75rem; flex: none; }
.mark-rafters { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: square; }
.mark-door { fill: var(--hearth); }

/* Controls */
button { font: inherit; color: inherit; }
.primary, .secondary, .quiet, .close {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.5rem; padding: .55rem .95rem;
  border: 1px solid transparent; border-radius: var(--radius-control);
  font: 600 .9375rem/1.1 var(--text); text-align: center; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.primary { background: var(--button); color: var(--button-ink); }
.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--button) 86%, var(--hearth)); }
.secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.secondary:hover:not(:disabled) { border-color: var(--ink); }
.quiet {
  background: none; color: var(--ink); min-height: 2rem; padding: .35rem .5rem;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
}
.quiet:hover:not(:disabled) { text-decoration-thickness: 2px; }
.close {
  background: none; min-height: 2.25rem; width: 2.25rem; padding: 0;
  font: 400 1.5rem/1 var(--text); color: var(--slate);
}
.close:hover { color: var(--ink); background: var(--sunk); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary:active:not(:disabled), .secondary:active:not(:disabled) { transform: translateY(1px); }

label { display: block; margin: 1.1rem 0 .35rem; font-weight: 600; font-size: .9375rem; }
input, select, textarea {
  width: 100%; min-height: 2.75rem; padding: .6rem .75rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-control);
  background: var(--paper); color: var(--ink); font: inherit;
}
textarea { min-height: 7rem; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--slate) 75%, transparent); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; }
input[type=checkbox] { width: 1.15rem; height: 1.15rem; min-height: 0; margin: .15rem 0 0; accent-color: var(--ink); flex: none; }
input[type=file] { padding: .5rem; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 400; margin-top: 1rem; }
.check small { display: block; }
.form-error { color: var(--rust); font-weight: 600; margin-top: .9rem; }

/* State: a small arched doorway, lit while a server runs. */
.badge {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8125rem; font-weight: 600; color: var(--slate);
  white-space: nowrap;
}
.badge::before {
  content: ''; width: .55rem; height: .72rem; flex: none;
  border-radius: .3rem .3rem 0 0; background: var(--line-strong);
}
.badge.running, .badge.succeeded, .badge.ready, .badge.complete, .badge.current { color: var(--ink); }
.badge.running::before { background: var(--hearth); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hearth) 28%, transparent); }
.badge.succeeded::before, .badge.ready::before, .badge.complete::before, .badge.current::before { background: var(--moss); }
.badge.queued::before, .badge.provisioning::before, .badge.pending::before, .badge.in-progress::before { background: var(--hearth); animation: ember 1.6s ease-in-out infinite; }
.badge.needs_attention, .badge.quarantined, .badge.unknown, .badge.failed, .badge.warn { color: var(--rust); }
.badge.needs_attention::before, .badge.quarantined::before, .badge.unknown::before, .badge.failed::before, .badge.warn::before { background: var(--rust); }
@keyframes ember { 50% { opacity: .35; } }

.notice {
  background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--ink);
  border-radius: var(--radius-control); padding: .75rem 1rem; margin-bottom: 1.25rem;
  max-width: 60rem;
}
.notice.error, .notice.is-error { border-left-color: var(--rust); background: var(--rust-wash); }

/* Site header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--birch) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: 78rem; margin: 0 auto; padding: .7rem var(--gutter);
  display: flex; align-items: center; gap: .75rem 2rem; flex-wrap: wrap;
}
.header-end { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .875rem; color: var(--slate); }

dialog {
  width: min(34rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem);
  padding: 0; border: 0; border-radius: var(--radius-panel);
  background: var(--paper); color: var(--ink);
  box-shadow: 0 1.5rem 4rem -1.5rem rgb(10 14 17 / .55);
}
dialog::backdrop { background: var(--scrim); }
dialog[open] { animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(.5rem); } }

progress {
  appearance: none; -webkit-appearance: none; width: 100%; height: .375rem;
  border: 0; border-radius: 999px; background: var(--line); overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--ink); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--ink); border-radius: 999px; }

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