/*
  AETHER — design system condiviso da tutte le pagine.
  Impaginazione, tipografia e movimento derivano dal template "Evenkeel" di 8B
  (https://8b.com/templates/evenkeel/ · codice MIT, copia in reference/).
  Palette di prodotto: orange & teal. Carta calda, inchiostro nero-petrolio,
  l'arancio e il teal come accenti. Gli elementi d'accento a superficie (bottoni,
  punti, barre, tessere) sono "buchi" nella pagina: sotto scorre lo sfondo
  Grainient (assets/js/lib/holes.js), con la stessa palette.
*/

/* latin-ext */
@font-face {
  font-family: 'Host Grotesk';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/hostgrotesk/v5/co3BmWBnlCJ3U42vbbfdwMjZqljm0U0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Host Grotesk';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/hostgrotesk/v5/co3BmWBnlCJ3U42vbbfdwMjZpFjm.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@layer tokens, base, atoms, layout, components, sections, pages, scenes, holes;

@layer tokens {
:root {
  --color-1: #fbf7f1; /* carta, calda */
  --color-2: #0f1e20; /* inchiostro: nero petrolio */
  --color-3: #f2eadf; /* superficie: sabbia */
  --color-4: #5c6866; /* testo secondario: grigio teal (5,4:1 sulla carta) */
  --color-5: #959891; /* tracce, ghost */
  --color-6: #e8611c; /* arancio: l'accento */
  --color-7: #b8470f; /* arancio profondo: testo in accento (5:1), premuto */
  --color-8: #e2d8ca; /* filetti */
  --color-9: #b3261e; /* errori */
  --color-10: #0f6f6b; /* teal (5,6:1 sulla carta) */
  --color-11: #0a4d4a; /* teal profondo */
  --color-12: #f6c7a1; /* pesca: le luci della palette */
  /* lo sfondo che si vede dai buchi: dal teal profondo all'arancio chiaro, mai vicino alla carta o all'inchiostro */
  --hole-1: #0b4746;
  --hole-2: #10726c;
  --hole-3: #279a8e;
  --hole-4: #ec6620;
  --hole-5: #f8a565;
  /* finché lo sfondo animato non è pronto (o senza WebGL) i buchi mostrano questo */
  --hole-fallback: radial-gradient(120% 140% at 85% 110%, var(--hole-5) 0%, var(--hole-4) 28%, transparent 56%), linear-gradient(140deg, var(--hole-1) 0%, var(--hole-2) 38%, var(--hole-3) 70%, var(--hole-4) 100%);
  --font-1: "Host Grotesk", "Host Grotesk Fallback", Arial, sans-serif;
  --radius-1: 999px;
  --shadow-1: 0 0 0 1.5px var(--color-1);
  --shadow-2: inset 0 0 0 1px var(--color-2);
  --shadow-3: inset 0 0 0 1px var(--color-8);
  --space-1: clamp(16px, 2.4vw, 32px);
  --space-2: max(var(--space-1), 31vw - 110px);
  --space-3: max(112px, 40vw - 40px);
  --space-4: clamp(10px, 1.1vw, 16px);
  --ease-1: cubic-bezier(0.7, 0, 0.2, 1);
  --ease-2: cubic-bezier(0.2, 0.7, 0.2, 1);
}
}

@layer base {
@font-face { font-family: "Host Grotesk Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica"); font-weight: 100 549; size-adjust: 101.7%; ascent-override: 100.3%; descent-override: 31.5%; line-gap-override: 0%; }
@font-face { font-family: "Host Grotesk Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"); font-weight: 550 799; size-adjust: 96.5%; ascent-override: 105.7%; descent-override: 33.2%; line-gap-override: 0%; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
body { margin: 0; background: var(--color-1); color: var(--color-2); font-family: var(--font-1); font-size: 15px; font-weight: 400; line-height: 1.45; letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd, fieldset { margin: 0; }
fieldset { padding: 0; border: 0; min-width: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--color-10); color: var(--color-1); }
:focus-visible { outline: 2px solid var(--color-6); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
main { position: relative; z-index: 1; display: block; }
.skip { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 10px 16px; border-radius: var(--radius-1); background: var(--color-2); color: var(--color-1); font-weight: 600; text-decoration: none; transform: translateY(-160%); transition: transform 0.3s var(--ease-1); }
.skip:focus { transform: none; }
/* il canvas di un buco (holes.js): di base riempie il suo host, che lo ritaglia; il CSS dell'host lo può spostare */
.hole { position: absolute; inset: 0; z-index: -1; display: block; width: 100%; height: 100%; border-radius: inherit; pointer-events: none; }
.has-hole { isolation: isolate; }
/* un buco qualsiasi: <div data-hole>…</div> (il testo dentro sceglie chiaro o scuro da solo) */
[data-hole] { position: relative; overflow: hidden; background: var(--hole-fallback) fixed; color: var(--color-1); }
[data-hole][data-hole-tone="light"] { color: var(--color-2); }
}

@layer atoms {
/* tipografia */
.m-text { font-family: var(--font-1); font-size: 15px; font-weight: 400; line-height: 1.45; letter-spacing: -0.005em; }
.m-text-2 { font-family: var(--font-1); font-size: clamp(34px, 6.25vw, 112px); font-weight: 500; line-height: 0.88; letter-spacing: -0.05em; }
.m-text-3 { font-family: var(--font-1); font-size: 12px; font-weight: 600; line-height: 1.25; letter-spacing: 0; }
.m-text-4 { font-family: var(--font-1); font-size: clamp(19px, 1.75vw, 28px); font-weight: 500; line-height: 1.12; letter-spacing: -0.025em; }
.m-text-5 { font-family: var(--font-1); font-size: clamp(26px, 3.4vw, 54px); font-weight: 500; line-height: 0.98; letter-spacing: -0.04em; }
.m-lead { font-family: var(--font-1); font-size: clamp(17px, 1.35vw, 21px); font-weight: 400; line-height: 1.38; letter-spacing: -0.015em; }

/* bottoni: pillola nera; al passaggio si apre da sinistra un buco sullo sfondo.
   La variante accento è già un buco: al passaggio la chiude l'inchiostro. */
.m-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 26px; border: 0; border-radius: var(--radius-1); background: var(--color-2); color: var(--color-1); font-family: var(--font-1); font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: -0.01em; text-decoration: none; overflow: hidden; isolation: isolate; cursor: pointer; white-space: nowrap; transition: color 0.35s; }
.m-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hole-fallback) fixed; clip-path: inset(0 63% 0 37%); transition: clip-path 0.55s var(--ease-1); }
.m-btn > .hole { z-index: -2; clip-path: inset(0 63% 0 37%); transition: clip-path 0.55s var(--ease-1); }
.holes-live .m-btn:not(.m-btn--accent):not(.m-btn--ghost)::before { content: none; }
.m-btn__label { position: relative; }
.m-btn__glyph { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; flex: none; }
.m-btn--accent { background: var(--hole-fallback) fixed; }
.m-btn--accent > .hole { clip-path: none; transition: none; }
.m-btn--accent::before, .m-btn--ghost::before { background: var(--color-2); clip-path: none; transform: scaleX(0); transform-origin: 37% 50%; transition: transform 0.55s var(--ease-1); }
.m-btn--accent[data-hole-tone="light"] { color: var(--color-2); }
.m-btn--ghost { background: transparent; color: var(--color-2); box-shadow: var(--shadow-2); }
.m-btn--small { min-height: 38px; padding: 0 18px; font-size: 14px; }
.m-btn[disabled], .m-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
@media (hover: hover) {
  .m-btn:not([disabled]):hover::before, .m-btn:not([disabled]):hover > .hole { clip-path: inset(0 0 0 0); }
  .m-btn--accent:not([disabled]):hover::before, .m-btn--ghost:not([disabled]):hover::before { transform: scaleX(1); }
  .m-btn:not(.m-btn--accent):not(.m-btn--ghost):not([disabled]):hover[data-hole-tone="light"] { color: var(--color-2); }
  .m-btn--accent:not([disabled]):hover, .m-btn--ghost:not([disabled]):hover { color: var(--color-1); }
}
.m-btn.is-busy .m-btn__label { opacity: 0.55; }
.m-btn.is-busy::after { content: ""; width: 14px; height: 14px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: m-spin 0.7s linear infinite; }
@keyframes m-spin { to { transform: rotate(360deg); } }

