/* Font self-hostati: nessuna richiesta a domini terzi.
   Sottoinsiemi latin e latin-ext, generati da Google Fonts (SIL OFL 1.1). */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/geist-300-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/geist-300-700-latin.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-600-latin.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* =========================================================
   MeshCore ITA — style.css
   Hand-written, no framework, no preprocessor.
   ========================================================= */

:root {
  --bg: #000;
  --fg: #fafafa;
  --muted: #adadad;
  --dim: #7d7d7d;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --accent: #22c55e;
  --accent-2: #e11d48;
  --panel: rgba(255, 255, 255, .03);
  --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --maxw: 1180px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --header-h: 72px;
  --rhythm: clamp(4rem, 10vh, 7.5rem);
}

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

html {
  color-scheme: dark;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  min-height: 100svh;
}

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

/* -----------------------------------------------------------
   Background: static gradient fallback + fixed particle canvas
   ----------------------------------------------------------- */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(34, 197, 94, .16), transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 10%, rgba(225, 29, 72, .10), transparent 65%),
    linear-gradient(180deg, #000 0%, #000 100%);
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* -----------------------------------------------------------
   Layout helpers
   ----------------------------------------------------------- */

.site-header__inner,
.site-footer__inner,
.hero,
.section {
  width: min(var(--maxw), 100%);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section {
  border-top: 1px solid var(--line);
  padding-block: var(--rhythm);
}

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 200;
  background: var(--fg);
  color: #000;
  padding: .75rem 1.25rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: .8rem;
  text-decoration: none;
  transition: top .2s;
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* -----------------------------------------------------------
   Header & navigation
   ----------------------------------------------------------- */

.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  background: transparent;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background .25s, border-color .25s;
}

.site-header[data-scrolled="true"] {
  background: rgba(0, 0, 0, .72);
  border-bottom-color: var(--line);
}

.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -.01em;
}

.brand__mark {
  width: 26px;
  height: 26px;
  display: block;
}

.brand__text em {
  color: var(--accent);
  font-style: normal;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.85rem;
}

.nav__link {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--dim);
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  transition: color .2s;
  white-space: nowrap;
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--fg);
}

.nav__link[aria-current="true"] {
  color: var(--fg);
}

.nav__link[aria-current="true"]::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
}

.nav__link--ext {
  display: inline-flex;
  align-items: center;
  gap: .3em;
}

.ext-arrow {
  color: var(--accent-2);
  font-style: normal;
  display: inline-block;
  transform: translateY(-2px);
  font-size: .9em;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  cursor: pointer;
}

.nav-toggle .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nav-toggle::before,
.nav-toggle::after {
  content: '';
  position: absolute;
  left: 9px;
  width: 18px;
  height: 1px;
  background: currentColor;
  transition: transform .25s ease;
}

.nav-toggle::before { transform: translateY(-4px); }
.nav-toggle::after { transform: translateY(4px); }

body[data-nav-open] .nav-toggle::before { transform: rotate(45deg); }
body[data-nav-open] .nav-toggle::after { transform: rotate(-45deg); }

/* -----------------------------------------------------------
   Hero
   ----------------------------------------------------------- */

.hero {
  min-height: 100svh;
  padding-top: calc(var(--header-h) + 3rem);
  padding-bottom: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.75rem;
}

.eyelash {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--dim);
  margin: 0;
}

.hero__title {
  margin: 0;
  font-size: clamp(2.6rem, 7.2vw, 5.6rem);
  line-height: .98;
  letter-spacing: -.035em;
  font-weight: 600;
}

.hero__title span {
  display: block;
}

.t-fg { color: var(--fg); }
.t-muted { color: var(--muted); }
.t-accent { color: var(--accent); }

.hero__lede {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .5rem;
}

.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .4rem .85rem;
}

.hero__lede strong {
  color: var(--fg);
  font-weight: 600;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

/* Glossario minimo nella cover: chi arriva da fuori legge subito cosa
   significano le quattro parole che il resto del sito dà per scontate. */
.terms {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 1rem 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .55)), var(--panel);
  overflow: hidden;
}

.term {
  padding: 1.1rem 1.25rem;
  border-left: 1px solid var(--line);
}

.term:first-child {
  border-left: none;
}

.term__name {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: .45rem;
}

.term__def {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.55;
}

/* Percorso di un messaggio: telefono -> radio -> ripetitori -> radio -> telefono. */
.flow {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  counter-reset: flow;
}

.flow__step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .55)), var(--panel);
}

