@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

html, body {
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-tint);
  background-attachment: fixed;
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--dur-3) var(--ease-out), color var(--dur-3) var(--ease-out);
}

::selection { background: color-mix(in srgb, var(--accent-quiet) 70%, black); color: #fff; }
::-moz-selection { background: color-mix(in srgb, var(--accent-quiet) 70%, black); color: #fff; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; padding: 0; }

/* ---- Typography ---------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--text);
}
h1 { letter-spacing: -0.03em; }

p { text-wrap: pretty; }

.font-mono, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---- Accessibility ------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: fixed;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: var(--z-tooltip);
  padding: var(--sp-2) var(--sp-4);
  background: var(--accent);
  color: var(--text-on-accent);
  border-radius: var(--r-sm);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--dur-2) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* ---- App shell layout ---------------------------------------------------- */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--dur-3) var(--ease-out);
}
.app-shell[data-collapsed="true"] .app-content { margin-left: var(--sidebar-mini); }

.main-area {
  flex: 1 1 auto;
  padding: var(--sp-6) var(--sp-8) var(--sp-10);
}

.content-wrap {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ---- Page header --------------------------------------------------------- */
.page-head {
  margin-bottom: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
}
.page-head__text { min-width: 0; }
.page-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}
.page-title {
  font-size: clamp(26px, 3.4vw, 36px);
  margin: 0;
}
.page-subtitle {
  margin-top: var(--sp-2);
  color: var(--text-muted);
  max-width: var(--prose-max);
  line-height: 1.55;
}
.page-head__actions { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }

/* ---- Generic helpers ----------------------------------------------------- */
.stack { display: grid; gap: var(--sp-4); }
.stack-sm { display: grid; gap: var(--sp-2); }
.row { display: flex; gap: var(--sp-3); align-items: center; }
.row-between { display: flex; gap: var(--sp-3); align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---- Entrance motion (respects reduced-motion below) --------------------- */
@keyframes lor-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lor-rise {
  animation: lor-rise var(--dur-4) var(--ease-out) both;
}
.lor-stagger > * {
  animation: lor-rise var(--dur-4) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

@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;
  }
  .lor-rise, .lor-stagger > * { animation: none; opacity: 1; transform: none; }
}
