/* ============================================
   PolDoc AI — reset & base
   ============================================ */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--t);
}
a:hover { color: var(--ink); }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

strong { font-weight: 700; }

::selection {
  background: var(--blue);
  color: #fff;
}

/* --- Focus --- */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* --- Anchor offset under sticky header --- */
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

/* --- Screen-reader only --- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-lg);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform var(--t);
}
.skip-link:focus { transform: translateY(0); color: #fff; }

/* ============================================
   Typography primitives
   ============================================ */

.h1 {
  font-size: var(--fs-h1);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 800;
  text-wrap: balance;
}

.h2 {
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -.03em;
  font-weight: 800;
  text-wrap: balance;
}

.h2--sm {
  font-size: var(--fs-h2-sm);
  line-height: 1.12;
}

.lead {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-400);
  text-wrap: pretty;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-300);
}

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

/* ============================================
   Motion — scroll reveal
   ============================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity .7s var(--ease),
    transform .7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger helpers (applied by JS to grid children) */
.stagger > * { --reveal-delay: 0ms; }

/* No-JS safety: never hide content if the observer never runs */
.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
