/* =====================================================================
   STUDIO 70 LAB - Home "Laboratorio"
   Foglio autonomo: in home il CSS del tema padre non viene caricato.
   ===================================================================== */

/* 0.0 FONT (in locale, niente Google Fonts: GDPR) */
@font-face { font-family: "Unbounded"; src: url("fonts/unbounded.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* 0.1 VARIABILI: i colori sono quelli delle 9 gocce del logo */
:root {
	--ink: #0b0b0e;
	--ink-2: #131318;
	--ink-3: #1c1c23;
	--text: #f4f2ee;
	--muted: #9b9ba6;
	--line: rgba(255,255,255,.12);
	--paper: #f1eee7;
	--paper-ink: #151515;

	--pink: #e5098a;
	--blue: #159ee3;
	--green: #22b24c;
	--yellow: #ffe14a;
	--orange: #f7871f;
	--red: #e8202a;

	--display: "Unbounded", "Arial Black", sans-serif;
	--body: "Poppins", system-ui, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

	--pad: clamp(16px, 4vw, 56px);
	--section: clamp(96px, 13vw, 190px);
	--ease: cubic-bezier(.16,1,.3,1);
	--palette: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow), var(--green), var(--blue), var(--pink));
}

/* WCAG 1.4.3: il rosa del logo con testo bianco arriva a 4,43:1 (serve 4,5). Come fondo per
   testo usiamo un rosa appena piu' profondo (#d6087f, 5,0:1); il rosa originale resta nell'hero. */
