/* KeywordSkout - sistema visivo (rif. riferimenti/stile.png, piano B5.1)
   Nessuna risorsa esterna: font locali, icone SVG inline, grafici SVG a mano. */

@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f2f3;
  --dot: #e4e4e7;
  --card: #ffffff;
  --line: #ebebed;
  --nest: #f7f7f8;
  --ink: #151518;
  --ink-soft: #6b6b73;
  --dark: #0b0b0c;
  --dark-nest: #161618;
  --blue: #45a6f5;
  --grey-bar: #8e8e93;
  --green: #34c759;
  --green-soft: #5cc98c;
  --orange: #e8872f;
  --violet: #7c3aed;
  --chip-bg: #e8f0fe;
  --chip-ink: #2563eb;
  --note: #f6d56f;
  --note-head: #f9e4a4;
  --note-ink: #3b3310;
  --note-title: #6b5a12;
  --r-card: 28px;
  --r-nest: 18px;
  --r-dark-nest: 22px;
  --pad: 32px;
  --measure: 68ch;
}

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

html[data-lang="it"] .l-en,
html[data-lang="en"] .l-it {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.1px);
  background-size: 13px 13px;
  font-family: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3 {
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0;
}

a {
  color: var(--chip-ink);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 20;
  background: var(--dark);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  text-decoration: none;
}
.skip:focus {
  left: 0.75rem;
}

.wrap {
  width: min(1180px, 100% - 3rem);
  margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header {
  padding-block: 1.5rem 0.5rem;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.7rem 0.55rem 1.35rem;
  box-shadow: 0 1px 2px rgba(11, 11, 12, 0.04);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}
.site-nav a:hover {
  color: var(--ink);
  background: var(--nest);
}
.lang-switch {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--nest);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  cursor: pointer;
  margin-left: 0.3rem;
}
.lang-switch:hover {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

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

.hero {
  padding-block: 2.5rem 1rem;
}
.hero-intro {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}
.hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1.1rem;
}
.hero .lead {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 1.3rem;
}
.hero .note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--chip-ink);
  background: var(--chip-bg);
  border-radius: 999px;
  padding: 0.45rem 1rem 0.45rem 0.8rem;
  margin: 0;
}
.hero .note svg {
  flex: none;
}

/* ---------- Griglia dashboard ---------- */

.sample-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
}
.sample-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: repeating-linear-gradient(45deg, var(--orange) 0 2px, transparent 2px 4px);
  flex: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--pad);
  box-shadow: 0 1px 2px rgba(11, 11, 12, 0.04);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.3rem;
}
.card-head h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.card-kicker {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 0.2rem;
  font-weight: 500;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  white-space: nowrap;
}
.round-btn {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
}
.btn-row {
  display: flex;
  gap: 0.45rem;
}

.big-number {
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.big-number .unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}
.delta {
  font-size: 1rem;
  font-weight: 600;
  color: var(--green);
  letter-spacing: -0.02em;
}

.dashed-rule {
  border: 0;
  border-top: 1.5px dashed var(--line);
  margin: 1.4rem 0;
}

/* Card 1: ricerche recenti */
.row-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.row-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--nest);
  border-radius: var(--r-nest);
  padding: 0.75rem 0.9rem;
}
.datetile {
  display: block;
  flex: none;
  width: 46px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  padding: 0.3rem 0 0.35rem;
  line-height: 1.15;
}
.datetile .m {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.datetile .d {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.row-main {
  display: block;
  min-width: 0;
  flex: 1;
}
.row-main .t {
  display: block;
}
.row-main .t {
  display: block;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--chip-ink);
  background: var(--chip-bg);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  margin-top: 0.25rem;
}
.chip svg {
  flex: none;
}

/* Card 2: volume medio + barra divisa */
.split-bars {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 0.9rem;
}
.bar-block .bar-label {
  font-size: 0.9rem;
  font-weight: 600;
  border-left: 2px solid var(--green-soft);
  padding-left: 0.6rem;
  line-height: 1.3;
}
.bar-block.orange .bar-label {
  border-left-color: var(--orange);
}
.bar-block .bar-value {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-soft);
}
.bar {
  display: block;
  height: 62px;
  border-radius: 10px;
  margin-top: 0.6rem;
  background: repeating-linear-gradient(
    -45deg,
    var(--green-soft) 0 7px,
    #eaf7ef 7px 14px
  );
  border: 1px solid var(--green-soft);
}
.bar.short {
  height: 62px;
  margin-top: 2.1rem;
  background: var(--orange);
  border-color: var(--orange);
}

