/* ==========================================================================
   Legal Eagles — sito istituzionale
   Mondo visivo: «L'Archivio Veneziano», lo stesso dell'applicazione
   (avvocati/DESIGN.md). Carta calda, inchiostro seppia, oro brunito riservato
   alle azioni, campi d'inchiostro per i passaggi decisivi.
   ========================================================================== */

/* ── Font (serviti in locale, nessuna chiamata a terzi) ── */
@font-face {
    font-family: "Fraunces";
    src: url("/fonts/fraunces.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Crimson Pro";
    src: url("/fonts/crimson-pro.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Crimson Pro";
    src: url("/fonts/crimson-pro-italic.woff2") format("woff2");
    font-weight: 400 600;
    font-style: italic;
    font-display: swap;
}

:root {
    /* Carta */
    --carta: #FAF6F0;
    --carta-2: #FFFCF5;
    --vellum: #FFFEF6;
    --carta-scura: #F3EAE0;
    --carta-piega: #E9DCC6;
    --bordo: #D8C8B0;
    --bordo-tenue: rgba(125, 101, 80, 0.22);
    /* Inchiostro */
    --inchiostro: #1F140D;
    --seppia: #4A3525;
    --seppia-morbida: #6B5341;
    --seppia-chiara: #7D6550;
    /* Accenti */
    --oro: #C4960C;
    --oro-luce: #D9A520;
    --oro-testo: #8A6508;
    --siena: #8B4513;
    --verde: #4A6B35;
    --rosso: #8B2020;
    --blu: #3A6B8C;
    /* Campi d'inchiostro */
    --campo: #1F140D;
    --campo-2: #2A1C13;
    --campo-testo: #F3EAE0;
    --campo-tenue: #C8B49A;
    --campo-bordo: rgba(243, 234, 224, 0.16);
    /* Tipografia */
    --f-display: "Fraunces", Georgia, "Times New Roman", serif;
    --f-testo: "Crimson Pro", Georgia, "Times New Roman", serif;
    /* Forma */
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 10px;
    --r-xl: 14px;
    --ombra-carta: 0 1px 1px rgba(31, 20, 13, 0.04), 0 10px 28px -12px rgba(31, 20, 13, 0.22);
    --ombra-alta: 0 2px 4px rgba(31, 20, 13, 0.05), 0 30px 60px -24px rgba(31, 20, 13, 0.35);
    --max: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
    --sezione: clamp(72px, 9vw, 128px);
    --header-h: 68px;

    /* Alias per stili inline preesistenti (guida all'installazione) */
    --gold: var(--oro-testo);
    --ink: var(--inchiostro);
    --iris: var(--siena);
    --iris-soft: var(--oro-luce);
    --line: var(--bordo);
    --muted: var(--seppia);
    --white: var(--carta);
    --radius-sm: var(--r-md);
    --radius-md: var(--r-xl);
    --radius-pill: 999px;
    --shadow-soft: var(--ombra-carta);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--f-testo);
    font-size: 1.1875rem;
    line-height: 1.55;
    color: var(--inchiostro);
    background: var(--carta);
    font-variant-numeric: oldstyle-nums proportional-nums;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    padding-top: var(--header-h);
}

::selection { background: rgba(196, 150, 12, 0.32); color: var(--inchiostro); }
.section--ink ::selection, .site-footer ::selection { background: rgba(217, 165, 32, 0.4); color: var(--carta); }

html { scrollbar-color: var(--bordo) var(--carta-scura); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--carta-scura); }
::-webkit-scrollbar-thumb { background: var(--bordo); border: 3px solid var(--carta-scura); border-radius: 10px; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration-color: var(--oro); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }

:focus-visible {
    outline: 2px solid var(--oro);
    outline-offset: 3px;
    border-radius: 3px;
}
.section--ink :focus-visible, .site-footer :focus-visible { outline-color: var(--oro-luce); }

input, textarea, select, button { font: inherit; color: inherit; }
button { cursor: pointer; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 200;
    background: var(--inchiostro); color: var(--carta); padding: 10px 16px; border-radius: var(--r-md);
    text-decoration: none; transition: top 160ms ease;
}
.skip-link:focus { top: 12px; }

code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.82em;
    background: var(--carta-scura);
    border: 1px solid var(--bordo-tenue);
    border-radius: 4px;
    padding: 0.05em 0.35em;
}

/* ── Tipografia ── */
h1, h2, h3, h4 {
    font-family: var(--f-display);
    font-optical-sizing: auto;
    font-weight: 560;
    color: inherit;
    letter-spacing: -0.015em;
    text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 1.4rem + 4.4vw, 4.9rem); line-height: 1.02; letter-spacing: -0.03em; font-weight: 520; }
h2 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.3rem); line-height: 1.06; letter-spacing: -0.025em; font-weight: 520; }
h3 { font-size: clamp(1.35rem, 1.15rem + 0.7vw, 1.7rem); line-height: 1.18; }
h4 { font-size: 1.15rem; line-height: 1.25; }
p { text-wrap: pretty; }

.lead {
    font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.45rem);
    line-height: 1.5;
    color: var(--seppia);
    max-width: 58ch;
}
.section--ink .lead { color: var(--campo-tenue); }

.small { font-size: 1rem; color: var(--seppia-morbida); }
em.accent { font-style: italic; color: var(--siena); }
.section--ink em.accent { color: var(--oro-luce); }

/* ── Struttura ── */
.wrap, .container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 860px; }

.section { padding: var(--sezione) 0; position: relative; }
.section:not(.section--ink):not(.section--sheet) + .section:not(.section--ink):not(.section--sheet) { padding-top: 0; }
.section--sheet { background: var(--carta-scura); border-top: 1px solid var(--bordo-tenue); border-bottom: 1px solid var(--bordo-tenue); }
.section--ink { background: var(--campo); color: var(--campo-testo); }