.flow__step--hop {
  border-color: rgba(34, 197, 94, .45);
}

.flow__step + .flow__step::before {
  content: '→';
  position: absolute;
  left: -1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-family: var(--font-mono);
}

.flow__name {
  color: var(--fg);
  font-weight: 600;
  font-size: .95rem;
}

.flow__hint {
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.45;
}

.faq--tech {
  margin-top: 1.75rem;
  padding-inline: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.cmdbox__intro {
  margin: 2rem 0 .75rem;
}

.cmdbox__intro + .cmdbox {
  margin-bottom: 1.5rem;
}

.faq--tech + .section__lede {
  margin-top: 1.5rem;
}

/* -----------------------------------------------------------
   Command box
   ----------------------------------------------------------- */

.cmdbox {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .55)), var(--panel);
  backdrop-filter: blur(2px);
  max-width: 640px;
  overflow: hidden;
}

.cmdbox__tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.cmdbox__tab {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dim);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: .85rem 1.1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s;
}

.cmdbox__tab:hover {
  color: var(--fg);
}

.cmdbox__tab[aria-selected="true"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.cmdbox__panels {
  position: relative;
}

.cmdbox__panel[hidden] {
  display: none;
}

.cmdbox__panel {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1.1rem;
}

.cmdbox__panel::before {
  content: '$';
  font-family: var(--font-mono);
  color: var(--accent);
  flex-shrink: 0;
}

.cmdbox__code {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--fg);
  overflow-x: auto;
  white-space: pre;
  flex: 1;
  scrollbar-width: thin;
}

.cmdbox__copy {
  flex-shrink: 0;
  border: none;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .4rem 0 .4rem 1rem;
  cursor: pointer;
  transition: color .2s;
}

.cmdbox__copy:hover {
  color: var(--fg);
}

.cmdbox__copy[data-copied] {
  color: var(--accent);
}

.cmdbox__copy-label {
  display: inline-block;
}

/* -----------------------------------------------------------
   Section headers
   ----------------------------------------------------------- */

.section__head {
  margin-bottom: 2.5rem;
  max-width: 62ch;
}

.section__title {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  letter-spacing: -.02em;
  line-height: 1.15;
  max-width: 24ch;
  margin: .5rem 0 .75rem;
}

.section__lede {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 68ch;
  margin: 0;
}

/* -----------------------------------------------------------
   Grid & cards
   ----------------------------------------------------------- */

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid + .hwlist,
.grid + .note {
  margin-top: 1.75rem;
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.75rem;
  background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .55)), var(--panel);
  transition: border-color .2s;
}

.card:hover {
  border-color: var(--line-strong);
}

.card--role {
  border-left: 2px solid var(--accent);
}

.card__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: .9rem;
}

.card__title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--fg);
  margin: 0 0 .6rem;
}

.card__body {
  color: var(--muted);
  font-size: .975rem;
  line-height: 1.65;
  max-width: 68ch;
  margin: 0;
}

/* -----------------------------------------------------------
   Steps
   ----------------------------------------------------------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.step {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: .5rem 1.5rem;
  padding: 1.5rem 1.75rem;
  border-top: 1px solid var(--line);
}

.step:first-child {
  border-top: none;
}

.step__num {
  grid-row: 1 / 3;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: .9rem;
  margin: 0;
  line-height: 1.6;
}

.step__title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
  align-self: end;
}

.step__body {
  color: var(--muted);
  font-size: .975rem;
  line-height: 1.6;
  max-width: 68ch;
  margin: 0;
  grid-column: 2;
}

.step > .link {
  grid-column: 2;
  justify-self: start;
  font-size: .95rem;
}
.link {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* -----------------------------------------------------------
   Hardware list
   ----------------------------------------------------------- */

.hwlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.hw {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--line);
}

.hw:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.hw:nth-child(-n+2) {
  border-top: none;
}

.hw__name {
  color: var(--fg);
  font-size: .95rem;
  font-weight: 600;
  white-space: nowrap;
}

.hw__note {
  font-size: .9rem;
  line-height: 1.5;
  color: var(--muted);
}

/* -----------------------------------------------------------
   Spec table
   ----------------------------------------------------------- */

table.spec {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: .85rem;
  display: block;
  overflow-x: auto;
  background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .55)), var(--panel);
}

table.spec caption {
  text-align: left;
  font-family: var(--font-sans);
  color: var(--muted);
  margin-bottom: 1rem;
  font-size: .95rem;
}

.spec th,
.spec td {
  padding: .75rem 1rem;
  text-align: left;
  white-space: nowrap;
}

