/* RISEN IT Support — base: reset, typography, focus, utilities. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: var(--lh);
  font-feature-settings: "cv11", "ss01";
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; line-height: var(--lh-tight); letter-spacing: -.011em; color: var(--gray-900); }
h1 { font-size: var(--fs-24); font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: var(--fs-18); font-weight: 620; }
h3 { font-size: var(--fs-16); font-weight: 600; }
p { margin: 0 0 var(--sp-3); }
.h-sm { font-size: var(--fs-15); font-weight: 600; margin: 0 0 var(--sp-3); letter-spacing: -.005em; }

a { color: var(--primary); text-decoration: none; transition: color var(--t) var(--ease); }
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: .9em; }
pre.code, pre.debug {
  background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: var(--sp-3); overflow-x: auto; font-family: var(--mono); font-size: var(--fs-13); white-space: pre-wrap;
}
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }
ul.plain { margin: 0; padding-left: 1.1rem; }

/* Keyboard focus: always visible, never on mouse click */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

::selection { background: var(--blue-200); color: var(--gray-900); }

/* Utilities */
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-13); }
.xsmall { font-size: var(--fs-12); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.inline { display: inline; margin: 0; }
.stack { margin: 0 0 var(--sp-2); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.prose { overflow-wrap: anywhere; line-height: 1.65; }
.prose p:last-child { margin-bottom: 0; }

/* Icons (Lucide sprite) */
.icon {
  width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -0.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 15px; height: 15px; }
.icon-xs { width: 13px; height: 13px; }
.icon-lg { width: 22px; height: 22px; }

/* Skip link */
.skip-link {
  position: absolute; left: var(--sp-3); top: -60px; z-index: 100;
  background: var(--navy-900); color: var(--white); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-sm);
  font-weight: 600; transition: top var(--t) var(--ease);
}
.skip-link:focus { top: var(--sp-3); color: var(--white); text-decoration: none; }

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