.head { max-width: 780px; margin-bottom: clamp(36px, 5vw, 64px); }
.head h2 + .lead, .head h2 + p { margin-top: 20px; }
.head--center { margin-left: auto; margin-right: auto; text-align: center; }
.head--center .lead { margin-left: auto; margin-right: auto; }

.rule { height: 1px; background: var(--bordo); border: 0; }

/* ── Etichette (stato, non kicker) ── */
.tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--f-testo); font-size: 0.95rem; font-weight: 600; line-height: 1;
    padding: 6px 11px 7px; border-radius: 999px;
    background: var(--carta-2); color: var(--seppia);
    border: 1px solid var(--bordo);
    white-space: nowrap;
    vertical-align: middle;
}
.tag svg { width: 14px; height: 14px; flex: none; }
.tag--collaudo { background: #F6EBD2; color: #6A4A06; border-color: #E2CB8E; }
.tag--nuovo { background: #E8EFE1; color: #3B5629; border-color: #C3D3B4; }
.tag--ink { background: transparent; color: var(--oro-luce); border-color: rgba(217, 165, 32, 0.45); }

/* ── Pulsanti ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 50px; padding: 12px 24px 13px;
    font-family: var(--f-testo); font-size: 1.125rem; font-weight: 600; line-height: 1.1;
    border-radius: var(--r-md); border: 1px solid transparent;
    text-decoration: none; white-space: nowrap;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--seal {
    background: var(--oro); color: var(--inchiostro);
    box-shadow: inset 0 -2px 0 rgba(31, 20, 13, 0.18), 0 6px 16px -8px rgba(122, 88, 4, 0.55);
}
.btn--seal:hover { background: var(--oro-luce); }
.btn--seal:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(31, 20, 13, 0.18); }
.btn--line { background: transparent; color: var(--inchiostro); border-color: var(--seppia-chiara); }
.btn--line:hover { background: var(--carta-2); border-color: var(--inchiostro); }
.section--ink .btn--line, .product--ink .btn--line, .site-footer .btn--line { color: var(--campo-testo); border-color: rgba(243, 234, 224, 0.45); }
.section--ink .btn--line:hover, .product--ink .btn--line:hover { background: rgba(243, 234, 224, 0.06); border-color: var(--campo-testo); }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.65; cursor: progress; }
.btn--full { width: 100%; }

.link-arrow {
    display: inline; font-weight: 600; color: var(--siena); text-decoration: underline;
    text-decoration-color: rgba(139, 69, 19, 0.35); text-decoration-thickness: 1px; text-underline-offset: 0.25em;
}
.link-arrow:hover { text-decoration-color: var(--siena); }
.link-arrow svg { display: inline-block; width: 16px; height: 16px; margin-left: 6px; vertical-align: -0.15em; transition: transform 180ms ease; }
.link-arrow:hover svg { transform: translateX(3px); }
.section--ink .link-arrow { color: var(--oro-luce); text-decoration-color: rgba(217, 165, 32, 0.4); }

/* ── Header ── */
.site-header {
    position: fixed; inset: 0 0 auto 0; z-index: 100;
    background: rgba(250, 246, 240, 0.94);
    border-bottom: 1px solid transparent;
    transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}
@supports (backdrop-filter: blur(1px)) {
    .site-header { background: rgba(250, 246, 240, 0.82); backdrop-filter: saturate(1.2) blur(12px); -webkit-backdrop-filter: saturate(1.2) blur(12px); }
}
.site-header.is-scrolled { border-bottom-color: var(--bordo-tenue); box-shadow: 0 8px 24px -20px rgba(31, 20, 13, 0.5); }
.site-header__bar {
    max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
    height: var(--header-h); display: flex; align-items: center; gap: 36px;
}
.site-header__logo { display: flex; align-items: center; flex: none; min-height: 44px; }
.site-header__logo img { height: 34px; width: auto; }
.site-header__nav { display: flex; gap: 6px; flex: 1; }
.site-header__nav a {
    position: relative; padding: 10px 12px; border-radius: var(--r-md);
    font-size: 1.08rem; font-weight: 500; color: var(--seppia); text-decoration: none;
}
.site-header__nav a:hover { color: var(--inchiostro); background: var(--carta-scura); }
.site-header__nav a[aria-current="page"] { color: var(--inchiostro); font-weight: 600; }
.site-header__nav a[aria-current="page"]::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 2px; background: var(--oro); border-radius: 2px;
}
.site-header__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.site-header__login {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
    font-weight: 600; font-size: 1.05rem; text-decoration: none; color: var(--inchiostro);
    border: 1px solid var(--seppia-chiara); border-radius: var(--r-md);
}
.site-header__login:hover { background: var(--carta-2); border-color: var(--inchiostro); }
.site-header__login svg { width: 16px; height: 16px; }
.site-header__burger {
    display: none; width: 44px; height: 44px; border: 1px solid var(--bordo); border-radius: var(--r-md);
    background: var(--carta-2); align-items: center; justify-content: center;
}
.site-header__burger svg { width: 22px; height: 22px; }
.site-header__burger .icon-close { display: none; }
.site-header__burger[aria-expanded="true"] .icon-open { display: none; }
.site-header__burger[aria-expanded="true"] .icon-close { display: block; }
.mobile-menu {
    display: none; border-top: 1px solid var(--bordo-tenue); background: var(--carta);
    padding: 8px var(--gutter) 20px;
}
.mobile-menu a {
    display: flex; align-items: center; min-height: 52px; font-size: 1.3rem; font-family: var(--f-display);
    color: var(--inchiostro); text-decoration: none; border-bottom: 1px solid var(--bordo-tenue);
}
.mobile-menu a[aria-current="page"] { color: var(--siena); }
.mobile-menu .mobile-menu__login { border-bottom: 0; margin-top: 14px; justify-content: center; font-family: var(--f-testo); font-weight: 600; font-size: 1.15rem; border: 1px solid var(--seppia-chiara); border-radius: var(--r-md); }
.mobile-menu.is-open { display: block; }

/* ── Footer (campo d'inchiostro) ── */
.site-footer { background: #170F09; color: var(--campo-tenue); padding: 72px 0 36px; font-size: 1.05rem; border-top: 1px solid var(--campo-bordo); }
.site-footer__grid {
    display: grid; grid-template-columns: minmax(260px, 1.4fr) 1fr 1fr; gap: 48px 40px;
    padding-bottom: 44px; border-bottom: 1px solid var(--campo-bordo);
}
.site-footer__brand img { height: 36px; width: auto; margin-bottom: 18px; }
.site-footer__brand p { max-width: 36ch; }
.site-footer__col h2 {
    font-family: var(--f-testo); font-size: 1.05rem; font-weight: 600; letter-spacing: 0; color: var(--campo-testo);
    margin-bottom: 10px;
}
.site-footer__col a {
    display: flex; align-items: center; min-height: 44px; color: var(--campo-tenue); text-decoration: none;
}
.site-footer__col a:hover { color: var(--campo-testo); text-decoration: underline; text-decoration-color: var(--oro-luce); }
.site-footer__legal { padding-top: 28px; display: flex; flex-wrap: wrap; gap: 6px 28px; justify-content: space-between; align-items: center; font-size: 0.98rem; }
.site-footer__legal p { margin: 0; }
.copy-email {
    position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
    background: none; border: 1px solid var(--campo-bordo); border-radius: var(--r-md); padding: 6px 14px;
    color: var(--campo-testo);
}
.copy-email:hover { border-color: rgba(243, 234, 224, 0.4); }
.copy-email svg { width: 16px; height: 16px; }
.copy-email__tip {
    position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px);
    background: var(--carta); color: var(--inchiostro); font-size: 0.9rem; padding: 4px 10px; border-radius: var(--r-sm);
    opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; white-space: nowrap;
}
.copy-email__tip.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ── Breadcrumb ── */
.breadcrumb {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 20px;
    color: var(--seppia); text-decoration: none; font-size: 1.05rem;
}
.breadcrumb:hover { color: var(--inchiostro); }
.breadcrumb svg { width: 16px; height: 16px; }

/* ==========================================================================
   HERO della piattaforma: il fascicolo come tesi
   ========================================================================== */
.hero { padding: clamp(40px, 6vw, 88px) 0 clamp(56px, 7vw, 104px); position: relative; overflow: hidden; }
.hero::before {
    /* righe di registro, appena percettibili */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: repeating-linear-gradient(to bottom, transparent 0 35px, rgba(125, 101, 80, 0.07) 35px 36px);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { max-width: 12ch; }
.hero .lead { margin-top: 24px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero__note { margin-top: 20px; font-size: 1.02rem; color: var(--seppia-morbida); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* Il foglio del fascicolo */
.sheet {
    position: relative;
    background: var(--vellum);
    border: 1px solid var(--bordo);
    border-radius: var(--r-xl);
    box-shadow: var(--ombra-alta);
    padding: 26px 28px 24px;
    font-size: 1.05rem;
}
.sheet::before, .sheet::after {
    /* fogli sottostanti */
    content: ""; position: absolute; inset: 0; border: 1px solid var(--bordo); border-radius: var(--r-xl);
    background: var(--carta-2); z-index: -1;
}
.sheet::before { transform: translate(10px, 10px) rotate(0.8deg); }
.sheet::after { transform: translate(20px, 18px) rotate(1.6deg); background: var(--carta-scura); z-index: -2; }
.sheet__meta {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
    padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--bordo-tenue);
    font-size: 0.98rem; color: var(--seppia-morbida);
}
.sheet__meta strong { color: var(--inchiostro); font-weight: 600; }
.sheet__q {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--carta-scura); border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 16px;
    color: var(--seppia);
}
.sheet__q svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--seppia-chiara); }
.sheet__a { line-height: 1.55; }
.sheet__a p + p { margin-top: 10px; }

