/* Pagine pubbliche (benvenuto, privacy): la carta e l'inchiostro di Albera, una colonna di
   lettura, un solo accento vermiglio. I colori vengono da style.css. */
/* I link alle sezioni scorrono invece di saltare (28 settembre); con il movimento ridotto, no. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.pub { background: var(--paper); color: var(--ink); overflow-x: hidden; }
.pub main, .pub-top, .pub-foot { width: min(1080px, 100%); margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.pub a { color: inherit; }
.pub [hidden] { display: none !important; }

.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.2rem; padding-bottom: 1.2rem; }
/* La testata resta in alto mentre si scorre (30/9). La carta si allarga a tutta la finestra con
   un'ombra piena, tagliata sopra e sotto; la seconda ombra è la riga che appare scorrendo.
   I link alle sezioni si fermano sotto la testata. */
html { scroll-padding-top: 4.5rem; }
.pub-top { position: sticky; top: 0; z-index: 30; background: var(--paper);
  box-shadow: 0 0 0 100vmax var(--paper), 0 1px 0 100vmax transparent; clip-path: inset(0 -100vmax -1px); }
.pub-brand img { width: 36px; height: 36px; }
/* Scorrendo la testata si stringe: meno spazio, logo più piccolo, la riga sotto. Legata allo
   scorrimento, senza script; dove il browser non la conosce resta ferma e piena. */
@supports (animation-timeline: scroll()) {
  .pub-top { animation: pub-top-shrink linear both; animation-timeline: scroll(root); animation-range: 0 120px; }
  .pub-brand img { animation: pub-logo-shrink linear both; animation-timeline: scroll(root); animation-range: 0 120px; }
}
@keyframes pub-top-shrink {
  to { padding-top: 0.45rem; padding-bottom: 0.45rem; box-shadow: 0 0 0 100vmax var(--paper), 0 1px 0 100vmax var(--line); }
}
@keyframes pub-logo-shrink { to { width: 26px; height: 26px; } }
.pub-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; letter-spacing: 0.3em; }
.pub-top nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.3rem 1.3rem; font-size: 0.95rem; }
.pub-top nav a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid transparent; }
.pub-top nav a:hover { color: var(--ink); border-color: var(--ink-faint); }
.pub-top .pub-login { color: var(--shu); }

.pub h1 { font-weight: 400; font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.12; letter-spacing: 0.01em; margin: 0; }
.pub-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.8rem 1.4rem; margin: 2rem 0 0; }
/* Pulsanti a inchiostro (27 settembre): il vermiglio resta per i piccoli accenti, come un sigillo. */
.pub-cta { display: inline-block; padding: 0.55rem 1.5rem; border: 1px solid var(--ink); border-radius: 999px; color: var(--ink) !important; text-decoration: none; transition: background 0.3s; }
.pub-cta:hover, .pub-cta:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); outline: none; }
.pub-more { color: var(--ink-soft) !important; font-style: italic; text-decoration: none; border-bottom: 1px solid var(--ink-faint); }
.pub-more:hover { color: var(--ink) !important; border-color: var(--ink); }

.pub-section { border-top: 1px solid var(--line); padding: 3.2rem 0; scroll-margin-top: 1rem; }
.pub h2 { font-weight: 400; font-size: 1.05rem; letter-spacing: 0.3em; color: var(--ink-soft); margin: 0 0 2rem; }
.pub h2::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--shu); margin-right: 0.8rem; vertical-align: 0.15em; }
.pub h3 { font-weight: 400; font-size: 1.25rem; margin: 0 0 0.5rem; }
.pub-section p, .pub-section li, .pub-section dd { line-height: 1.6; }
.pub-section p { color: var(--ink-soft); margin: 0; }

/* Presentazione, sotto l'hero: poche parole, grandi segni. */
.pub-section { padding: 4.5rem 0; }
.pub-section h2 { margin-bottom: 2.8rem; }
/* Più carta fra i capitoli della landing, con un respiro più breve su telefono. */
.pub-landing { --section-space: 6rem; }
.pub-landing main > .pub-section { padding-block: var(--section-space); }
.pub-landing main > .pub-band { padding-block: var(--section-space); margin-block: 2.5rem; }
.pub-landing main > .pub-closing { padding-block: var(--section-space); }

/* Come funziona: tre gesti uniti da un filo d'inchiostro. */
.pub-flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem; position: relative; }
.pub-flow > li:not(:last-child)::after { content: ""; position: absolute; top: 2.25rem; left: 6rem; right: -1.4rem; border-top: 1px dashed var(--ink-faint); }
.pub-flow > li { position: relative; }
.pub-step-icon { position: relative; display: grid; place-items: center; width: 4.5rem; height: 4.5rem; border: 1px solid var(--ink-faint); border-radius: 50%; background: var(--paper); color: var(--ink); margin-bottom: 1.6rem; box-shadow: 0 0 0 0.6rem var(--paper); }
.pub-step-icon .icon { width: 2rem; height: 2rem; vertical-align: 0; }
.pub-step-n { position: absolute; top: -0.35rem; right: -0.45rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--shu); color: var(--paper); font-size: 0.9rem; font-style: italic; display: grid; place-items: center; line-height: 1; }
.pub-flow h3 { font-size: 1.45rem; margin-bottom: 0.9rem; }
.pub-flow p { font-size: 1rem; }

