/* GreenLog: token e componenti condivisi da index.html e brand.html.
   La fonte dei valori è DESIGN.md nella radice del repo. */

:root {
  /* colore */
  --brand: #238A51;        /* il verde del logo, misurato sul file originale. 4,35:1 su bianco: non per testo piccolo */
  --brand-ink: #1A6B3F;    /* verde per testo e bottoni: 6,52:1 su bianco */
  --brand-ink-hover: #145633;
  --brand-tint: #EEF5F0;
  --canvas: #FBFBFA;
  --surface: #FFFFFF;
  --band: #F3F5F2;
  --ink: #17201B;
  --ink-2: #454E49;
  --muted: #69716C;        /* 4,85:1 su canvas, 4,54:1 su brand-tint: il limite per testo piccolo */
  --line: #E4E7E3;
  --line-strong: #C9CFCA;
  --amber-bg: #FBF1DA;
  --amber-ink: #8A5A00;

  /* tipografia */
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* forma e movimento */
  --r-card: 10px;
  --r-btn: 6px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

a { color: var(--brand-ink); text-underline-offset: 3px; }
a:hover { color: var(--brand-ink-hover); }
::selection { background: #CFE6D7; color: var(--ink); }

:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: clamp(20px, 4vw, 40px); }

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* link per saltare la navigazione, visibile solo da tastiera */
.skip { position: absolute; left: 16px; top: -64px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-btn); text-decoration: none; font-size: 15px; }
.skip:focus { top: 12px; }
.skip:hover, .skip:focus { color: #fff; }

/* bottoni: raggio 6px, niente pillole, niente ombre */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--r-btn); border: 1px solid transparent;
  font: 500 16px/1 var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand-ink); color: #fff; }
.btn-primary:hover { background: var(--brand-ink-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn span { transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .btn:hover span { transform: translateX(3px); } }

/* link alle slide di presentazione, nell'header di ogni pagina */
.deck-link { display: inline-flex; align-items: center; gap: 7px; }
.deck-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (max-width: 420px) { .back.deck-link span { display: none; } }

/* cifre grandi: Plex Sans con cifre tabellari. Il mono resta per etichette, id e codice,
   perché in corpo grande la virgola monospazio apre un buco ("55 , 7%"). */
.display-num { font-family: var(--sans); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.035em; line-height: 1.05; }

.tag {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px;
  border-radius: 999px; font: 500 12px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase;
}
.tag-green { background: var(--brand-tint); color: var(--brand-ink); }
.tag-amber { background: var(--amber-bg); color: var(--amber-ink); }

/* cornice per gli screenshot della dashboard */
.frame {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
}
.frame-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.frame-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.frame-bar span { margin-left: 10px; font: 12px/1 var(--mono); color: var(--muted); }

/* ingresso allo scroll: solo se JS è attivo e il movimento è consentito */
.js .reveal { opacity: 0; }
.js .reveal.is-in { opacity: 1; transition: opacity 480ms var(--ease-out); transition-delay: var(--d, 0ms); }
/* lo spostamento solo se il movimento è consentito; con "riduci movimento" resta la dissolvenza */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { transform: translateY(12px); }
  .js .reveal.is-in { transform: none; transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out); transition-delay: var(--d, 0ms); }
}