.spec tbody tr + tr > th,
.spec tbody tr + tr > td {
  border-top: 1px solid var(--line);
}

.spec thead th {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .7rem;
  color: var(--dim);
}

.note {
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.6;
  margin-top: 1.25rem;
}

.note code {
  font-family: var(--font-mono);
  color: var(--fg);
  background: var(--panel);
  padding: .1rem .35rem;
  border-radius: 4px;
}

/* -----------------------------------------------------------
   Citazioni: <sup class="cit"><a href="#f1">1</a></sup> nel testo,
   <ol class="fonti"> in coda alla pagina con <li id="f1">.
   ----------------------------------------------------------- */

.cit {
  font-family: var(--font-mono);
  font-size: .7em;
  line-height: 0;
  vertical-align: super;
  margin-left: .1em;
}

.cit a {
  color: var(--accent);
  text-decoration: none;
}

.fonti {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
}

.fonti li {
  margin-bottom: .6rem;
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.fonti li:target {
  color: var(--fg);
}

.fonti a {
  overflow-wrap: anywhere;
}

/* -----------------------------------------------------------
   FAQ
   ----------------------------------------------------------- */

.faq {
  border-bottom: 1px solid var(--line);
  padding: 1.25rem 0;
  background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .55)), var(--panel);
}

.faq:first-of-type {
  border-top: 1px solid var(--line);
}

.faq__q {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--fg);
  padding-block: .65rem;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q::after {
  content: '+';
  flex-shrink: 0;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.1rem;
}

.faq[open] .faq__q::after {
  content: '\2212';
}

.faq__a {
  color: var(--muted);
  line-height: 1.65;
  padding-top: .85rem;
  margin: 0;
  max-width: 68ch;
}

/* -----------------------------------------------------------
   CTA / buttons
   ----------------------------------------------------------- */

.section--cta {
  text-align: center;
}

.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 14px;
  background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .55)), var(--panel);
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.6rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  background: transparent;
  font-family: var(--font-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}

.btn:hover,
.btn:focus-visible {
  background: var(--accent);
  color: #000;
}

.btn--primary {
  background: var(--accent);
  color: #000;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: transparent;
  color: var(--accent);
}

/* -----------------------------------------------------------
   Footer
   ----------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  padding-block: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer__note {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: .75rem;
  margin: 0;
}

.site-footer__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.site-footer__links a {
  color: var(--dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: color .2s;
}

.site-footer__links a:hover {
  color: var(--fg);
}

/* -----------------------------------------------------------
   Reveal-on-scroll
   ----------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s, transform .6s;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* -----------------------------------------------------------
   Responsive
   ----------------------------------------------------------- */