.pub-fallen { margin-top: 3.4rem; padding: 1.6rem 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem; }
.pub-fallen p { color: var(--ink-soft); }
.pub-fallen strong { font-weight: 400; color: var(--ink); font-style: italic; }
.pub-fallen .pub-more { margin-left: auto; }


/* Prova un albero (benvenuto.html): il disegno a sinistra, il pannello delle fonti a destra,
   nel flusso della pagina; su telefono il pannello scende sotto l'albero. */
.pub-demo { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.pub-demo-tree { margin: 0; position: relative; }
/* Nella demo il ramo aperto si riconosce, ma l'albero non sembra spento. */
/* Sbiadiscono legno e foglie degli altri rami, non i loro nomi: restano da leggere e da toccare. */
.pub-demo-tree .crown:has(.branch.focused) .branch:not(.focused) { opacity: 1 !important; }
.pub-demo-tree .crown:has(.branch.focused) .branch:not(.focused) > :not(.label, .period, .hit) { opacity: 0.6 !important; }
/* Nella demo niente anni sui rami della bibliografia (dal 27 settembre, sera): affollavano la
   cima; i rami restano e aprono la bibliografia. */
.pub-demo-tree .period { display: none; }
.pub-all { position: absolute; top: 0.4rem; right: 0.4rem; font: inherit; font-size: 0.88rem; font-style: italic; color: var(--ink); background: var(--paper); border: 0; border-bottom: 1px solid var(--ink-faint); padding: 0 0 0.05rem; cursor: pointer; }
.pub-all[hidden] { display: none; }
.pub-demo-tree svg { width: 100%; height: auto; display: block; }
.pub-demo-tree .branch, .pub-demo-tree .leafholder, .pub-demo-tree .radice { cursor: pointer; }
.pub-key { list-style: none; padding: 0; margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.4rem; color: var(--ink-mute); font-size: 0.88rem; font-style: italic; }
.pub-key li { display: flex; align-items: center; gap: 0.45rem; }
.k-leaf { width: 0.8rem; height: 0.42rem; border-radius: 50%; background: var(--leaf); transform: rotate(-25deg); }
.k-leaf.big { width: 1.15rem; height: 0.58rem; }
.k-leaf.young { background: var(--leaf-young); }
.k-dash { width: 1.3rem; border-top: 2px dashed var(--bark); opacity: 0.6; }
.k-root { width: 1rem; height: 0.7rem; border-left: 1.5px solid var(--bark); border-bottom: 1.5px solid var(--bark); border-radius: 0 0 0 0.8rem; opacity: 0.6; }
.pub-panel { background: var(--panel); border: 1px solid var(--line); padding: 1.4rem 1.4rem 0.6rem; position: sticky; top: 4rem; }
.pub-branches { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.2rem; }
.pub-branches button { font: inherit; font-size: 0.88rem; font-style: italic; color: var(--ink-soft); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.75rem; cursor: pointer; }
.pub-branches button small { color: var(--ink-mute); font-size: 0.8em; margin-left: 0.15rem; }
.pub-branches button:hover, .pub-branches button:focus-visible { border-color: var(--ink-faint); color: var(--ink); outline: none; }
.pub-branches button[aria-selected="true"] { border-color: var(--shu); color: var(--shu); }
.pub-langs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.9rem; margin: -0.5rem 0 1.1rem; font-size: 0.85rem; color: var(--ink-mute); font-style: italic; }
.pub-langs button { font: inherit; color: var(--ink-soft); background: none; border: 0; border-bottom: 1px solid transparent; padding: 0; cursor: pointer; }
.pub-langs button:hover, .pub-langs button:focus-visible { color: var(--ink); border-color: var(--ink-faint); outline: none; }
.pub-langs button[aria-pressed="true"] { color: var(--ink); border-color: var(--shu); }
.pub-panel h3 { font-style: italic; font-size: 1.5rem; margin: 0; }
.pub-panel .desc { margin: 0.3rem 0 0.8rem; font-size: 0.95rem; }
.pub-panel .list { max-height: 30rem; overflow-y: auto; padding-right: 0.4rem; }
.pub-panel .list li { padding-top: 0.8rem; padding-bottom: 0.8rem; }
.pub-panel .list li p { margin: 0.2rem 0 0; }

