/* ---------------------------
   Variabili di colore & base
   --------------------------- */

:root {
    --tm-primary: #9E1935;
    --tm-secondary: #3F3F3F;
    --tm-tertiary: #E3E3E6;
    --tm-bg-dark: #111111;
    --tm-text-main: #FFFFFF;
    --tm-text-soft: #DADAE0;

    --tm-font-main: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

/* ---------------------------
   Layout pagina
   --------------------------- */

body {
    font-family: var(--tm-font-main);
    background-color: var(--tm-bg-dark);
    color: var(--tm-text-main);
}

.tm-page {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* ---------------------------
   Loader “sipario” + TV
   --------------------------- */

.tm-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: transparent; /* la pagina sotto è già visibile, coperta solo dalle tende */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
    animation: tm-loader-fade 0.6s ease-in-out 1.4s forwards;
}

/* linea centrale che cade, poi si chiude in puntino bianco */

.tm-loader-line {
    position: relative;
    width: 3px;
    height: 0;
    border-radius: 999px;
    background: linear-gradient(
        to bottom,
        #ffffff 0%,
        var(--tm-primary) 30%,
        #000000 100%
    );
    box-shadow:
        0 0 8px rgba(0, 0, 0, 0.45),
        0 0 16px rgba(158, 25, 53, 0.45);
    animation: tm-line-tv 1.1s cubic-bezier(0.55, 0.1, 0.35, 1.0) forwards;
}

/* pannelli che si aprono a tenda da centro verso i lati */

.tm-loader-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    background: #ffffff;
}

.tm-loader-left {
    left: 0;
    transform: translateX(0);
    animation: tm-curtain-left 1s cubic-bezier(0.6, 0.0, 0.2, 1.0) 0.45s forwards;
}

.tm-loader-right {
    right: 0;
    transform: translateX(0);
    animation: tm-curtain-right 1s cubic-bezier(0.6, 0.0, 0.2, 1.0) 0.45s forwards;
}

/* dissolvenza finale del layer loader */

@keyframes tm-loader-fade {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* sequenza linea: compare, diventa colonna, si restringe in puntino, poi svanisce */

@keyframes tm-line-tv {
    0% {
        height: 0;
        width: 3px;
        opacity: 0;
        border-radius: 999px;
        background: linear-gradient(
            to bottom,
            #ffffff 0%,
            var(--tm-primary) 30%,
            #000000 100%
        );
        box-shadow:
            0 0 8px rgba(0, 0, 0, 0.45),
            0 0 16px rgba(158, 25, 53, 0.45);
    }
    35% {
        height: 100vh;
        width: 3px;
        opacity: 1;
    }
    70% {
        height: 10px;
        width: 10px;
        opacity: 1;
        border-radius: 50%;
        background: #ffffff;
        box-shadow:
            0 0 16px rgba(255, 255, 255, 0.9),
            0 0 30px rgba(255, 255, 255, 0.6);
    }
    100% {
        height: 10px;
        width: 10px;
        opacity: 0;
        border-radius: 50%;
        background: #ffffff;
        box-shadow: none;
    }
}

@keyframes tm-curtain-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

@keyframes tm-curtain-right {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ---------------------------
   Slider di sfondo
   --------------------------- */

.tm-bg-slider {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.tm-bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transform: scale(1.05);
    transition:
        opacity 1.5s ease-in-out,
        transform 8s ease-out;
}

.tm-bg-slide.tm-active {
    opacity: 1;
    transform: scale(1.0);
}

/* ---------------------------
   Overlay colore
   --------------------------- */

.tm-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at top left, rgba(158, 25, 53, 0.35), transparent 60%),
        linear-gradient(135deg, rgba(17, 17, 17, 0.70), rgba(63, 63, 63, 0.78));
    mix-blend-mode: normal;
}

/* ---------------------------
   Contenuto principale
   --------------------------- */

.tm-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 3rem clamp(1.5rem, 4vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3.5rem;
    max-width: 1180px;
    margin: 0 auto;
}

/* ---------------------------
   Header / logo / pill
   --------------------------- */