.cite {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 26px; height: 22px; padding: 0 6px; margin: 0 2px; vertical-align: 0.12em;
    font-size: 0.82rem; font-weight: 700; line-height: 1;
    color: var(--blu); background: #E6EEF3; border: 1px solid #BFD1DD; border-radius: 6px;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
button.cite { cursor: pointer; position: relative; }
.cite, .source__n { font-variant-numeric: lining-nums tabular-nums; }
button.cite::after { content: ""; position: absolute; inset: -11px -9px; }
.cite:hover, .cite.is-active { background: var(--blu); color: #fff; border-color: var(--blu); }

.missing {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 1px 9px 2px; border-radius: 6px;
    color: var(--rosso); background: #F7E6E2; border: 1px dashed #D9A99F;
    font-weight: 600; font-size: 0.98rem; white-space: nowrap;
}
.missing svg { width: 14px; height: 14px; }

.sources { margin-top: 20px; border-top: 1px solid var(--bordo-tenue); padding-top: 12px; }
.sources__title { font-size: 0.95rem; font-weight: 600; color: var(--seppia-morbida); margin-bottom: 6px; }
.source {
    display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 9px 10px; margin: 0 -10px;
    border-radius: var(--r-md); transition: background-color 200ms ease, box-shadow 200ms ease;
}
.source__n { font-weight: 700; color: var(--blu); font-size: 0.95rem; padding-top: 1px; }
.source__doc { font-weight: 600; font-size: 1rem; }
.source__ref { font-size: 0.93rem; color: var(--seppia-morbida); }
.source__quote { display: block; margin-top: 4px; font-style: italic; color: var(--seppia); font-size: 0.98rem; }
.source.is-active { background: #F6EBD2; box-shadow: inset 0 0 0 1px #E2CB8E; }
.sheet__caption { margin-top: 30px; font-size: 0.95rem; color: var(--seppia-morbida); text-align: right; }

/* Indice interno della pagina */
.page-index { border-top: 1px solid var(--bordo-tenue); border-bottom: 1px solid var(--bordo-tenue); background: var(--carta-2); }
.page-index ul { list-style: none; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 6px 0; }
.page-index ul::-webkit-scrollbar { display: none; }
.page-index a {
    display: flex; align-items: center; min-height: 44px; padding: 0 14px; white-space: nowrap;
    color: var(--seppia); text-decoration: none; border-radius: var(--r-md); font-weight: 500;
}
.page-index a:hover { background: var(--carta-scura); color: var(--inchiostro); }

/* ── Le tre prove ── */
.proofs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--bordo); border-bottom: 1px solid var(--bordo); }
.proof { padding: 30px 28px 32px 0; }
.proof + .proof { padding-left: 28px; border-left: 1px solid var(--bordo); }
.proof__sample { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 30px; margin-bottom: 18px; font-size: 1rem; }
.proof__sample .cite { margin: 0; }
.proof__ref { color: var(--seppia-morbida); font-size: 0.95rem; }
.proof__sample del { color: #5E1A1A; background: #F7E6E2; text-decoration-color: rgba(139, 32, 32, 0.7); text-decoration-thickness: 2px; padding: 1px 6px; border-radius: 5px; }
.proof__sample ins { color: #2C4220; background: #E8EFE1; text-decoration: none; padding: 1px 6px; border-radius: 5px; }
.proof h3 { font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.55rem); }
.proof p { margin-top: 10px; color: var(--seppia); }

/* ==========================================================================
   Capitoli: testo + figura
   ========================================================================== */
.chapter { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.chapter--flip > :first-child { order: 2; }
.chapter__text h2 { margin-bottom: 20px; }
.chapter__status { margin: -6px 0 20px; }
.chapter__text > p { color: var(--seppia); max-width: 56ch; }
.chapter__text > p + p { margin-top: 14px; }
.chapter__figure { position: sticky; top: calc(var(--header-h) + 28px); }
.chapter__figure--center { position: static; align-self: center; }

/* Registro: elenco a righe */
.ledger { list-style: none; margin-top: 28px; border-top: 1px solid var(--bordo); }
.ledger li { display: grid; grid-template-columns: 26px 1fr; gap: 14px; padding: 16px 0 17px; border-bottom: 1px solid var(--bordo-tenue); }
.ledger svg { width: 22px; height: 22px; color: var(--siena); margin-top: 3px; }
.ledger strong { display: block; font-weight: 600; font-size: 1.12rem; }
.ledger span { color: var(--seppia); }
.section--ink .ledger { border-top-color: var(--campo-bordo); }
.section--ink .ledger li { border-bottom-color: var(--campo-bordo); }
.section--ink .ledger svg { color: var(--oro-luce); }
.section--ink .ledger span { color: var(--campo-tenue); }

/* Indice denso a più colonne */
.index-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px; }
.index-group h3 { font-size: 1.3rem; padding-bottom: 12px; border-bottom: 2px solid var(--inchiostro); margin-bottom: 4px; }
.index-group ul { list-style: none; }
.index-group li { padding: 12px 0 13px; border-bottom: 1px solid var(--bordo-tenue); color: var(--seppia); }
.index-group li strong { color: var(--inchiostro); font-weight: 600; }

/* ── Schermata reale ── */
.shot { margin: 0; }
.shot__frame {
    border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--bordo);
    box-shadow: var(--ombra-alta); background: var(--vellum);
}
.shot__bar { display: flex; gap: 6px; align-items: center; padding: 9px 12px; background: var(--carta-scura); border-bottom: 1px solid var(--bordo-tenue); }
.shot__bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--bordo); }
.shot__bar em { margin-left: 10px; font-style: normal; font-size: 0.88rem; color: var(--seppia-morbida); }
.shot figcaption { margin-top: 14px; font-size: 1rem; color: var(--seppia-morbida); }
.shot figcaption strong { color: var(--seppia); font-weight: 600; }

