/* Tektur (condensed width instance) carries names, titles, buttons and values;
   Lacuna Text is IBM Plex Sans, renamed as its licence requires for a subset. */
@font-face { font-family: "Tektur"; src: url("../assets/fonts/tektur-700.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Tektur"; src: url("../assets/fonts/tektur-600.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Lacuna Text"; src: url("../assets/fonts/lacuna-text-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lacuna Text"; src: url("../assets/fonts/lacuna-text-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Lacuna Text"; src: url("../assets/fonts/lacuna-text-600.woff") format("woff"); font-weight: 600; font-display: swap; }

/* Roles: background and panels are cool graphite; amber is the single action
   colour; green confirms a met requirement; coral marks what blocks progress. */
:root {
  --bg: #0f171b;
  --panel: rgba(13, 20, 24, 0.88);
  --panel-soft: rgba(13, 20, 24, 0.66);
  --panel-solid: #121b20;
  --raise: rgba(255, 255, 255, 0.045);
  --line: rgba(163, 188, 197, 0.16);
  --line-strong: rgba(163, 188, 197, 0.32);
  --ink: #eceae2;
  --ink-2: #b9c4c7;
  --ink-3: #93a3a9;
  --amber: #ffb44f;
  --amber-hover: #ffc774;
  --amber-ink: #1b1409;
  --amber-soft: rgba(255, 180, 79, 0.12);
  --ok: #95d6b5;
  --ok-soft: rgba(149, 214, 181, 0.12);
  --coral: #f38e7a;
  --coral-soft: rgba(243, 142, 122, 0.12);
  --focus: #ffd598;
  --font-display: "Tektur", "Arial Narrow", sans-serif;
  --font-text: "Lacuna Text", "Segoe UI", system-ui, sans-serif;
  --gutter: 40px;
  --rail: 420px;
  --topbar: 64px;
  --objective-h: 56px;
  --tabbar: 0px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 160ms;
  --medium: 260ms;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body {
  font: 400 15px/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* A game interface over a 3D view: dragging to look around must never paint
     text-selection highlights across the panels. Messages and form fields
     stay selectable. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, .bubble, .events li span { -webkit-user-select: text; user-select: text; }
a, img { -webkit-user-drag: none; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.maker-link { justify-self: start; padding: 4px 0; font: 700 12px/1 var(--font-display); letter-spacing: 0.16em; color: var(--ink-3); transition: color var(--fast) var(--ease); }
.maker-link:hover { color: var(--ink); }
/* Headings receive focus only to announce a new screen; no ring needed. */
[tabindex="-1"]:focus { outline: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

/* Type roles */
.display { font: 700 clamp(64px, 6.2vw, 96px)/0.86 var(--font-display); letter-spacing: -0.01em; text-transform: uppercase; }
.title { font: 700 44px/0.95 var(--font-display); text-transform: uppercase; letter-spacing: 0.005em; }
.h2 { font: 700 32px/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em; }
.h3 { font: 700 16px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.label { font: 500 13px/1.35 var(--font-text); color: var(--ink-3); }
.lead { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.data { font: 700 30px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.data .unit, .data-sm .unit { font: 400 14px/1 var(--font-text); color: var(--ink-3); margin-left: 3px; }
.data-sm { font: 700 20px/1 var(--font-display); font-variant-numeric: tabular-nums; }

/* Buttons: one primary action per view; secondary is outlined. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px;
  font: 700 17px/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.05em;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn .icon { width: 20px; height: 20px; }
.btn-primary { background: var(--amber); color: var(--amber-ink); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.btn-primary:hover:not(:disabled) { background: var(--amber-hover); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { background: rgba(255, 255, 255, 0.08); color: var(--ink-3); }
.btn-secondary { border: 1px solid var(--line-strong); color: var(--ink); background: rgba(10, 16, 19, 0.35); }
.btn-secondary:hover:not(:disabled) { border-color: var(--amber); color: var(--amber); }
.btn-secondary:active:not(:disabled) { background: var(--amber-soft); }
.btn-secondary:disabled, .btn-ghost:disabled { color: var(--ink-3); border-color: var(--line); opacity: 0.7; }
.btn-ghost { min-height: 40px; padding: 0 8px; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { color: var(--amber); }
.btn-block { width: 100%; justify-content: center; }
.btn-block:has(> .icon) { justify-content: space-between; }
.btn.is-busy { background: rgba(255, 180, 79, 0.28); color: var(--ink); position: relative; overflow: hidden; }
.btn.is-busy::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--amber); transform-origin: left; animation: couple 1s linear forwards; }
@keyframes couple { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); color: var(--ink-2); background: rgba(10, 16, 19, 0.4);
  transition: color var(--fast), border-color var(--fast), background var(--fast);
}
.icon-button:hover { color: var(--amber); border-color: var(--amber); }
.icon-button:active { background: var(--amber-soft); }
kbd { font: 500 11px/1 var(--font-text); color: var(--ink-2); border: 1px solid var(--line-strong); padding: 3px 5px 2px; border-radius: 2px; }

/* Status chips pair colour with an icon and a word. */
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1.2 var(--font-text); color: var(--ink-2); white-space: nowrap; }
.chip .icon { width: 16px; height: 16px; }
.chip-ok { color: var(--ok); }
.chip-refit { color: var(--ink-2); }
.chip-blocked { color: var(--coral); }
.chip-active { color: var(--amber-ink); background: var(--amber); padding: 3px 8px; font-weight: 600; }

.panel { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* Screens settle in from a partly visible state, never from blank. */
.enter { animation: enter var(--fast) var(--ease) both; }
/* Opacity only: a transform would make animated panels containing blocks for
   the fixed mobile action bar inside them. */
@keyframes enter { from { opacity: 0.4; } to { opacity: 1; } }
.swap { animation: swap 220ms var(--ease) both; }
@keyframes swap { from { opacity: 0.2; } to { opacity: 1; } }

body[data-reduced="true"] *, body[data-reduced="true"] *::before, body[data-reduced="true"] *::after {
  animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important;
}
