/* ==========================================================================
   GHE OS - reset, typography, scrollbars, focus
   ========================================================================== */

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;               /* the shell scrolls its own panes */
  overscroll-behavior: none;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1 { font-size: var(--fs-2xl); font-weight: var(--fw-semi); letter-spacing: var(--track-tight); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-xl); font-weight: var(--fw-semi); letter-spacing: var(--track-tight); line-height: var(--lh-tight); }
h3 { font-size: var(--fs-lg); font-weight: var(--fw-semi); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-base); font-weight: var(--fw-semi); line-height: var(--lh-snug); }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { background: none; border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }

img, svg, video, canvas { display: block; max-width: 100%; }
svg { flex: none; }

table { border-collapse: collapse; border-spacing: 0; width: 100%; }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--s2) 0; }

code, pre, .mono { font-family: var(--font-mono); font-size: .92em; }

::selection { background: var(--primary-soft); color: var(--text); }

/* ---- focus: visible for keyboards, quiet for mice ---------------------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ---- scrollbars -------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: #2f2f2f transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #2f2f2f;
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #3d3d3d; background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---- utilities --------------------------------------------------------- */
.u-row      { display: flex; align-items: center; }
.u-col      { display: flex; flex-direction: column; }
.u-between  { display: flex; align-items: center; justify-content: space-between; }
.u-center   { display: flex; align-items: center; justify-content: center; }
.u-wrap     { flex-wrap: wrap; }
.u-grow     { flex: 1 1 auto; min-width: 0; }
.u-none     { flex: none; }
.u-gap-05   { gap: var(--s05); }
.u-gap-1    { gap: var(--s1); }
.u-gap-2    { gap: var(--s2); }
.u-gap-3    { gap: var(--s3); }

.u-muted    { color: var(--text-muted); }
.u-dim      { color: var(--text-2); }
.u-faint    { color: var(--text-faint); }
.u-accent   { color: var(--primary); }
.u-good     { color: var(--good); }
.u-warning  { color: var(--warning); }
.u-critical { color: var(--critical); }

.u-xs   { font-size: var(--fs-xs); }
.u-sm   { font-size: var(--fs-sm); }
.u-md   { font-size: var(--fs-md); }
.u-lg   { font-size: var(--fs-lg); }
.u-semi { font-weight: var(--fw-semi); }
.u-med  { font-weight: var(--fw-medium); }
.u-bold { font-weight: var(--fw-bold); }

/* Columns of figures that must line up vertically get tabular figures;
   standalone hero numbers keep proportional figures. */
.u-tnum { font-variant-numeric: tabular-nums; }

.u-caps {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.u-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.u-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.u-hide { display: none !important; }
.u-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Wide content (tables, gantt, boards) scrolls inside its own box so the
   page body never scrolls horizontally. */
.u-scroll-x { overflow-x: auto; overflow-y: hidden; }
.u-scroll-y { overflow-y: auto; overflow-x: hidden; }