/* ── Illustrazioni del prodotto (dati sintetici) ── */
.vignette {
    background: var(--vellum); border: 1px solid var(--bordo); border-radius: var(--r-xl);
    box-shadow: var(--ombra-carta); overflow: hidden;
}
.vignette + .vignette { margin-top: 20px; }
.vignette__head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
    padding: 14px 20px; background: var(--carta-2); border-bottom: 1px solid var(--bordo-tenue);
}
.vignette__title { font-family: var(--f-display); font-size: 1.12rem; font-weight: 600; }
.vignette__meta { font-size: 0.95rem; color: var(--seppia-morbida); }
.vignette__body { padding: 18px 20px 20px; font-size: 1.04rem; }
.vignette__label { font-size: 0.93rem; font-weight: 600; color: var(--seppia-morbida); margin-bottom: 6px; }
.vignette__foot {
    padding: 12px 20px; border-top: 1px solid var(--bordo-tenue); background: var(--carta-2);
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font-size: 0.97rem; color: var(--seppia-morbida);
}
.figure-note { margin-top: 14px; font-size: 0.97rem; color: var(--seppia-morbida); }
.section--ink .figure-note { color: var(--campo-tenue); }

.pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 4px; border-radius: 999px;
    font-size: 0.9rem; font-weight: 600; line-height: 1.2; border: 1px solid transparent; white-space: nowrap;
}
.pill svg { width: 13px; height: 13px; }
.pill--verde { color: var(--verde); background: #E8EFE1; border-color: #C3D3B4; }
.pill--rosso { color: var(--rosso); background: #F7E6E2; border-color: #E4BDB5; }
.pill--oro { color: #6A4A06; background: #F6EBD2; border-color: #E2CB8E; }
.pill--blu { color: var(--blu); background: #E6EEF3; border-color: #BFD1DD; }

/* Tema di revisione */
.theme-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.theme-row + .theme-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--bordo-tenue); }
.theme-row p { color: var(--seppia); }

/* Prima / dopo */
.diff { display: grid; gap: 10px; }
.diff__line { padding: 10px 14px; border-radius: var(--r-md); line-height: 1.5; }
.diff__line b { display: block; font-size: 0.88rem; font-weight: 700; margin-bottom: 2px; }
.diff__line--prima { background: #F7E6E2; color: #5E1A1A; }
.diff__line--prima del { text-decoration-color: rgba(139, 32, 32, 0.7); text-decoration-thickness: 2px; }
.diff__line--dopo { background: #E8EFE1; color: #2C4220; }
.diff__line--dopo ins { text-decoration: none; background: rgba(74, 107, 53, 0.18); border-radius: 3px; padding: 0 2px; }

/* Atto → modello */
.field { display: inline; padding: 1px 6px 2px; border-radius: 5px; background: #F6EBD2; border: 1px solid #E2CB8E; color: #6A4A06; font-weight: 600; font-size: 0.96em; white-space: nowrap; }
.field--db { background: #E6EEF3; border-color: #BFD1DD; color: var(--blu); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 0.95rem; color: var(--seppia-morbida); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* Assistente collegato */
.chat { display: grid; gap: 12px; }
.chat__msg { max-width: 88%; padding: 11px 14px; border-radius: 12px; line-height: 1.5; }
.chat__msg--user { justify-self: end; background: var(--inchiostro); color: var(--carta); border-bottom-right-radius: 4px; }
.chat__msg--ai { background: var(--carta-scura); color: var(--inchiostro); border-bottom-left-radius: 4px; }
.chat__tool { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--seppia-morbida); margin-bottom: 4px; }
.chat__tool svg { width: 14px; height: 14px; }
.chat__link { display: inline-block; margin-top: 8px; font-weight: 600; color: var(--siena); text-decoration: underline; text-decoration-color: rgba(139, 69, 19, 0.4); text-underline-offset: 0.2em; }
.vignette--app { border-style: dashed; }
.confirm {
    margin-top: 6px; border: 1px solid var(--bordo); border-radius: var(--r-lg); padding: 14px 16px; background: var(--vellum);
}
.confirm__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.confirm__btn { padding: 8px 14px; border-radius: var(--r-md); font-weight: 600; font-size: 0.98rem; border: 1px solid var(--seppia-chiara); background: var(--carta-2); }
.confirm__btn--ok { background: var(--oro); border-color: var(--oro); color: var(--inchiostro); }

/* ==========================================================================
   Litigation Twin: campo d'inchiostro
   ========================================================================== */
.phases { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 12px; counter-reset: fase; }
.phase { position: relative; padding: 50px 22px 0 0; }
.phase::before {
    content: ""; position: absolute; top: 16px; left: 0; right: 0; height: 1px; background: var(--campo-bordo);
}
.phase__n {
    position: absolute; top: 0; left: 0; width: 33px; height: 33px; border-radius: 50%;
    display: grid; place-items: center; background: var(--campo); border: 1.5px solid var(--oro-luce);
    font-family: var(--f-display); font-size: 1.05rem; font-weight: 600; color: var(--oro-luce); line-height: 1;
}
.phase h3 { font-size: 1.3rem; color: var(--campo-testo); }
.phase p { margin-top: 10px; color: var(--campo-tenue); font-size: 1.05rem; }
.twin-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 56px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--campo-bordo); }
.twin-foot p { color: var(--campo-tenue); }
.twin-foot strong { color: var(--campo-testo); font-weight: 600; }
.twin-foot details summary { cursor: pointer; color: var(--oro-luce); font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 10px; list-style: none; }
.twin-foot details summary::-webkit-details-marker { display: none; }
.twin-foot details summary svg { width: 18px; height: 18px; transition: transform 220ms ease; }
.twin-foot details[open] summary svg { transform: rotate(45deg); }
.twin-foot details summary:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.twin-foot details[open] summary { margin-bottom: 8px; }
.twin-foot dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 1.02rem; }
.twin-foot dt { color: var(--campo-testo); font-weight: 600; }
.twin-foot dd { color: var(--campo-tenue); }

/* ── Dati e sicurezza: tabella di fatti ── */
.facts { border-top: 2px solid var(--inchiostro); }
.fact { display: grid; grid-template-columns: minmax(200px, 0.8fr) 2fr; gap: 12px 40px; padding: 24px 0 26px; border-bottom: 1px solid var(--bordo); }
.fact h3 { font-size: 1.35rem; }
.fact p { color: var(--seppia); }
.fact p + p { margin-top: 8px; }
.fact .small { margin-top: 10px; }

/* ── FAQ ── */
.faq { border-top: 1px solid var(--bordo); }
.faq details { border-bottom: 1px solid var(--bordo); }
.faq summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 20px;
    min-height: 64px; padding: 16px 4px; font-family: var(--f-display); font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem); font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 20px; height: 20px; flex: none; color: var(--siena); transition: transform 220ms ease; }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq summary:hover { color: var(--siena); }