.m-btn-3 { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 0 16px; border: 0; border-radius: var(--radius-1); background: var(--color-2); color: var(--color-1); box-shadow: var(--shadow-1); font-family: var(--font-1); font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: 0; text-decoration: none; overflow: hidden; isolation: isolate; cursor: pointer; white-space: nowrap; transition: color 0.3s; }
.m-btn-3::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hole-fallback) fixed; clip-path: inset(0 63% 0 37%); transition: clip-path 0.5s var(--ease-1); }
.m-btn-3 > .hole { z-index: -2; clip-path: inset(0 63% 0 37%); transition: clip-path 0.5s var(--ease-1); }
.holes-live .m-btn-3::before { content: none; }
.m-btn-3__label { position: relative; }
.m-btn-3--light { background: var(--color-1); color: var(--color-2); box-shadow: inset 0 0 0 1px var(--color-2), var(--shadow-1); }
@media (hover: hover) {
  .m-btn-3:hover::before, .m-btn-3:hover > .hole { clip-path: inset(0 0 0 0); }
  .m-btn-3--light:hover { color: var(--color-1); }
  .m-btn-3:hover[data-hole-tone="light"] { color: var(--color-2); }
}

/* link: filetto sotto, superficie che sale al passaggio */
.m-link { color: var(--color-2); font-weight: 600; text-decoration: none; background-image: linear-gradient(var(--color-2), var(--color-2)), linear-gradient(var(--color-3), var(--color-3)); background-repeat: no-repeat; background-position: 0 100%, 0 100%; background-size: 100% 1px, 100% 0%; padding: 0 1px 1px; transition: background-size 0.45s var(--ease-1); cursor: pointer; border: 0; background-color: transparent; font: inherit; font-weight: 600; }
@media (hover: hover) { .m-link:hover { background-size: 100% 1px, 100% 100%; } }
.m-link-2 { color: var(--color-1); font-weight: 600; text-decoration: none; background-image: linear-gradient(var(--color-1), var(--color-1)), linear-gradient(var(--color-7), var(--color-7)); background-repeat: no-repeat; background-position: 0 100%, 0 100%; background-size: 100% 1px, 100% 0%; padding: 0 1px 1px; transition: background-size 0.45s var(--ease-1); }
@media (hover: hover) { .m-link-2:hover { background-size: 100% 1px, 100% 100%; } }
.m-link-3 { color: var(--color-2); font-family: var(--font-1); font-size: clamp(34px, 5vw, 76px); font-weight: 500; line-height: 0.95; letter-spacing: -0.05em; text-decoration: none; background-image: linear-gradient(var(--color-2), var(--color-2)), linear-gradient(var(--color-3), var(--color-3)); background-repeat: no-repeat; background-position: 0 100%, 0 100%; background-size: 100% 2px, 100% 0%; transition: background-size 0.45s var(--ease-1); }
@media (hover: hover) { .m-link-3:hover { background-size: 100% 2px, 100% 100%; } }