/* La foresta: promessa a sinistra, funzioni in righe a destra, come una pagina aperta. */
.pub-section .pub-statement { font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.4; color: var(--ink); margin: -1rem 0 2.6rem; max-width: 56rem; text-wrap: pretty; }
.pub-forest-layout { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.pub-forest-intro { max-width: 25rem; }
.pub-section .pub-forest-promise { font-size: clamp(1.9rem, 3.3vw, 2.6rem); line-height: 1.2; color: var(--ink); text-wrap: pretty; }
.pub-section .pub-forest-about { margin-top: 1.4rem; max-width: 22rem; font-size: 1.1rem; text-wrap: pretty; }
.pub-forest-features article { display: grid; grid-template-columns: 1.5rem 8rem minmax(0, 1fr); gap: 0 1rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.pub-forest-features article:first-child { padding-top: 0.2rem; }
.pub-forest-features .icon { width: 1.5rem; height: 1.5rem; color: var(--leaf); margin-top: 0.15rem; }
.pub-forest-features h3 { font-size: 1.25rem; line-height: 1.35; margin: 0; }
.pub-forest-features p { font-size: 1rem; }
.pub-who { list-style: none; padding: 0; margin: 2.6rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 0; font-size: 1.3rem; font-style: italic; color: var(--ink); }
.pub-who li + li::before { content: "·"; color: var(--shu); padding: 0 1rem; }

/* Il bosco: una fascia d'inchiostro da bordo a bordo, la carta in negativo. */
.pub-band + .pub-section { border-top: 0; }
.pub-band { margin: 2rem calc(50% - 50vw); padding: 5rem calc(50vw - 50%); background: var(--bark); color: var(--paper); }
.pub-band-in { max-width: 56rem; }
.pub-band h2 { color: color-mix(in srgb, var(--paper) 75%, var(--bark)); }
.pub-band h2::before { background: #e07a5c; }
.pub-band-lead { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.3; margin: 0 0 3rem; }
/* Che cos'è Albera, in una frase, in testa a «come funziona». */
.pub-section .pub-lead { max-width: 40rem; margin: -1.4rem 0 2.8rem; font-size: 1.15rem; line-height: 1.55; color: var(--ink); text-wrap: pretty; }
/* Domande: si aprono una alla volta a richiesta; il testo è sempre nella pagina. */
.pub-faq-layout { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.pub-faq-intro .pub-statement { font-size: clamp(1.7rem, 3vw, 2.1rem); max-width: 15rem; margin-bottom: 1.4rem; }
.pub-faq details { border-bottom: 1px solid var(--line); }
.pub-faq details:first-child { border-top: 1px solid var(--line); }
.pub-faq summary { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.15rem 0; cursor: pointer; list-style: none; }
.pub-faq summary::-webkit-details-marker { display: none; }
.pub-faq summary::after { content: "+"; flex: 0 0 1rem; text-align: center; color: var(--ink-mute); font-size: 1.2rem; }
.pub-faq details[open] summary::after { content: "–"; color: var(--shu); }
.pub-faq summary h3 { margin: 0; font-weight: 400; font-size: 1.15rem; color: var(--ink); }
.pub-faq summary:hover h3, .pub-faq summary:focus-visible h3 { text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 0.2em; }
.pub-faq summary:focus-visible { outline: 2px solid var(--shu); outline-offset: 4px; }
.pub-faq details p { padding: 0 2rem 1.3rem 0; max-width: 40rem; }
.pub-band-note { color: color-mix(in srgb, var(--paper) 82%, var(--bark)); margin: 0; line-height: 1.6; }
.pub-band-note a { font-style: italic; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--paper) 45%, var(--bark)); }
.pub-band-note a:hover, .pub-band-note a:focus-visible { color: var(--paper); border-color: var(--paper); }
.pub-figure { font-size: clamp(3.6rem, 8vw, 5.4rem); line-height: 1 !important; color: #e07a5c !important; margin-bottom: 0.8rem !important; }
.pub-figure small { font-size: 0.32em; font-style: italic; margin-left: 0.25rem; color: color-mix(in srgb, var(--paper) 70%, var(--bark)); }
.pub-band h3 { color: var(--paper); font-size: 1.3rem; }
/* Il bosco oggi: tre numeri veri a sinistra, con le cifre di .pub-figure e i cerchi di
   .pub-step-icon; a destra la foresta disegnata, solo le linee. */
.pub-grove { margin: 0 0 3.2rem; padding-bottom: 2.8rem; border-bottom: 1px solid color-mix(in srgb, var(--paper) 22%, var(--bark)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 1.4rem 3rem; align-items: center; }
.pub-grove[hidden] { display: none; }
.pub-grove-stats { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem; }
.pub-grove-stats li { min-width: 0; display: grid; grid-template-columns: 3rem 1fr; column-gap: 1.1rem; align-items: center; }
.pub-grove-icon { grid-row: span 2; display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid color-mix(in srgb, var(--paper) 35%, var(--bark)); border-radius: 50%; color: color-mix(in srgb, var(--paper) 85%, var(--bark)); }
.pub-grove-icon .icon { width: 1.4rem; height: 1.4rem; vertical-align: 0; }
.pub-grove .pub-figure { font-size: clamp(2.2rem, 4vw, 3rem); white-space: nowrap; font-variant-numeric: tabular-nums; margin: 0 !important; }
.pub-grove h3 { font-size: 1rem; font-weight: normal; font-style: italic; color: color-mix(in srgb, var(--paper) 78%, var(--bark)); margin: 0.2rem 0 0; }
.pub-forest-art { width: 100%; height: auto; display: block; overflow: visible; color: color-mix(in srgb, var(--paper) 70%, var(--bark)); }
.pub-forest-art .wood path, .pub-forest-art .rootwood path { stroke: currentColor; }
.pub-forest-art .leaf { fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pub-forest-art .flare path { fill: currentColor; }
.pub-forest-art .rootwood path { opacity: 0.55; }
.pub-forest-art :is(.label, .period, .name, .root-label, .fallen, .count, .vein, .fruit, .sprout, .ground, .hit, .hit-branch, .hit-leaf) { display: none; }
.pub-forest-art .terra { stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0.6; }
.pub-grove-when { grid-column: 1 / -1; margin-top: 0.4rem !important; font-size: 0.88rem; font-style: italic; }

/* Piani: il gratuito apre la sezione; sotto, due abbonamenti da confrontare. */
.pub-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; align-items: stretch; }
.pub-plans article { border: 1px solid var(--line); padding: 2rem 2.2rem; background: transparent; }
.pub-plans h3 { letter-spacing: 0.2em; font-size: 1rem; color: var(--ink-soft); margin-bottom: 1.5rem; }
.pub-plans .pub-plan-top { background: var(--panel); border-top: 2px solid var(--shu); padding-top: calc(2rem - 1px); }
.pub-price { font-size: clamp(2.8rem, 4vw, 3.5rem); color: var(--ink) !important; margin: 0 !important; line-height: 1 !important; font-variant-numeric: tabular-nums; }
.pub-price small { color: var(--ink-mute); font-size: 1rem; font-style: italic; margin-left: 0.3rem; white-space: nowrap; }
.pub-section .pub-plan-year { margin-top: 0.7rem; font-size: 0.95rem; color: var(--ink-mute); }
.pub-section .pub-plan-credit { display: flex; align-items: baseline; gap: 0.6rem; margin: 1.7rem 0 1rem; color: var(--ink); }
.pub-plan-credit span { font-size: 1.8rem; line-height: 1; font-variant-numeric: tabular-nums; }
.pub-plans ul { list-style: none; margin: 0; padding: 1rem 0 0; border-top: 1px solid var(--line); color: var(--ink-soft); }
.pub-plans li { padding: 0.25rem 0 0.25rem 1.2rem; position: relative; }
.pub-plans li::before { content: ""; position: absolute; left: 0; top: 0.85em; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--leaf); }
.pub-plans .pub-plan-free { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.7fr) minmax(0, 1.5fr); gap: 1.5rem; align-items: center; padding-block: 1.5rem; }
.pub-plan-free h3 { margin: 0; }
.pub-plan-free .pub-price { font-size: 2.4rem; }
.pub-plan-free ul { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 1.5rem; }
.pub-note { max-width: 48rem; font-style: italic; margin-top: 1.8rem !important; font-size: 0.95rem; }

/* Comparsa calma al primo sguardo (benvenuto.js), mai con il movimento ridotto. */
@media (prefers-reduced-motion: no-preference) {
  .pub-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s ease, transform 0.9s ease; }
  .pub-reveal.pub-seen { opacity: 1; transform: none; }
}

/* Chiusura: il titolo grande e un solo pulsante pieno, su un fondo di carta più chiaro. */
.pub-closing { margin: 0 calc(50% - 50vw); padding: 5rem calc(50vw - 50%) 5.5rem; background: var(--panel); border-top: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; align-items: center; }
.pub-closing-mark { width: 2.5rem; height: 2.5rem; color: var(--leaf); margin-bottom: 1.5rem; }
main:has(> .pub-closing:last-child) + .pub-foot { border-top: 0; }
.pub .pub-closing-title { max-width: 36rem; font-size: clamp(2.2rem, 4.8vw, 3.4rem); letter-spacing: 0.01em; color: var(--ink); margin: 0 0 1.2rem; line-height: 1.15; text-wrap: balance; }
.pub .pub-closing-title::before { display: none; }
.pub-closing-sub { max-width: 30rem; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.6; margin: 0; text-wrap: balance; }
.pub-closing .pub-actions { flex-direction: column; align-items: center; gap: 1.2rem; margin-top: 2rem; }
.pub-closing .pub-cta-solid { min-width: 10rem; padding: 0.95rem 2.4rem; }
.pub-cta-solid { background: var(--ink); color: var(--paper) !important; padding: 0.8rem 2.2rem; font-size: 1.1rem; }
.pub-cta-solid:hover, .pub-cta-solid:focus-visible { background: var(--bark); }

.pub-foot { display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; padding-top: 1.6rem; padding-bottom: 2.4rem; border-top: 1px solid var(--line); color: var(--ink-mute); font-size: 0.88rem; }
.pub-foot a { color: var(--ink-mute); text-decoration: none; border-bottom: 1px solid var(--ink-faint); }

/* Hero animato (hero-goccia.js): la goccia, l'albero, i frutti, le frasi. In benvenuto.html e
   nella prova a sé, hero-goccia.html. */
.ink-hero { position: relative; min-height: calc(100svh - 4.5rem); display: grid; align-content: center; justify-items: center; gap: 1.2rem; padding: 1.5rem 16px 3rem; box-sizing: border-box; }
/* La scena lascia sempre posto alla frase finale e ai pulsanti, anche su uno schermo basso. */
.ink-stage { --ratio: 1.8; position: relative; width: min(1100px, 100%, calc(52svh * var(--ratio))); aspect-ratio: var(--ratio); }
@media (max-width: 640px) { .ink-stage { width: calc(100% + 32px); margin: 0 -16px; } }
/* Dentro una pagina (benvenuto.html) il margine laterale c'è già: la scena arriva ai bordi. */
.pub main > .ink-hero { padding-left: 0; padding-right: 0; }
.ink-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* Solo l'albero: niente nomi, conteggi, anni, foglie a terra. */
#ink-tree .label, #ink-tree .period, #ink-tree .name, #ink-tree .root-label, #ink-tree .fallen, #ink-tree .count { display: none; }
#ink-fx .drop, #ink-fx .blot { fill: var(--ink); }
/* Linee di spessore fisso sullo schermo: su telefono la scena è larga, 1 unità è meno di un pixel. */
#ink-fx .ring { fill: none; stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
#ink-fx .line { fill: none; stroke-width: 1; color: var(--ink-faint); vector-effect: non-scaling-stroke; }
/* I frutti: il codice dell'app, contorno «da possedere», pieno «lo possiedo». */
#ink-fx .seed { fill: var(--shu); fill-opacity: 0; stroke: var(--shu); stroke-width: 1.4; }

.ink-words { text-align: center; min-height: 12.5rem; width: min(40rem, 100%); position: relative; }
.ink-words > p { margin: 0; position: absolute; inset: 0 0 auto; font-size: clamp(1.35rem, 3vw, 1.9rem); line-height: 1.35; color: var(--ink); font-style: italic; opacity: 0; }
.ink-words > p small { display: block; font-size: 0.62em; color: var(--ink-soft); margin-top: 0.4rem; }
.ink-final { position: absolute; inset: 0 0 auto; opacity: 0; }
.ink-final h1 { font-weight: 400; font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.12; margin: 0; }
.ink-final p { margin: 0.8rem 0 0; color: var(--ink-soft); font-size: 1.1rem; }
.ink-final .pub-actions { justify-content: center; align-items: center; margin-top: 1.4rem; }
.ink-replay { position: absolute; right: 16px; bottom: 16px; font: inherit; font-size: 0.88rem; font-style: italic; color: var(--ink-mute); background: none; border: 0; border-bottom: 1px solid var(--ink-faint); padding: 0; cursor: pointer; }
.ink-replay:hover, .ink-replay:focus-visible { color: var(--ink); outline: none; }

/* Testo lungo (privacy): una colonna stretta. */
.pub-doc { max-width: 42rem; padding: 1rem 0 3rem; }
.pub-doc h1 { font-size: 2rem; margin-bottom: 0.6rem; }
.pub-doc h2 { margin: 2.4rem 0 0.8rem; }
.pub-doc p, .pub-doc li { color: var(--ink-soft); line-height: 1.65; }
.pub-doc .pub-draft { border-left: 2px solid var(--shu); padding: 0.4rem 0 0.4rem 1rem; font-style: italic; }
.pub-doc table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.pub-doc th, .pub-doc td { text-align: left; vertical-align: top; padding: 0.5rem 0.6rem 0.5rem 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.pub-doc th { color: var(--ink); font-weight: 400; font-style: italic; }
.pub-doc .pub-table { overflow-x: auto; }

@media (max-width: 820px) {
  .pub-landing { --section-space: 4rem; }
  .pub-faq-layout { grid-template-columns: 1fr; gap: 2.2rem; }
  .pub-faq-intro .pub-statement { max-width: none; }
  .pub-section { padding: 3.2rem 0; }
  .pub-flow, .pub-plans, .pub-demo { grid-template-columns: 1fr; gap: 1.8rem; }
  .pub-plans article { padding: 1.6rem; }
  .pub-plans .pub-plan-top { padding-top: calc(1.6rem - 1px); }
  .pub-plans .pub-plan-free { grid-template-columns: minmax(0, 1fr) auto; gap: 1.2rem; }
  .pub-plan-free ul { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 1rem 0 0; }
  .pub-forest-layout { grid-template-columns: 1fr; gap: 2rem; }
  .pub-forest-intro { max-width: 32rem; }
  .pub-section .pub-forest-about { max-width: 30rem; }
  .pub-forest-features article { grid-template-columns: 1.5rem minmax(0, 1fr); row-gap: 0.5rem; }
  .pub-forest-features p { grid-column: 2; }
  .pub-grove { grid-template-columns: 1fr; }
  .pub-panel { position: static; padding: 1.1rem 1rem 0.4rem; }
  /* Su telefono il pannello non scorre dentro la pagina che scorre: le fonti si leggono intere. */
  .pub-panel .list { max-height: none; overflow: visible; }
  .pub-flow > li::after { display: none; }
  .pub-step-icon { width: 3.8rem; height: 3.8rem; margin-bottom: 1rem; }
  .pub-flow > li { display: grid; grid-template-columns: 3.8rem minmax(0, 1fr); column-gap: 1.2rem; align-content: start; }
  .pub-flow .pub-step-icon { grid-row: 1 / 3; margin-bottom: 0; }
  .pub-flow h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
  .pub-fallen { margin-top: 2rem; }
  .pub-fallen .pub-more { margin-left: 0; }
  .pub-who { display: grid; grid-template-columns: repeat(2, auto); gap: 0.4rem 1.4rem; font-size: 1.1rem; }
  .pub-who li + li::before { display: none; }
  .pub-band { padding-top: 3.4rem; padding-bottom: 3.4rem; }
  .pub-top nav a:not(.pub-login):not(.pub-lang) { display: none; }
}

/* Pagina pubblica di un autore (src/author-page.mjs): testa, disegno, fonti per ramo, libri, radici. */
.pub-crumbs { font-size: 0.85rem; color: var(--ink-mute); margin: 0.6rem 0 1.6rem; }
.pub-crumbs a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--ink-faint); }
.pub-author-head { max-width: 46rem; }
.pub-author-sub { margin: 0.7rem 0 0; font-style: italic; color: var(--ink-soft); font-size: 1.1rem; }
.pub-author-head .pub-lead { margin: 1.6rem 0 0; }
.pub-author-tree { margin: 1.5rem auto 0; max-width: 760px; }
.pub-author-tree svg { width: 100%; height: auto; display: block; }
.pub-author-tree .branch, .pub-author-tree .leafholder, .pub-author-tree .radice { cursor: pointer; }
.pub-author-sources h2, .pub-author-books h2, .pub-author-roots h2 { margin-bottom: 2rem; }
.pub-author-branch { max-width: 46rem; margin: 0 0 2.4rem; scroll-margin-top: 1.5rem; }
.pub-author-branch h3 { font-style: italic; margin: 0; }
.pub-author-branch h3 small { font-style: normal; font-size: 0.8rem; color: var(--ink-mute); margin-left: 0.2rem; }
.pub-author-about { margin: 0.2rem 0 0.8rem; font-size: 0.92rem; color: var(--ink-mute) !important; font-style: italic; }
.pub-author-branch ol, .pub-author-books ol, .pub-author-roots ul { list-style: none; margin: 0; padding: 0; }
.pub-author-branch li, .pub-author-roots li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.pub-author-branch li a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink-faint); line-height: 1.45; }
.pub-author-branch li a:hover { border-color: var(--ink); }
.pub-author-branch li small, .pub-author-roots li small, .pub-author-books li small { display: block; margin-top: 0.2rem; font-size: 0.85rem; color: var(--ink-mute); }
.pub-author-more { margin-top: 0.7rem !important; font-size: 0.92rem; }
.pub-author-more a, .pub-author-roots li a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink-faint); }
.pub-author-fallen { max-width: 46rem; font-style: italic; }
.pub-author-books ol { columns: 2 18rem; column-gap: 2.5rem; }
.pub-author-books li { break-inside: avoid; padding: 0.35rem 0; display: grid; grid-template-columns: 3.2rem 1fr; column-gap: 0.4rem; }
.pub-author-books li small { grid-column: 2; margin: 0; }
.pub-author-year { font-variant-numeric: tabular-nums; color: var(--ink-mute); }
.pub-author-roots ul { max-width: 46rem; margin-bottom: 1.6rem; }
.pub-author-roots li { font-size: 1.05rem; }

