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

* { margin: 0; }

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

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

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

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

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

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 40;
}

h1 { font-size: clamp(2.8rem, 6.6vw, 5rem); letter-spacing: -0.038em; }
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -0.028em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.65rem); letter-spacing: -0.02em; line-height: 1.2; }
h4 { font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.3; }

p { text-wrap: pretty; }

::selection { background: var(--amber); color: var(--ink); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--ink-mute); border-radius: 99px; border: 3px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }

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

.shell--narrow { max-width: 820px; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.2rem;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

/* — Typographic helpers — */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.kicker::before {
  content: '';
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.kicker--plain::before { display: none; }

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 62ch;
}

.muted { color: var(--ink-mute); }

.serif-em { font-family: var(--display); font-style: italic; font-weight: 300; }

/* Riserva lo spazio mentre il chunk della rotta arriva: niente salti di layout */
.route-fallback { min-height: 70vh; }
