/* =========================================================
   missione.css — pagina "Missione" di LuniSpace
   Si appoggia a style.css (font, nav, footer, colori) senza modificarlo.
   Tutte le classi nuove hanno il prefisso "ms-".
   ========================================================= */

/* ---------- Hero (riusa .section-hero2 / .sez1 / .logo / .p1 di style.css) ---------- */
.section.ms-hero {
    height: auto;
    min-height: 0;
}

@media (min-width: 1025px) {
    .ms-hero .sez1 {
        height: auto;
        padding-top: 4vh;
        padding-bottom: 4vh;
    }
    .ms-hero .logo { margin-top: 10vh; }
    .ms-hero .p1   { margin-top: 10vh; }
}

.ms-hero .linea { margin-bottom: 0; }

/* ---------- Palcoscenico con il disegno a linee ---------- */
.ms-stage {
    position: relative;
    background-color: var(--panel);
}

.ms-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

.ms-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* contenitore della barra: alto zero, resta incollato in cima e sopra a tutto il resto */
.ms-strip-wrap {
    position: sticky;
    top: 0;
    height: 0;
    z-index: 10;
}

/* il footer copre la barra quando la sezione finisce */
.footer {
    position: relative;
    z-index: 11;
}

/* barra di telemetria in alto, stile "cartiglio" da disegno tecnico */
.ms-strip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.4fr repeat(6, 1fr);
    background-color: var(--panel);
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}

.ms-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.85rem 1.2rem;
    border-left: 1px solid rgba(0, 0, 0, 0.2);
    min-width: 0;
}

.ms-cell:first-child {
    border-left: 0;
    padding-left: 4vw;
}

.ms-k {
    font-weight: 700;
    font-size: clamp(0.62rem, 0.55rem + 0.2vw, 0.75rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.ms-v {
    font-weight: 700;
    font-size: clamp(0.95rem, 0.75rem + 0.6vw, 1.4rem);
    letter-spacing: -0.02em;
    color: #111111;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ms-phase .ms-v { color: var(--amber); }

.ms-progress {
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 2px;
    width: 0;
    background-color: var(--amber);
}

/* ---------- Testi che scorrono sopra il disegno ---------- */
.ms-steps {
    position: relative;
    z-index: 3;
    margin-top: -100vh;
    margin-top: -100svh;
}

.ms-step {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 120px 4vw 8vh;
}

.ms-step[data-side="right"] { justify-content: flex-end; }

@media (min-width: 1101px) {
    .ms-step[data-side="right"] { padding-right: calc(4vw + 300px); }
}

.ms-box {
    max-width: 440px;
    padding: clamp(1.4rem, 1rem + 1.2vw, 2.4rem);
    background-color: rgba(226, 226, 226, 0.94);
    border: 1px solid rgba(0, 0, 0, 0.5);
    border-left: 6px solid var(--amber);
    color: var(--text);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s var(--aww-ease), transform 1s var(--aww-ease);
}

.ms-box.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ms-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    margin-bottom: 1.1rem;
    font-weight: 700;
    font-size: clamp(0.8rem, 0.72rem + 0.25vw, 1rem);
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--amber);
}

.ms-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--amber);
    animation: riquadro-pulse 1.8s ease-in-out infinite; /* keyframes definiti in style.css */
}

.ms-box h2 {
    margin: 0;
    font-weight: 800;
    font-size: clamp(1.7rem, 1rem + 2vw, 3rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
    color: #111111;
}

.ms-line {
    height: 1px;
    margin: 1.1rem 0 1.2rem;
    background-color: rgba(0, 0, 0, 0.5);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.2s var(--aww-ease) 0.2s;
}

.ms-box.is-visible .ms-line { transform: scaleX(1); }

.ms-box p {
    margin: 0 0 0.9rem;
    font-size: clamp(0.92rem, 0.8rem + 0.3vw, 1.1rem);
    line-height: 1.45;
}

.ms-box p:last-child { margin-bottom: 0; }

.ms-box b { font-weight: 700; color: #111111; }

.ms-list {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
}

.ms-list li {
    padding: 0.6rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    font-size: clamp(0.88rem, 0.78rem + 0.25vw, 1rem);
    line-height: 1.4;
}

.ms-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
}

.ms-stat b {
    display: block;
    font-weight: 800;
    font-size: clamp(1.4rem, 1rem + 1vw, 2rem);
    letter-spacing: -0.04em;
    color: #111111;
}

.ms-stat span {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.ms-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.6rem;
    font-weight: 700;
    font-size: clamp(0.9rem, 0.8rem + 0.3vw, 1.1rem);
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-decoration: none;
    color: #111111;
    transition: color 0.3s ease;
}

.ms-link svg {
    width: 1.2em;
    height: 1.2em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.4s var(--aww-ease);
}

.ms-link:hover { color: var(--amber); }
.ms-link:hover svg { transform: translateX(6px); }

.ms-note {
    font-size: 0.78rem !important;
    color: var(--text-dim);
}

/* ---------- Tablet / mobile ---------- */
@media (max-width: 1024px) {
    .ms-strip { grid-template-columns: repeat(3, 1fr); }
    .ms-cell:nth-child(7) { display: none; }
    .ms-phase { grid-column: 1 / -1; border-bottom: 1px solid rgba(0, 0, 0, 0.2); }
    .ms-cell { padding: 0.5rem 0.9rem; }
    .ms-cell:first-child { padding-left: 5vw; }
    .ms-cell:nth-child(2), .ms-cell:nth-child(5) { border-left: 0; padding-left: 5vw; }
}

@media (max-width: 760px) {
    /* su telefono prima si vede la grafica (uno schermo intero libero), poi arriva il riquadro di testo */
    .ms-step {
        display: block;
        min-height: 0;
        padding: 100vh 5vw 0;
        padding-top: 100svh;
    }
    .ms-step:last-child {
        padding-bottom: 60vh;
        padding-bottom: 60svh;
    }
    .ms-box {
        max-width: 100%;
        padding: 1.2rem 1.3rem;
    }
    .ms-box h2 { font-size: 1.6rem; }
    .ms-strip { grid-template-columns: repeat(4, 1fr); }
    .ms-phase { flex-direction: row; align-items: baseline; gap: 0.6rem; padding-top: 0.45rem; padding-bottom: 0.45rem; }
    .ms-cell { padding: 0.4rem 0.6rem; }
    .ms-cell:nth-child(2) { padding-left: 5vw; }
    .ms-cell:nth-child(5) { border-left: 1px solid rgba(0, 0, 0, 0.2); padding-left: 0.6rem; }
    .ms-cell:nth-child(6), .ms-cell:nth-child(7) { display: none; }
    .ms-v { font-size: 0.9rem; }
    .ms-line { margin: 0.8rem 0 0.9rem; }
    .ms-box p { font-size: 0.9rem; margin-bottom: 0.6rem; }
    .ms-list li { font-size: 0.85rem; padding: 0.45rem 0; }
    .ms-stats { gap: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ms-box, .ms-line { transition: none; }
    .ms-dot { animation: none; }
}
