/* ULTRABENCH — base: tokens, reset, shell layout. No external fonts, no CDN. */

:root {
  --bg:            #0b0d11;
  --bg-raised:     #11141a;
  --bg-inset:      #0e1116;
  --line:          #1e232c;
  --line-strong:   #2b323e;
  --text:          #e6e9ef;
  --text-dim:      #98a1b0;
  --text-faint:    #6b7484;
  --accent:        #54d6b0;
  --accent-dim:    #1d3a34;
  --warn:          #e0b23c;
  --danger:        #e8646b;
  --info:          #6aa9f0;

  --radius:  6px;
  --radius-s: 4px;
  --gap:     16px;
  --pad-x:   20px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 13px; color: var(--text-dim); font-weight: 600;
     text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0 0 10px; }
code, .mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute; left: -9999px; top: 0; padding: 8px 12px;
  background: var(--accent); color: #06231c; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

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

/* ---------- scrollbars (app scheme: black track / green thumb) ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 999px;
                            border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-corner { background: var(--bg); }
html { scrollbar-color: #1d3a34 #0b0d11; } /* Firefox two-value form takes no var() in FF<112 — literals match the tokens */

/* ---------- header ---------- */

.app-header {
  display: flex; align-items: center; gap: var(--gap);
  padding: 10px var(--pad-x);
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
  position: sticky; top: 0; z-index: 20;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 12px; height: 12px; border-radius: 3px;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}
.brand-name { font-weight: 700; letter-spacing: .1em; font-size: 13px; }

.app-nav { display: flex; gap: 2px; flex: 1 1 auto; flex-wrap: wrap; }
.app-nav a {
  color: var(--text-dim); padding: 6px 10px; border-radius: var(--radius-s);
  font-size: 13px; text-decoration: none; white-space: nowrap;
}
.app-nav a:hover { color: var(--text); background: var(--bg-inset); text-decoration: none; }
.app-nav a[aria-current="page"] { color: var(--text); background: var(--accent-dim); }

/* ---------- main + footer ---------- */

.view {
  flex: 1 1 auto;
  padding: 18px var(--pad-x) 40px;
  max-width: 1680px; width: 100%; margin: 0 auto;
  outline: none;
}

.app-footer {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 8px var(--pad-x);
  border-top: 1px solid var(--line);
  color: var(--text-faint); font-size: 12px;
  font-family: var(--mono);
}
/* Middle dots come from CSS so an unstamped footer never shows a dangling separator:
   `#footer-updated` collapses while it is empty and the rule skips it. */
.app-footer > * + *::before { content: "· "; color: var(--line-strong); }
.app-footer #footer-updated:empty { display: none; }

.view-head {
  display: flex; align-items: baseline; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.view-head .count { color: var(--text-faint); font-family: var(--mono); font-size: 12px; }

@media (max-width: 860px) {
  :root { --pad-x: 12px; }
  /* Three nav items; the header wraps, so the wordmark survives the phone breakpoint. */
  .app-header { gap: 10px; padding: 8px var(--pad-x); }
  .brand-name { font-size: 12px; }
  .app-nav { flex: 0 1 auto; }
  .view { padding-top: 12px; }
}