.tm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.tm-logo-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(227, 227, 230, 0.35);
    overflow: hidden;
    height: 120px;
    min-width: 230px;
}

.tm-logo {
    max-height: 110px;
    width: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.9));
}

.tm-logo-light,
.tm-logo-dark {
    opacity: 0;
}

/* cross-fade morbido tra logo chiaro e scuro */

@keyframes tm-logo-fade-light {
    0%, 40% {
        opacity: 1;
    }
    60%, 100% {
        opacity: 0;
    }
}

@keyframes tm-logo-fade-dark {
    0%, 40% {
        opacity: 0;
    }
    60%, 100% {
        opacity: 1;
    }
}

.tm-logo-light {
    animation: tm-logo-fade-light 10s ease-in-out infinite;
}

.tm-logo-dark {
    animation: tm-logo-fade-dark 10s ease-in-out infinite;
}

.tm-pill {
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    background: rgba(227, 227, 230, 0.10);
    border: 1px solid rgba(227, 227, 230, 0.35);
    color: var(--tm-tertiary);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ---------------------------
   Hero text
   --------------------------- */

.tm-hero {
    max-width: 700px;
}

.tm-title {
    margin: 0 0 0.6rem 0;
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
}

.tm-title::after {
    content: "";
    display: block;
    width: 72px;
    height: 3px;
    margin-top: 0.6rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--tm-primary), transparent);
}

.tm-subtitle {
    margin: 0;
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    line-height: 1.6;
    color: var(--tm-text-soft);
    max-width: 38rem;
}

/* ---------------------------
   Sezione azienda
   --------------------------- */

.tm-company {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr);
    gap: 2.5rem;
    align-items: flex-start;
}

/* card con bordo superiore/inferiore rosso e fade-up */

.tm-company-col {
    position: relative;
    backdrop-filter: blur(14px);
    background: rgba(10, 10, 10, 0.46);
    border-radius: 1.4rem;
    border: 1px solid rgba(227, 227, 230, 0.18);
    border-top: 5px solid var(--tm-primary);
    border-bottom: 5px solid var(--tm-primary);
    padding: 1.9rem 2rem;
    box-shadow:
        0 18px 30px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.75);
    overflow: hidden;

    opacity: 0;
    transform: translateY(24px);
}

/* animazione fade from bottom */

@keyframes tm-fade-up {
    0% {
        opacity: 0;
        transform: translateY(24px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.tm-company-col.tm-in-view {
    animation: tm-fade-up 0.9s ease-out forwards;
}

.tm-company-data {
    max-width: 360px;
}

.tm-section-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.tm-separator {
    height: 1px;
    width: 100%;
    margin: 1.5rem 0 1.1rem 0;
    background: linear-gradient(90deg, rgba(227, 227, 230, 0.70), transparent);
}

.tm-address,
.tm-contact,
.tm-vat {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--tm-tertiary);
}

.tm-contact a {
    color: var(--tm-tertiary);
    text-decoration: none;
    border-bottom: 1px solid rgba(227, 227, 230, 0.35);
}

.tm-contact a:hover {
    border-bottom-color: var(--tm-primary);
    color: #ffffff;
}

.tm-company-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--tm-tertiary);
}

.tm-company-text p {
    margin: 0 0 0.9rem 0;
}

/* ---------------------------
   Footer
   --------------------------- */

.tm-footer {
    margin-top: 1rem;
    font-size: 0.78rem;
    color: rgba(227, 227, 230, 0.65);
}

/* ---------------------------
   Responsività
   --------------------------- */

@media (max-width: 960px) {
    .tm-content {
        padding: 2.5rem 1.5rem;
        justify-content: flex-start;
    }

    .tm-company {
        grid-template-columns: 1fr;
    }

    .tm-company-data {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .tm-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tm-pill {
        font-size: 0.7rem;
    }

    .tm-content {
        padding-top: 2rem;
        padding-bottom: 2.5rem;
        gap: 2.4rem;
    }

    .tm-company-col {
        padding: 1.6rem 1.4rem;
        border-radius: 1.1rem;
    }
}
