/* Stile del sito di Citadel. Solo valori da tokens.css e brand.css (tema scuro, colori del logo). */

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

html { background: var(--bg); color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: var(--radius-sm); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--space-4); }

/* Testata */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 60px; }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.brand img { height: 32px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: var(--space-5); font-size: var(--text-sm); }
.site-nav a { color: var(--ink-dim); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.lang-switch { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 2px var(--space-2); font-size: var(--text-xs); letter-spacing: .04em; }

/* Sezioni */
main section { padding: var(--space-8) 0; border-bottom: 1px solid var(--border); }
main section:last-child { border-bottom: 0; }
.kicker { margin: 0 0 var(--space-2); color: var(--accent-text); font-size: var(--text-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; font-weight: 650; }
h2 { font-size: var(--text-3xl); margin-bottom: var(--space-4); text-wrap: balance; }
/* Titoli di due frasi: ognuna sulla sua riga, si va a capo solo al punto */
h1 .sentence, h2 .sentence { display: block; }
h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
p { margin: 0 0 var(--space-4); color: var(--ink-dim); }
p strong, li strong { color: var(--ink); font-weight: 600; }
.lead { font-size: var(--text-lg); }

/* Colonna unica: testo, poi diagramma o esempio sotto, alla stessa larghezza */
.split { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
.split > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); margin-top: var(--space-6); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-5); margin-top: var(--space-6); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-5); }
.card p { margin: 0; font-size: var(--text-sm); }
.facts { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.facts li { padding-left: var(--space-5); position: relative; color: var(--ink-dim); }
.facts li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 2px; border: 1.5px solid var(--primary); }

/* Apertura */
#hero { padding: var(--space-8) 0; }
#hero h1 { font-size: var(--text-5xl); line-height: 1.06; letter-spacing: -.03em; text-wrap: balance; margin-bottom: var(--space-5); }
#hero .lead { margin-bottom: var(--space-6); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.btn-primary, .btn-secondary { display: inline-flex; align-items: center; padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 600; text-decoration: none; }
.btn-primary { background: var(--brand-gradient); color: var(--on-primary); }
.btn-primary:hover { background: var(--brand-fill-hover); color: var(--on-primary); }
.btn-secondary { border: 1px solid var(--border-strong); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-dim); color: var(--ink); }
.meta { color: var(--ink-dim); font-size: var(--text-xs); font-family: var(--font-mono); }

/* Motivo a celle */
.cells svg { width: 100%; height: auto; display: block; }
.cells.small { width: 100%; max-width: 320px; margin: 0 auto; }
.cells.hero-map { width: 100%; max-width: 680px; margin: 0 auto; }
.cells .cell { fill: var(--surface); stroke: var(--border-strong); }
.cells .cell-app { fill: var(--primary-soft); stroke: var(--accent); stroke-width: 1.5; }
.cells .label { fill: var(--ink); font-family: var(--font-mono); font-size: 11px; }
.cells .label-faint { fill: var(--ink-dim); font-family: var(--font-mono); font-size: 10px; }
.cells .blocked { stroke: var(--error); stroke-width: 1.5; fill: none; }
.cells .blocked-dash { stroke: var(--error); stroke-width: 1.5; stroke-dasharray: 3 3; fill: none; }
.cells .allowed { stroke: var(--ok); stroke-width: 1.5; fill: none; }
.cells .edge { fill: var(--surface-2); stroke: var(--border-strong); }

/* Esempi da terminale */
.split .example { margin-top: 0; }
.example { margin-top: var(--space-6); }
.example-caption { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-xs); color: var(--ink-dim); margin-bottom: var(--space-2); font-family: var(--font-mono); }
.term {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--ink-dim);
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
}
.term .cmd { color: var(--ink); }
.term .ok { color: var(--ok); }
.term .no { color: var(--error); }
.term .host { color: var(--primary); }

/* Prossimi sviluppi e prova */
.roadmap { list-style: none; padding: 0; margin: var(--space-6) 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3) var(--space-5); }
.roadmap li { border-left: 2px solid var(--primary); padding-left: var(--space-4); color: var(--ink-dim); }
.roadmap li strong { display: block; color: var(--ink); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: var(--space-6) 0; display: grid; gap: var(--space-4); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: var(--space-3); color: var(--ink-dim); }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: var(--text-xs); color: var(--ink); font-family: var(--font-mono); }
.licenses { font-size: var(--text-sm); color: var(--ink-dim); margin-top: var(--space-5); }

/* Piede */
.site-footer { border-top: 1px solid var(--border); padding: var(--space-6) 0; color: var(--ink-dim); font-size: var(--text-xs); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); }
.site-footer p { margin: 0; color: var(--ink-dim); }

@media (max-width: 860px) {
  .grid-2, .grid-3, .roadmap { grid-template-columns: 1fr; }
  #hero h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  main section { padding: var(--space-7) 0; }
}
@media (max-width: 520px) {
  .site-nav .nav-extra { display: none; }
  .term { padding: var(--space-3) var(--space-4); font-size: var(--text-xs); }
}

/* Mappa dell'apertura: fuori e dentro l'azienda */
.hero-map .zone-label { fill: var(--ink-dim); font-family: var(--font-sans); font-size: 9px; font-weight: 600; letter-spacing: .08em; }
.hero-map .ext { fill: none; stroke: var(--border-strong); stroke-width: 1.2; stroke-dasharray: 4 3; }
.hero-map .ext-label { fill: var(--ink-dim); font-family: var(--font-mono); font-size: 10px; }
.hero-map .infra { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.hero-map .citadel-layer { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.hero-map .layer-label { fill: var(--ink); font-family: var(--font-sans); font-size: 13px; font-weight: 650; }
.hero-map .flow { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.hero-map .flow-head { fill: var(--accent); }
.hero-map .flow-label { fill: var(--accent-text); font-family: var(--font-mono); font-size: 10px; }
.hero-map .cell-label { fill: var(--ink); font-family: var(--font-mono); font-size: 10px; }
.hero-map .cell-note { fill: var(--accent-text); font-family: var(--font-mono); font-size: 9px; }
.hero-map .ext-note { fill: var(--ink-dim); font-family: var(--font-sans); font-size: 9px; }
.hero-map .leak { fill: none; stroke: var(--error); stroke-width: 1.4; stroke-dasharray: 3 3; }
.hero-map .leak-head { fill: var(--error); }
.hero-map .leak-label { fill: var(--error); font-family: var(--font-mono); font-size: 10px; }
.hero-map .data { fill: var(--surface-2); stroke: var(--border-strong); }
.hero-map .data-label { fill: var(--ink); font-family: var(--font-mono); font-size: 10px; }
