/* Layout: editorial column on a cream "export document" page; tinted rounded panels carry each chapter, mono labels read like shipping paperwork. */
:root {
  --paper: #faf8f4;
  --surface: #fffdf9;
  --sand: #f1eae2;
  --blush: #f4e6e3;
  --sage: #e6ede4;
  --ink: #191714;
  --muted: #5a534c;
  --faint: #857d73;
  --line: #e2d9cc;
  --line-strong: #cfc4b4;
  --brand: #9e2f26;
  --brand-hover: #7e241d;
  --on-brand: #ffffff;
  --gold: #c99b4b;
  --jade: #3e7c6b;
  --deep: #1f1b18;
  --deep-ink: #f3ede4;
  --deep-muted: #b8afa3;
  --deep-line: #3a332d;
  --shadow: 0 1px 2px rgba(25, 23, 20, .04), 0 12px 32px rgba(25, 23, 20, .06);

  --f-display: "Newsreader", Georgia, "Times New Roman", serif;
  --f-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --f-hanzi: "Noto Serif SC", "Songti SC", "SimSun", serif;

  --wrap: 1184px;
  --radius: 20px;
  --radius-sm: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161311; --surface: #201c19; --sand: #26201b; --blush: #2a1f1d; --sage: #1d2420;
    --ink: #f3ede4; --muted: #c0b7ab; --faint: #948b80; --line: #352e28; --line-strong: #4a4139;
    --brand: #c4473b; --brand-hover: #d65a4d; --on-brand: #ffffff; --gold: #d4aa5e; --jade: #6fae9b;
    --deep: #0f0d0c; --deep-ink: #f3ede4; --deep-muted: #b8afa3; --deep-line: #2e2823;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161311; --surface: #201c19; --sand: #26201b; --blush: #2a1f1d; --sage: #1d2420;
  --ink: #f3ede4; --muted: #c0b7ab; --faint: #948b80; --line: #352e28; --line-strong: #4a4139;
  --brand: #c4473b; --brand-hover: #d65a4d; --on-brand: #ffffff; --gold: #d4aa5e; --jade: #6fae9b;
  --deep: #0f0d0c; --deep-ink: #f3ede4; --deep-muted: #b8afa3; --deep-line: #2e2823;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 4px; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--brand); color: var(--on-brand); }

/* bilingual content: both languages ship in the markup, the root lang picks one */
html[lang="it"] [data-l="en"], html[lang="en"] [data-l="it"] { display: none !important; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); display: flex; align-items: center; gap: 10px;
}
.eyebrow .mono { color: var(--faint); letter-spacing: .04em; text-transform: none; font-weight: 400; }
.h2 {
  font-family: var(--f-display); font-weight: 600; font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.08; letter-spacing: -.02em; text-wrap: balance;
}
.h2 em, .h1 em { font-style: italic; color: var(--brand); font-weight: 500; }
.rule { width: 56px; height: 2px; background: var(--brand); border: 0; margin: 0; }
.lede { color: var(--muted); max-width: 62ch; font-size: 17.5px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 12px 22px; border-radius: 10px;
  font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none;
  border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand);
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:active { transform: translateY(1px); }
.btn .arr { font-size: 17px; transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(3px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn small { font-family: var(--f-mono); font-weight: 400; font-size: 11.5px; opacity: .8; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--paper); /* riserva per browser senza color-mix */
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; min-width: 0; }
.brand-name { font-family: var(--f-display); font-weight: 600; font-size: 21px; letter-spacing: -.01em; white-space: nowrap; }
.brand-role { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--faint); letter-spacing: .04em; margin-top: 1px; }
.brand-text { line-height: 1.15; }
.nav { display: flex; gap: 22px; }
.nav a { text-decoration: none; font-size: 14.5px; font-weight: 500; color: var(--muted); padding-block: 8px; }
.nav a:hover { color: var(--brand); }
.lang {
  display: inline-flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
}
.lang button {
  border: 0; background: transparent; border-radius: 999px; padding: 5px 11px;
  font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--faint);
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- seal ---------- */
.seal { flex: none; display: block; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(32px, 5vw, 56px); overflow: hidden; overflow: clip visible; } /* hidden: riserva per Safari < 16 */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy { min-width: 0; display: grid; gap: 24px; }
.h1 {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(40px, 5.6vw, 68px); line-height: 1.02; letter-spacing: -.03em; text-wrap: balance;
}
.hero .lede { font-size: 18.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; }
.hero-meta { display: grid; gap: 6px; color: var(--faint); }
.hero-meta .open { color: var(--jade); display: flex; gap: 8px; align-items: baseline; }
.hero-meta .open::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; transform: translateY(-1px); }

