/* Base styles and the app bar. All values come from css/tokens.css;
   see docs/design-system.md. */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
}

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

/* Engineering-paper surface: fine grid with a heavier line every 5th. */
.paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size:
    calc(var(--grid-step) * 5) calc(var(--grid-step) * 5),
    calc(var(--grid-step) * 5) calc(var(--grid-step) * 5),
    var(--grid-step) var(--grid-step),
    var(--grid-step) var(--grid-step);
}

.panel {
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
}

/* ---- App bar ---- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--page);
  border-bottom: var(--border);
}
.appbar-row, .tabs {
  width: calc(100% - 2 * var(--s4));
  max-width: var(--measure);
  margin: 0 auto;
}
.appbar-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; }
.brand { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s2); min-width: 0; }
.eyebrow {
  flex-basis: 100%;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--load-text);
}
.brand-name { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; line-height: 1.1; }

.theme-switch { display: flex; margin: 0; padding: 0; border: 1px solid var(--ink); border-radius: var(--radius); flex: none; }
.theme-switch label { position: relative; }
.theme-switch label + label { border-left: 1px solid var(--ink); }
.theme-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.theme-switch span { display: flex; align-items: center; min-height: 2.25rem; padding: 0 var(--s2); font-size: var(--text-xs); font-weight: 600; }
.theme-switch input:checked + span { background: var(--shear-fill); color: var(--shear); box-shadow: inset 0 -2px 0 var(--shear); }
.theme-switch input:focus-visible + span { outline: 2px solid var(--shear); outline-offset: -2px; }

.tabs { display: flex; }
.tabs a {
  flex: 1 1 0;
  display: flex; align-items: center; justify-content: center;
  min-height: var(--touch);
  border-bottom: 3px solid transparent;
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.03em;
  color: var(--ink-soft); text-decoration: none;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--shear); border-bottom-color: var(--shear); }

.view[hidden] { display: none; }
/* A tab link scrolls to its view; keep the view's title clear of the sticky bar. */
.view { scroll-margin-top: 9rem; }

.version {
  padding: 0 var(--s2);
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--paper);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--shear);
}

.foot {
  margin-top: auto;
  width: 100%;
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  padding: var(--s5);
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--ink-soft);
}

.foot p { margin: 0 0 var(--s2); }
