/* Card Offloader — foglio di stile unico.
   Nessun JavaScript, nessun font remoto, nessuno stile inline:
   la CSP del vhost vieta script e style-src esterni, e ogni richiesta in
   meno conta su un server senza HTTP/2. */

:root {
  --brand-1:   #005bd8;          /* campionati dall'icona ufficiale */
  --brand-2:   #0093ff;

  --bg:        #ffffff;
  --bg-soft:   #f6f8fb;
  --bg-inset:  #eef2f7;
  --bg-code:   #f3f5f9;
  --text:      #14171a;
  --text-mid:  #3d454e;
  --text-dim:  #616b76;
  --rule:      #dde3ea;
  --rule-soft: #eaeff5;
  --accent:    #005bd8;
  --accent-lo: #e9f1fe;
  --ok:        #12653a;
  --ok-lo:     #e4f5eb;
  --warn:      #8a5300;
  --warn-lo:   #fdf3e2;
  --err:       #b3261e;
  --err-lo:    #fdeceb;
  --shadow:    0 1px 2px rgba(16,24,40,.05), 0 6px 20px -8px rgba(16,24,40,.13);
  --shadow-lg: 0 2px 4px rgba(16,24,40,.05), 0 18px 40px -16px rgba(16,24,40,.22);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 64rem;
  --radius: 7px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0d1117;
    --bg-soft:   #141a22;
    --bg-inset:  #1a212b;
    --bg-code:   #161d26;
    --text:      #e8ecf1;
    --text-mid:  #b9c2cd;
    --text-dim:  #8b96a3;
    --rule:      #262e39;
    --rule-soft: #1d242d;
    --accent:    #6cb2ff;
    --accent-lo: #10203a;
    --ok:        #5fd39b;
    --ok-lo:     #0f2a1e;
    --warn:      #e3ad61;
    --warn-lo:   #2c2114;
    --err:       #ff8f85;
    --err-lo:    #2e1717;
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 6px 20px -8px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 18px 40px -16px rgba(0,0,0,.7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.68 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ============ accessibilita' ============ */

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff; font-weight: 600;
  padding: .7rem 1.1rem; border-radius: 0 0 8px 0; z-index: 20;
}
.skip:focus { left: 0; top: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ============ struttura ============ */

/* UN solo contenitore centrato. Applicare max-width + margin auto a ogni
   figlio (come facevo prima) centra i paragrafi limitati a 68ch mentre i
   titoli restano a sinistra: il risultato e' un allineamento a meta'. */
.head-inner, .foot-inner { max-width: var(--wrap); margin-inline: auto; }
main { max-width: var(--wrap); margin-inline: auto; padding: 0 1.5rem 4.5rem; }
main > * { max-width: none; margin-inline: 0; }

.site-head {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
  padding: 0 1.25rem;
}
.site-head > .head-inner {
  display: flex; flex-wrap: wrap; gap: .75rem 1.75rem;
  align-items: center; justify-content: space-between;
  padding: .85rem 0;
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 660; font-size: 1.05rem; letter-spacing: -.01em;
  color: var(--text); text-decoration: none;
}
.brand img { border-radius: 8px; display: block; box-shadow: var(--shadow); }

.site-head nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.site-head nav a {
  color: var(--text-mid); text-decoration: none; font-size: .94rem;
  padding: .4rem .7rem; border-radius: 7px;
}
.site-head nav a:hover { color: var(--accent); background: var(--accent-lo); }
.site-head nav a[aria-current="page"] { color: var(--text); font-weight: 620; background: var(--bg-inset); }


/* ============ intestazione di pagina ============ */

.hero {
  margin: 2.4rem 0 3.4rem;
  padding: 0 0 2.2rem;
  border-bottom: 2px solid var(--text);
}
.hero > :last-child { margin-bottom: 0; }

.eyebrow {
  display: block;
  font: 620 .76rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 1.1rem;
}

/* ============ testo ============ */

h1 {
  font-size: clamp(2rem, 1.3rem + 2.9vw, 2.95rem);
  line-height: 1.06; letter-spacing: -.033em; font-weight: 700;
  margin: 0 0 .85rem; max-width: 19ch; text-wrap: balance;
}
h2 {
  font-size: clamp(1.38rem, 1.14rem + 1.1vw, 1.72rem);
  line-height: 1.2; letter-spacing: -.023em; font-weight: 660;
  margin: 3.4rem 0 .9rem; scroll-margin-top: 5.5rem;
  padding-top: 1.4rem; border-top: 1px solid var(--rule-soft);
  text-wrap: balance;
}
.hero + h2, h1 + h2 { border-top: 0; padding-top: 0; margin-top: 2.4rem; }
h3 { font-size: 1.13rem; font-weight: 650; letter-spacing: -.012em; margin: 2rem 0 .55rem; }

p, ul, ol { margin: 0 0 1.15rem; }
p, li { max-width: 58ch; }
ul, ol { padding-left: 1.35rem; }
li { margin-bottom: .45rem; }
li::marker { color: var(--text-dim); }

.lede {
  font-size: clamp(1.1rem, 1.02rem + .4vw, 1.3rem);
  line-height: 1.5; color: var(--text-mid); max-width: 50ch;
  margin-bottom: 1.5rem; text-wrap: pretty;
}

a { color: var(--accent); text-underline-offset: 2.5px; text-decoration-thickness: 1.2px; }
a:hover { text-decoration-thickness: 2px; }

strong { font-weight: 650; color: var(--text); }
q { quotes: "\201C" "\201D"; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

code {
  font: .875em/1.5 var(--mono);
  overflow-wrap: anywhere;
  background: var(--bg-code); color: var(--text);
  padding: .14em .4em; border-radius: 5px;
  border: 1px solid var(--rule-soft);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  font: .855rem/1.7 var(--mono);
  box-shadow: var(--shadow);
  margin: 0 0 1.4rem;
}
pre code { background: none; padding: 0; border: 0; font-size: 1em; }

/* ============ tabelle ============ */

.table-wrap {
  overflow-x: auto; margin: 0 0 1.6rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--shadow);
}
table { border-collapse: collapse; width: 100%; font-size: .945rem; }
caption {
  caption-side: bottom; text-align: left;
  font-size: .855rem; color: var(--text-dim);
  padding: .75rem 1rem; border-top: 1px solid var(--rule-soft);
}
th, td { text-align: left; padding: .72rem 1rem; vertical-align: top; }
thead th {
  font-size: .78rem; font-weight: 660; letter-spacing: .045em; text-transform: uppercase;
  color: var(--text-dim); background: var(--bg-soft);
  border-bottom: 1px solid var(--rule);
}
tbody tr + tr td { border-top: 1px solid var(--rule-soft); }
tbody tr:hover { background: var(--bg-soft); }
td strong { white-space: normal; }
.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-us { background: var(--accent-lo); }
.row-us:hover { background: var(--accent-lo); }

/* ============ blocchi che portano il peso del sito ============ */

/* I riquadri-prova sono composti come voci di un referto: filetto netto in
   alto, nessuna barra colorata di lato, angoli quasi vivi. Il prodotto
   produce referti, e la pagina si comporta di conseguenza. */
.proof {
  border: 1px solid var(--rule);
  border-top: 2px solid var(--text);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--bg);
  padding: 1.15rem 1.3rem 1.3rem;
  margin: 0;
}
.proof > :last-child { margin-bottom: 0; }
.proof p, .proof li { max-width: 58ch; }
.proof h3 { margin-top: 0; margin-bottom: .6rem; }
.proof ul { margin-bottom: .8rem; }

.proof-grid { display: grid; gap: 1.1rem; margin: 0 0 1.8rem; }
@media (min-width: 62rem) {
  .proof-grid { grid-template-columns: 1fr 1fr; }
  /* tre riquadri in due colonne: l'ultimo prende tutta la riga invece di
     restare spaiato a meta' larghezza */
  .proof-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .proof-grid > :last-child:nth-child(odd) p { max-width: 66ch; }
}

/* Le condizioni in cui un numero e' stato misurato. Mai separarle dal numero. */
.caveat {
  font-size: .885rem; line-height: 1.55; color: var(--text-dim);
  border-left: 3px solid var(--rule); padding: .3rem 0 .3rem .9rem;
  margin: -.4rem 0 1.4rem; max-width: 72ch;
}
.proof .caveat { margin-bottom: 0; }

.callout {
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.05rem 1.2rem; margin: 0 0 1.5rem; background: var(--bg-soft);
}
.callout > :last-child { margin-bottom: 0; }
.callout h3 { margin-top: 0; }
.callout.warn   { background: var(--warn-lo); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }
.callout.danger { background: var(--err-lo);  border-color: color-mix(in srgb, var(--err) 32%, transparent); }
.callout.good   { background: var(--ok-lo);   border-color: color-mix(in srgb, var(--ok) 32%, transparent); }

/* numeri misurati */
.measured { font-family: var(--mono); font-weight: 620; font-variant-numeric: tabular-nums; }
.verdict-ok   { color: var(--ok);   font-weight: 660; }
.verdict-warn { color: var(--warn); font-weight: 660; }
.verdict-err  { color: var(--err);  font-weight: 660; }
/* Le date di verifica sono lunghe: nowrap le faceva sforare dal viewport
   su schermo stretto e mandava in scroll orizzontale tutta la pagina. */
.checked { font-size: .8rem; color: var(--text-dim); }

/* riquadri con un numero grande */
.stats { display: grid; gap: 1rem; margin: 0 0 1.8rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.stat {
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.05rem 1.15rem; background: var(--bg); box-shadow: var(--shadow);
}
.stat .n {
  display: block; font-family: var(--mono); font-weight: 680;
  font-size: 1.65rem; line-height: 1.15; letter-spacing: -.02em;
  color: var(--accent); font-variant-numeric: tabular-nums; margin-bottom: .3rem;
}
.stat .k { display: block; font-size: .885rem; color: var(--text-mid); line-height: 1.45; }

/* passi numerati */
.steps { list-style: none; padding: 0; counter-reset: s; margin: 0 0 1.8rem; }
.steps > li {
  counter-increment: s; position: relative;
  padding: 0 0 1.35rem 3.1rem; margin: 0;
  border-left: 2px solid var(--rule); margin-left: 1.05rem;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(s);
  position: absolute; left: -1.06rem; top: -.15rem;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  display: grid; place-items: center;
  font: 650 .92rem/1 var(--mono); color: #fff;
  background: linear-gradient(160deg, var(--brand-2), var(--brand-1));
  box-shadow: var(--shadow);
}
.steps > li > strong { display: block; margin-bottom: .2rem; font-size: 1.03rem; }

/* elenchi con segno di spunta o di divieto */
.ticks, .crosses { list-style: none; padding: 0; }
.ticks > li, .crosses > li { position: relative; padding-left: 1.7rem; }
.ticks > li::before   { content: "\2713"; position: absolute; left: 0; color: var(--ok);  font-weight: 700; }
.crosses > li::before { content: "\2715"; position: absolute; left: 0; color: var(--err); font-weight: 700; }

/* richiami di navigazione a fine pagina */
.next {
  display: grid; gap: .9rem; margin: 2.6rem 0 0;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.next a {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: .95rem 1.1rem; background: var(--bg); box-shadow: var(--shadow);
}
.next a:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.next .t::after { content: " \2192"; opacity: .5; }
.next a:hover .t::after { opacity: 1; }
.next .t { display: block; font-weight: 650; color: var(--accent); margin-bottom: .18rem; }
.next .d { display: block; font-size: .89rem; color: var(--text-dim); line-height: 1.45; }

/* prezzi */
.tiers { display: grid; gap: 1.2rem; margin: 0 0 1.8rem; }
@media (min-width: 48rem) { .tiers { grid-template-columns: 1fr 1fr; } }
.tier {
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.4rem 1.45rem; background: var(--bg); box-shadow: var(--shadow);
}
.tier.hi { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.tier h3 { margin: 0 0 .15rem; font-size: 1.22rem; }
.tier .price { font-family: var(--mono); font-size: 1.5rem; font-weight: 680; letter-spacing: -.02em; margin: .35rem 0 .1rem; }
.tier .price small { font-family: var(--sans); font-size: .82rem; font-weight: 400; color: var(--text-dim); letter-spacing: 0; }
.tier ul { margin: 1rem 0 0; }

/* piede */
.site-foot {
  border-top: 2px solid var(--text);
  background: var(--bg-soft);
  padding: 2.5rem 1.5rem 3rem;
  font-size: .93rem; color: var(--text-dim);
}
.foot-cols { display: grid; gap: 1.6rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin-bottom: 1.9rem; }
.foot-cols h2 { font-size: .78rem; font-weight: 660; letter-spacing: .06em; text-transform: uppercase; color: var(--text); margin: 0 0 .6rem; }
.foot-cols ul { list-style: none; padding: 0; margin: 0; }
.foot-cols li { margin-bottom: .38rem; }
.foot-cols a { color: var(--text-mid); text-decoration: none; }
.foot-cols a:hover { color: var(--accent); text-decoration: underline; }
.site-foot .tagline { color: var(--text); font-weight: 500; max-width: 40ch; }
.site-foot .fine { font-size: .845rem; margin: 0; max-width: 78ch; line-height: 1.6; }
.foot-bar { border-top: 1px solid var(--rule); padding-top: 1.3rem; }

/* ============ stampa ============ */

@media print {
  .site-head, .skip, .next { display: none; }
  body { font-size: 10.5pt; color: #000; background: #fff; }
  a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .82em; color: #444; }
  .hero { background: none; padding: 0; margin: 0 0 1.5rem; border: 0; }
  pre, .proof, .callout, .table-wrap, .stat { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
}

/* ============ figure, diagrammi, grafici ============
   Gli SVG sono scritti in linea nell'HTML: la CSP vieta risorse esterne,
   e in linea ereditano il tema del documento invece di ignorarlo. */

figure { margin: 0 0 1.8rem; }
figure svg { display: block; width: 100%; height: auto; }
figcaption {
  font-size: .865rem; color: var(--text-dim); line-height: 1.55;
  margin-top: .7rem; max-width: 62ch;
}

.diagram {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
  padding: 1.4rem 1.3rem; box-shadow: var(--shadow);
}

/* colori dei diagrammi, agganciati al tema */
.d-card   { fill: #0a0e14; }
.d-chip   { fill: var(--brand-2); }
.d-box    { fill: var(--bg); stroke: var(--rule); stroke-width: 1.5; }
.d-box-hi { fill: var(--accent-lo); stroke: var(--accent); stroke-width: 1.5; }
.d-line   { stroke: var(--accent); stroke-width: 2.5; fill: none; }
.d-line-b { stroke: var(--text-dim); stroke-width: 2; fill: none; stroke-dasharray: 6 5; }
.d-fill   { fill: var(--accent); }
.d-dim    { fill: var(--text-dim); }
.d-txt    { fill: var(--text); font: 600 13px var(--sans); }
.d-txt-s  { fill: var(--text-dim); font: 500 11.5px var(--sans); }
.d-num    { fill: var(--text); font: 650 13px var(--mono); }

/* barre dei grafici */
.bar     { fill: var(--accent); }
.bar-alt { fill: var(--brand-2); opacity: .55; }
.bar-bg  { fill: var(--bg-inset); }
.axis    { stroke: var(--rule); stroke-width: 1; }

/* finestra del Finder simulata */
.finder {
  border: 1px solid var(--rule); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow-lg); background: var(--bg); margin: 0 0 .7rem;
}
.finder-bar {
  display: flex; align-items: center; gap: .45rem;
  padding: .6rem .8rem; background: var(--bg-inset);
  border-bottom: 1px solid var(--rule);
}
.finder-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--rule); display: block; }
.finder-bar span { font-size: .8rem; color: var(--text-dim); margin-left: .4rem; }
.finder-body { padding: .55rem .35rem; }
.finder-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .42rem .7rem; border-radius: 7px; font-size: .9rem;
}
.finder-row + .finder-row { margin-top: .1rem; }
.finder-row.bad  { background: var(--err-lo); color: var(--err); font-weight: 620; }
.finder-row.good { background: var(--ok-lo);  color: var(--ok);  font-weight: 620; }
.finder-row .nm { font-family: var(--mono); font-size: .84rem; overflow-wrap: anywhere; }
.finder-row svg { width: 18px; height: 18px; flex: none; }

/* blocco di terminale con barra */
.term { margin: 0 0 1.5rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); box-shadow: var(--shadow); }
.term-bar {
  display: flex; align-items: center; gap: .45rem;
  padding: .55rem .8rem; background: var(--bg-inset); border-bottom: 1px solid var(--rule);
  font: 500 .78rem var(--mono); color: var(--text-dim);
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); display: block; }
.term-bar span { margin-left: .4rem; }
.term pre { margin: 0; border: 0; border-radius: 0; box-shadow: none; }

/* apertura della home: il testo porta il peso, l'icona lo accompagna */
.hero.with-art { display: grid; gap: 1.8rem 3rem; align-items: start; }
@media (min-width: 54rem) {
  .hero.with-art { grid-template-columns: minmax(0, 1fr) auto; gap: 1.8rem 3rem; }
  .hero.with-art .art { order: 2; padding-top: .5rem; }
}
.hero .art img { display: block; width: 116px; height: 116px; border-radius: 24px; }
@media (min-width: 54rem) {
  .hero .art img { width: 168px; height: 168px; border-radius: 35px; }
  .hero.with-art h1 { font-size: clamp(2.2rem, 1.2rem + 3.2vw, 3.2rem); max-width: 16ch; }
}

/* riga di dati sotto l'apertura: fatti, non slogan */
.facts {
  display: flex; flex-wrap: wrap; gap: .7rem 2.2rem;
  margin: 1.8rem 0 0; padding-top: 1.3rem;
  border-top: 1px solid var(--rule);
  font: 500 .84rem/1.4 var(--mono); color: var(--text-dim);
  max-width: none; letter-spacing: -.01em;
}
.facts span { display: inline-flex; align-items: baseline; gap: .45rem; }
.facts b { color: var(--accent); font-weight: 680; font-size: 1.08rem; }

/* Titolo di un riquadro: ha il peso di un titolo ma NON e' una sezione del
   documento, quindi non e' un heading. Metterlo come <h3> creava un salto
   h1 -> h3 nella gerarchia. */
.callout-title {
  font-size: 1.13rem; font-weight: 650; letter-spacing: -.012em;
  margin: 0 0 .5rem; color: var(--text); max-width: none;
}
.tier > h2 { font-size: 1.22rem; margin: 0 0 .15rem; padding-top: 0; border-top: 0; }

/* ============ richiamo all'azione ============
   Il badge dello Store e' l'asset ufficiale di Apple, servito da noi e mai
   ridisegnato: le Identity Guidelines lo richiedono, e le proporzioni
   (156x40) non vanno alterate. */

.cta {
  margin: 2rem 0 2.4rem;
  padding: 1.5rem 1.6rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-top: 3px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--accent-lo);
}
.cta > :last-child { margin-bottom: 0; }

.cta .badge {
  display: inline-block;
  /* spazio libero attorno al badge, come chiedono le linee guida Apple */
  padding: 4px; margin: 0 0 1rem -4px;
  border-radius: 9px; text-decoration: none;
}
.cta .badge img { display: block; width: 216px; height: auto; }
.cta .badge {
  transition: transform .12s ease;
}
.cta .badge:hover { transform: translateY(-1px); }
.cta .badge:focus-visible { outline-offset: 4px; }

.cta-note { font-size: .92rem; color: var(--text-mid); max-width: 56ch; margin-top: 1.1rem; }

.cta-soon {
  background: var(--bg-soft);
  border-color: var(--rule);
  border-top-color: var(--text);
  border-top-width: 2px;
}
.cta-head {
  font: 650 1.06rem/1.3 var(--sans); color: var(--text);
  margin: 0 0 .5rem; letter-spacing: -.012em;
}
.cta-soon p { max-width: 60ch; }

/* nell'apertura il richiamo sta piu' stretto al testo */
.hero .cta { margin: 1.6rem 0 0; }