/* «Il progetto»: cinque capitoli, una colonna di lettura e illustrazioni a tutta pagina. */
.proj { margin: 0 auto; padding: 1rem 0 4rem; }
.proj-head { max-width: 54rem; margin: 0 auto; padding: 4.5rem 0 1rem; }
.proj-kicker { margin: 0 0 1.8rem; font-size: 0.85rem; letter-spacing: 0.3em; color: var(--ink-mute); }
.proj-kicker::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; margin-right: 0.7rem; border-radius: 50%; background: var(--shu); vertical-align: middle; }
.proj h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); line-height: 1.12; text-wrap: balance; }
.proj-lead { max-width: 43rem; margin: 2rem 0 0 auto; font-size: 1.2rem; line-height: 1.7; color: var(--ink-soft); text-wrap: pretty; }
.proj-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 46rem) minmax(0, 1fr); padding: 3.5rem 0 0; border-top: 1px solid var(--line); margin-top: 5rem; scroll-margin-top: 1.5rem; }
.proj-section > * { grid-column: 2; min-width: 0; }
.proj h2 { font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.2; letter-spacing: 0; color: var(--ink); margin: 0 0 2.4rem; text-wrap: balance; }
.proj h2::before { content: none; }
.proj-section > .proj-chapter { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 1.2rem; }
.proj-chapter-n { flex-shrink: 0; color: var(--shu); font-size: 0.85rem; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.proj-section > h3, .proj-explanation h3, .proj-uses h3 { font-size: 1.4rem; font-style: italic; line-height: 1.3; margin: 2.6rem 0 0.8rem; color: var(--ink); }
.proj-section > p, .proj-explanation p, .proj-uses p { font-size: 1.075rem; line-height: 1.75; color: var(--ink-soft); margin: 0 0 0.9rem; text-wrap: pretty; }
.proj-section strong { font-weight: 400; color: var(--ink); }
/* L'albero e la legenda condividono la larghezza del foglio. */
.proj-section > :is(.proj-anatomy, .proj-uses, .proj-screen, .proj-pipe, .proj-evaluation, .proj-loop, .proj-band, .proj-time) { grid-column: 1 / -1; }
.proj-anatomy { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.proj-tree { margin: 0; }
.proj-tree svg { width: 100%; height: auto; display: block; }
.proj-tree figcaption, .proj-fruits figcaption { font-size: 0.88rem; line-height: 1.5; font-style: italic; color: var(--ink-mute); text-align: center; }
.proj-parts { border-top: 0; padding-top: 0; }
.proj-parts dl { align-items: start; gap: 1rem 0.8rem; margin: 0; }
.proj-parts dd { font-size: 0.95rem; line-height: 1.5; }
.proj-parts dd strong { display: block; font-size: 1.08rem; margin-bottom: 0.1rem; }
.proj-parts .swatch .fruit { opacity: 1; animation: none; }
.proj-parts .swatch .panelshape { fill: none; stroke: var(--ink-mute); stroke-width: 1.4; stroke-linejoin: round; }
/* Le schermate restano integre, grandi e apribili a misura originale. */
.proj-screen { margin: 2.8rem 0 1rem; scroll-margin-top: 1rem; }
.proj-screen-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; margin-bottom: 1rem; }
.proj-screen-tabs button { font: inherit; font-size: 1.05rem; font-style: italic; color: var(--ink-soft); background: none; border: 0; border-bottom: 1px solid transparent; padding: 0.3rem 0; cursor: pointer; }
.proj-screen-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--shu); }
.proj-screen-tabs button:hover { color: var(--ink); }
.proj-screen-tabs button:focus-visible, .proj-screen-image:focus-visible { outline: 2px solid var(--shu); outline-offset: 4px; }
.proj-screen-image { display: block; aspect-ratio: 16 / 9; border: 1px solid var(--line); background: var(--paper); cursor: zoom-in; box-shadow: 0 1rem 2.5rem -1.5rem color-mix(in srgb, var(--ink) 25%, transparent); }
.proj-screen-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.proj-roots-art { grid-column: 1 / -1; justify-self: center; width: 100%; max-width: 46rem; aspect-ratio: 1000 / 285; margin: 1.6rem 0 0; background: var(--ink); -webkit-mask: url(/progetto-radici.png) center / contain no-repeat; mask: url(/progetto-radici.png) center / contain no-repeat; }
.proj-screen figcaption { max-width: 46rem; margin: 1rem auto 0; font-size: 0.9rem; line-height: 1.6; font-style: italic; color: var(--ink-soft); }
.proj-screen figcaption span { color: var(--ink-mute); }
/* Il percorso della fonte: la linea unisce cinque passaggi, Jev ha l'accento vermiglio. */
.proj-pipe { list-style: none; padding: 0; margin: 2rem 0 1rem; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem; }
.proj-pipe li { position: relative; font-size: 0.95rem; line-height: 1.6; color: var(--ink-soft); }
.proj-pipe li strong { display: block; margin: 1rem 0 0.5rem; font-size: 1.12rem; line-height: 1.3; }
.proj-pipe-n { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--ink-faint); border-radius: 50%; font-size: 0.85rem; color: var(--ink-mute); background: var(--paper); position: relative; z-index: 1; }
.proj-pipe li:not(:last-child)::after { content: ""; position: absolute; top: 1rem; left: 2.5rem; right: -1rem; border-top: 1px solid var(--line); }
.proj-pipe li:nth-child(4) .proj-pipe-n { border-color: var(--shu); color: var(--shu); }
/* Spiegazione e giudizio reale, affiancati come testo e nota a margine. */
.proj-evaluation { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: start; margin: 3rem 0 0; }
.proj-explanation h3 { margin-top: 0; }
.proj-judgment { margin: 0; padding: 1.7rem; border-top: 2px solid var(--leaf); background: var(--panel); }
.proj-judgment figcaption { font-size: 1rem; line-height: 1.5; font-style: italic; color: var(--ink); margin-bottom: 1.6rem; }
.proj-judgment dl { display: grid; grid-template-columns: 1fr; gap: 0.35rem; margin: 0; }
.proj-judgment dt { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.65rem; }
.proj-judgment dd { margin: 0; display: grid; grid-template-columns: 1fr 8.5rem; gap: 1rem; align-items: center; font-size: 0.88rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.proj-bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.proj-bar i { display: block; height: 100%; background: var(--leaf); }
.proj-verdict { margin: 1.6rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.95rem; line-height: 1.6; color: var(--ink-soft); }
/* Economia: quattro passaggi aperti, con numeri grandi e separatori leggeri. */
.proj-loop { list-style: none; padding: 0; margin: 2rem 0 2.4rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; counter-reset: giro; }
.proj-loop li { counter-increment: giro; position: relative; padding: 1.2rem 0 0 3.4rem; border-top: 1px solid var(--line); font-size: 1rem; line-height: 1.65; color: var(--ink-soft); }
.proj-loop li::before { content: counter(giro, decimal-leading-zero); position: absolute; left: 0; top: 1rem; font-size: 1.65rem; color: var(--ink-faint); line-height: 1.2; }
.proj-loop li strong { display: block; margin-bottom: 0.6rem; font-size: 1.25rem; line-height: 1.3; }
.proj-loop li:last-child::after { content: "↺ e il giro ricomincia"; display: block; margin-top: 0.8rem; font-size: 0.88rem; font-style: italic; color: var(--shu); }
html[lang="en"] .proj-loop li:last-child::after { content: "↺ and the cycle starts again"; }
.proj-band { margin: 2.5rem calc(50% - 50vw); padding-block: 4rem; }
.proj-band .pub-grove { margin: 0; padding-bottom: 0; border-bottom: 0; }
/* Le date restano una piccola linea del tempo, dopo il racconto personale. */
.proj-time { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.8rem; border-top: 1px solid var(--ink-faint); }
.proj-time li { position: relative; padding-top: 1.3rem; font-size: 0.95rem; line-height: 1.6; color: var(--ink-soft); }
.proj-time li::before { content: ""; position: absolute; top: -0.25rem; left: 0; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--ink); }
.proj-time time { display: block; color: var(--ink); margin-bottom: 0.4rem; }
/* Uso personale: il racconto e i frutti, poi la foresta reale. */
.proj-section > .pub-who { grid-column: 1 / -1; justify-content: flex-start; margin: -0.5rem 0 2.5rem; font-size: 1.2rem; }
.proj-uses { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 3rem; align-items: center; }
.proj-uses h3 { margin-top: 0; }
.proj-fruit-key { list-style: none; padding: 0; margin: 1.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.8rem 1.4rem; font-size: 0.95rem; font-style: italic; color: var(--ink-soft); }
.proj-fruit-key li { display: flex; align-items: center; gap: 0.45rem; }
.proj-fruit-key svg { width: 0.9rem; height: 0.9rem; overflow: visible; }
.proj-fruit-key .fruit, .proj-fruits .fruit { opacity: 1; animation: none; }
.proj-fruits { margin: 0; }
.proj-fruits svg { width: 100%; height: auto; display: block; max-height: 32rem; }
.proj-fruits :is(.radici, .ground, .fallen, .label, .count, .period, .name, .root-label) { display: none; }
@media (hover: none) { .proj-hover-hint { display: none; } }
#perche > .proj-chapter + p { font-size: 1.25rem; line-height: 1.75; }
.proj-section > .proj-company { margin-top: 3rem; }
.proj-sign { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem 3rem; margin-top: 5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.proj-sign p { margin: 0; line-height: 1.7; color: var(--ink-soft); font-style: italic; }
.proj-sign .pub-actions { align-items: center; margin: 0; }
@media (max-width: 900px) {
  .proj-anatomy { grid-template-columns: 1fr; gap: 2rem; }
  .proj-tree { width: 100%; max-width: 40rem; justify-self: center; }
  .proj-parts dl { grid-template-columns: 2.4rem minmax(0, 1fr) 2.4rem minmax(0, 1fr); column-gap: 1rem; }
  .proj-evaluation, .proj-uses { gap: 2rem; }
  .proj-pipe { grid-template-columns: 1fr; gap: 1.2rem; max-width: 46rem; width: 100%; justify-self: center; }
  .proj-pipe li { padding-left: 3.2rem; }
  .proj-pipe-n { position: absolute; left: 0; top: 0; }
  .proj-pipe li strong { margin: 0 0 0.3rem; }
  .proj-pipe li:not(:last-child)::after { top: 2.5rem; bottom: -0.7rem; left: 1rem; right: auto; border-top: 0; border-left: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .proj { padding-bottom: 2rem; }
  .proj-head { padding-top: 2.5rem; }
  .proj-lead { font-size: 1.1rem; margin-top: 1.6rem; }
  .proj-section { margin-top: 3.5rem; padding-top: 2.5rem; }
  .proj-section > .proj-chapter { gap: 0.8rem; margin-bottom: 1.8rem; }
  .proj-anatomy, .proj-evaluation, .proj-uses, .proj-loop { grid-template-columns: 1fr; }
  .proj-anatomy { gap: 2rem; }
  .proj-parts dl { grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0.9rem 0.6rem; }
  .proj-judgment { padding: 1.3rem; }
  .proj-screen { margin-top: 2rem; }
  .proj-section > .pub-who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; font-size: 1.1rem; margin-bottom: 2rem; }
  .proj .pub-who li + li::before { content: none; }
  .proj-time { grid-template-columns: 1fr; gap: 0; border-top: 0; border-left: 1px solid var(--ink-faint); padding-left: 1.3rem; }
  .proj-time li { padding: 0 0 1.3rem; }
  .proj-time li::before { top: 0.5rem; left: -1.55rem; }
  #perche > .proj-chapter + p { font-size: 1.15rem; }
  .proj-sign { margin-top: 3.5rem; }
  .proj-sign .pub-actions { align-items: flex-start; flex-direction: column; }
}

/* Catalogo del bosco (`/autori`, src/routes/author-routes.mjs): ricerca, iniziali, autori in due
   colonne da computer. Inchiostro su carta; il vermiglio resta per gli accenti. */
.pub-catalog-search { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; margin: 2.4rem 0 0.6rem; max-width: 40rem; }
.pub-catalog-search label { width: 100%; font-size: 0.85rem; letter-spacing: 0.2em; color: var(--ink-mute); }
.pub-catalog-search input { flex: 1; min-width: 12rem; font: inherit; font-size: 1.2rem; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--ink-faint); padding: 0.3rem 0; }
.pub-catalog-search input:focus { outline: none; border-bottom-color: var(--ink); }
.pub-catalog-search button { font: inherit; font-style: italic; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--ink-faint); padding: 0 0 0.05rem; cursor: pointer; }
.pub-catalog-count { font-size: 0.9rem; font-style: italic; color: var(--ink-mute); margin: 0 0 1.4rem; }
.pub-catalog-count a { color: var(--ink-soft); }
.pub-catalog-letters { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0 0 1rem; font-style: italic; }
.pub-catalog-letters a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid transparent; }
.pub-catalog-letters a:hover { border-color: var(--ink-faint); }
.pub-catalog-group { border-top: 1px solid var(--line); padding: 1.2rem 0 0.4rem; scroll-margin-top: 4.5rem; }
.pub-catalog-group h2 { font-size: 1.4rem; font-weight: normal; font-style: italic; color: var(--ink-mute); margin: 0 0 0.4rem; }
.pub-catalog-group ul { list-style: none; margin: 0; padding: 0; columns: 2 20rem; column-gap: 3rem; }
.pub-catalog-group li { break-inside: avoid; display: flex; flex-direction: column; gap: 0.1rem; margin: 0 0 1rem; }
.pub-catalog-group li a { font-size: 1.15rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink-faint); align-self: flex-start; }
.pub-catalog-group li a:hover { border-color: var(--ink); }
.pub-catalog-who { font-style: italic; font-size: 0.92rem; color: var(--ink-soft); }
.pub-catalog-group small { font-size: 0.82rem; color: var(--ink-mute); }
.pub-catalog-none { font-size: 1.05rem; color: var(--ink-soft); }
