/* Reset, typography, focus. Uses tokens only. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  font-family: var(--font);
  font-size: 16px;
  line-height: var(--lh);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01"; /* Inter: open digits/alternates */
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-size: var(--fs-14);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, kbd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.92em; }

h1 { font-size: var(--fs-24); font-weight: var(--fw-semibold); line-height: var(--lh-tight); letter-spacing: -0.015em; }
h2 { font-size: var(--fs-20); font-weight: var(--fw-semibold); line-height: var(--lh-tight); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-16); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
h4 { font-size: var(--fs-13); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }

.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.fs-12 { font-size: var(--fs-12); }
.fs-13 { font-size: var(--fs-13); }
.fs-16 { font-size: var(--fs-16); }
.num { font-variant-numeric: tabular-nums; }
.undefined-value { color: var(--text-3); font-style: italic; } /* «da definire», never a fake default */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

::selection { background: var(--accent-soft); color: var(--text); }
::placeholder { color: var(--text-3); opacity: 1; }

.stack > * + * { margin-top: var(--sp-3); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-6); }
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mb-4 { margin-bottom: var(--sp-4); }

/* Live update highlight: 600 ms (SPECIFICHE 8.4) */
@keyframes pm-flash { from { background-color: var(--accent-soft); } to { background-color: transparent; } }
.flash { animation: pm-flash 600ms var(--ease); }
