/* ============================================================
   cpfischer.com: reset, primitives, typography base
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01";
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--w-display); }

::selection { background: var(--accent); color: var(--paper); }

:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }

[hidden] { display: none !important; }

/* ---------- Layout primitives ---------- */
.shell { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(1rem, 2.5vw, 2.5rem);
}

.rule { border: 0; border-top: 1px solid var(--hairline); }

/* ---------- Mono / micro labels (Figtree, no third typeface) ---------- */
.mono {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.mono--ink { color: var(--ink); }

.idx {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.num { color: var(--accent); margin-right: 0.35ch; font-variant-numeric: tabular-nums; }

/* ---------- Skip link (first focusable element) ---------- */
.c-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.c-skip:focus { left: 1rem; top: 1rem; }

/* ---------- Visually hidden ---------- */
.u-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Scroll reveal (progressive enhancement) ----------
   Content is hidden ONLY when JS is active (the inline script in <head>
   sets `.js` on <html> before first paint). With JS off or failed, nothing
   is hidden, so the page renders fully. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