/* icona tonda */
.m-icon { position: relative; display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border: 1px solid var(--color-2); border-radius: var(--radius-1); background: var(--color-1); color: var(--color-2); overflow: hidden; isolation: isolate; cursor: pointer; padding: 0; text-decoration: none; }
.m-icon::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--color-2); transform: scaleX(0); transition: transform 0.45s var(--ease-1); }
.m-icon__glyph { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: color 0.3s; }
.m-icon--small { width: 36px; height: 36px; }
.m-icon--small .m-icon__glyph { width: 16px; height: 16px; }
@media (hover: hover) { .m-icon:hover::before { transform: scaleX(1); } .m-icon:hover { color: var(--color-1); } }

/* superfici */
.m-surface { background: var(--color-3); color: var(--color-2); }
.m-surface-2 { background: var(--color-1); color: var(--color-2); box-shadow: var(--shadow-2); }
.m-surface-3 { background: var(--color-2); color: var(--color-1); }
.m-surface-4 { position: relative; background: var(--hole-fallback) fixed; color: var(--color-1); transition: color 0.4s; }
.m-surface-4[data-hole-tone="light"] { color: var(--color-2); }
.m-photo { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.04); background: var(--color-3); }

/* campi: una sola riga sotto, come su carta */
.m-field { display: grid; gap: 6px; }
.m-field__label { font-family: var(--font-1); font-size: 12px; font-weight: 600; line-height: 1.25; letter-spacing: 0; }
.m-field__input { width: 100%; padding: 8px 0 9px; border: 0; border-bottom: 1px solid var(--color-2); border-radius: 0; background: transparent; color: var(--color-2); font-family: var(--font-1); font-size: 17px; font-weight: 400; line-height: 1.3; resize: vertical; }
.m-field__input::placeholder { color: var(--color-5); }
.m-field__input:focus-visible { outline: 2px solid var(--color-6); outline-offset: 2px; }
.m-field__input--big { font-size: clamp(24px, 2.6vw, 40px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.08; }
select.m-field__input { appearance: none; -webkit-appearance: none; padding-right: 28px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f1e20' stroke-width='1.6'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 2px center / 18px; cursor: pointer; }
textarea.m-field__input { min-height: 3.2em; }
.m-field__meta { display: flex; justify-content: space-between; gap: 12px; color: var(--color-4); }
.m-field__count.is-over { color: var(--color-9); }
.m-field.is-invalid .m-field__input { border-bottom-color: var(--color-9); }
.m-field__error { color: var(--color-9); }

/* chip: filtri, ruoli, categorie */
.m-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.m-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 14px; border: 0; border-radius: var(--radius-1); background: var(--color-1); color: var(--color-2); box-shadow: var(--shadow-3); font-family: var(--font-1); font-size: 13px; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer; transition: box-shadow 0.25s, background-color 0.25s, color 0.25s; white-space: nowrap; }
.m-chip[aria-pressed="true"], .m-chip[aria-checked="true"], .m-chip.is-on { background: var(--color-2); color: var(--color-1); box-shadow: inset 0 0 0 1px var(--color-2); }
@media (hover: hover) { .m-chip:not(.is-static):hover { box-shadow: inset 0 0 0 1px var(--color-2); } }
.m-chip.is-static { cursor: default; min-height: 26px; padding: 0 11px; font-size: 12px; }
.m-chip.is-accent { overflow: hidden; isolation: isolate; background: var(--hole-fallback) fixed; color: var(--color-1); box-shadow: none; }
.m-chip.is-accent[data-hole-tone="light"] { color: var(--color-2); }
.m-chip__dot { position: relative; width: 7px; height: 7px; border-radius: 50%; overflow: hidden; background: var(--hole-fallback) fixed; }

/* etichetta, badge */
.m-tag { display: inline-block; color: var(--color-4); font-size: 12px; font-weight: 600; line-height: 1.25; }
.m-badge { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border-radius: var(--radius-1); overflow: hidden; isolation: isolate; background: var(--hole-fallback) fixed; color: var(--color-1); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; transition: color 0.4s; }
.m-badge[data-hole-tone="light"] { color: var(--color-2); }
.m-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* avatar: foto in bianco e nero come nel template, iniziali se manca */
.m-avatar { --size: 40px; position: relative; display: inline-grid; place-items: center; flex: none; width: var(--size); height: var(--size); border-radius: 50%; overflow: hidden; background: var(--color-2); color: var(--color-1); font-size: calc(var(--size) * 0.38); font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.m-avatar img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.04); transition: filter 0.5s; }
a.m-avatar:hover img { filter: none; }

