/* Reset + base type. UI/display: Poppins; body/italic: Lora. */

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

/* Film grain — a single fixed overlay at the token-defined opacity. Breaks the
   flatness of large dark fields without reading as decoration; pointer-events
   off so it never intercepts clicks. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--noise-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* Skip link — visible only on keyboard focus, lands on #top */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: var(--t-small);
}

.skip-link:focus {
  left: var(--gutter);
  top: var(--s-3);
}

/* Visually hidden, but available to screen readers and search engines —
   used to give keyword-bearing text to the wordmark <h1>. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* legacy Edge / IE */
}

/* Hidden scrollbars — scrolling stays functional, the bar is not drawn
   (Valmeer standard). Applies to the page and any inner scroll area. */
html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  /* Default to UI sans (Poppins) - nav, buttons, captions, meta inherit.
     Paragraphs explicitly opt into the editorial serif via the p rule below. */
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern', 'liga';
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

main {
  position: relative;
  z-index: 2;
  overflow-x: clip;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
  border-radius: var(--r-sm);
}

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

::selection {
  background: var(--primary-muted);
  color: var(--text);
}

/* Headings - Poppins. Brand guide uses it for editorial structure and UI. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.04;
  font-feature-settings: 'kern', 'liga';
  text-wrap: balance;
}

h1 {
  font-size: var(--t-h1);
  letter-spacing: -0.035em;
  line-height: 0.98;
  font-weight: 500;
}

h2 {
  font-size: var(--t-h2);
  letter-spacing: -0.028em;
  line-height: 1.04;
  font-weight: 500;
}

h3 {
  font-size: var(--t-h3);
  line-height: 1.12;
  letter-spacing: -0.022em;
  font-weight: 500;
}

h4 {
  font-size: var(--t-h4);
  line-height: 1.22;
  letter-spacing: -0.015em;
  font-weight: 500;
}

/* Body paragraphs switch into Lora, the brand narrative face. */
p {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.62;
  color: var(--text-secondary);
  max-width: 64ch;
  font-feature-settings: 'kern', 'liga';
  text-wrap: pretty;
}

p.lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--text);
  max-width: 62ch;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* True italic - Lora italic is the editorial accent face. */
em, i {
  font-style: italic;
  font-family: var(--font-serif);
}

/* Wordmark - typeset uppercase name lockup paired with the one-colour V mark. */
.wordmark {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-feature-settings: 'tnum';
}

/* Small caps utility for inline labels (no eyebrow blocks — Valmeer principle) */
.smallcaps {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--text-tertiary);
  font-size: var(--t-small);
}

/* Mono utility — used sparingly for stats/IDs */
.mono {
  font-family: var(--font-mono);
  font-feature-settings: 'ss01', 'cv01';
}