@media (max-width: 820px) {
  .nav {
    position: fixed;
    inset-inline: 0;
    top: var(--header-h);
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    background: var(--bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: 1.5rem var(--pad) 2rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
  }

  body[data-nav-open] .nav {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .grid--3,
  .grid--2 {
    grid-template-columns: 1fr;
  }

  .hwlist {
    grid-template-columns: 1fr;
  }

  .hw:nth-child(odd) {
    border-right: none;
  }

  .hw:nth-child(-n+2) {
    border-top: 1px solid var(--line);
  }

  .hw:first-child {
    border-top: none;
  }

  .cmdbox__tabs {
    -webkit-overflow-scrolling: touch;
  }

  .terms {
    grid-template-columns: repeat(2, 1fr);
  }

  .term:nth-child(odd) {
    border-left: none;
  }

  .term:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }

  .flow {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .flow__step + .flow__step::before {
    content: '↓';
    left: 1.1rem;
    top: -1.05rem;
    transform: none;
    line-height: 1;
  }
}

@media (max-width: 560px) {
  .site-header__inner {
    height: 64px;
  }

  .hero {
    padding-top: calc(64px + 2rem);
    gap: 1.25rem;
  }

  .step {
    grid-template-columns: 1fr;
    gap: .4rem;
  }

  .step__num {
    grid-row: auto;
  }

  .step__body {
    grid-column: 1;
  }

  .cmdbox__panel {
    flex-wrap: wrap;
  }

  .cmdbox__copy {
    border-left: none;
    border-top: 1px solid var(--line);
    padding: .5rem 0 0;
    width: 100%;
    text-align: left;
  }

  .cta__actions {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .hero__lede {
    font-size: 1.0625rem;
  }

  .section__title {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  .nav__link {
    display: inline-block;
    padding-block: .85rem;
  }

  .hw {
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
  }

  .hw__note {
    text-align: left;
  }

  .terms {
    grid-template-columns: 1fr;
  }

  .term {
    border-left: none;
  }

  .term:nth-child(n+2) {
    border-top: 1px solid var(--line);
  }
}

/* -----------------------------------------------------------
   Multi-page layout additions (breadcrumbs, prose, related, footer meta)
   ----------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero--page {
  min-height: auto;
  padding-top: calc(var(--header-h) + 2.5rem);
  padding-bottom: 2.5rem;
  gap: 1rem;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .04em;
  color: var(--dim);
}

.crumbs a {
  color: var(--dim);
  text-decoration: none;
}

.crumbs a:hover,
.crumbs a:focus-visible {
  color: var(--fg);
}

.crumbs li[aria-current="page"] {
  color: var(--muted);
}

.crumbs li + li::before {
  content: '\203A';
  display: inline-block;
  margin: 0 .5rem;
  color: var(--line-strong);
}

/* -----------------------------------------------------------
   Widget interattivi (assets/js/widgets/*.js). Shell condivisa:
   .widget > .widget__controls (label+input) + .widget__stage (svg/canvas)
   + .widget__out (valori). I widget non definiscono altri stili globali.
   ----------------------------------------------------------- */

.widget {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  background: rgba(255, 255, 255, .02);
  display: grid;
  gap: 1.25rem;
}

.widget--failed { display: none; }

.widget__controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem 1.25rem;
}

.widget__controls label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .3rem .4rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--dim);
}

.widget__controls label > input,
.widget__controls label > select {
  flex-basis: 100%;
}

.widget__controls output,
.widget__val {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: .9rem;
  text-transform: none;
  letter-spacing: 0;
}

.widget input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.widget select,
.widget input[type="number"] {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: .4rem .5rem;
  font: inherit;
  font-family: var(--font-mono);
  font-size: .9rem;
}

.widget__stage {
  width: 100%;
  display: block;
  border-radius: 8px;
  background: #050505;
  border: 1px solid var(--line);
}

.widget__stage svg,
.widget__stage canvas {
  display: block;
  width: 100%;
  height: auto;
}

.widget__stage text:not([fill]) {
  fill: var(--fg);
  font-family: var(--font-mono);
  font-size: 10px;
}

.widget__out {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem 1.25rem;
  margin: 0;
}

.antenna__stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.antenna__stage svg { background: rgba(0, 0, 0, .35); border-radius: 6px; }

@media (max-width: 640px) {
  .antenna__stage { grid-template-columns: 1fr; }
}

.antenna__calc {
  margin-top: 1rem;
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.antenna__calc summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--fg);
}

.antenna__calc input[type="number"] {
  font: inherit;
  font-family: var(--font-mono);
  width: 7rem;
  padding: .25rem .5rem;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.widget__out div { display: grid; gap: .2rem; }

.widget__out dt {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--dim);
}

.widget__out dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--fg);
}

