/* base.css — reset, typography, layout primitives */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--n-50);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: var(--lh-heading); margin: 0; font-weight: 600; }
h1 { font-size: var(--fs-25); font-family: var(--font-display); font-weight: 600; }
h2 { font-size: var(--fs-20); }
h3 { font-size: var(--fs-16); }
p { margin: 0 0 var(--s-2); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* screen-reader only */
.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;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--c-primary); color: #fff; padding: var(--s-2) var(--s-4);
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* Layout container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-4);
}

/* App scaffolding */
#app-root { min-height: 100vh; }
.screen { padding: var(--s-6) 0 var(--s-8); }

/* Text helpers */
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.small { font-size: var(--fs-13); }
.display { font-family: var(--font-display); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-3 {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.stack > * + * { margin-top: var(--s-3); }
.row { display: flex; align-items: center; gap: var(--s-2); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.grow { flex: 1; }
.wrap { flex-wrap: wrap; }

/* Three-column feed grid */
.three-col {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: var(--col-left) var(--col-center) var(--col-right);
  justify-content: center;
  align-items: start;
}
.two-col-main {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: var(--col-center) var(--col-right);
  justify-content: center;
  align-items: start;
}
.sticky-rail { position: sticky; top: calc(var(--devbar-h) + var(--topnav-h) + var(--s-4)); }

@media (max-width: 1023px) {
  .three-col { grid-template-columns: minmax(0, var(--col-center)) var(--col-right); }
  .three-col > .rail-left { display: none; }
}
@media (max-width: 719px) {
  .three-col, .two-col-main { grid-template-columns: minmax(0, 1fr); }
  .three-col > .rail-right, .two-col-main > .rail-right { display: none; }
}

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