/* testo vuoto / caricamento */
.m-skel { display: block; height: 0.9em; border-radius: 4px; background: linear-gradient(90deg, var(--color-3) 0%, var(--color-8) 50%, var(--color-3) 100%) 0 0 / 200% 100%; animation: m-skel 1.4s ease-in-out infinite; }
@keyframes m-skel { to { background-position: -200% 0; } }

.u-muted { color: var(--color-4); }
.u-accent { color: var(--color-7); }
.u-num { font-variant-numeric: tabular-nums; }
.u-nowrap { white-space: nowrap; }
}

@layer layout {
.l-a, .l-b { display: block; }
.l-a { margin-left: var(--space-2); }
.l-b { margin-left: calc(var(--space-3) + var(--space-4)); }
.l-left { display: inline-block; width: calc(var(--space-3) - var(--space-4)); margin-right: calc(var(--space-4) * 2); text-align: right; }
.l-rule { position: absolute; top: 0; bottom: 0; left: var(--space-3); width: 1px; background: var(--color-2); }
.l-ledger { display: grid; grid-template-columns: var(--space-2) calc(var(--space-3) - var(--space-2)) minmax(0, 1fr) minmax(120px, 15vw); padding-right: var(--space-1); }
.l-ledger > :first-child { padding-left: var(--space-1); }
/* due colonne appese al filetto: etichetta a sinistra, contenuto a destra */
.l-hang { position: relative; display: grid; grid-template-columns: var(--space-3) minmax(0, 1fr); }
.l-hang__left { padding: 0 var(--space-4) 0 var(--space-1); text-align: right; }
.l-hang__right { padding: 0 var(--space-1) 0 var(--space-4); min-width: 0; }
@media (max-width: 700px) {
  .l-hang { grid-template-columns: 1fr; gap: 10px; }
  .l-hang > .l-rule { display: none; }
  .l-hang__left { text-align: left; padding: 0 var(--space-1); }
  .l-hang__right { padding: 0 var(--space-1); }
}
}