.faq details > div { padding: 0 4px 24px; max-width: 70ch; color: var(--seppia); }
.faq details > div p + p { margin-top: 10px; }

/* ── Come si inizia + modulo ── */
.start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); gap: clamp(36px, 6vw, 88px); align-items: start; }
.start h2 { color: var(--campo-testo); }
.steps-line { list-style: none; margin-top: 36px; }
.steps-line li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--campo-bordo); }
.steps-line li:last-child { border-bottom: 1px solid var(--campo-bordo); }
.steps-line b {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid var(--oro-luce); color: var(--oro-luce); font-family: var(--f-display); font-weight: 600;
}
.steps-line strong { display: block; color: var(--campo-testo); font-weight: 600; font-size: 1.15rem; }
.steps-line span { color: var(--campo-tenue); }

.form { background: var(--carta); color: var(--inchiostro); border-radius: var(--r-xl); padding: clamp(24px, 3.5vw, 40px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6); }
.form h3 { font-size: 1.6rem; }
.form__intro { margin-top: 8px; color: var(--seppia); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__field { display: grid; gap: 6px; margin-top: 18px; }
.form__field label { font-weight: 600; font-size: 1.05rem; }
.form__field label small { font-weight: 400; color: var(--seppia-morbida); font-size: 0.95rem; }
.form__field input, .form__field textarea {
    width: 100%; min-height: 50px; padding: 11px 14px; font-size: 1.1rem;
    background: var(--vellum); color: var(--inchiostro);
    border: 1px solid var(--seppia-chiara); border-radius: var(--r-md);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}
.form__field textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.form__field input::placeholder, .form__field textarea::placeholder { color: var(--seppia-chiara); opacity: 1; }
.form__field input:hover, .form__field textarea:hover { border-color: var(--seppia); }
.form__field input:focus, .form__field textarea:focus { outline: none; border-color: var(--oro-testo); box-shadow: 0 0 0 3px rgba(196, 150, 12, 0.28); }
.form__field input[aria-invalid="true"], .form__field textarea[aria-invalid="true"] { border-color: var(--rosso); box-shadow: 0 0 0 3px rgba(139, 32, 32, 0.14); }
.form__hint { font-size: 0.98rem; color: var(--seppia-morbida); }
.form__error { font-size: 0.98rem; color: var(--rosso); font-weight: 600; min-height: 0; }
.form__error:empty { display: none; }
.form__privacy { margin-top: 18px; font-size: 0.98rem; color: var(--seppia-morbida); }
.form__privacy a { color: var(--siena); }
.form .btn { margin-top: 20px; }
.form__msg { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); font-weight: 600; }
.form__msg[hidden] { display: none; }
.form__msg--ok { background: #E8EFE1; color: #2C4220; border: 1px solid #C3D3B4; }
.form__msg--err { background: #F7E6E2; color: #5E1A1A; border: 1px solid #E4BDB5; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   HOME
   ========================================================================== */
.home-hero { padding: clamp(48px, 7vw, 104px) 0 clamp(56px, 7vw, 96px); position: relative; overflow: hidden; }
.home-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: repeating-linear-gradient(to bottom, transparent 0 35px, rgba(125, 101, 80, 0.07) 35px 36px);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
}
.home-hero__top { position: relative; max-width: 900px; }
.home-hero__top h1 { max-width: 14ch; }
.home-hero__top .lead { margin-top: 24px; }
.products { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: clamp(40px, 6vw, 72px); }
.product {
    position: relative; display: flex; flex-direction: column;
    background: var(--vellum); border: 1px solid var(--bordo); border-radius: var(--r-xl);
    box-shadow: var(--ombra-carta); padding: clamp(24px, 3vw, 36px);
}
.product--featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    grid-template-areas: "intro facts" "actions facts";
    column-gap: clamp(40px, 6vw, 88px);
    row-gap: 28px;
}
.product--featured .product__intro { grid-area: intro; }
.product--featured > .product__facts { grid-area: facts; align-self: center; margin: 0; }
.product--featured > .product__actions { grid-area: actions; margin-top: 0; }
.product--featured h2 { font-size: clamp(2.2rem, 1.45rem + 2.5vw, 3.5rem); }
.product--ink { background: var(--campo); color: var(--campo-testo); border-color: var(--campo); }
.product__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.product__status { margin-top: 10px; }
.product__mark { display: flex; align-items: center; gap: 12px; }
.product__mark img { width: auto; height: 30px; object-fit: contain; }
.product h2 { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.5rem); margin-top: 22px; }
.product > p { margin-top: 12px; color: var(--seppia); max-width: 48ch; }
.product--ink > p { color: var(--campo-tenue); }
.product__intro > p { margin-top: 12px; color: var(--campo-tenue); max-width: 58ch; }
.product__facts { list-style: none; margin: 22px 0 28px; border-top: 1px solid var(--bordo-tenue); }
.product--ink .product__facts { border-top-color: var(--campo-bordo); }
.product__facts li { padding: 11px 0; border-bottom: 1px solid var(--bordo-tenue); display: flex; gap: 10px; }
.product--ink .product__facts li { border-bottom-color: var(--campo-bordo); color: var(--campo-tenue); }
.product__facts svg { width: 18px; height: 18px; margin-top: 4px; flex: none; color: var(--siena); }
.product--ink .product__facts svg { color: var(--oro-luce); }
.product__actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; }

