/* ==========================================================================
   TECNOACCESS — BASE & RESET
   ========================================================================== */

/* Modern reset (Andy Bell) -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt", "ss01";
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* WCAG 2.4.11 AAA: focus non coperto da masthead sticky */
}

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

body {
  background: var(--tn-paper);
  color: var(--tn-ink);
  font-family: var(--tn-font-body);
  font-size: var(--tn-text-base);
  line-height: var(--tn-lh-normal);
  font-weight: 400;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  body { font-size: var(--tn-text-md); }
}

/* TYPOGRAPHY ---------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--tn-font-display);
  font-weight: 600;
  line-height: var(--tn-lh-tight);
  letter-spacing: var(--tn-tracking-tight);
  color: var(--tn-ink);
}

h1 { font-size: var(--tn-text-4xl); }
h2 { font-size: var(--tn-text-3xl); }
h3 { font-size: var(--tn-text-2xl); }
h4 { font-size: var(--tn-text-xl); line-height: var(--tn-lh-snug); }
h5 { font-size: var(--tn-text-lg); line-height: var(--tn-lh-snug); }
h6 {
  font-family: var(--tn-font-mono);
  font-size: var(--tn-text-xs);
  letter-spacing: var(--tn-tracking-mono);
  text-transform: uppercase;
  font-weight: 500;
}

p { line-height: var(--tn-lh-prose); }

a {
  color: var(--tn-orange-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: currentColor;
  transition: color var(--tn-dur-fast) var(--tn-ease),
              text-decoration-color var(--tn-dur-fast) var(--tn-ease);
}

a:hover {
  color: var(--tn-orange);
  text-decoration-color: var(--tn-orange);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: var(--tn-focus-ring);
  outline-offset: var(--tn-focus-offset);
  border-radius: 2px;
  text-decoration: none;
}

ul, ol { padding-left: 1.25rem; line-height: var(--tn-lh-prose); }
li + li { margin-top: var(--space-2); }

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

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
}

button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: var(--tn-focus-ring);
  outline-offset: var(--tn-focus-offset);
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  background: var(--tn-paper);
  color: var(--tn-ink);
  border: var(--tn-border-thin);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--tn-radius-0);
}

::selection {
  background: var(--tn-orange);
  color: var(--tn-paper);
}

/* SKIP LINK · visibile on focus ------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: var(--tn-z-skip);
  background: var(--tn-ink);
  color: var(--tn-paper);
  padding: var(--space-3) var(--space-5);
  font-family: var(--tn-font-mono);
  font-size: var(--tn-text-sm);
  text-transform: uppercase;
  letter-spacing: var(--tn-tracking-mono);
  text-decoration: none;
  border: var(--tn-border-thick);
  border-color: var(--tn-orange);
  transform: translateY(0);
  transition: top var(--tn-dur-base) var(--tn-ease-out);
}

.skip-link:focus {
  top: var(--space-3);
  outline: var(--tn-focus-ring);
  outline-offset: var(--tn-focus-offset);
}

/* CONTAINERS / GRID ------------------------------------------------------- */
.tn-container {
  width: 100%;
  max-width: var(--tn-container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

@media (min-width: 768px) { .tn-container { padding-inline: var(--space-7); } }
@media (min-width: 1280px){ .tn-container { padding-inline: var(--space-8); } }

.tn-container--md { max-width: var(--tn-container-md); }
.tn-container--sm { max-width: var(--tn-container-sm); }

.tn-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-5);
  row-gap: var(--space-7);
}

@media (max-width: 767px) {
  .tn-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* UTILITY CLASSES --------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.tn-divider {
  height: 1px;
  background: var(--tn-line);
  width: 100%;
  border: 0;
  margin-block: var(--space-7);
}

.tn-divider--thick {
  height: 2px;
}

.tn-rule-top { border-top: var(--tn-border-thick); padding-top: var(--space-5); }
.tn-rule-bot { border-bottom: var(--tn-border-thick); padding-bottom: var(--space-5); }

/* APPEAR ANIMATION (page load) -------------------------------------------- */
@keyframes tn-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tn-rise {
  animation: tn-rise var(--tn-dur-reveal) var(--tn-ease) both;
}

.tn-rise:nth-child(2) { animation-delay: 80ms; }
.tn-rise:nth-child(3) { animation-delay: 160ms; }
.tn-rise:nth-child(4) { animation-delay: 240ms; }
.tn-rise:nth-child(5) { animation-delay: 320ms; }
.tn-rise:nth-child(6) { animation-delay: 400ms; }
