/* ============================================================
   Stealthlink - base: reset, document, typography, layout primitives
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Components set display on many elements; the hidden attribute must still win. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
  color-scheme: dark;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

/* Inline icons default to 20px; components size them where they need more or less. */
.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

a:hover {
  color: var(--text-strong);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-fill-2);
  color: var(--white);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--t-h1);
  line-height: var(--lh-h1);
}

h2 {
  font-size: var(--t-h2);
  line-height: var(--lh-h2);
  font-weight: var(--fw-regular);
}

h3 {
  font-size: var(--t-h3);
  line-height: var(--lh-h3);
  font-weight: var(--fw-regular);
}

h4 {
  font-size: var(--t-h4);
  line-height: var(--lh-h4);
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
  letter-spacing: 0;
}

:not(pre) > code {
  padding: 0.12em 0.4em;
  border-radius: var(--r-sm);
  background: var(--surface-raised);
  color: var(--text-strong);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-12) 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-narrow {
  width: 100%;
  max-width: calc(var(--container-narrow) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section-sm {
  padding-block: var(--section-y-sm);
}

.section + .section {
  padding-top: 0;
}

.stack > * + * {
  margin-top: var(--stack, var(--s-4));
}

.grid {
  display: grid;
  gap: var(--grid-gap, var(--s-8));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

/* ---------- Typography helpers ---------- */
.display {
  font-size: var(--t-display);
  line-height: var(--lh-display);
  font-weight: var(--fw-medium);
}

.lead {
  font-size: var(--t-lead);
  line-height: var(--lh-lead);
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: var(--t-small);
  line-height: var(--lh-small);
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: var(--s-3);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--t-micro);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
}

.hl {
  color: var(--accent-light);
}

.center {
  text-align: center;
}

.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;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--accent-strong);
  color: var(--white);
}

.skip-link:focus {
  top: 12px;
  color: var(--white);
}

/* ---------- Prose (blog posts, legal pages) ---------- */
.prose {
  color: var(--text-body);
  font-size: 17px;
  line-height: 1.7;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  margin-top: 2em;
  font-size: clamp(26px, 3vw, 34px);
}

.prose h3 {
  margin-top: 1.6em;
  font-size: clamp(20px, 2.2vw, 24px);
}

.prose p,
.prose ul,
.prose ol {
  margin-bottom: 0;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose li::marker {
  color: var(--accent);
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease), text-decoration-color var(--dur) var(--ease), text-underline-offset var(--dur) var(--ease);
}

.prose a:hover {
  text-decoration-color: currentColor;
  text-underline-offset: 5px;
}

/* ---------- Scroll reveal (app.js adds .rv, then .is-in once in view) ---------- */
body .rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  transition-delay: var(--rv-delay, 0ms);
}

body .rv.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  body .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.prose pre {
  overflow-x: auto;
  padding: var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.6;
}

.prose blockquote {
  margin-inline: 0;
  padding-left: var(--s-5);
  border-left: 2px solid var(--accent);
  color: var(--text-muted);
}

.prose table {
  font-size: 15px;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.prose th {
  color: var(--text-strong);
  font-weight: var(--fw-medium);
}