.statement { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: end; }
.statement p { color: var(--seppia); }
.principles { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--bordo); }
.principles li { padding: 26px 24px 0 0; }
.principles li + li { padding-left: 24px; border-left: 1px solid var(--bordo); }
.principles h3 { font-size: 1.35rem; }
.principles p { margin-top: 8px; color: var(--seppia); }

.quote {
    font-family: var(--f-display); font-weight: 400; font-style: normal;
    font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3.2rem); line-height: 1.15; letter-spacing: -0.02em;
    max-width: 22ch; text-wrap: balance;
}
.quote::before { content: "«"; color: var(--oro-luce); margin-right: 0.05em; }
.quote::after { content: "»"; color: var(--oro-luce); margin-left: 0.05em; }

.split { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 0; border: 1px solid var(--campo-bordo); border-radius: var(--r-xl); overflow: hidden; }
.split > div { padding: clamp(28px, 4vw, 48px); }
.split > div + div { border-left: 1px solid var(--campo-bordo); }
.split h3 { color: var(--campo-testo); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-top: 14px; }
.split p { color: var(--campo-tenue); margin: 10px 0 24px; }

/* ==========================================================================
   PSEUDONYMIA
   ========================================================================== */
.pp-hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.pp-hero h1 { max-width: 11ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; list-style: none; }
.chips li { padding: 6px 12px 7px; border-radius: 999px; border: 1px solid var(--bordo); background: var(--carta-2); color: var(--seppia); font-size: 1rem; font-weight: 500; }