.widget__out dd.is-ok { color: var(--accent); }
.widget__out dd.is-warn { color: #f59e0b; }
.widget__out dd.is-bad { color: #ef4444; }

.widget__cmd {
  font-family: var(--font-mono);
  font-size: .9rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .6rem .8rem;
  color: var(--fg);
  overflow-x: auto;
  margin: 0;
}

.widget__note {
  color: var(--dim);
  font-size: .8rem;
  line-height: 1.5;
  margin: 0;
}

.prose {
  max-width: 72ch;
}

.prose p,
.prose ul,
.prose ol {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 1.1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li {
  margin-bottom: .4rem;
}

.prose p:last-child,
.prose ul:last-child,
.prose ol:last-child,
.prose li:last-child {
  margin-bottom: 0;
}

.prose h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  letter-spacing: -.01em;
  color: var(--fg);
  margin: 2rem 0 .75rem;
}

.prose h3 {
  font-size: 1.1rem;
  color: var(--fg);
  margin: 1.5rem 0 .5rem;
}

.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}

.prose strong {
  color: var(--fg);
}

.prose code {
  font-family: var(--font-mono);
  font-size: .9em;
  color: var(--fg);
  background: var(--panel);
  padding: .1rem .35rem;
  border-radius: 4px;
}

.foot__meta {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: .75rem;
  margin: 0;
}

.related .card {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* -----------------------------------------------------------
   Footer navigation (Documentazione)
   ----------------------------------------------------------- */

.foot__nav {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.foot__nav-label {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0;
}

.foot__nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  margin: 0;
  padding: 0;
}

.foot__nav-list a {
  color: var(--dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: .7rem;
  transition: color .2s;
}

.foot__nav-list a:hover,
.foot__nav-list a:focus-visible {
  color: var(--fg);
}

.foot__nav-list a[aria-current="true"] {
  color: var(--accent);
}

/* -----------------------------------------------------------
   Ricerca client-side e blog (Aggiornamenti)
   Markup emesso da build.mjs, cablato da assets/js/search.js.
   ----------------------------------------------------------- */

.search-toggle {
  display: inline-flex;
  position: relative;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}

.search-toggle:hover,
.search-toggle:focus-visible {
  border-color: var(--line-strong);
  color: var(--accent);
}

/* Lente disegnata con due pseudo-elementi, stesso approccio dell'hamburger
   di .nav-toggle: nessun asset SVG da caricare. */
.search-toggle::before {
  content: '';
  position: absolute;
  top: 9px;
  left: 9px;
  width: 13px;
  height: 13px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
}

.search-toggle::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  width: 7px;
  height: 1.6px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

/* La toolbar dell'header non prevede più solo brand+nav: da qui in poi
   .nav si spinge a destra da sola, portando con sé search-toggle. */
.nav {
  margin-left: auto;
}

dialog.search {
  width: min(640px, 92vw);
  max-height: min(70vh, 560px);
  margin: 8vh auto auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
  overflow: hidden;
}

dialog.search:not([open]) {
  display: none;
}

dialog.search::backdrop {
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(6px);
}

.search__form {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  transition: border-color .2s;
}

.search__form:focus-within {
  border-bottom-color: var(--accent);
}

.search__input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
}

.search__input::placeholder {
  color: var(--dim);
}

/* Chrome/Safari disegnano una ✕ nativa dentro input[type=search]: doppione
   della pillola ESC accanto, e non stilabile. Via. */
.search__input::-webkit-search-cancel-button,
.search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search__close {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .6rem;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}

.search__close:hover,
.search__close:focus-visible {
  color: var(--fg);
  border-color: var(--line-strong);
}

.search__results {
  list-style: none;
  margin: 0;
  padding: .5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.search__item + .search__item {
  margin-top: .2rem;
}

.search__link {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .65rem .75rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}

.search__link:hover,
.search__item[aria-selected="true"] .search__link {
  background: var(--panel);
  border-color: var(--accent);
}

.search__page {
  font-family: var(--font-mono);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dim);
}

.search__title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--fg);
}

.search__snippet {
  font-size: .825rem;
  line-height: 1.5;
  color: var(--muted);
}

.search__snippet mark {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}

.search__empty {
  margin: 0;
  padding: 1.75rem 1.1rem;
  text-align: center;
  color: var(--dim);
  font-size: .9rem;
}

/* -----------------------------------------------------------
   Blog (Aggiornamenti) — stessa estetica delle .card esistenti
   ----------------------------------------------------------- */

.posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.post-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .55)), var(--panel);
  transition: border-color .2s;
}

.post-card:hover {
  border-color: var(--line-strong);
}

.post-card__link {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  height: 100%;
  padding: 1.75rem;
  color: inherit;
  text-decoration: none;
}

.post-card__date {
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dim);
}

.post-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--fg);
  margin: 0;
}

.post-card__body {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
  margin: 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--dim);
  margin: 0 0 1.5rem;
}

.post-meta__author {
  color: var(--muted);
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 1.5rem;
  padding: 0;
}

.tag {
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .75rem;
}

/* -----------------------------------------------------------
   Ricerca e blog — responsive
   ----------------------------------------------------------- */

@media (max-width: 820px) {
  .search-toggle {
    margin-left: auto;
  }

  .posts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  dialog.search {
    width: 94vw;
    margin-top: 4vh;
    max-height: 86vh;
  }

  .search__title {
    font-size: 1rem;
  }
}

/* Ancore di sezione: l'header è sticky, senza questo margine il titolo
   raggiunto da un link #ancora finisce sotto la barra. */
.section h2[id],
.section h3[id],
details.faq[id] {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

/* Paginazione dell'indice Aggiornamenti. */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad) var(--rhythm);
}

.pager__link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .5rem 1.1rem;
  font-size: .9rem;
  color: var(--fg);
  text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease;
}

.pager__link:hover,
.pager__link:focus-visible {
  border-color: var(--accent);
  background: var(--panel);
}

.pager__link--prev::before { content: '← '; }
.pager__link--next::after { content: ' →'; }

.pager__status {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--dim);
}