@layer components {
/* ── navigazione ─────────────────────────────────────────────── */
#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: 64px; pointer-events: none; transition: transform 0.5s var(--ease-1); }
#nav.is-hidden { transform: translateY(-110%); }
#nav .nav__logo { position: absolute; top: 11px; left: var(--space-2); display: block; height: 43px; aspect-ratio: 382.37 / 591.85; pointer-events: auto; }
/* il marchio (assets/img/brand/logo.svg, dal kit): il profilo con la stella sulla guancia.
   La silhouette è una maschera colorata con --mark-ink; la stella è un buco sullo sfondo, come
   ogni accento del sito. Un contorno di carta da 1 px la tiene leggibile sopra le zone scure. */
#nav .nav__mark, .brand-mark { --mark-ink: var(--color-2); position: absolute; inset: 0; display: block; filter: drop-shadow(1px 0 0 var(--mark-edge, var(--color-1))) drop-shadow(-1px 0 0 var(--mark-edge, var(--color-1))) drop-shadow(0 1px 0 var(--mark-edge, var(--color-1))) drop-shadow(0 -1px 0 var(--mark-edge, var(--color-1))); }
#nav .nav__mark::before, .brand-mark::before { content: ""; position: absolute; inset: 0; background: var(--mark-ink); -webkit-mask: url(../img/brand/logo.svg) center / contain no-repeat; mask: url(../img/brand/logo.svg) center / contain no-repeat; transition: background-color 1.3s var(--ease-1); }
#nav .nav__mark::after, .brand-mark::after, #nav .nav__mark > .hole, .brand-mark > .hole { content: ""; position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border-radius: 0; background: var(--hole-fallback) fixed; -webkit-mask: url(../img/brand/logo-star.svg) center / contain no-repeat; mask: url(../img/brand/logo-star.svg) center / contain no-repeat; transform-origin: 72.133% 43.802%; transition: transform 0.9s var(--ease-1); }
.holes-live #nav .nav__mark::after, .holes-live .brand-mark::after { visibility: hidden; }
/* al passaggio la stella fa un giro di 72°: torna identica */
#nav .nav__logo:hover .nav__mark::after, #nav .nav__logo:hover .nav__mark > .hole, #nav .nav__logo:focus-visible .nav__mark > .hole { transform: rotate(72deg); }
/* di notte (sezione "Una notte", html.is-night) il profilo diventa carta */
.is-night #nav .nav__mark { --mark-ink: var(--color-1); --mark-edge: transparent; }
#nav .nav__actions { position: absolute; top: 16px; right: var(--space-1); display: flex; align-items: center; gap: 8px; pointer-events: auto; }
#nav .menu { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto; background: var(--color-1); pointer-events: auto; overflow-y: auto; padding: 18px var(--space-1) 24px 0; }
#nav .menu__rule { position: absolute; top: 0; bottom: 0; left: var(--space-3); width: 1px; background: var(--color-2); }
#nav .menu__top { display: flex; justify-content: flex-end; }
#nav .menu__list { align-self: center; display: grid; gap: clamp(6px, 1.4vh, 14px); padding: 32px 0; }
#nav .menu__list li:nth-child(odd) { margin-left: var(--space-2); }
#nav .menu__list li:nth-child(even) { margin-left: calc(var(--space-3) + var(--space-4)); }
#nav .menu__list li:nth-child(odd) .m-link-3 { background-color: var(--color-1); }
#nav .menu__foot { margin-left: calc(var(--space-3) + var(--space-4)); display: grid; gap: 4px; }
@media (max-width: 560px) { #nav .nav__download { display: none; } }

/* account: pulsante Accedi o avatar con menu */
.account { position: relative; }
.account__button { --size: 34px; padding: 0; border: 0; cursor: pointer; box-shadow: 0 0 0 1.5px var(--color-1), 0 0 0 2.5px var(--color-2); }
.account__menu { position: absolute; top: calc(100% + 10px); right: 0; min-width: 240px; padding: 8px 0; background: var(--color-1); box-shadow: var(--shadow-2); }
.account__head { display: grid; gap: 2px; padding: 10px 16px 12px; border-bottom: 1px solid var(--color-8); }
.account__head span:last-child { color: var(--color-4); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__item { display: flex; width: 100%; padding: 10px 16px; border: 0; background: none; text-align: left; text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer; }
.account__item:hover { background: var(--color-3); }
.account__item--out { border-top: 1px solid var(--color-8); color: var(--color-4); }

/* ── testata delle pagine interne ───────────────────────────── */
.page-head { position: relative; overflow-x: clip; padding: clamp(108px, 17vh, 176px) var(--space-1) clamp(36px, 7vh, 72px) 0; }
.page-head__rule { transform-origin: 50% 0; }
.page-head__meta { display: grid; gap: 2px; margin-bottom: clamp(36px, 7vh, 80px); }
.page-head__title .ln { display: block; }
.page-head__title .ln__i { display: inline-block; position: relative; }
/* come nel template: le righe che incrociano il filetto lo coprono con la carta */
.page-head__title .ln.l-a .ln__i { background: var(--color-1); padding-right: 0.08em; }
.page-head__lead { max-width: 46ch; margin-top: clamp(22px, 4vh, 40px); }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: clamp(22px, 4vh, 36px); }
@media (prefers-reduced-motion: no-preference) {
  .page-head__rule { animation: m-draw 1s var(--ease-1) backwards; }
  .page-head__title .ln { animation: m-from-rule 0.9s var(--ease-2) backwards; }
  .page-head__title .ln:nth-child(2) { animation-delay: 0.06s; }
  .page-head__title .ln:nth-child(3) { animation-delay: 0.12s; }
  .page-head__lead, .page-head__actions { animation: m-rise 0.8s 0.25s var(--ease-2) backwards; }
}
@keyframes m-draw { from { transform: scaleY(0); } }
@keyframes m-from-rule { from { transform: translateX(-44px); opacity: 0; } }
@keyframes m-rise { from { transform: translateY(14px); opacity: 0; } }

/* ── pannello a tutto schermo (composer, modifica profilo) ───── */
.m-sheet { position: fixed; inset: 0; z-index: 70; background: var(--color-1); overflow-y: auto; overscroll-behavior: contain; }
.m-sheet__rule { position: absolute; top: 0; bottom: 0; left: var(--space-3); width: 1px; background: var(--color-2); min-height: 100%; }
.m-sheet__top { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px var(--space-1) 14px calc(var(--space-3) + var(--space-4)); background: color-mix(in srgb, var(--color-1) 92%, transparent); backdrop-filter: blur(6px); }
.m-sheet__body { position: relative; padding: clamp(24px, 6vh, 64px) 0 clamp(64px, 12vh, 120px); }
.m-sheet__title { margin-bottom: clamp(32px, 6vh, 64px); }
.m-sheet__row { padding-bottom: clamp(26px, 4.5vh, 40px); }
.m-sheet__row .l-hang__left { padding-top: 10px; color: var(--color-4); }
.m-sheet__row .l-hang__left strong { display: block; color: var(--color-2); font-weight: 600; margin-bottom: 4px; }
.m-sheet__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.m-sheet[open-anim] { animation: m-sheet-in 0.55s var(--ease-1); }
@keyframes m-sheet-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

/* ── finestra di dialogo ─────────────────────────────────────── */
.m-dialog { width: min(640px, calc(100vw - 2 * var(--space-1))); max-height: calc(100svh - 48px); padding: 0; border: 0; background: var(--color-1); color: var(--color-2); box-shadow: var(--shadow-2); overflow: auto; }
.m-dialog::backdrop { background: color-mix(in srgb, var(--color-2) 55%, transparent); backdrop-filter: blur(2px); }
.m-dialog[open] { animation: m-dialog-in 0.45s var(--ease-2); }
@keyframes m-dialog-in { from { transform: translateY(18px); opacity: 0; } }
.m-dialog__inner { display: grid; gap: 22px; padding: clamp(22px, 3vw, 36px); }
.m-dialog__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.m-dialog__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

/* ── notifiche ───────────────────────────────────────────────── */
.m-toasts { position: fixed; left: var(--space-1); bottom: var(--space-1); z-index: 90; display: grid; gap: 8px; max-width: min(440px, calc(100vw - 2 * var(--space-1))); pointer-events: none; }
.m-toast { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; background: var(--color-2); color: var(--color-1); font-size: 14px; font-weight: 500; line-height: 1.35; pointer-events: auto; animation: m-toast-in 0.5s var(--ease-2); }
.m-toast::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--hole-fallback) fixed; }
.m-toast > .hole { inset: auto; left: 18px; top: 19px; z-index: 1; width: 8px; height: 8px; border-radius: 50%; }
.holes-live .m-toast:not(.is-error)::before { visibility: hidden; }
.m-toast.is-error::before { background: #ff5d6c; }
.m-toast.is-leaving { animation: m-toast-out 0.35s var(--ease-1) forwards; }
@keyframes m-toast-in { from { transform: translateY(16px); opacity: 0; } }
@keyframes m-toast-out { to { transform: translateY(10px); opacity: 0; } }

/* ── voto: una riga graduata, la bolla-buco segna il punto ── */
.m-rate { --value: 0; position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 560px; }
.m-rate::before { content: ""; position: absolute; left: 0; right: 0; top: 33px; height: 1px; background: var(--color-2); }
.m-rate::after, .m-rate > .hole { content: ""; position: absolute; inset: auto; left: 0; top: 32px; z-index: 0; height: 3px; width: 100%; border-radius: 0; background: var(--hole-fallback) fixed; clip-path: inset(0 calc(100% - var(--value) / 5 * 100%) 0 0); transition: clip-path 0.5s var(--ease-1); }
.holes-live .m-rate::after { content: none; }
.m-rate__opt { position: relative; display: grid; justify-items: start; gap: 10px; padding: 0 8px 0 0; border: 0; background: none; text-align: left; cursor: pointer; }
.m-rate__opt::before { content: ""; position: absolute; left: 0; top: 22px; width: 1px; height: 12px; background: var(--color-2); }
.m-rate__num { font-size: 15px; font-weight: 600; line-height: 1; color: var(--color-4); transition: color 0.25s; }
.m-rate__label { margin-top: 18px; font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--color-4); transition: color 0.25s; }
.m-rate__opt.is-lit .m-rate__num, .m-rate__opt.is-lit .m-rate__label { color: var(--color-2); }
.m-rate__opt[aria-checked="true"] .m-rate__label { color: var(--color-7); }
.m-rate__bubble { position: absolute; top: 27px; left: calc(var(--value) / 5 * 100% - 8px); z-index: 1; width: 16px; height: 14px; border-radius: 50%; overflow: hidden; background: var(--hole-fallback) fixed; opacity: 0; transition: left 0.5s var(--ease-1), opacity 0.3s; pointer-events: none; }
.m-rate.has-value .m-rate__bubble { opacity: 1; }
.m-rate[aria-disabled="true"] .m-rate__opt { cursor: not-allowed; }
@media (max-width: 560px) { .m-rate__label { font-size: 10.5px; } }