.live-doc { position: relative; }
.live-doc__page {
    background: var(--vellum); border: 1px solid var(--bordo); border-radius: var(--r-xl); box-shadow: var(--ombra-alta);
    padding: 28px 30px; font-size: 1.04rem; line-height: 1.6; color: var(--inchiostro);
}
.live-doc__page p + p { margin-top: 12px; }
.live-doc__page .live-doc__heading { font-family: var(--f-display); font-size: 1.1rem; font-weight: 600; }
.pp-morph { border-radius: 4px; padding: 0 2px; transition: background-color 300ms ease, color 300ms ease; background: rgba(196, 150, 12, 0.14); }
.pp-morph.is-scrambling { background: rgba(139, 32, 32, 0.12); color: var(--rosso); }
.pp-morph.is-token { background: #E6EEF3; color: var(--blu); font-weight: 700; font-size: 0.94em; }
.live-doc__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.live-doc__status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--seppia); }
.live-doc__status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--rosso); }
.live-doc__status.is-pseudonymized { color: var(--verde); }
.live-doc__status.is-pseudonymized::before { background: var(--verde); }
.live-doc__replay { background: none; border: 1px solid var(--bordo); border-radius: var(--r-md); min-height: 40px; padding: 4px 12px; color: var(--seppia); font-weight: 600; }
.live-doc__replay:hover { border-color: var(--seppia); color: var(--inchiostro); }

.flow { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 2px solid var(--inchiostro); }
.flow li { padding: 26px 26px 0 0; }
.flow li + li { padding-left: 26px; border-left: 1px solid var(--bordo); }
.flow__n { font-family: var(--f-display); font-size: 2.4rem; line-height: 1; color: var(--oro-testo); font-weight: 400; }
.flow h3 { margin-top: 14px; font-size: 1.4rem; }
.flow p { margin-top: 10px; color: var(--seppia); }

.features { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; border-top: 1px solid var(--bordo); }
.feature { display: grid; grid-template-columns: 34px 1fr; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--bordo-tenue); }
.feature svg { width: 26px; height: 26px; color: var(--siena); margin-top: 2px; }
.feature h3 { font-size: 1.3rem; }
.feature p { margin-top: 6px; color: var(--seppia); }

.pricing { max-width: 720px; margin: 0 auto; background: var(--vellum); border: 1px solid var(--bordo); border-radius: var(--r-xl); box-shadow: var(--ombra-alta); padding: clamp(28px, 4vw, 48px); }
.pricing__price { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.pricing__amount { font-family: var(--f-display); font-size: clamp(3.4rem, 2.4rem + 4vw, 5.2rem); line-height: 0.9; color: var(--inchiostro); font-weight: 500; }
.pricing__period { font-size: 1.35rem; color: var(--seppia); }
.pricing__note { margin-top: 10px; color: var(--seppia-morbida); }
.pricing__list { list-style: none; margin: 24px 0 28px; border-top: 1px solid var(--bordo-tenue); }
.pricing__list li { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--bordo-tenue); }
.pricing__list svg { width: 18px; height: 18px; color: var(--verde); margin-top: 5px; flex: none; }
.pricing__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pricing__footer { margin-top: 18px; font-size: 1.02rem; color: var(--seppia-morbida); }
.pricing__footer a { color: var(--siena); }

.install-guide { display: none; max-width: 860px; margin: 32px auto 0; }
.install-guide--open { display: block; }
.install-guide__inner { background: var(--carta-2); border: 1px solid var(--bordo); border-radius: var(--r-xl); padding: clamp(22px, 3vw, 36px); }
.install-guide__download-btn { margin-bottom: 18px; }
.install-guide__intro { color: var(--seppia); }
.install-guide__steps { display: grid; gap: 20px; margin-top: 20px; }
.install-guide__step { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
.install-guide__step-text { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.install-guide__num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--oro-testo); color: var(--oro-testo); font-weight: 700; }
.install-guide__step-text p { color: var(--seppia); margin-top: 4px; }
.install-guide__img img { border-radius: var(--r-md); border: 1px solid var(--bordo); }
.install-guide__why { margin-top: 20px; color: var(--seppia); font-size: 1.02rem; }

/* ==========================================================================
   Pagine interne: contatti, legali
   ========================================================================== */
.page-head { padding: clamp(24px, 4vw, 48px) 0 clamp(28px, 4vw, 48px); }
.page-head h1 { font-size: clamp(2.3rem, 1.6rem + 3vw, 3.8rem); }
.page-head p { margin-top: 16px; }

.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 88px); align-items: start; padding-bottom: var(--sezione); }
.contact__side .ledger { margin-top: 0; }
.contact .form { box-shadow: var(--ombra-alta); background: var(--vellum); border: 1px solid var(--bordo); }

