@layer tokens, base, components, utilities;

@layer base {

  @font-face {
    font-family: 'Hanken Grotesk';
    src: url('../fonts/hanken-grotesk-400.woff2?v=c8ff5b21f9') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: 'Hanken Grotesk';
    src: url('../fonts/hanken-grotesk-500.woff2?v=a8fa113376') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: 'Hanken Grotesk';
    src: url('../fonts/hanken-grotesk-600.woff2?v=789e3dabbd') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: 'Hanken Grotesk';
    src: url('../fonts/hanken-grotesk-700.woff2?v=63f05066b5') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: 'Instrument Serif';
    src: url('../fonts/instrument-serif-400.woff2?v=95a44842dd') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: 'Instrument Serif';
    src: url('../fonts/instrument-serif-400-italic.woff2?v=ab8a8cb344') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
  }
  @font-face {
    font-family: 'Space Mono';
    src: url('../fonts/space-mono-400.woff2?v=c800c104f0') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Hanken Grotesk Fallback';
    src: local('Arial');
    size-adjust: 96.83%;
    ascent-override: 103.27%;
    descent-override: 31.29%;
    line-gap-override: 0.00%;
  }
  @font-face {
    font-family: 'Instrument Serif Fallback';
    src: local('Times New Roman');
    size-adjust: 79.59%;
    ascent-override: 124.38%;
    descent-override: 38.95%;
    line-gap-override: 0.00%;
  }
  @font-face {
    font-family: 'Space Mono Fallback';
    src: local('Courier New');
    size-adjust: 101.98%;
    ascent-override: 109.82%;
    descent-override: 35.40%;
    line-gap-override: 0.00%;
  }

  * { box-sizing: border-box; }

  html, body { margin: 0; padding: 0; }

  body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background: var(--paper);
    color: var(--ink);
  }

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

  html { hyphens: auto; }

  /* Titoli e testi in corpo grande: mai sillabati. */
  h1, h2, h3, h4,
  .hero-h, .contatti-quote, .checkup-title, .legal-title {
    hyphens: none;
  }

  body, p, td, th, h1, h2, h3, li, figcaption {
    overflow-wrap: break-word;
  }

  footer, .skip-link {
    --focus-color: var(--paper);
  }

  :focus-visible {
    outline: var(--focus-width) solid var(--focus-color);
    outline-offset: var(--focus-offset);
    border-radius: 2px;
  }

  :focus:not(:focus-visible) { outline: none; }

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