.lab-c-pink   { --fam: #d6087f;       --on: #fff; }
.lab-c-blue   { --fam: var(--blue);   --on: var(--ink); }
.lab-c-green  { --fam: var(--green);  --on: var(--ink); }
.lab-c-yellow { --fam: var(--yellow); --on: var(--ink); }
.lab-c-orange { --fam: var(--orange); --on: var(--ink); }
.lab-c-red    { --fam: var(--red);    --on: #fff; }

/* 0.2 RESET (minimo) */
/* :where() = specificita zero: il reset non scavalca mai le classi qui sotto */
:where(.lab) *, :where(.lab) *::before, :where(.lab) *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body.lab { margin: 0; background: var(--ink); color: var(--text); font: 400 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; }
:where(.lab) :where(h1, h2, h3, p, figure) { margin: 0; }
:where(.lab) :where(ul, ol) { list-style: none; margin: 0; padding: 0; }
:where(.lab) img { display: block; max-width: 100%; height: auto; }
:where(.lab) a { color: inherit; text-decoration: none; }
:where(.lab) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.lab :focus-visible { outline: 2px solid var(--yellow); outline-offset: 4px; }
.lab ::selection { background: var(--pink); color: #fff; }
.lab main:focus { outline: none; }

.lab-skip { position: fixed; left: 16px; top: -80px; z-index: 200; padding: 10px 16px; background: var(--yellow); color: var(--ink); font-weight: 600; border-radius: 8px; transition: top .2s; }
.lab-skip:focus { top: 16px; }

.lab-mono { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
/* Etichette di sezione ("02 Manifesto"...): +2pt rispetto al testo mono di base */
.lab-label { display: inline-flex; align-items: center; gap: 14px; color: var(--muted); font-size: calc(12px + 2pt); }
.lab-label span { display: inline-grid; place-items: center; min-width: 40px; height: 26px; padding: 0 10px; border: 1px solid currentColor; border-radius: 999px; font-size: calc(11px + 2pt); }

.lab-h2 { font-family: var(--display); font-weight: 700; font-size: clamp(2.1rem, 5.4vw, 5.2rem); line-height: 1.02; letter-spacing: -.045em; }
.lab-head { display: grid; gap: 24px; padding: 0 var(--pad); margin-bottom: clamp(40px, 6vw, 88px); }
.lab-head__text { max-width: 30em; color: var(--muted); font-size: 17px; }
.lab-head--row { grid-template-columns: 1fr auto; align-items: end; }

.lab-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 28px; border-radius: 999px; font-weight: 600; font-size: 16px; white-space: nowrap; transition: background .3s, color .3s, border-color .3s, transform .4s var(--ease); }
.lab-btn span { transition: transform .4s var(--ease); }
.lab-btn:hover span { transform: translateX(4px); }
.lab-btn--light { background: var(--text); color: var(--ink); }
.lab-btn--light:hover { background: var(--yellow); }
.lab-btn--line { border: 1px solid rgba(255,255,255,.3); color: var(--text); }
.lab-btn--line:hover { border-color: var(--text); background: rgba(255,255,255,.06); }

/* Una goccia del logo: tonda, con un angolo appuntito */
.lab-menu-btn__dots i, .lab-hero__fallback i, .lab-formula__drops i, .lab-legend li::before, .lab-family__name::before { border-radius: 50% 50% 50% 14%; background: var(--c, var(--fam)); }


/* 1.0 BARRA ====================================================== */
.lab-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px var(--pad); transition: background .4s, padding .4s var(--ease), backdrop-filter .4s; }
body.admin-bar .lab-bar { top: 32px; }
.lab-bar.is-scrolled { padding-top: 10px; padding-bottom: 10px; background: rgba(11,11,14,.62); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); }
.lab-bar__logo img { width: auto; height: 76px; transition: height .4s var(--ease); }
.lab-bar.is-scrolled .lab-bar__logo img { height: 54px; }
.lab-bar__meta { display: flex; gap: 28px; color: var(--muted); }
.lab-bar__actions { display: flex; align-items: center; gap: 8px; }
.lab-bar__cta { padding: 12px 18px; font-weight: 500; font-size: 15px; border-radius: 999px; transition: background .3s; }
.lab-bar__cta:hover { background: rgba(255,255,255,.08); }

.lab-menu-btn { display: inline-flex; align-items: center; gap: 12px; height: 48px; padding: 0 18px 0 14px; border-radius: 999px; background: var(--text); color: var(--ink); font-weight: 600; font-size: 15px; transition: transform .4s var(--ease); }
.lab-menu-btn:hover { transform: scale(1.04); }
.lab-menu-btn__dots { display: grid; grid-template-columns: repeat(3, 6px); gap: 2.5px; padding: 4px; background: var(--ink); border-radius: 50%; transition: transform .5s var(--ease); }
.lab-menu-btn__dots i { width: 6px; height: 6px; transition: opacity .3s, transform .5s var(--ease); }
.lab-menu-btn:hover .lab-menu-btn__dots { transform: rotate(90deg); }
/* Aperto: restano le gocce sulle due diagonali e formano una X */
.lab-menu-btn[aria-expanded="true"] .lab-menu-btn__dots { transform: rotate(0); }
.lab-menu-btn[aria-expanded="true"] .lab-menu-btn__dots i:nth-child(even) { opacity: 0; transform: scale(0); }

/* 1.1 MENU A TUTTO SCHERMO */
.lab-menu { position: fixed; inset: 0; z-index: 90; background: var(--ink-2); overflow-y: auto;
	clip-path: circle(0 at calc(100% - var(--pad) - 50px) 42px); transition: clip-path .8s var(--ease); }
.lab-menu.is-open { clip-path: circle(150% at calc(100% - var(--pad) - 50px) 42px); }
.lab-menu[hidden] { display: none; }
.lab-menu__inner { min-height: 100%; display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: end; padding: 120px var(--pad) 56px; }
.lab-menu__label { color: var(--muted); margin-bottom: 20px; }
.lab-menu__list { counter-reset: m; }
.lab-menu__list li { counter-increment: m; border-top: 1px solid var(--line); }
.lab-menu__list a { display: flex; align-items: baseline; gap: 20px; padding: 14px 0; font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 4.6vw, 4.2rem); line-height: 1.1; letter-spacing: -.04em; transition: color .3s, padding .5s var(--ease); }
.lab-menu__list a::before { content: "0" counter(m); font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; color: var(--muted); }
.lab-menu__list li:nth-child(4n+1) a:hover { color: var(--pink); }
.lab-menu__list li:nth-child(4n+2) a:hover { color: var(--blue); }
.lab-menu__list li:nth-child(4n+3) a:hover { color: var(--green); }
.lab-menu__list li:nth-child(4n+4) a:hover { color: var(--yellow); }
.lab-menu__list a:hover { padding-left: 16px; }
.lab-menu__sublist a { display: block; padding: 8px 0; font-size: 20px; font-weight: 500; color: var(--muted); transition: color .2s; }
.lab-menu__sublist a:hover { color: var(--text); }
.lab-menu__contact { margin-top: 32px; font-size: 15px; line-height: 2; color: var(--muted); }
.lab-menu__contact a:hover { color: var(--text); }
.lab-menu .lab-menu__list > li, .lab-menu .lab-menu__side { opacity: 0; transform: translateY(30px); transition: opacity .5s, transform .8s var(--ease); }
.lab-menu.is-open .lab-menu__list > li, .lab-menu.is-open .lab-menu__side { opacity: 1; transform: none; }
.lab-menu.is-open .lab-menu__list > li:nth-child(1) { transition-delay: .15s; }
.lab-menu.is-open .lab-menu__list > li:nth-child(2) { transition-delay: .2s; }
.lab-menu.is-open .lab-menu__list > li:nth-child(3) { transition-delay: .25s; }
.lab-menu.is-open .lab-menu__list > li:nth-child(4) { transition-delay: .3s; }
.lab-menu.is-open .lab-menu__side { transition-delay: .35s; }
body.lab-menu-open { overflow: hidden; }


/* 2.0 HERO ======================================================= */
.lab-hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; isolation: isolate; touch-action: pan-y; }
.lab-hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.lab-hero__fallback { position: absolute; z-index: -2; right: 14%; top: 26%; display: none; grid-template-columns: repeat(3, 1fr); gap: 3vmin; padding: 6vmin; border-radius: 50%; background: #000; }
.lab-hero__fallback i { width: 11vmin; height: 11vmin; }
.lab-hero.no-webgl .lab-hero__fallback { display: grid; }

.lab-hero__content { position: relative; padding: 140px var(--pad) 104px; pointer-events: none; }
.lab-hero__content a { pointer-events: auto; }
.lab-hero__kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; color: var(--muted); }
.lab-blink { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(232,32,42,.6); animation: lab-pulse 1.8s infinite; }
@keyframes lab-pulse { 70% { box-shadow: 0 0 0 10px rgba(232,32,42,0); } 100% { box-shadow: 0 0 0 0 rgba(232,32,42,0); } }