.legal-section { padding-bottom: var(--sezione); }
.legal-container { max-width: 860px; }
.legal-section .section-heading h1 { font-size: clamp(2.3rem, 1.6rem + 3vw, 3.6rem); }
.legal-section .section-heading p { margin-top: 14px; color: var(--seppia); font-size: 1.2rem; max-width: 60ch; }
.legal-updated { margin-top: 18px; color: var(--seppia-morbida); font-size: 1rem; }
.legal-body { margin-top: 36px; border-top: 2px solid var(--inchiostro); }
.legal-block { padding: 30px 0; border-bottom: 1px solid var(--bordo); }
.legal-block h2 { font-size: clamp(1.45rem, 1.25rem + 0.7vw, 1.8rem); margin-bottom: 14px; }
.legal-block h3 { font-size: 1.25rem; margin: 22px 0 8px; }
.legal-block p, .legal-block li { color: var(--seppia); }
.legal-block p + p { margin-top: 10px; }
.legal-block ul, .legal-block ol { margin: 10px 0 10px 1.3em; }
.legal-block li + li { margin-top: 6px; }
.legal-block a { color: var(--siena); }
.legal-block strong { color: var(--inchiostro); }
.legal-address { margin: 14px 0; padding: 16px 18px; background: var(--vellum); border: 1px solid var(--bordo); border-radius: var(--r-lg); color: var(--seppia); line-height: 1.6; }
.legal-table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--bordo); border-radius: var(--r-lg); }
.legal-table { width: 100%; border-collapse: collapse; font-size: 1.02rem; background: var(--vellum); }
.legal-table th, .legal-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--bordo-tenue); vertical-align: top; }
.legal-table th { background: var(--carta-scura); font-weight: 600; color: var(--inchiostro); }
.legal-toc { margin-top: 28px; padding: 18px 22px; background: var(--vellum); border: 1px solid var(--bordo); border-radius: var(--r-lg); }
.legal-toc a { color: var(--siena); }
.legal-toc ol, .legal-toc ul { margin-left: 1.2em; columns: 2; column-gap: 32px; }
.legal-toc li { padding: 3px 0; break-inside: avoid; }

/* ── Azione fissa su mobile ── */
.sticky-cta { display: none; }
@media (max-width: 720px) {
    .sticky-cta {
        display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90;
        padding: 8px; gap: 8px; align-items: center; justify-content: space-between;
        background: var(--campo); color: var(--campo-testo); border-radius: var(--r-lg);
        box-shadow: 0 18px 40px -16px rgba(31, 20, 13, 0.7);
        transform: translateY(140%); transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
    }
    .sticky-cta.is-shown { transform: none; }
    .sticky-cta p { padding-left: 8px; font-size: 1rem; line-height: 1.2; color: var(--campo-tenue); }
    .sticky-cta .btn { min-height: 44px; padding: 8px 16px; font-size: 1.05rem; }
}

/* ==========================================================================
   Comparsa progressiva: il contenuto è visibile per default
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
    .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1); }
    .js [data-reveal].is-visible { opacity: 1; transform: none; }
    .js .sheet[data-reveal] { transform: translateY(24px) rotate(-0.6deg); }
    .js .sheet[data-reveal].is-visible { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
    .phases { grid-template-columns: 1fr 1fr; gap: 8px 32px; }
    .phase:last-child { grid-column: 1 / -1; }
    .index-cols { grid-template-columns: 1fr 1fr; }
    .index-cols .index-group:last-child { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
    :root { --header-h: 62px; }
    .site-header__nav { display: none; }
    .site-header__burger { display: inline-flex; }
    .site-header__login { display: none; }
    .hero__grid, .pp-hero__grid, .chapter, .start, .statement, .contact { grid-template-columns: 1fr; }
    .chapter--flip > :first-child { order: 0; }
    .chapter__figure { position: static; }
    .hero h1, .pp-hero h1 { max-width: 16ch; }
    .sheet { margin-right: 18px; }
    .product--featured { grid-template-columns: 1fr; grid-template-areas: "intro" "facts" "actions"; gap: 0; }
    .product--featured > .product__facts { margin-top: 24px; }
    .product--featured > .product__actions { margin-top: 28px; }
    .twin-foot { grid-template-columns: 1fr; }
    .fact { grid-template-columns: 1fr; gap: 8px; }
    .features { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; }
    .split > div + div { border-left: 0; border-top: 1px solid var(--campo-bordo); }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
    .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    body { font-size: 1.125rem; }
    .products { grid-template-columns: 1fr; }
    .proofs, .principles, .flow { grid-template-columns: 1fr; }
    .proof, .proof + .proof, .principles li, .principles li + li, .flow li, .flow li + li { padding: 22px 0; border-left: 0; }
    .proof + .proof, .principles li + li, .flow li + li { border-top: 1px solid var(--bordo); }
    .phases { grid-template-columns: 1fr; gap: 0; }
    .phase { padding: 4px 0 28px 50px; }
    .phase::before { top: 0; bottom: 0; left: 16px; right: auto; width: 1px; height: auto; }
    .index-cols { grid-template-columns: 1fr; }
    .index-group + .index-group { margin-top: 32px; }
    .form__row { grid-template-columns: 1fr; gap: 0; }
    .hero__actions .btn, .product__actions .btn { width: 100%; }
    .pricing__actions { grid-template-columns: 1fr; }
    .install-guide__step { grid-template-columns: 1fr; }
    .sheet { padding: 20px 18px; margin-right: 14px; }
    .sheet::before { transform: translate(7px, 7px) rotate(0.8deg); }
    .sheet::after { transform: translate(14px, 13px) rotate(1.4deg); }
    .site-footer__grid { grid-template-columns: 1fr; gap: 28px; }
    .site-footer__legal { flex-direction: column; align-items: flex-start; }
    .legal-toc ol, .legal-toc ul { columns: 1; }
    .theme-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .sheet { margin-right: 8px; }
    .sheet::before { transform: translate(5px, 5px) rotate(0.6deg); }
    .sheet::after { display: none; }
}

@media print {
    .site-header, .site-footer, .page-index, .hero__actions, .form { display: none; }
    body { padding-top: 0; background: #fff; }
    .section--ink { background: #fff; color: #000; }
}
