/* La documentazione di Aether.
 *
 * Stessi font e stessi colori del sito, ma una pagina da leggere e non da
 * guardare: una colonna di testo di larghezza misurata, un indice che resta
 * sotto gli occhi, nessun movimento che non sia lo scorrimento. Scuro di serie
 * come il sito, chiaro se il sistema lo chiede. */

:root {
  --bg: #09090d;
  --surf: #0e0e14;
  --raise: #1e1e2a;
  --line: rgba(255, 255, 255, 0.1);
  --t1: rgba(255, 255, 255, 0.94);
  --t2: rgba(255, 255, 255, 0.7);
  --t3: rgba(255, 255, 255, 0.5);
  --acc: #8b7cf6;
  --acc2: #4fd6e0;
  --acc-soft: rgba(139, 124, 246, 0.12);
  --ink: #09090d;
  --code: rgba(255, 255, 255, 0.07);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f6fb;
    --surf: #ffffff;
    --raise: #e6e4f0;
    --line: rgba(20, 18, 40, 0.12);
    --t1: #17151f;
    --t2: #413e52;
    --t3: #6b6880;
    --acc: #5b49d6;
    --acc2: #0e8f9a;
    --acc-soft: rgba(91, 73, 214, 0.1);
    --ink: #ffffff;
    --code: rgba(20, 18, 40, 0.07);
  }
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scrollbar-color: var(--raise) var(--bg);
  scrollbar-width: thin;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--t1);
  font: 400 16px/1.65 Geist, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
a {
  color: var(--acc);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
::selection {
  background: color-mix(in srgb, var(--acc) 32%, transparent);
}
[id] {
  scroll-margin-top: 84px;
}
[hidden] {
  display: none !important;
}

/* ── la testata ── */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--acc);
  font: 600 15px/1 Geist, sans-serif;
  letter-spacing: -0.01em;
}
.brand span {
  color: var(--t1);
}
.brand:hover {
  text-decoration: none;
}
.badge {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--t3);
  font: 500 9.5px/1.4 "Geist Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.spacer {
  flex: 1;
}
.menu-btn {
  display: none;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surf);
  color: var(--t1);
  font: 500 13px/1 Geist, sans-serif;
  cursor: pointer;
}

/* ── indice e testo ── */
.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}
.side {
  position: sticky;
  top: 58px;
  align-self: start;
  max-height: calc(100vh - 58px);
  overflow-y: auto;
  padding: 24px 18px 40px 0;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin-bottom: 18px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surf);
  color: var(--t3);
}
.search:focus-within {
  border-color: var(--acc);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--t1);
  font: 400 14px/1 Geist, sans-serif;
}
.side h2 {
  margin: 20px 0 6px;
  color: var(--t3);
  font: 500 10.5px/1.3 "Geist Mono", monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.side ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.side li a {
  display: block;
  padding: 5px 10px;
  border-left: 2px solid transparent;
  color: var(--t2);
  font-size: 14px;
  line-height: 1.4;
}
.side li a:hover {
  color: var(--t1);
  text-decoration: none;
}
.side li a[aria-current="true"] {
  border-left-color: var(--acc);
  background: var(--acc-soft);
  color: var(--t1);
}

.doc {
  min-width: 0;
  max-width: 760px;
  padding: 32px 0 96px 12px;
}
.intro h1 {
  margin: 0 0 12px;
  font: 600 clamp(34px, 5vw, 54px) / 1.04 "Bricolage Grotesque", Geist, sans-serif;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.intro p {
  margin: 0 0 12px;
  color: var(--t2);
  font-size: 17px;
  text-wrap: pretty;
}
.capitolo {
  margin-top: 56px;
}
.capitolo > h2 {
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font: 600 clamp(24px, 3vw, 32px) / 1.15 "Bricolage Grotesque", Geist, sans-serif;
  letter-spacing: -0.03em;
}
.capitolo > .lead {
  margin: 12px 0 0;
  color: var(--t2);
}
.voce {
  margin-top: 36px;
}
.voce h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font: 600 20px/1.3 Geist, sans-serif;
  letter-spacing: -0.015em;
}
.voce h3 a.ancora {
  color: var(--t3);
  font: 400 15px/1 "Geist Mono", monospace;
  opacity: 0;
}
.voce h3:hover a.ancora,
.voce h3 a.ancora:focus-visible {
  opacity: 1;
}
.fonte {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  margin: 6px 0 14px;
  color: var(--t3);
  font: 500 10.5px/1.6 "Geist Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.fonte code {
  letter-spacing: 0;
  text-transform: none;
  color: var(--t2);
  font-size: 12px;
}
.voce p {
  margin: 0 0 12px;
  color: var(--t2);
  text-wrap: pretty;
}
.voce h4 {
  margin: 18px 0 6px;
  color: var(--t1);
  font: 600 15px/1.4 Geist, sans-serif;
}
.voce ul,
.voce ol {
  margin: 0 0 12px;
  padding-left: 22px;
  color: var(--t2);
}
.voce li {
  margin-bottom: 5px;
}
.voce strong {
  color: var(--t1);
  font-weight: 600;
}
code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--code);
  color: var(--t1);
  font: 400 0.88em "Geist Mono", monospace;
}
pre {
  margin: 0 0 14px;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surf);
  tab-size: 2;
}
pre code {
  padding: 0;
  background: none;
  color: var(--t1);
  font: 400 13px/1.55 "Geist Mono", monospace;
  white-space: pre;
  overflow-wrap: normal;
}
.tavola {
  margin: 0 0 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tavola table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
}
.tavola th,
.tavola td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
}
.tavola th {
  background: var(--surf);
  color: var(--t1);
  font-weight: 600;
  white-space: nowrap;
}
.tavola td {
  color: var(--t2);
  min-width: 7ch;
}
.tavola tr:last-child td {
  border-bottom: 0;
}
.tavola td code {
  white-space: nowrap;
}
.callout {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 2px solid var(--acc);
  border-radius: 0 8px 8px 0;
  background: var(--acc-soft);
  color: var(--t2);
  font-size: 15px;
}
.vedi {
  margin: 14px 0 0;
  color: var(--t3);
  font-size: 14px;
}
.vedi a {
  margin-left: 6px;
}
.nessuno {
  margin-top: 40px;
  color: var(--t3);
}
mark {
  background: color-mix(in srgb, var(--acc) 30%, transparent);
  color: inherit;
  border-radius: 3px;
}

/* ── telefono ── */
@media (max-width: 860px) {
  .layout {
    display: block;
    padding: 0 16px;
  }
  .menu-btn {
    display: inline-block;
  }
  .side {
    position: fixed;
    inset: 58px 0 0 0;
    z-index: 15;
    max-height: none;
    padding: 18px 16px 40px;
    background: var(--bg);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }
  .side[data-aperto] {
    transform: none;
    visibility: visible;
    transition: transform 0.25s ease;
  }
  .doc {
    padding-left: 0;
  }
  .badge {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .side {
    transition: none !important;
  }
}