.lab-hero__title { font-family: var(--display); font-weight: 800; font-size: clamp(2.4rem, 6.3vw, 7.3rem); line-height: .94; letter-spacing: -.055em; text-shadow: 0 2px 30px rgba(11,11,14,.35); }
.lab-line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.lab-line > span { display: inline-block; animation: lab-rise 1.2s var(--ease) both; }
.lab-line:nth-child(2) > span { animation-delay: .1s; }
.lab-line:nth-child(3) > span { animation-delay: .2s; }
.lab-line:nth-child(3) { font-weight: 300; font-size: .46em; letter-spacing: -.03em; line-height: 1.2; margin-top: .25em; }
@keyframes lab-rise { from { transform: translateY(110%); } }
.lab-ink { font-style: normal; font-weight: 700; background: var(--palette); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: lab-flow 8s linear infinite; }
@keyframes lab-flow { to { background-position: 300% 0; } }

.lab-hero__foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px 48px; margin-top: 40px; animation: lab-fade 1.2s .45s var(--ease) both; }
@keyframes lab-fade { from { opacity: 0; transform: translateY(20px); } }
.lab-hero__lead { max-width: 30em; font-size: 18px; line-height: 1.6; color: #d6d4d0; }
.lab-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.lab-hero__hint, .lab-hero__scroll { position: absolute; bottom: 28px; color: var(--muted); }
.lab-hero__hint { right: var(--pad); }
.lab-hero__scroll { left: var(--pad); }
.lab-hero__scroll span { display: inline-block; animation: lab-bob 2s infinite; }
@keyframes lab-bob { 50% { transform: translateY(5px); } }
.lab-hint-touch { display: none; }
@media (hover: none) { .lab-hint-touch { display: inline; } .lab-hint-mouse { display: none; } }


/* 3.0 MANIFESTO ================================================== */
/* Manifesto centrato: etichetta e testo */
.lab-manifesto { padding: var(--section) var(--pad); max-width: 1500px; margin: 0 auto; text-align: center; }
.lab-manifesto .lab-label { margin-bottom: 40px; }
.lab-manifesto__text { font-family: var(--display); font-weight: 400; font-size: clamp(calc(1.55rem - 2pt), calc(3.7vw - 2pt), calc(3.6rem - 2pt)); text-wrap: balance; line-height: 1.22; letter-spacing: -.035em; }
.lab-manifesto__text strong { font-weight: 700; background: var(--palette); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: lab-flow 8s linear infinite; }
.lab-word { opacity: .14; transition: opacity .4s; }
.lab-word.is-lit { opacity: 1; }


/* 4.0 TAVOLA PERIODICA ============================================ */
.lab-table-section { padding: 0 0 var(--section); }
/* Intestazione 03: titolo -2pt, testo a destra +4pt e centrato in altezza rispetto al titolo */
.lab-table-section .lab-head { grid-template-columns: 1.2fr 1fr; align-items: center; }
.lab-table-section .lab-h2 { font-size: clamp(calc(2.1rem - 2pt), calc(5.4vw - 2pt), calc(5.2rem - 2pt)); }
.lab-table-section .lab-head__text { font-size: calc(17px + 4pt); line-height: 1.5; max-width: 26em; }
.lab-table-section .lab-label { grid-column: 1 / -1; }

.lab-table { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; padding: 0 var(--pad); max-width: 1440px; }
.lab-family, .lab-family__list { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; }
.lab-family__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.lab-el { position: relative; display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 1; padding: 12px 12px 11px; border-radius: 6px;
	background: color-mix(in srgb, var(--fam) 7%, var(--ink-2)); border: 1px solid color-mix(in srgb, var(--fam) 38%, transparent); color: var(--text);
	transition: background .3s, color .3s, transform .5s var(--ease), box-shadow .4s, opacity .4s, border-color .3s; }
.lab-el__n { font-family: var(--mono); font-size: 11px; color: var(--muted); transition: color .3s; }
.lab-el__sym { font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 2.7vw, 2.8rem); line-height: 1; letter-spacing: -.04em; color: var(--fam); transition: color .3s; }
.lab-el__name { font-size: 12px; line-height: 1.25; color: #c9c7c3; min-height: 2.5em; transition: color .3s; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.lab-el.is-head { background: var(--fam); border-color: var(--fam); color: var(--on); }
.lab-el.is-head .lab-el__n, .lab-el.is-head .lab-el__sym, .lab-el.is-head .lab-el__name { color: var(--on); }
.lab-el.is-head .lab-el__name { font-weight: 600; }
.lab-el:hover, .lab-el:focus-visible { background: var(--fam); border-color: var(--fam); transform: translateY(-6px) scale(1.04); z-index: 2;
	box-shadow: 0 18px 50px -12px color-mix(in srgb, var(--fam) 70%, transparent); }
.lab-el:hover *, .lab-el:focus-visible * { color: var(--on); }
/* Famiglie non attive attenuate: a .6 i nomi restano sopra 4,5:1 (a .3 erano a 2,3:1) */
.lab-table.is-probing .lab-family:not(.is-active) .lab-el { opacity: .6; }

.lab-key { position: relative; display: flex; flex-direction: column; margin-left: 16px; padding: clamp(18px, 2vw, 30px); border-radius: 10px; background: var(--fam); color: var(--on); overflow: hidden; z-index: 1;
	transition: background .45s var(--ease), color .45s; }
.lab-key::after { content: ""; position: absolute; right: -30%; bottom: -40%; width: 90%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 60%); pointer-events: none; }
.lab-key__top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
/* Contenuto della scheda centrato nel box (la riga in alto resta in alto) */
.lab-key__sym, .lab-key__name, .lab-key__text, .lab-key__go { text-align: center; align-self: center; }
.lab-key__sym { margin: auto 0 4px; font-family: var(--display); font-weight: 700; font-size: clamp(4rem, 8.5vw, 8.5rem); line-height: .9; letter-spacing: -.06em; }
.lab-key__name { font-family: var(--display); font-weight: 600; font-size: clamp(1rem, 1.5vw, 1.4rem); line-height: 1.2; letter-spacing: -.02em; margin-bottom: 12px; }
/* Niente trasparenze sul testo: abbassavano il contrasto (descrizione .85, CTA .8) */
.lab-key__text { max-width: 30em; font-size: 16px; line-height: 1.55; font-weight: 500; }
.lab-key__go { margin: 18px 0 auto; font-size: 13px; font-weight: 600; }
.lab-key.is-swapping .lab-key__sym, .lab-key.is-swapping .lab-key__name, .lab-key.is-swapping .lab-key__text { animation: lab-swap .45s var(--ease); }
@keyframes lab-swap { from { opacity: 0; transform: translateY(10px); } }