/* Card 3: scura, barre a trattini */
.card.dark {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.card.dark .card-head h3 {
  color: #fff;
}
.card.dark .pill {
  background: var(--dark-nest);
  border-color: #2a2a2e;
  color: #d9d9de;
}
.panel {
  background: var(--dark-nest);
  border-radius: var(--r-dark-nest);
  padding: 1.1rem 1.2rem 0.9rem;
  margin-top: 1.3rem;
}
.dash-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 132px;
}
.dash-col {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  align-items: stretch;
}
.dash-col i {
  display: block;
  height: 5px;
  border-radius: 2px;
  background: var(--blue);
}
.dash-col.muted i {
  background: var(--grey-bar);
  opacity: 0.55;
}
.dash-legend {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.72rem;
  color: #9a9aa1;
  font-weight: 500;
}
.dash-legend li {
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Card 4: nota gialla */
.card.note-card {
  background: var(--note);
  border-color: #e9c65c;
  color: var(--note-ink);
  padding: 0;
  overflow: hidden;
}
.note-head {
  background: var(--note-head);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--pad);
}
.note-head h3 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--note-title);
}
.note-body {
  padding: 1.4rem var(--pad) var(--pad);
}
.note-body p {
  margin: 0 0 1.2rem;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.015em;
}
.note-btn {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--note);
  border: 1px solid #e6c85a;
  color: var(--note-title);
}
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
  font-weight: 500;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.checklist svg {
  flex: none;
}

/* Card 5: linea stagionale */
.line-chart svg {
  display: block;
  width: 100%;
  height: auto;
}
.months {
  display: flex;
  justify-content: space-between;
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-weight: 500;
}

/* Card 6: output ad albero */
.progress {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--nest);
  overflow: hidden;
  margin: 0.2rem 0 1.2rem;
}
.progress i {
  display: block;
  height: 100%;
  width: 72%;
  border-radius: 999px;
  background: var(--green);
}
.tree {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.35rem;
}
.tree li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.tree li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 50%;
  border-left: 1.5px solid var(--line);
  border-bottom: 1.5px solid var(--line);
  width: 1rem;
  border-bottom-left-radius: 8px;
}
.tree li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  bottom: 0;
  border-left: 1.5px solid var(--line);
}
.tree .n {
  color: var(--ink-soft);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ---------- Sezioni ---------- */

section.block {
  padding-block: 3.5rem 0;
}
.block-head {
  max-width: 44rem;
  margin-bottom: 1.6rem;
}
.block-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 700;
}
.block-head p {
  color: var(--ink-soft);
  margin: 0.7rem 0 0;
  max-width: var(--measure);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 1.7rem;
  box-shadow: 0 1px 2px rgba(11, 11, 12, 0.04);
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--nest);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}
.steps h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}
.steps p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.outputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}
.outputs .card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.outputs .card p {
  margin: 0;
  color: var(--ink-soft);
}
.outputs .tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}
.outputs .tag i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--blue);
  display: block;
}
.outputs .card:nth-child(2) .tag i {
  background: var(--violet);
}
.outputs .card:nth-child(3) .tag i {
  background: var(--orange);
}

.limits {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 2.5rem;
  align-items: start;
}
.limits ul {
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}
.limits li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  max-width: var(--measure);
}
.limits li svg {
  flex: none;
  margin-top: 0.28rem;
  color: var(--green);
}
.limits p:last-child {
  margin: 0;
  color: var(--ink-soft);
}

/* ---------- Pagine legali ---------- */

.doc {
  padding-block: 2rem 1rem;
}
.doc .card {
  padding: clamp(1.6rem, 4vw, 3.2rem);
  max-width: 54rem;
  margin-inline: auto;
}
.doc h1 {
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.doc .updated {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 2rem;
}
.doc h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2.6rem 0 0.7rem;
  padding-top: 1.5rem;
  border-top: 1.5px dashed var(--line);
}
.doc h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.6rem 0 0.4rem;
}
.doc p,
.doc li {
  max-width: var(--measure);
}
.doc ul {
  padding-left: 1.15rem;
}
.doc li + li {
  margin-top: 0.45rem;
}
.doc code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.9em;
  background: var(--nest);
  border-radius: 6px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

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

.site-footer {
  margin-top: 4rem;
  padding-block: 2rem 3rem;
}
.site-footer .inner {
  background: var(--dark);
  color: #d9d9de;
  border-radius: var(--r-card);
  padding: clamp(1.7rem, 3vw, 2.6rem);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2rem;
  font-size: 0.95rem;
}
.site-footer a {
  color: #fff;
}
.site-footer address {
  font-style: normal;
  line-height: 1.75;
}
.site-footer .company {
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.site-footer .links {
  display: flex;
  gap: 1.3rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-weight: 500;
}
.site-footer .tm {
  color: #9a9aa1;
  margin: 0;
  max-width: 50ch;
  font-size: 0.88rem;
  line-height: 1.55;
}

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

@media (max-width: 960px) {
  .grid,
  .outputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .limits {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .site-footer .inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --pad: 24px;
    --r-card: 24px;
  }
  .wrap {
    width: min(1180px, 100% - 2rem);
  }
  .grid,
  .outputs,
  .steps {
    grid-template-columns: 1fr;
  }
  .site-header .wrap {
    border-radius: 24px;
    padding: 0.8rem 0.9rem;
  }
  .site-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .big-number {
    font-size: 2.5rem;
  }
  .split-bars {
    grid-template-columns: 1fr 1fr;
  }
  .bar.short {
    margin-top: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
