/* Tunnex console — the "wire trace" identity of the landing, tuned for a daily tool.
   Ink on paper, one signal colour (orange) used as a fill, hairline rules, monospace hex frame headers.
   No gradients, glows or drop shadows. Orange text uses --accent-ink for contrast. */

/* Self-hosted fonts (SIL OFL, see ../fonts/OFL-*.txt): Archivo for headings, IBM Plex Mono for code and frames.
   Body text uses the system font stack. */
@font-face {
  font-family: "Archivo Display";
  src: url("../fonts/archivo-display.woff2") format("woff2");
  font-weight: 700 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular-Latin1.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-SemiBold-Latin1.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --paper: #f1eee4;
  --paper-2: #e8e4d8;
  --slip: #fbfaf5;
  --ink: #141414;
  --signal: #ff4d00; /* fills only; ink text on top (5.5:1) */

  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --surface: var(--slip);
  --fg: var(--ink);
  --muted: #5c5850; /* 6.1:1 on paper */
  --hair: #cbc5b5;
  --rule: var(--ink);
  --accent: var(--signal);
  --accent-ink: #b53600; /* orange text on paper (5.2:1) */
  --on-accent: var(--ink);
  --tint: rgba(20, 20, 20, 0.045);
  --accent-tint: rgba(255, 77, 0, 0.1);
  --input-bg: var(--slip);
  --input-border: #8a8478; /* 3.4:1 on paper: visible field edges */

  --slab-bg: var(--ink); /* commands and code on an ink slab */
  --slab-fg: #f1eee4;
  --slab-muted: #a39e92;

  --display: "Archivo Display", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Noto Sans Mono", monospace;

  --sidebar-w: 216px;
  --gutter: clamp(16px, 3vw, 36px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --bg-2: #1c1b19;
    --surface: #1a1917;
    --fg: #f1eee4;
    --muted: #a39e92; /* 7.0:1 on ink */
    --hair: #3a3833;
    --rule: #b9b4a6;
    --accent-ink: #ff6a29; /* 6.4:1 on ink */
    --on-accent: #141414;
    --tint: rgba(241, 238, 228, 0.05);
    --accent-tint: rgba(255, 77, 0, 0.16);
    --input-bg: #0e0e0d;
    --input-border: #6b675e;
    --slab-bg: #0a0a09;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--text);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p,
dl,
dd,
ol,
ul,
pre,
figure,
fieldset {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}
fieldset {
  padding: 0;
  border: 0;
  min-width: 0;
}
img,
svg {
  display: block;
}
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: currentColor;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
code,
pre,
kbd {
  font-family: var(--mono);
  font-size: 0.92em;
}
strong {
  font-weight: 650;
}
::selection {
  background: var(--accent);
  color: var(--ink);
}

:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

.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;
}
.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}
.noscript {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 12.5px;
}
.accent-ink {
  color: var(--accent-ink);
}
.warn-ink {
  color: var(--accent-ink);
  font-weight: 600;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.hint {
  font-size: 12.5px;
  color: var(--muted);
}
.hint code,
.page__lead code,
.state__text code,
.auth__lead code,
.modal__text code,
.danger-zone code,
.steps code {
  padding: 0 0.3em;
  background: var(--tint);
  overflow-wrap: anywhere;
}
.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Brand */
.logo__tile {
  fill: var(--fg);
}
.logo__glyph {
  fill: var(--bg);
}
.logo__byte {
  fill: var(--accent);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--fg);
}
.brand__name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}
.brand__tag {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  border: 1px solid var(--fg);
  padding: 0 5px;
}

/* Boot and fatal states */
.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 16px;
}
.boot--error {
  max-width: 520px;
  margin: 0 auto;
  justify-items: stretch;
}

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