/* barretta di sola lettura (media voti) */
.m-meter { position: relative; display: inline-block; width: 64px; height: 6px; border-bottom: 1px solid var(--color-2); vertical-align: middle;
  background: repeating-linear-gradient(to right, var(--color-2) 0 1px, transparent 1px 20%) 0 100% / 100% 6px no-repeat; }
.m-meter__fill { position: absolute; left: 0; bottom: -1px; height: 3px; width: calc(var(--value, 0) / 5 * 100%); overflow: hidden; background: var(--hole-fallback) fixed; }

/* ── stati vuoti ─────────────────────────────────────────────── */
.m-empty { display: grid; gap: 16px; justify-items: start; padding: clamp(40px, 8vh, 80px) 0; }
.m-empty .m-text-4 { max-width: 22ch; }
.m-empty .m-text { max-width: 46ch; color: var(--color-4); }

/* ── avviso in linea ─────────────────────────────────────────── */
.m-note { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; background: var(--color-3); font-size: 14px; line-height: 1.4; }
.m-note::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--hole-fallback) fixed; }
.m-note > .hole { inset: auto; left: 18px; top: 20px; z-index: 1; width: 8px; height: 8px; border-radius: 50%; }
.holes-live .m-note::before { visibility: hidden; }
}

@layer sections {
/* ── domande (comune a landing e download) ─────────────────── */
.fq { position: relative; padding: clamp(110px, 18vh, 200px) 0 clamp(90px, 14vh, 160px); }
.fq .fq-h { margin-bottom: clamp(48px, 9vh, 96px); }
.fq .fq-list { margin: 0 var(--space-1) 0 calc(var(--space-3) + var(--space-4)); }
.fq .fq-item { position: relative; }
.fq .fq-line { position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--color-2); transform-origin: 0 50%; }
.fq .fq-q { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 20px 0 22px; cursor: pointer; list-style: none; }
.fq .fq-q::-webkit-details-marker { display: none; }
.fq .fq-icon { position: relative; flex: none; width: 18px; height: 18px; margin-top: 4px; }
.fq .fq-icon::before, .fq .fq-icon::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 1px); height: 2px; background: var(--color-2); transition: transform 0.35s var(--ease-1); }
.fq .fq-icon::after { transform: rotate(90deg); }
.fq details[open] .fq-icon::after { transform: rotate(0deg); }
.fq .fq-a { max-width: 58ch; padding: 0 0 26px; }
@media (max-width: 700px) { .fq .fq-list { margin-left: var(--space-1); } }

