/* ============================================================================
   Base — reset, typography, and the handful of utilities the pages rely on.
   ========================================================================= */

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

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

body {
  margin: 0;
  background: var(--thsti-panel);
  color: var(--thsti-body);
  font-family: var(--thsti-font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-family: var(--thsti-font-heading);
  color: var(--thsti-text);
  line-height: var(--lh-tight);
  margin: 0;
}

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--thsti-maroon);
  text-decoration: none;
  transition: color var(--dur-1) var(--ease);
}
/* The site's core interaction: maroon turns navy on hover, and vice-versa. */
a:hover { color: var(--thsti-navy); }

img, svg { max-width: 100%; }
svg { display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

hr {
  border: 0;
  border-top: 1px solid var(--thsti-rule);
  margin: var(--sp-6) 0;
}

code, kbd, pre { font-family: var(--thsti-font-mono); font-size: 0.92em; }

::selection { background: var(--thsti-maroon-100); color: var(--thsti-maroon-dark); }

/* Focus — one visible ring everywhere, never removed. */
:focus-visible {
  outline: 2px solid var(--thsti-navy);
  outline-offset: 2px;
}

/* ---- Type roles --------------------------------------------------------- */

.page-title {
  font-family: var(--thsti-font-heading);
  font-weight: 700;
  font-size: var(--fs-page-title);
  color: var(--thsti-text);
  letter-spacing: -0.01em;
}

.section-title {
  font-family: var(--thsti-font-heading);
  font-weight: 600;
  font-size: var(--fs-section);
  color: var(--thsti-text);
}

.eyebrow,
.label {
  font-family: var(--thsti-font-body);
  font-weight: 700;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--thsti-text-2nd);
}

.lead { font-size: var(--fs-body); color: var(--thsti-body); max-width: 72ch; }
.muted { color: var(--thsti-text-2nd); }
.small { font-size: var(--fs-xs); }
.num { font-family: var(--thsti-font-heading); font-weight: 700; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--thsti-font-mono); }

.text-maroon  { color: var(--thsti-maroon); }
.text-navy    { color: var(--thsti-navy); }
.text-success { color: var(--thsti-success); }
.text-error   { color: var(--thsti-error); }
.text-warning { color: var(--thsti-orange-deep); }

/* ---- Layout utilities --------------------------------------------------- */

.stack > * + * { margin-top: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1 1 auto; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.grid { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
}

/* Accessible-only text */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Respect a reduced-motion preference everywhere. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print — drop the chrome, keep the data. */
@media print {
  .app-sidebar, .app-topbar, .app-scrim, .no-print { display: none !important; }
  .app-main { margin-left: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid var(--thsti-border); break-inside: avoid; }
}
