/* ==========================================================================
   TOF – Sito · Home
   ========================================================================== */

.th { --th-r: 15px; --th-pad: var(--tof-margine); }

/* ---------- 1 · Hero ---------- */
.th-hero {
	position: relative; isolation: isolate; overflow: hidden;
	display: flex; align-items: flex-end;
	height: 100vh; height: 100svh; min-height: 640px; max-height: 1100px;
	padding: 250px var(--th-pad) 30px;
	background: #14102a; color: var(--tof-bianco);
}
.th-hero__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.th-hero__poster, .th-hero__media video {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.th-hero__media iframe {
	position: absolute; top: 50%; left: 50%;
	width: 100vw; height: 56.25vw; min-height: 100%; min-width: 177.78vh;
	transform: translate(-50%, -50%); border: 0; pointer-events: none;
	opacity: 0; transition: opacity 1.2s ease;
}
.th-hero__media video { opacity: 0; transition: opacity 1.2s ease; }
.th-hero__media.is-pronto iframe, .th-hero__media.is-pronto video { opacity: 1; }
.th-hero::after {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(180deg, rgba(10, 6, 25, .45) 0%, rgba(10, 6, 25, .15) 40%, rgba(10, 6, 25, .55) 100%);
}
.th-hero__testo { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.th-hero__titolo { font-size: 78px; line-height: 1; font-weight: 500; letter-spacing: -.015em; }

/* ---------- 2 · Settori ---------- */
.th-settori { padding: 60px var(--th-pad) 120px; }
.th-settori .tof-settori__griglia { margin: 0; }
@media (min-width: 1025px) { .th-settori { overflow: hidden; } }

/* ---------- 3 · Inside TOF ---------- */
.th-inside { background: var(--tof-viola); color: var(--tof-bianco); padding: 60px 0 40px; overflow: hidden; }
.th-inside__riga { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; padding: 0 var(--th-pad); }
.th-inside__testo { max-width: 560px; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.th-lead { font-size: 18px; line-height: 1.5; }
.th-inside__foto { flex: 0 0 40%; max-width: 570px; aspect-ratio: 570 / 420; overflow: hidden; }
.th-inside__foto img { width: 100%; height: 100% !important; object-fit: cover; }

.th-numeri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 90px var(--th-pad) 50px !important; text-align: center; }
.th-numeri li { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.th-numeri__n { font-size: 150px; line-height: .9; font-weight: 400; letter-spacing: -.03em; color: var(--tof-arancio); font-variant-numeric: tabular-nums; }
.th-numeri__txt { font-size: 12px; line-height: 1; }

.th-scorre { padding: 30px 0 20px; overflow: hidden; }
.th-scorre__nastro { display: flex; width: max-content; animation: th-scorri 32s linear infinite; }
.th-scorre.is-fermo .th-scorre__nastro { animation-play-state: paused; }
.th-scorre__voce {
	display: inline-flex; align-items: center; gap: 60px; padding-right: 60px;
	font-size: 150px; line-height: 1; font-weight: 500; letter-spacing: -.02em; text-transform: uppercase; white-space: nowrap;
}
.th-scorre__voce img { width: 120px; height: auto; }
@keyframes th-scorri { to { transform: translateX(-50%); } }

/* ---------- 4 · Prodotti ---------- */
.th-prodotti { background: var(--tof-bianco); padding: 60px var(--th-pad) 100px; }
.th-prodotti__titolo-m { display: none; }
.th-prodotti__griglia { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.th-prod {
	display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 14px;
	min-height: 437px; padding: 28px 20px; border-radius: var(--th-r);
	background: var(--tof-lavanda); text-align: center; transition: background-color .25s ease;
}
.th-prod:hover { background: #DADCF0; }
.th-prod__tag { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--tof-arancio); }
.th-prod__img { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; }
.th-prod__img img { max-height: 200px; width: auto; object-fit: contain; transition: transform .5s ease; }
.th-prod:hover .th-prod__img img { transform: translateY(-6px); }
.th-prod__titolo { font-size: 34px; line-height: 1.1; color: var(--tof-viola); }

/* ---------- 5 · Ecosystem ---------- */
.th-eco { background: var(--tof-bianco); color: var(--tof-viola); }
.th-eco__intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; padding: 100px var(--th-pad) 0; }
.th-eco__intro .tof-h2 span { display: block; }
.th-eco__intro p { max-width: 330px; font-size: 16px; line-height: 1.55; }
.th-eco__griglia { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 60px var(--th-pad); }
.th-eco-card {
	position: relative; isolation: isolate; overflow: hidden;
	display: flex; flex-direction: column; justify-content: space-between;
	height: 600px; padding: 30px; border-radius: var(--th-r);
}
.th-eco-card > img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; z-index: -2; transition: transform .8s ease; }
.th-eco-card:hover > img { transform: scale(1.03); }
.th-eco-card__basso { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.th-eco-card__titolo { font-size: 59px; line-height: 1.05; font-weight: 500; letter-spacing: -.01em; }
.th-eco-card__testo { max-width: 430px; font-size: 16px; line-height: 1.55; }
.th-eco-card .tof-btn { margin-top: 8px; }
.th-eco-card--hub { color: var(--tof-bianco); background: var(--tof-arancio); }
.th-eco-card--hub::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(47, 28, 123, 0) 0%, var(--tof-viola) 100%); }
.th-eco-card--hub .tof-tag { background: var(--tof-arancio); color: var(--tof-viola); }
.th-eco-card--hub .th-eco-card__titolo { color: var(--tof-arancio); }
.th-eco-card--academy { color: var(--tof-viola); background: var(--tof-lavanda); }
.th-eco-card--academy .tof-tag { background: transparent; color: var(--tof-arancio); border: 1px solid var(--tof-arancio); }

/* ---------- 6 · Contatti ---------- */
.th-cta {
	position: relative; isolation: isolate; overflow: hidden;
	display: flex; align-items: stretch;
	min-height: 353px; padding: 30px var(--th-pad);
	border-radius: var(--th-r) var(--th-r) 0 0;
	background: var(--tof-bianco); color: var(--tof-bianco);
}
.th-cta > img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; z-index: -2; }
.th-cta::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, .33); }
.th-cta__testo { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.th-cta__testo .tof-btn { margin-top: auto; }
.th-cta .tof-tag { border-radius: 4px; }
/* il footer viola inizia subito sotto la foto */
.tof-pagina--home .toff { margin-top: 0; }

/* ======================= TABLET (768–1024 px) ======================= */
@media (max-width: 1024px) {
	.th-eco-card__titolo { font-size: 46px; }
	.th-hero__titolo { font-size: 62px; }
	.th-numeri__n { font-size: 96px; }
	.th-scorre__voce { font-size: 96px; }
	.th-prodotti__griglia { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.th-eco-card { height: 520px; }
}

/* ======================= MOBILE (≤ 767 px) ======================= */
@media (max-width: 767px) {
	.th { --th-pad: var(--tof-margine-m); }

	/* scala tipografica mobile unica */
	.th-eco-card__titolo { font-size: 32px; line-height: 1.05; }
	.th-hero__titolo { font-size: 46px; line-height: 1.02; }
	.th-lead, .th-eco__intro p, .th-eco-card__testo { font-size: 16px; }
	.tof-btn { font-size: 15px; }

	.th-hero { min-height: 560px; padding: 0 var(--th-pad) 32px; }
	.th-hero__testo { gap: 28px; }

	.th-settori { padding: 32px 0 88px; }
	.th-prodotti__griglia { padding: 0 var(--th-pad) 4px; }

	.th-inside { padding: 88px 0 88px; }
	.th-inside__riga { flex-direction: column; gap: 36px; }
	.th-inside__testo { gap: 16px; }
	.th-inside__testo .tof-btn { margin-top: 12px; }
	.th-inside__foto { flex: none; width: 100%; max-width: none; }
	.th-numeri { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 56px var(--th-pad) 0 !important; text-align: left; }
	.th-numeri li { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: baseline; gap: 12px; border-top: 1px solid var(--tof-linea); padding-top: 20px; }
	.th-numeri__n { font-size: 64px; }
	.th-numeri__txt { font-size: 15px; }
	.th-scorre { display: none; }

	.th-prodotti { padding: 88px 0; }
	.th-prodotti__titolo-m { display: block; padding: 0 var(--th-pad) 36px; font-size: 32px; line-height: 1.05; font-weight: 500; color: var(--tof-viola); }
	.th-prod { flex: 0 0 68%; min-height: 360px; padding: 24px 16px; }
	.th-prod__img img { max-height: 160px; }
	.th-prod__titolo { font-size: 24px; }

	.th-eco__intro { flex-direction: column; gap: 16px; padding: 88px var(--th-pad) 0; }
	.th-eco__intro p { max-width: none; }
	.th-eco__griglia { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 36px var(--th-pad) 88px; }
	.th-eco-card { height: auto; min-height: 460px; padding: 24px; }
	.th-eco-card__basso { gap: 16px; }

	.th-cta { min-height: 0; padding: 88px var(--th-pad); }
	.th-cta__testo { gap: 16px; }
	.th-cta__testo .tof-btn { margin-top: 12px; }
}