/* ── piè di pagina con parola gigante e ghost fisso ─────────── */
#footer { position: relative; padding: clamp(60px, 10vh, 110px) 0 0; }
#footer .ft-inner { position: relative; z-index: 1; padding: 0 var(--space-1); }
#footer .ft-top { position: relative; display: grid; grid-template-columns: calc(var(--space-3) - var(--space-1)) minmax(0, 1fr) auto; align-items: start; gap: 24px 0; border-top: 1px solid var(--color-2); padding-top: 22px; }
#footer .ft-tag { padding-right: var(--space-4); }
#footer .ft-links { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-left: var(--space-4); }
#footer .ft-icons { display: flex; gap: 8px; }
#footer .ft-word { display: flex; margin-top: clamp(48px, 10vh, 110px); font-size: min(34vw, (100vw - 2 * var(--space-1)) / (var(--len) * 0.45)); line-height: 0.8; white-space: nowrap; }
#footer .ft-a, #footer .ft-b { display: inline-block; }
#footer .ft-b { --hole-bx: 0em; --hole-by: 0.16em; }
#footer .ft-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 16px 0 20px; }
#footer .ghost { position: fixed; left: 0; right: 0; bottom: 0; z-index: 0; display: flex; justify-content: space-between; padding: 0 var(--space-1) 14px; color: var(--color-5); font-size: clamp(44px, 6.25vw, 112px); pointer-events: none; overflow: hidden; }
#footer .ghost span { display: inline-block; line-height: 0.82; }
@media (max-width: 700px) {
  #footer .ft-top { grid-template-columns: 1fr auto; }
  #footer .ft-links { grid-column: 1 / -1; grid-row: 2; padding-left: 0; }
}
/* le pagine interne coprono il ghost con la carta */
.has-paper main { background: var(--color-1); }
}

/* blocco download riutilizzato anche da download.html */
@layer components {
.dl { display: grid; gap: 22px; max-width: 760px; }
.dl__main { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.dl__main .m-btn { min-height: 56px; padding: 0 30px; font-size: 16px; }
.dl__meta { color: var(--color-4); }
.dl__list { border-top: 1px solid var(--color-2); }
.dl__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 18px; padding: 14px 0; border-bottom: 1px solid var(--color-8); }
.dl__item strong { font-weight: 600; }
.dl__item .m-text-3 { color: var(--color-4); }
.dl__tag { position: relative; display: inline-block; margin-left: 10px; padding: 4px 9px; border-radius: var(--radius-1); overflow: hidden; isolation: isolate; background: var(--hole-fallback) fixed; color: var(--color-1); font-size: 11px; font-weight: 600; line-height: 1; vertical-align: 2px; transition: color 0.4s; }
.dl__tag[data-hole-tone="light"] { color: var(--color-2); }
.dl__soon { color: var(--color-4); font-size: 13px; font-weight: 600; }
.dl__mobile { display: grid; gap: 14px; padding: 18px 20px; background: var(--color-3); }
.dl__mobile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
}

