/* Migliorie non invasive per navigazione, leggibilità e stampa. */
:root {
  --copper: #91482f;
  --copper-light: #efb493;
  --sage: #4e6259;
  --reading-progress: 0%;
}

body {
  overflow-x: clip;
}

main {
  overflow-x: clip;
}

main:focus {
  outline: none;
}

[id] {
  scroll-margin-top: 116px;
}

.site-header {
  width: 100%;
  padding-inline: max(24px, calc((100% - 1240px) / 2));
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
}

.reading-progress {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
}

.reading-progress > span {
  display: block;
  width: var(--reading-progress);
  height: 100%;
  background: var(--copper);
  transition: width 80ms linear;
}

.site-header nav a[aria-current="location"] {
  color: var(--copper);
}

.site-header nav a[aria-current="location"]::after {
  width: 100%;
}

a:focus-visible {
  outline: 3px solid #91482f;
  outline-offset: 4px;
  border-radius: 3px;
}

.research a:focus-visible {
  outline-color: #efb493;
}

.site-header a,
.hero-actions a,
.author-links a,
footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.privacy-note a {
  color: var(--copper-light);
  font-weight: 700;
  text-underline-offset: 4px;
}

.project-status {
  margin-top: 25px;
  padding: 24px;
  border: 1px solid rgb(255 255 255 / 18%);
  background: rgb(255 255 255 / 6%);
}

.project-status-label {
  margin: 0;
  color: var(--copper-light);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .16em;
}

.project-status h3 {
  margin: 10px 0 8px;
  color: #fff;
  font-family: Georgia, serif;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 400;
  line-height: 1.2;
}

.project-status > p:not(.project-status-label) {
  max-width: 720px;
  margin: 0;
  color: #bfcec8;
  line-height: 1.65;
}

.project-status a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  color: var(--copper-light);
  font-weight: 700;
  gap: 8px;
  text-underline-offset: 5px;
}

.site-header nav a,
.version-chip,
.eyebrow,
.section-index,
.hero-proof span,
.instrument-top,
.instrument-core small,
.lag-instrument > p,
.vertical-label,
.case-steps span,
.heading-note strong,
.fit-card > span,
.difference-grid strong,
.research-seal span,
.research-seal small,
.pilot-grid strong,
.trajectory strong {
  font-size: .75rem;
}

.privacy-note,
.emergency,
footer {
  font-size: .875rem;
}

@media (max-width: 960px) {
  .site-header {
    height: auto;
    min-height: 88px;
    padding: 14px 24px 10px;
    row-gap: 8px;
  }

  .site-header nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    gap: 22px;
    padding: 4px 2px 9px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    white-space: nowrap;
  }

  .version-chip {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  [id] {
    scroll-margin-top: 138px;
  }

  .site-header {
    height: auto;
    min-height: 110px;
    padding-inline: 16px;
  }

  .trajectory {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(4px, 2vw, 12px);
    overflow-x: visible;
  }

  .trajectory::before {
    left: 6%;
    right: 6%;
  }

  .trajectory div {
    min-width: 0;
  }

  .trajectory strong {
    letter-spacing: .04em;
  }

  footer a {
    width: fit-content;
  }
}

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

  .reading-progress > span {
    transition: none;
  }
}

@page {
  margin: 18mm;
}

@media print {

  body,
  main {
    overflow: visible;
  }

  .emergency {
    display: grid !important;
    width: 100%;
    padding: 18px 0;
    color: #000 !important;
    break-inside: avoid;
  }

  footer {
    width: 100%;
    color: #000 !important;
  }

  a {
    text-decoration: underline;
  }
}