.lab-legend { align-self: end; display: grid; gap: 8px; padding: 0 0 6px 14px; font-size: 12.5px; color: var(--muted); }
.lab-legend li { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.lab-legend li::before, .lab-family__name::before { content: ""; flex: none; width: 10px; height: 10px; }


/* 4.1 TAVOLA A MISURA DI SCHERMO (solo desktop)
   L'altezza delle righe si ricava dall'altezza dello schermo diviso il numero di
   famiglie (--rows, dal PHP): la tavola intera e la scheda di lettura stanno sempre in
   una schermata sotto la barra. Le tessere diventano rettangolari (circa 4:3) e la
   tavola non si allarga oltre ~1,4 volte l'altezza delle righe, cosi' non si appiattisce. */
@media (min-width: 1000px) {
	/* --rows/--cols arrivano dal PHP sulla sezione: servono anche all'intestazione */
	.lab-table-section {
		--bar: 84px;                                         /* barra in alto, ridotta durante lo scroll */
		--row-h: clamp(92px, calc((100vh - var(--bar) - 48px - (var(--rows) - 1) * 8px) / var(--rows)), 172px);
		--table-w: min(1440px, calc(var(--cols) * var(--row-h) * 1.42 + 2 * var(--pad) + 16px));
	}
	/* Intestazione larga quanto la tavola, cosi' titolo e tavola partono dallo stesso bordo */
	.lab-table-section .lab-head { max-width: var(--table-w); margin-left: auto; margin-right: auto; }
	.lab-table {
		grid-auto-rows: var(--row-h);
		max-width: var(--table-w);
		margin: 0 auto;
		scroll-margin-top: calc(var(--bar) + 16px);
	}
	.lab-el { aspect-ratio: auto; height: var(--row-h); padding: 10px 12px 9px; }
	.lab-el__sym { font-size: clamp(1.3rem, min(2.7vw, calc(var(--row-h) * .3)), 2.8rem); }
	.lab-el__name { min-height: 0; }

	/* Scheda di lettura: tutto in proporzione all'altezza delle righe */
	.lab-key { padding: clamp(16px, calc(var(--row-h) * .16), 28px); }
	.lab-key__sym { font-size: clamp(3rem, calc(var(--row-h) * .72), 8.5rem); }
	.lab-key__name { font-size: clamp(1.1rem, calc(var(--row-h) * .14), 1.5rem); margin-bottom: 10px; }
	.lab-key__text { font-size: clamp(15px, calc(var(--row-h) * .115), 17px); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; }
	.lab-key__go { margin-top: clamp(10px, calc(var(--row-h) * .1), 18px); }

	.lab-legend { gap: 4px; font-size: 12px; line-height: 1.35; padding-bottom: 2px; }
}

/* 5.0 LA FORMULA (sezione chiara) ================================= */
.lab-formula { padding: var(--section) 0; background: var(--paper); color: var(--paper-ink); }
.lab-formula .lab-label { color: #6e6a62; }
.lab-formula__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 72px; padding: 0 var(--pad); }
.lab-reagent { position: relative; padding-top: 28px; border-top: 1px solid rgba(0,0,0,.18); }
.lab-reagent::before { content: "+"; display: none; position: absolute; left: -36px; top: 64px; transform: translateX(-50%); font-family: var(--display); font-weight: 300; font-size: 34px; color: #9a958b; }
.lab-reagent:not(:nth-child(3n+1))::before { display: block; }
.lab-reagent__n { position: absolute; right: 0; top: 30px; color: #8a857b; }
.lab-reagent__img { width: 84px; height: 84px; margin-bottom: 26px; clip-path: circle(40%); transform: scale(1.18); }
.lab-reagent__title { font-family: var(--display); font-weight: 600; font-size: clamp(1.3rem, 2vw, 1.8rem); letter-spacing: -.035em; line-height: 1.15; margin-bottom: 12px; }
.lab-reagent__text { font-size: 16px; line-height: 1.6; color: #4a4741; max-width: 26em; }
/* Chiusura della formula: logo, una frase che si capisce da sola e un invito a contattarci */
.lab-formula__result { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px clamp(24px, 3vw, 48px); margin: clamp(64px, 8vw, 110px) var(--pad) 0; padding-top: 40px; border-top: 2px solid var(--paper-ink); }
.lab-formula__label { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2.9rem); line-height: 1.12; letter-spacing: -.04em; text-wrap: balance; }
.lab-formula__label strong { display: block; font-weight: 700; }
.lab-formula__drops { font-size: clamp(2.6rem, 5vw, 4.6rem); }
.lab-formula__cta { background: var(--paper-ink); color: var(--paper); }
.lab-formula__cta:hover { background: var(--pink); color: #fff; }
.lab--light .lab-formula__cta { background: #f4f2ee; color: #121216; }
.lab--light .lab-formula__cta:hover { background: var(--yellow); color: #121216; }
@media (max-width: 767px) {
	.lab-formula__result { grid-template-columns: auto minmax(0, 1fr); }
	.lab-formula__cta { grid-column: 1 / -1; justify-content: center; }
}
.lab-formula__drops { display: inline-grid; grid-template-columns: repeat(3, 1fr); gap: .09em; padding: .2em; border-radius: 50%; background: #000; }
.lab-formula__drops i { width: .2em; height: .2em; transform: scale(0); transition: transform .6s var(--ease); }
.lab-formula__result.is-in .lab-formula__drops i { transform: none; }
.lab-formula__drops i:nth-child(2) { transition-delay: .05s; } .lab-formula__drops i:nth-child(3) { transition-delay: .1s; }
.lab-formula__drops i:nth-child(4) { transition-delay: .15s; } .lab-formula__drops i:nth-child(5) { transition-delay: .2s; }
.lab-formula__drops i:nth-child(6) { transition-delay: .25s; } .lab-formula__drops i:nth-child(7) { transition-delay: .3s; }
.lab-formula__drops i:nth-child(8) { transition-delay: .35s; } .lab-formula__drops i:nth-child(9) { transition-delay: .4s; }


/* 6.0 PROTOCOLLO: la provetta ===================================== */
.lab-protocol { padding: var(--section) 0; --liq: var(--pink); }
.lab-protocol[data-step="2"] { --liq: var(--yellow); }
.lab-protocol[data-step="3"] { --liq: var(--blue); }
.lab-protocol[data-step="4"] { --liq: var(--green); }
.lab-protocol__body { display: grid; grid-template-columns: clamp(120px, 16vw, 240px) 1fr; gap: clamp(24px, 4vw, 64px); padding: 0 var(--pad); }

.lab-tube-wrap { position: sticky; top: 16vh; height: 68vh; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.lab-tube { position: relative; flex: 1; width: 100%; display: flex; justify-content: center; }
.lab-tube__glass { position: relative; width: clamp(56px, 6vw, 88px); height: 100%; border: 2px solid rgba(255,255,255,.35); border-top: 0; border-radius: 0 0 999px 999px; overflow: hidden;
	background: linear-gradient(90deg, rgba(255,255,255,.07), rgba(255,255,255,0) 35%, rgba(255,255,255,0) 70%, rgba(255,255,255,.1)); }
.lab-tube__glass::before { content: ""; position: absolute; top: 0; left: -8px; right: -8px; height: 2px; background: rgba(255,255,255,.5); }
.lab-tube__liquid { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--fill, 0) * 100%); background: var(--liq); transition: background-color .8s; min-height: 8px; }
.lab-tube__liquid::before { content: ""; position: absolute; left: 0; width: 200%; top: -9px; height: 18px; background: radial-gradient(10px 9px at 10px 9px, var(--liq) 98%, transparent) 0 0 / 20px 18px repeat-x; animation: lab-wave 1.6s linear infinite; transition: background-color .8s; }
@keyframes lab-wave { to { transform: translateX(-20px); } }
.lab-tube__liquid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.25), transparent 30%, transparent 75%, rgba(0,0,0,.18)); }
.lab-tube__liquid i { position: absolute; bottom: 0; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.7); animation: lab-bubble 3.2s infinite ease-in; opacity: 0; }
.lab-tube__liquid i:nth-child(1) { left: 20%; animation-delay: 0s; }
.lab-tube__liquid i:nth-child(2) { left: 55%; animation-delay: .7s; width: 5px; height: 5px; }
.lab-tube__liquid i:nth-child(3) { left: 38%; animation-delay: 1.4s; }
.lab-tube__liquid i:nth-child(4) { left: 70%; animation-delay: 2.1s; width: 9px; height: 9px; }
.lab-tube__liquid i:nth-child(5) { left: 30%; animation-delay: 2.6s; width: 4px; height: 4px; }
@keyframes lab-bubble { 10% { opacity: 1; } 90% { opacity: .8; } to { transform: translateY(calc(var(--fill-px, 300px) * -1)); opacity: 0; } }
.lab-tube__mark { position: absolute; left: calc(50% + clamp(28px, 3vw, 44px) + 10px); bottom: calc(var(--i) * 25% - 8px); font-family: var(--mono); font-size: 10px; color: var(--muted); white-space: nowrap; }
.lab-tube__mark::before { content: ""; display: inline-block; width: 10px; height: 1px; margin-right: 6px; vertical-align: middle; background: currentColor; }
.lab-tube__readout { color: var(--liq); transition: color .8s; }

.lab-step { min-height: 78vh; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr; column-gap: 48px; align-content: center; opacity: .25; transition: opacity .6s; }
.lab-step.is-active { opacity: 1; }
.lab-step__n { grid-column: 1; color: var(--fam); margin-bottom: 18px; }
.lab-step__title { grid-column: 1; font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 8vw, 8rem); line-height: .95; letter-spacing: -.06em; margin-bottom: 24px; }
.lab-step__text { grid-column: 1; max-width: 28em; font-size: 18px; line-height: 1.6; color: #cfcdc9; }
.lab-step__lens { grid-column: 2; grid-row: 1 / 4; align-self: center; position: relative; width: clamp(180px, 22vw, 320px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; }
.lab-step__lens img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15) brightness(.9); transform: scale(1.15); transition: transform 1.2s var(--ease); }
.lab-step.is-active .lab-step__lens img { transform: scale(1); }
.lab-step__lens::after { content: ""; position: absolute; inset: 0; background: var(--fam); mix-blend-mode: multiply; }
.lab-step__lens::before { content: ""; position: absolute; inset: 10px; z-index: 1; border-radius: 50%; border: 1px dashed rgba(255,255,255,.55); animation: lab-spin 30s linear infinite; }
@keyframes lab-spin { to { transform: rotate(360deg); } }


/* 7.0 ESPERIMENTO IN EVIDENZA ===================================== */
.lab-feature { position: relative; overflow: hidden; padding: var(--section) var(--pad); isolation: isolate; }
.lab-feature__disc { position: absolute; z-index: -1; right: -18vw; top: 50%; width: min(80vw, 1100px); aspect-ratio: 1; border-radius: 50%; transform: translateY(-50%);
	background: radial-gradient(circle at 35% 35%, #ff4fb0, var(--pink) 45%, #8c0254 100%); animation: lab-breathe 9s ease-in-out infinite; }
@keyframes lab-breathe { 50% { transform: translateY(-50%) scale(1.06); } }
.lab-feature__inner { max-width: 980px; }
.lab-feature .lab-label { margin-bottom: 28px; }
.lab-feature .lab-h2 { margin-bottom: 36px; }
.lab-feature__text { columns: 2 22em; column-gap: 48px; font-size: 17px; line-height: 1.7; color: #e3e1dd; margin-bottom: 44px; }
.lab-feature__text p { margin: 0 0 1em; }
.lab-feature__text strong { color: #fff; }
.lab-magnet { will-change: transform; }


/* 8.0 DIARIO ===================================================== */
.lab-diary { padding: var(--section) 0; }
.lab-diary__list { padding: 0 var(--pad); border-bottom: 1px solid var(--line); }
.lab-entry { display: grid; grid-template-columns: 130px clamp(120px, 11vw, 176px) minmax(0, 1fr) auto; align-items: center; gap: 24px clamp(20px, 2.4vw, 40px); padding: 26px 0; border-top: 1px solid var(--line); transition: opacity .4s; }
/* Miniatura dell'immagine in evidenza: al passaggio del mouse "salta fuori" (cresce, si alza,
   ombra) e si inclina seguendo il movimento del cursore, come la vecchia anteprima volante. */
.lab-entry__thumb { position: relative; z-index: 1; display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--ink-3);
	transform: translateY(0) rotate(var(--tilt, 0deg)) scale(1); transition: transform .5s var(--ease), box-shadow .4s; will-change: transform; }
.lab-entry__thumb img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); transition: filter .4s, transform .8s var(--ease); }
.lab-entry:hover .lab-entry__thumb, .lab-entry:focus-visible .lab-entry__thumb { z-index: 3; transform: translateY(-6px) rotate(var(--tilt, 0deg)) scale(1.35); box-shadow: 0 30px 60px -20px rgba(0,0,0,.7); transition: transform .5s var(--ease), box-shadow .4s; }
.lab-entry:hover .lab-entry__thumb img { filter: none; transform: scale(1.06); }
.lab-entry__nothumb { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 10px); gap: 5px; place-content: center; }
.lab-entry__nothumb i { width: 10px; height: 10px; border-radius: 50% 50% 50% 14%; background: var(--c); }
.lab-entry__date { color: var(--muted); }
.lab-entry__title { font-family: var(--display); font-weight: 500; font-size: clamp(1.15rem, 2.3vw, 2.1rem); line-height: 1.2; letter-spacing: -.035em; transition: transform .6s var(--ease), color .3s; }
.lab-entry__arrow { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 50%; font-size: 20px; transition: background .3s, color .3s, transform .5s var(--ease); }
.lab-entry:hover .lab-entry__title { transform: translateX(14px); }
.lab-entry:hover .lab-entry__arrow { background: var(--yellow); color: var(--ink); border-color: var(--yellow); transform: rotate(45deg); }
/* Le altre notizie si attenuano: .6 tiene i titoli sopra 4,5:1 (WCAG 1.4.3) */
.lab-diary__list:hover .lab-entry:not(:hover) { opacity: .6; }


/* 9.0 FOOTER ===================================================== */
.lab-footer { padding: var(--section) var(--pad) 32px; border-top: 1px solid var(--line); }
.lab-footer__big { display: block; }
.lab-footer__cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px 64px; margin-top: 28px; }
.lab-footer__word { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(2.4rem, 6vw, 6rem); line-height: 1; letter-spacing: -.035em;
	background: linear-gradient(90deg, var(--text) 0 38%, var(--pink) 44%, var(--orange) 50%, var(--yellow) 56%, var(--text) 62% 100%); background-size: 300% 100%; background-position: var(--x, 0%) 0;
	-webkit-background-clip: text; background-clip: text; color: transparent; transition: background-position .9s var(--ease); }