@layer components {
/* ── Grainient: il componente (mountGrainient) e lo sfondo dei buchi ── */
.grainient-container { position: relative; width: 100%; height: 100%; overflow: hidden; }
.grainient-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* ── Particles (particles.js, porting del componente React Bits) ── */
.particles-container { position: relative; width: 100%; height: 100%; overflow: hidden; }
.particles-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* ── accesso e iscrizione ────────────────────────────────────── */
.m-dialog--auth { width: min(520px, calc(100vw - 2 * var(--space-1))); }
.au { gap: 20px; }
.au-head { align-items: center; }
.au-head [data-tabs][hidden] + * { margin-left: auto; }
.au-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-1); box-shadow: var(--shadow-3); }
.au-tab { min-height: 32px; padding: 0 15px; border: 0; border-radius: var(--radius-1); background: none; color: var(--color-4); font-family: var(--font-1); font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color 0.3s var(--ease-1), color 0.3s; }
.au-tab[aria-selected="true"] { background: var(--color-2); color: var(--color-1); }
.au-tab:not([aria-selected="true"]):hover { color: var(--color-2); }
.au-pane { display: grid; gap: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .au-pane > * { animation: m-rise 0.5s var(--ease-2) backwards; }
  .au-pane > :nth-child(2) { animation-delay: 0.04s; }
  .au-pane > :nth-child(n + 3) { animation-delay: 0.08s; }
}
.au-lead { max-width: 42ch; color: var(--color-4); }
.au-lead strong { color: var(--color-2); font-weight: 600; overflow-wrap: anywhere; }
.au-google { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 50px; border: 0; border-radius: var(--radius-1); background: var(--color-1); color: var(--color-2); box-shadow: inset 0 0 0 1px var(--color-2); font-family: var(--font-1); font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color 0.3s; }
.au-google:hover { background: var(--color-3); }
.au-google.is-busy { opacity: 0.6; pointer-events: none; }
.au-google__g { width: 18px; height: 18px; flex: none; }
.au-or { display: flex; align-items: center; gap: 14px; color: var(--color-4); }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--color-8); }
.au-form { display: grid; gap: 18px; }
.au-pass { position: relative; display: block; }
.au-pass .m-field__input { padding-right: 46px; }
.au-eye { position: absolute; right: -4px; bottom: 2px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--color-4); cursor: pointer; transition: color 0.25s; }
.au-eye svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.au-eye[aria-pressed="true"] { color: var(--color-2); }
.au-eye[aria-pressed="true"] svg { stroke-dasharray: 60 4; }
.au-eye:hover { color: var(--color-2); }
.au-field.is-invalid .m-field__input { border-bottom-color: var(--color-9); }
.au-error { font-size: 13.5px; font-weight: 500; line-height: 1.4; }
.au-error:empty { display: none; }
.au-error .m-link { color: var(--color-9); }
.au-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 2px; }
.au-switch { color: var(--color-4); }
.au-consent { color: var(--color-4); font-weight: 500; line-height: 1.45; }
.au-consent .m-link { color: inherit; }
.au-strength { display: flex; align-items: center; gap: 12px; margin-top: -8px; color: var(--color-4); }
.au-strength__bars { display: flex; gap: 4px; }
.au-strength__bars i { position: relative; width: 30px; height: 4px; border-radius: 2px; overflow: hidden; background: var(--color-8); transition: background-color 0.3s; }
.au-strength__bars i > .hole { opacity: 0; transition: opacity 0.35s; }
.au-strength[data-strength="1"] i:nth-child(1) { background: var(--color-9); }
.au-strength[data-strength="2"] i:nth-child(-n + 2), .au-strength[data-strength="3"] i:nth-child(-n + 3), .au-strength[data-strength="4"] i { background: var(--hole-fallback) fixed; }
.au-strength[data-strength="2"] i:nth-child(-n + 2) > .hole, .au-strength[data-strength="3"] i:nth-child(-n + 3) > .hole, .au-strength[data-strength="4"] i > .hole { opacity: 1; }
.au-tips { display: grid; gap: 6px; color: var(--color-4); }
.au-tips li { position: relative; padding-left: 16px; }
.au-tips li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 1px; background: currentColor; }
/* busta con un punto-buco che arriva */
.au-sent { position: relative; width: 66px; height: 48px; margin-top: 4px; }
.au-sent__env { position: absolute; inset: 8px 4px 0 0; border: 1.5px solid var(--color-2); border-radius: 4px; overflow: hidden; }
.au-sent__env::before { content: ""; position: absolute; left: 50%; top: -22px; width: 36px; height: 36px; border-right: 1.5px solid var(--color-2); border-bottom: 1.5px solid var(--color-2); transform: translateX(-50%) rotate(45deg); }
.au-sent__dot { position: absolute; right: -2px; top: 0; width: 16px; height: 16px; border-radius: 50%; overflow: hidden; background: var(--hole-fallback) fixed; box-shadow: 0 0 0 3px var(--color-1); }
@media (prefers-reduced-motion: no-preference) { .au-sent__dot { animation: au-ping 2.6s var(--ease-2) infinite; } }
@keyframes au-ping { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-5px); } 90% { transform: translateY(1px); } }
@media (max-width: 560px) {
  .m-dialog--auth { width: 100vw; max-width: 100vw; max-height: 100svh; height: 100svh; margin: 0; }
  .au-foot .m-btn { flex: 1 1 100%; }
}
}

@layer holes {
/* ── testo-buco: le lettere lasciano vedere lo sfondo ─────────────
   Senza il motore (o prima che parta) basta un gradiente fisso ritagliato sul testo.
   Con il motore: lettere nere su bianco, il canvas in "screen" le riempie di sfondo,
   poi un velo del colore della pagina in "multiply" riporta il bianco a carta. */
html:not(.holes-live) :is(.hole-text, #footer .ft-b, .p-section__h .u-accent, .ix-score__n) {
  background: var(--hole-fallback) fixed; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
:is(.hole-text, #footer .ft-b, .p-section__h .u-accent, .ix-score__n) { display: inline-block; }
:is(.hole-text, #footer .ft-b, .p-section__h .u-accent, .ix-score__n).has-hole { position: relative; isolation: isolate; color: #000; -webkit-text-fill-color: #000; background: none; }
:is(.hole-text, #footer .ft-b, .p-section__h .u-accent, .ix-score__n).has-hole::before,
:is(.hole-text, #footer .ft-b, .p-section__h .u-accent, .ix-score__n).has-hole::after {
  content: ""; position: absolute; top: calc(-1 * var(--hole-by, 0.2em)); bottom: calc(-1 * var(--hole-by, 0.2em)); left: calc(-1 * var(--hole-bx, 0.06em)); right: calc(-1 * var(--hole-bx, 0.06em)); pointer-events: none;
}
:is(.hole-text, #footer .ft-b, .p-section__h .u-accent, .ix-score__n).has-hole::before { z-index: -1; background: #fff; }
:is(.hole-text, #footer .ft-b, .p-section__h .u-accent, .ix-score__n).has-hole::after { z-index: 2; background: var(--hole-bg, var(--color-1)); mix-blend-mode: multiply; }
:is(.hole-text, #footer .ft-b, .p-section__h .u-accent, .ix-score__n) > .hole {
  top: calc(-1 * var(--hole-by, 0.2em)); left: calc(-1 * var(--hole-bx, 0.06em)); right: auto; bottom: auto;
  width: calc(100% + 2 * var(--hole-bx, 0.06em)); height: calc(100% + 2 * var(--hole-by, 0.2em)); z-index: 1; border-radius: 0; mix-blend-mode: screen;
}
}