.portrait { position: relative; justify-self: center; width: min(100%, 420px); isolation: isolate; }
.portrait::before {
  content: ""; position: absolute; z-index: -1; inset: 6% -8% 14% 8%;
  background: var(--sand); border-radius: 50%;
}
.portrait-frame {
  border-radius: 18px 18px 120px 18px; overflow: hidden; aspect-ratio: 4 / 5; max-width: 100%;
  background: var(--sand); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.portrait .seal { position: absolute; top: -18px; right: -14px; transform: rotate(4deg); filter: drop-shadow(0 6px 14px rgba(158, 47, 38, .25)); }
.route-tag {
  position: absolute; left: -28px; bottom: 28px; width: min(270px, 78%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 14px 16px 12px; transform: rotate(-2deg);
}
.route-tag .mono { color: var(--faint); font-size: 11px; display: flex; justify-content: space-between; gap: 8px; }
.route-tag strong { display: block; font-family: var(--f-display); font-size: 17px; font-weight: 600; margin: 6px 0 10px; line-height: 1.2; }
.codes { display: flex; flex-wrap: wrap; gap: 5px; }
.codes li {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500; padding: 2px 6px;
  border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted);
}
.codes li.hot { border-color: var(--brand); color: var(--brand); }

/* ---------- manifest (numbers) ---------- */
.manifest { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line-strong); margin-top: clamp(40px, 6vw, 72px); }
.manifest-head { display: flex; justify-content: space-between; gap: 16px; padding-block: 10px; border-bottom: 1px solid var(--line); color: var(--faint); }
.manifest-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.manifest-item { padding: 20px 20px 22px 0; display: grid; gap: 6px; align-content: start; min-width: 0; }
.manifest-item + .manifest-item { border-left: 1px solid var(--line); padding-left: 20px; }
.manifest-item .mono { color: var(--faint); font-size: 11px; }
.num { font-family: var(--f-display); font-weight: 600; font-size: clamp(32px, 3.4vw, 42px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.num sup { font-size: .5em; color: var(--brand); vertical-align: .7em; margin-left: 1px; }
.manifest-item p { font-size: 14px; color: var(--muted); line-height: 1.45; }

/* ---------- panels / sections ---------- */
.section { padding-block: clamp(14px, 2vw, 22px); }
.panel { border-radius: var(--radius); padding: clamp(24px, 4.5vw, 64px); }
.panel-sand { background: var(--sand); }
.panel-blush { background: var(--blush); }
.panel-sage { background: var(--sage); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 44px); max-width: 760px; }

/* ---------- projects ---------- */
.projects { display: grid; gap: 20px; }
.case {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: clamp(22px, 3vw, 36px); display: grid; gap: 22px; min-width: 0;
}
.case-top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.case-kind { font-family: var(--f-mono); font-size: 11.5px; color: var(--brand); letter-spacing: .04em; text-transform: uppercase; }
.status {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-mono); font-size: 11.5px; color: var(--muted);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.status.live::before { background: var(--jade); }
.case h3 { font-family: var(--f-display); font-weight: 600; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.12; letter-spacing: -.015em; text-wrap: balance; }
.case-intro { color: var(--muted); max-width: 68ch; }
.case-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.case-body.media-right { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: start; }
.facts { display: grid; gap: 16px; }
.fact h4 { font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.fact p, .fact li { font-size: 15.5px; line-height: 1.55; }
.fact ul { display: grid; gap: 6px; }
.fact li { padding-left: 16px; position: relative; }
.fact li::before { content: ""; position: absolute; left: 0; top: .68em; width: 6px; height: 1px; background: var(--brand); }
.proves { border-top: 1px dashed var(--line-strong); padding-top: 14px; font-size: 15px; }
.proves b { color: var(--brand); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12.5px; padding: 4px 10px; border-radius: 6px; background: var(--blush); color: var(--ink); }
.panel-blush .tags li { background: var(--sand); }

/* pipeline diagram */
.pipeline { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); align-self: start; }
.pipeline-head { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--faint); }
.pipeline ol { display: grid; }
.step { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .t { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); }
.step b { font-weight: 600; font-size: 14.5px; display: block; line-height: 1.3; }
.step span.d { font-size: 13px; color: var(--muted); line-height: 1.4; display: block; }
.who { font-family: var(--f-mono); font-size: 10.5px; padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.who.ai { background: var(--sand); color: var(--muted); }
.who.human { background: var(--brand); color: var(--on-brand); }
.step.on { background: color-mix(in srgb, var(--sage) 70%, transparent); }
.step.on .t { color: var(--jade); }
.pipeline-foot { padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* market data strip in a case */
.datapoints { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.datapoints div { background: var(--paper); padding: 12px 14px; min-width: 0; }
.datapoints strong { display: block; font-family: var(--f-display); font-size: 24px; font-weight: 600; line-height: 1.1; font-variant-numeric: lining-nums; }
.datapoints span { font-size: 12.5px; color: var(--muted); line-height: 1.35; display: block; margin-top: 3px; }

/* versus bar (grafico a barre nelle card progetto) */
.versus { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--paper); display: grid; gap: 12px; }
.versus-row { display: grid; gap: 5px; }
.versus-row .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.versus-row .lbl .mono { color: var(--muted); font-size: 12px; }
.bar { height: 10px; border-radius: 3px; background: var(--sand); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--line-strong); border-radius: 3px; }
.bar i.us { background: var(--brand); min-width: 3px; }
.versus small { color: var(--faint); font-size: 12px; line-height: 1.4; }
.channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.channels li { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: var(--paper); font-size: 13.5px; line-height: 1.35; }
.channels li b { display: block; font-weight: 600; font-size: 14px; }
.channels li .hz { font-family: var(--f-hanzi); color: var(--brand); font-weight: 600; margin-left: 4px; }

/* screenshot */
.shot { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--paper); }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.shot-bar .mono { margin-left: 8px; color: var(--faint); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* tools: two smaller cards */
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.tool { gap: 18px; align-content: start; }
.tool h3 { font-size: 24px; }
.tool p { color: var(--muted); font-size: 15.5px; }
.mock { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 12px; overflow: hidden; }
.mock-caption { font-family: var(--f-mono); font-size: 10.5px; color: var(--faint); display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.col { background: var(--sand); border-radius: 8px; padding: 7px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.col > span { font-family: var(--f-mono); font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 7px; display: grid; gap: 3px; }
.kcard i { display: block; height: 6px; border-radius: 2px; background: var(--line-strong); }
.kcard i.w60 { width: 60%; } .kcard i.w80 { width: 80%; } .kcard i.w45 { width: 45%; }
.kcard em { font-style: normal; font-family: var(--f-mono); font-size: 9.5px; color: var(--faint); }
.kcard .pri { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); display: inline-block; margin-right: 4px; vertical-align: 1px; }
.kcard .pri.m { background: var(--gold); } .kcard .pri.l { background: var(--jade); }
.tasks { display: grid; gap: 0; font-family: var(--f-mono); font-size: 12px; }
.tasks li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px dashed var(--line); }
.tasks li:last-child { border-bottom: 0; }
.tasks .box { width: 13px; height: 13px; border: 1.5px solid var(--ink); border-radius: 2px; display: grid; place-items: center; font-size: 10px; line-height: 1; color: var(--paper); }
.tasks .done .box { background: var(--ink); }
.tasks .done .tx { text-decoration: line-through; color: var(--faint); }
.tasks .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks .tm { color: var(--faint); font-size: 11px; }
.sync { margin-top: 10px; display: flex; justify-content: space-between; gap: 8px; font-family: var(--f-mono); font-size: 10.5px; color: var(--jade); }

/* ---------- experience ---------- */
.timeline { display: grid; }
.job { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; padding-block: 28px; border-top: 1px solid var(--line-strong); }
.job:last-child { border-bottom: 1px solid var(--line-strong); }
.job-when { display: grid; gap: 6px; align-content: start; }
.job-when .mono { color: var(--ink); font-weight: 500; }
.job-when small { font-size: 13px; color: var(--faint); }
.job-main { display: grid; gap: 12px; min-width: 0; }
.job h3 { font-family: var(--f-display); font-size: 25px; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
.job h3 .co { color: var(--muted); font-weight: 500; }
.job ul { display: grid; gap: 7px; max-width: 74ch; }
.job li { padding-left: 18px; position: relative; color: var(--muted); font-size: 16px; }
.job li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 1px; background: var(--brand); }
.job li strong { color: var(--ink); font-weight: 600; }

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.skill { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: grid; gap: 14px; align-content: start; }
.skill h3 { font-family: var(--f-display); font-size: 22px; font-weight: 600; line-height: 1.15; }
.skill .mono { color: var(--brand); font-size: 11.5px; }
.skill ul { display: grid; gap: 0; }
.skill li { padding-block: 8px; border-bottom: 1px solid var(--line); font-size: 15px; display: flex; justify-content: space-between; gap: 12px; }
.skill li:last-child { border-bottom: 0; }
.skill li .mono { color: var(--faint); font-size: 11px; white-space: nowrap; }
.languages { margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.lang-card { border-top: 2px solid var(--ink); padding-top: 14px; display: grid; gap: 2px; }
.lang-card strong { font-family: var(--f-display); font-size: 22px; font-weight: 600; }
.lang-card > span { font-size: 14px; color: var(--muted); }
.lang-card > .mono { color: var(--brand); font-size: 12.5px; }

/* ---------- education ---------- */
.edu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 48px; }
.edu-list { display: grid; }
.edu-list li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--line-strong); }
.edu-list li:first-child { border-top: 1px solid var(--line-strong); }
.edu-list .mono { color: var(--faint); padding-top: 3px; }
.edu-list b { display: block; font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.edu-list div > span { font-size: 14px; color: var(--muted); }
.edu-col h3 { font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 12px; }
.award { margin-top: 20px; display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.award-mark { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--gold); display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; color: var(--gold); font-size: 18px; }
.award b { display: block; font-size: 15.5px; }
.award div > span { font-size: 14px; color: var(--muted); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.about-copy { display: grid; gap: 18px; }
.about-copy p { color: var(--muted); max-width: 62ch; }
.about-copy p.big { font-family: var(--f-display); font-size: clamp(22px, 2.2vw, 27px); line-height: 1.3; color: var(--ink); letter-spacing: -.01em; }
.principles { display: grid; gap: 14px; }
.principle { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.principle .ic { width: 36px; height: 36px; border-radius: 9px; background: var(--blush); display: grid; place-items: center; color: var(--brand); }
.principle b { display: block; font-size: 16px; margin-bottom: 2px; }
.principle p { font-size: 14.5px; color: var(--muted); line-height: 1.5; }

/* ---------- contact ---------- */
.contact { background: var(--deep); color: var(--deep-ink); border-radius: var(--radius); padding: clamp(28px, 5vw, 72px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(28px, 5vw, 64px); align-items: end; position: relative; overflow: hidden; }
.contact .eyebrow { color: #e0897e; }
.contact .h2 { color: var(--deep-ink); font-size: clamp(32px, 4.2vw, 52px); }
.contact .h2 em { color: #e0897e; }
.contact p { color: var(--deep-muted); max-width: 56ch; }
.contact-copy { display: grid; gap: 18px; }
.contact-actions { display: grid; gap: 12px; }
.contact .btn-ghost { color: var(--deep-ink); border-color: var(--deep-line); }
.contact .btn-ghost:hover { background: transparent; border-color: var(--deep-ink); }
.contact .btn { width: 100%; justify-content: space-between; }
.mailbox { display: flex; align-items: center; gap: 8px; border: 1px solid var(--deep-line); border-radius: 10px; padding: 6px 6px 6px 14px; min-width: 0; }
.mailbox a { font-family: var(--f-mono); font-size: 13.5px; color: var(--deep-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; user-select: all; }
.mailbox button { flex: none; border: 0; background: var(--deep-line); color: var(--deep-ink); border-radius: 7px; padding: 7px 12px; font-size: 13px; font-weight: 600; }
.mailbox button:hover { background: #4a4139; }
.contact-hanzi { position: absolute; right: clamp(16px, 4vw, 56px); top: clamp(16px, 3vw, 40px); font-family: var(--f-hanzi); font-size: 14px; letter-spacing: .5em; color: #6b625a; writing-mode: vertical-rl; }

/* ---------- footer ---------- */
.site-footer { padding-block: 28px calc(80px + env(safe-area-inset-bottom, 0px)); } /* spazio per il badge Netlify */
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; color: var(--faint); font-size: 13.5px; }
.footer-row a { color: var(--muted); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .rise.d1 { animation-delay: .08s; } .rise.d2 { animation-delay: .16s; } .rise.d3 { animation-delay: .24s; } .rise.d4 { animation-delay: .32s; }
  .stamp { animation: stamp .55s .5s cubic-bezier(.3, 1.6, .5, 1) both; }
  @keyframes rise { from { opacity: .001; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes stamp { from { opacity: .001; transform: rotate(4deg) scale(1.5); } to { opacity: 1; transform: rotate(4deg) scale(1); } }
}

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .manifest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manifest-item:nth-child(4) { border-left: 0; padding-left: 0; }
  .manifest-item:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 960px) {
  .nav { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { width: min(100%, 360px); margin-top: 12px; }
  .route-tag { left: -12px; }
  .case-body, .case-body.media-right, .tools, .skills, .edu, .about, .contact { grid-template-columns: 1fr; }
  .contact { align-items: start; }
  .contact-hanzi { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-row { gap: 10px; min-height: 64px; }
  .brand-role { display: none; }
  .brand .seal { width: 30px; height: 30px; }
  .brand-name { font-size: 18px; }
  .header-cv .long { display: none; }
  .manifest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manifest-item, .manifest-item + .manifest-item { border-left: 0; padding-left: 0; padding-right: 12px; border-top: 1px solid var(--line); }
  .manifest-item:nth-child(-n+2) { border-top: 0; }
  .manifest-item:nth-child(even) { border-left: 1px solid var(--line); padding-left: 16px; }
  .manifest-item:last-child { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
  .manifest-head span:last-child { display: none; }
  .job { grid-template-columns: 1fr; gap: 10px; padding-block: 22px; }
  .languages { grid-template-columns: 1fr; gap: 14px; }
  .datapoints { grid-template-columns: 1fr; }
  .channels { grid-template-columns: 1fr; }
  .step { grid-template-columns: 52px minmax(0, 1fr); }
  .step .who { grid-column: 2; justify-self: start; }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edu-list li { grid-template-columns: 76px minmax(0, 1fr); }
  .route-tag { left: -6px; bottom: 16px; }
  .portrait .seal { right: -4px; }
  .eyebrow { flex-wrap: wrap; gap: 2px 10px; }
}
@media (max-width: 400px) {
  .header-row { gap: 8px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 16px; white-space: normal; line-height: 1.1; }
  .lang button { padding-inline: 8px; }
  .header-cv { padding-inline: 12px; }
}

/* ---------- analisi di mercato: scheda sulla home ---------- */
.dossier {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: clamp(20px, 3vw, 40px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: clamp(22px, 3vw, 36px); text-decoration: none; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.dossier:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.dossier-body { display: grid; gap: 16px; align-content: start; min-width: 0; }
.dossier-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 11px; }
.dossier-meta > span { border: 1px solid var(--line-strong); border-radius: 4px; padding: 2px 7px; }
.dossier-meta > span:first-child { border-color: var(--brand); color: var(--brand); }
.dossier h3 { font-family: var(--f-display); font-weight: 600; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.1; letter-spacing: -.015em; text-wrap: balance; }
.dossier p { color: var(--muted); max-width: 60ch; }
.dossier-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dossier-figs div { background: var(--paper); padding: 12px 14px; min-width: 0; }
.dossier-figs strong { display: block; font-family: var(--f-display); font-size: 26px; font-weight: 600; line-height: 1.05; color: var(--brand); font-variant-numeric: lining-nums; }
.dossier-figs span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 4px; }
.dossier-cta { font-weight: 600; color: var(--brand); display: inline-flex; gap: 10px; align-items: center; }
.dossier .arr { transition: transform .2s ease; }
.dossier:hover .arr { transform: translateX(3px); }
.dossier-cover { align-self: center; justify-self: center; width: min(100%, 300px); }
.dossier-cover img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); box-shadow: var(--shadow); transform: rotate(2deg); }

/* ---------- progetti compatti ---------- */
.minis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.mini { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.mini h3 { font-family: var(--f-display); font-weight: 600; font-size: 21px; line-height: 1.2; text-wrap: balance; }
.mini p { color: var(--muted); font-size: 15px; line-height: 1.55; }

/* ---------- pagina analisi ---------- */
.back { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.back:hover { color: var(--brand); }
.note-lang { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 11px; white-space: nowrap; }
.an-hero { padding-block: clamp(36px, 6vw, 72px) clamp(24px, 4vw, 40px); display: grid; gap: 22px; }
.an-hero .h1 { font-size: clamp(36px, 5vw, 60px); max-width: 18ch; }
.an-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.an-meta span { font-family: var(--f-mono); font-size: 11.5px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 2px 8px; color: var(--muted); }
.verdict { border-left: 3px solid var(--brand); padding: 4px 0 4px 20px; max-width: 70ch; display: grid; gap: 10px; }
.verdict p { font-size: 18px; color: var(--ink); line-height: 1.6; }
.verdict .mono { color: var(--brand); }
.an-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line-strong); }
.an-figs > div { padding: 18px 18px 20px 0; display: grid; gap: 6px; align-content: start; min-width: 0; }
.an-figs > div + div { border-left: 1px solid var(--line); padding-left: 18px; }
.an-figs .mono { color: var(--faint); font-size: 11px; }
.an-figs p { font-size: 14px; color: var(--muted); line-height: 1.45; }
.an-figs .vs { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }

.carousel { display: grid; gap: 14px; min-width: 0; }
.carousel > * { min-width: 0; }
.car-track {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; border-radius: 14px; outline-offset: 4px;
}
.car-track::-webkit-scrollbar { display: none; }
.car-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; margin: 0; display: grid; place-items: center; }
.car-slide img { width: min(100%, 460px, calc((100vh - 220px) * .8)); height: auto; aspect-ratio: 1080 / 1350; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.car-controls { display: flex; align-items: center; justify-content: center; gap: 14px; }
.car-prev, .car-next {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 18px; display: grid; place-items: center; color: var(--ink);
}
.car-prev:hover:not(:disabled), .car-next:hover:not(:disabled) { border-color: var(--ink); }
.car-prev:disabled, .car-next:disabled { opacity: .35; cursor: default; }
.car-count { font-family: var(--f-mono); font-size: 13px; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.car-dots { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.car-dot { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; background: var(--line-strong); }
.car-dot[aria-current="true"] { background: var(--brand); width: 22px; border-radius: 4px; }
.car-hint { text-align: center; font-size: 13px; color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.an-figs .num small { font-size: .45em; }
.an-figs-note { font-size: 12.5px; color: var(--faint); margin-top: 10px; max-width: 90ch; }

/* corpo dell'analisi: articolo con grafici */
.an-sec { display: grid; gap: 22px; padding-block: clamp(28px, 4vw, 44px); border-top: 1px solid var(--line); min-width: 0; }
.an-sec:first-of-type { border-top: 0; padding-top: 0; }
.an-sec-text { display: grid; gap: 10px; max-width: 68ch; }
.an-sec-text .mono { color: var(--brand); font-size: 11.5px; }
.an-sec .h3 { font-family: var(--f-display); font-weight: 600; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; text-wrap: balance; }
.an-sec-text p { font-size: 17px; line-height: 1.65; }
.an-fig { display: grid; gap: 10px; min-width: 0; }
.an-fig img { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; border: 1px solid var(--line); background: #faf8f4; }
.an-fig-img { min-width: 0; }
.an-fig figcaption, .an-facts-src { font-size: 13px; color: var(--faint); max-width: 90ch; }
.an-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--ink); }
.an-facts > div { padding: 16px 18px 18px 0; display: grid; gap: 6px; align-content: start; min-width: 0; }
.an-facts > div + div { border-left: 1px solid var(--line); padding-left: 18px; }
.an-facts dt { font-family: var(--f-display); font-weight: 600; font-size: clamp(28px, 3vw, 36px); line-height: 1.05; color: var(--brand); }
.an-facts dd { margin: 0; font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.an-take { display: grid; gap: 14px; }
.an-take > p:not(.eyebrow) { max-width: 68ch; font-size: 18px; line-height: 1.65; }
.an-take .an-take-q { font-family: var(--f-display); font-style: italic; font-size: 22px; color: var(--brand); }
.an-take .an-take-src { font-size: 13px; color: var(--faint); }
.an-li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 20px; }
.an-li p { color: var(--muted); max-width: 62ch; }
.an-li .mono { color: var(--brand); font-size: 11.5px; margin-right: 8px; }

.points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.point { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.point .mono { color: var(--brand); font-size: 11.5px; }
.point h3 { font-family: var(--f-display); font-weight: 600; font-size: 22px; line-height: 1.2; }
.point p { color: var(--muted); font-size: 15.5px; }
.point.wide { grid-column: 1 / -1; }
.sources { display: grid; gap: 8px; font-size: 14px; color: var(--muted); max-width: 80ch; }
.sources li { padding-left: 16px; position: relative; }
.sources li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 1px; background: var(--brand); }
.sources a { color: var(--ink); }
.disclaimer { font-size: 13px; color: var(--faint); max-width: 80ch; }

@media (max-width: 960px) {
  .dossier { grid-template-columns: 1fr; }
  .dossier-cover { width: min(100%, 240px); order: -1; justify-self: start; }
  .an-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-figs > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .an-figs > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .an-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-facts > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .an-facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .minis, .points { grid-template-columns: 1fr; }
  .dossier-figs { grid-template-columns: 1fr; }
  .an-figs { grid-template-columns: 1fr; }
  .an-figs > div, .an-figs > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .an-figs > div:first-child { border-top: 0; }
  .an-fig-img { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
  .an-fig-img img { width: 640px; max-width: none; }
  .an-facts { grid-template-columns: 1fr; }
  .an-facts > div, .an-facts > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .an-facts > div:first-child { border-top: 0; }
  .dossier-cover { display: none; }
  .back { font-size: 18px; }
  .back .long, .note-lang { display: none; }
}

/* ---------- consenso e informativa ---------- */
.consent {
  position: fixed; z-index: 30; left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); /* sopra il badge Netlify (64px), che altrimenti copre i pulsanti */
  max-width: 760px; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow-y: auto; margin-inline: auto; padding: 16px 20px;
  display: grid; gap: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow);
}
.consent p { padding-right: 32px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.consent-x { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); }
.consent-x:hover { color: var(--ink); }
.consent-opts { display: grid; gap: 8px; font-size: 14px; line-height: 1.5; }
.consent-opts[hidden] { display: none; }
.consent-opts label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.consent-opts input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; }
.consent-actions .btn { min-width: 104px; }
.link-btn { border: 0; padding: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.legal { padding-block: 56px; max-width: 760px; }
.legal > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.legal h2 { font-family: var(--f-display); font-size: 24px; line-height: 1.2; margin-top: 16px; }
.legal ul { list-style: disc; padding-left: 20px; display: grid; gap: 6px; }
.legal p, .legal li { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .consent-actions .btn { flex: 1; min-width: 0; padding-inline: 8px; }
}
.legal-table { overflow-x: auto; }
.legal-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