.lab-footer__lead { max-width: 34em; margin-top: 24px; font-size: 18px; line-height: 1.6; color: #cfcdc9; }
.lab-footer__actions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.lab-footer__actions .lab-btn { justify-content: center; }
.lab--light .lab-footer__lead { color: #3d3b37; }
@media (max-width: 900px) {
	.lab-footer__cta { grid-template-columns: 1fr; }
	.lab-footer__lead { font-size: 16px; }
}
.lab-footer__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: clamp(56px, 8vw, 110px); padding-top: 32px; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.7; }
.lab-footer__k { color: var(--muted); margin-bottom: 10px; }
.lab-footer__grid a { transition: color .2s; }
.lab-footer__grid a:hover { color: var(--yellow); }
.lab-footer__social { display: flex; flex-direction: column; }
.lab-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; margin-top: 64px; color: var(--muted); font-size: 11px; }
.lab-legal { display: flex; gap: 20px; }
.lab-legal a:hover, .lab-footer__switch:hover { color: var(--text); }
.lab-footer__switch { text-decoration: underline; text-underline-offset: 3px; }


/* 10.0 ANIMAZIONI D'INGRESSO ====================================== */
.lab [data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.lab [data-reveal].is-in { opacity: 1; transform: none; }


/* 10.1 VARIANTE CHIARA (body.lab--light) ==========================
   Stessa pagina, fondo carta. --text diventa l'inchiostro scuro; --ink resta
   il nero "costante" per i testi sopra i colori pieni. Il giallo e gli altri
   colori chiari usano una tonalita' piu' scura (--fam-ink) quando sono testo. */
body.lab--light {
	--text: #121216;
	--muted: #6b6963;
	--line: rgba(18,18,22,.13);
	--ink-2: #ffffff;
	--palette: linear-gradient(90deg, var(--pink), var(--orange), #e0a400, var(--green), var(--blue), var(--pink));
	background: #f6f4ef;
	color: var(--text);
}
.lab--light .lab-c-pink   { --fam-ink: #c2077a; }
.lab--light .lab-c-blue   { --fam-ink: #0a78ba; }
.lab--light .lab-c-green  { --fam-ink: #15843a; }
.lab--light .lab-c-yellow { --fam-ink: #977000; }
.lab--light .lab-c-orange { --fam-ink: #bd5a00; }
.lab--light .lab-c-red    { --fam-ink: #c4121b; }

.lab--light .lab-btn--light { background: var(--text); color: #fff; }
.lab--light .lab-btn--light:hover { background: var(--yellow); color: var(--ink); }
.lab--light .lab-btn--line { border-color: rgba(18,18,22,.25); }
.lab--light .lab-btn--line:hover { background: rgba(18,18,22,.04); }

.lab--light .lab-bar.is-scrolled { background: rgba(246,244,239,.78); box-shadow: 0 1px 0 var(--line); }
.lab--light .lab-bar__cta:hover { background: rgba(18,18,22,.06); }
.lab--light .lab-menu-btn { background: var(--text); color: #fff; }
.lab--light .lab-menu { background: #fff; }
.lab--light .lab-menu__list li:nth-child(4n+1) a:hover { color: #c2077a; }
.lab--light .lab-menu__list li:nth-child(4n+2) a:hover { color: #0a78ba; }
.lab--light .lab-menu__list li:nth-child(4n+3) a:hover { color: #15843a; }
.lab--light .lab-menu__list li:nth-child(4n+4) a:hover { color: #977000; }

.lab--light .lab-hero__title { text-shadow: none; }
.lab--light .lab-hero__lead { color: #3d3b37; }

.lab--light .lab-el { box-shadow: 0 1px 2px rgba(18,18,22,.04); }
.lab--light .lab-el__sym { color: var(--fam-ink); }
.lab--light .lab-el__name { color: #55524c; }
.lab--light .lab-el.is-head .lab-el__sym, .lab--light .lab-el:hover .lab-el__sym, .lab--light .lab-el:focus-visible .lab-el__sym { color: var(--on); }
.lab--light .lab-table.is-probing .lab-family:not(.is-active) .lab-el { opacity: .6; }

/* Sul chiaro la formula diventa la fascia scura che spezza il ritmo */
.lab--light .lab-formula { background: #121216; color: #f4f2ee; }
.lab--light .lab-formula .lab-label { color: #9b9ba6; }
.lab--light .lab-reagent { border-top-color: rgba(255,255,255,.18); }
.lab--light .lab-reagent::before { color: #6e6c75; }
.lab--light .lab-reagent__n { color: #7d7b84; }
.lab--light .lab-reagent__text { color: #c9c7c3; }
.lab--light .lab-formula__result { border-top-color: #f4f2ee; }
.lab--light .lab-formula__drops { box-shadow: 0 0 0 1px rgba(255,255,255,.2); }

.lab--light .lab-tube__glass { border-color: rgba(18,18,22,.28); background: linear-gradient(90deg, rgba(18,18,22,.05), rgba(18,18,22,0) 35%, rgba(18,18,22,0) 70%, rgba(18,18,22,.06)); }
.lab--light .lab-tube__glass::before { background: rgba(18,18,22,.4); }
.lab--light .lab-tube__readout { color: var(--text); }
.lab--light .lab-step__n { color: var(--fam-ink); }
.lab--light .lab-step__text { color: #3d3b37; }

.lab--light .lab-feature__text { color: #2a2824; }
.lab--light .lab-feature__text strong { color: #000; }
.lab--light .lab-feature__disc { background: radial-gradient(circle at 35% 35%, #ff7cc4, #f23d9f 45%, var(--pink) 100%); }

.lab--light .lab-entry:hover .lab-entry__thumb { box-shadow: 0 30px 60px -20px rgba(18,18,22,.35); }
.lab--light .lab-footer__grid a:hover { color: #c2077a; }


/* 11.0 RESPONSIVE ================================================= */
@media (max-width: 1100px) {
	.lab-bar__meta { display: none; }
	.lab-formula__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.lab-reagent:not(:nth-child(3n+1))::before { display: none; }
	.lab-reagent:nth-child(even)::before { display: block; }
}

/* Sotto i 1000px la tavola diventa una riga scorrevole per famiglia */
@media (max-width: 999px) {
	.lab-table-section .lab-head { grid-template-columns: 1fr; }
	.lab-table { display: block; padding: 0; }
	.lab-family { display: block; margin-bottom: 28px; }
	.lab-family__name { position: static; width: auto; height: auto; overflow: visible; clip: auto; display: flex; align-items: center; gap: 10px; padding: 0 var(--pad); margin-bottom: 12px;
		font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
	.lab-family__list { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px var(--pad) 12px; scroll-padding: 0 var(--pad); scrollbar-width: none; }
	.lab-family__list::-webkit-scrollbar { display: none; }
	.lab-family__list li { flex: 0 0 132px; scroll-snap-align: start; }
	.lab-key, .lab-legend { display: none; }
	.lab-el:hover, .lab-el:focus-visible { transform: none; }
}

@media (max-width: 782px) { body.admin-bar .lab-bar { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .lab-bar { top: 0; } }

@media (max-width: 767px) {
	.lab-table-section .lab-head__text { font-size: 18px; }   /* su telefono il +4pt pesava quasi quanto il titolo */
	.lab-bar { padding-top: 12px; padding-bottom: 12px; }
	.lab-bar__logo img { height: 50px; }
	.lab-bar.is-scrolled .lab-bar__logo img { height: 42px; }
	.lab-bar__cta { display: none; }
	.lab-menu__inner { grid-template-columns: 1fr; align-items: start; padding-top: 100px; }

	.lab-hero__content { padding-bottom: 84px; }
	.lab-hero__lead { font-size: 16px; }
	.lab-hero__actions, .lab-hero__actions .lab-btn { width: 100%; }
	.lab-hero__actions .lab-btn { justify-content: center; }
	.lab-hero__hint { right: auto; left: var(--pad); bottom: 24px; }
	.lab-hero__scroll { display: none; }
	.lab-hero__fallback { right: 50%; top: 16%; transform: translateX(50%); }

	.lab-head--row { grid-template-columns: 1fr; }
	.lab-formula__list { grid-template-columns: 1fr; gap: 64px; }
	.lab-reagent:not(:first-child)::before { display: block; left: 50%; top: -50px; }

	.lab-protocol__body { grid-template-columns: 34px 1fr; gap: 20px; }
	.lab-tube-wrap { top: 18vh; height: 60vh; }
	.lab-tube__glass { width: 26px; }
	.lab-tube__mark, .lab-tube__readout { display: none; }
	/* Righe ad altezza naturale: la riga "1fr" allungava lo spazio tra testo e immagine */
	.lab-step { min-height: 62vh; grid-template-columns: 1fr; grid-template-rows: none; }
	.lab-step__title { margin-bottom: 14px; }
	.lab-step__lens { grid-column: 1; grid-row: auto; width: 150px; margin-top: 20px; }
	.lab-step__text { font-size: 16px; }

	.lab-feature__disc { width: 130vw; right: -70vw; }
	.lab-entry { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px 16px; padding: 20px 0; }
	.lab-entry__date { grid-column: 1 / -1; }
	.lab-entry:hover .lab-entry__thumb { transform: none; box-shadow: none; }
	.lab-entry__arrow { width: 42px; height: 42px; }
	.lab-diary__list:hover .lab-entry:not(:hover) { opacity: 1; }
	/* Footer su telefono: una colonna, tutto centrato */
	.lab-footer { text-align: center; }
	.lab-footer__lead { margin-left: auto; margin-right: auto; }
	.lab-footer__grid { grid-template-columns: 1fr; gap: 28px; }
	.lab-footer__social { align-items: center; }
	.lab-footer__legal { flex-direction: column; align-items: center; gap: 10px; }
	.lab-legal { justify-content: center; flex-wrap: wrap; }
	.lab-footer__sep { display: none; }
	.lab-footer__switch { display: block; width: fit-content; margin: 10px auto 0; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.lab *, .lab *::before, .lab *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
	.lab [data-reveal] { opacity: 1; transform: none; }
	.lab-word { opacity: 1; }
}
