/* Ajustes <=768px. Dono: agente Mobile. Última folha pública:
   tokens > components > sections > motion > hero-motion > nav > pages > page-* > hero-* > cliente > page-motion > mobile.
   Valores responsivos de tokens (:root) ficam em tokens.css; aqui só overrides de regras dentro de @media. */

@media (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
        scroll-padding-top: var(--nav-height);
    }

    body {
        font-size: 1rem;
        padding-bottom: env(safe-area-inset-bottom);
        -webkit-tap-highlight-color: rgb(255 195 0 / .18);
    }

    /* ---------- Hero ---------- */
    .hero {
        padding-block: 2rem 2rem;
    }

    .hero .container {
        gap: 2.25rem;
    }

    .hero h1 {
        max-width: 12ch;
        margin-bottom: 1rem;
        line-height: 1.04;
    }

    .hero p {
        font-size: 1.0625rem;
        line-height: 1.55;
    }

    .hero .cta-buttons {
        display: grid;
        gap: .25rem;
        margin-top: 1.5rem;
    }

    .hero .btn {
        width: 100%;
        min-height: 56px;
        font-size: 1.0625rem;
    }

    .hero .cta-link {
        justify-content: center;
        min-height: 48px;
        padding-block: .5rem;
        text-align: center;
        text-decoration-color: rgb(242 237 228 / .5);
    }

    /* Teclado inteiro (com o pedestal de luz) dentro do 1.º ecrã a 390x844. */
    .hero-illustration {
        width: min(72vw, 280px);
        margin-bottom: 1rem;
    }

    /* ---------- História: passos empilhados, ilustração centrada ---------- */
    .story-track {
        padding-block: 2.5rem var(--section-y);
    }

    .story-head {
        margin-bottom: 2rem;
    }

    .story-scenes {
        gap: 3.5rem;
    }

    /* Uma coluna: desenho em cima, texto em baixo, em todos os passos.
       `order` + grid-area:auto garantem isto qualquer que seja a ordem do DOM
       ou o posicionamento em grelha usado no desktop (desenho à esquerda). */
    .story-step {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .story-step > .story-illustration {
        grid-area: auto;
        order: -1;
    }

    .story-step > .story-copy {
        grid-area: auto;
        order: 0;
        align-self: start;
        padding-top: 0;
    }

    .story-copy {
        max-width: none;
    }

    .story-copy p:not(.story-step-number) {
        font-size: 1.0625rem;
    }

    .story-illustration {
        justify-self: center;
        width: min(100%, 22rem);
    }

    .phone-stage {
        width: min(64vw, 240px);
        margin-inline: auto;
    }

    /* Passo 2: par telemóvel + teclado ocupa a largura útil. */
    .story-illustration svg {
        max-width: 100%;
    }

    /* ---------- Secções claras ---------- */
    .light-run {
        --transition-length: 160px;
        --fade-out: 300px;
    }

    .section-head p {
        font-size: 1.0625rem;
    }

    .section-title {
        max-width: 16ch;
    }

    .status-block {
        padding: .75rem;
        gap: 1.25rem;
    }

    .status-block .availability-illustration {
        min-height: 0;
        padding: 1.5rem 1rem 1rem;
    }

    .status-block .unit-iso {
        width: min(100%, 300px);
    }

    .status-body {
        padding: 0 .5rem .5rem;
    }

    .status-body h3 {
        font-size: var(--fs-h3);
    }

    .status-chip {
        font-size: .875rem;
    }

    .spec-list div {
        padding-block: .875rem;
    }

    .spec-list dt {
        font-size: .8125rem;
        letter-spacing: .06em;
    }

    .spec-list dd {
        font-size: 1rem;
    }

    .status-actions .btn,
    .btn-dark {
        min-height: 56px;
    }

    .feature {
        padding-top: 1.25rem;
    }

    .feature h3 {
        font-size: 1.1875rem;
    }

    .feature p {
        max-width: none;
        font-size: 1rem;
        line-height: 1.6;
    }

    .faq-question {
        min-height: 64px;
        font-size: 1.125rem;
    }

    .faq-icon {
        width: 44px;
        height: 44px;
    }

    .faq-answer {
        font-size: 1rem;
    }

    /* ---------- Rodapé ---------- */
    footer {
        padding-bottom: calc(var(--space-8) + var(--bar-h) + env(safe-area-inset-bottom));
    }

    .footer-section p {
        font-size: 1rem;
    }

    .footer-section ul a {
        min-height: 48px;
        font-size: 1.0625rem;
    }

    .footer-bottom {
        font-size: .875rem;
        line-height: 1.55;
    }

    /* ---------- Home: reserva em 4 passos ---------- */
    .home-process__list {
        grid-template-columns: 1fr;
    }

    /* ---------- Barra CTA inferior ([data-cta-bar] em index, trasteros e como-funciona; .is-visible via cta-bar.js).
       Altura = --bar-h (tokens.css), já reservada no padding do footer; não há banner de cookies no site. ---------- */
    .cta-bar {
        position: fixed;
        z-index: calc(var(--z-nav) - 1);
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        gap: var(--space-3);
        align-items: center;
        padding: .625rem var(--gutter) calc(.625rem + env(safe-area-inset-bottom));
        background: rgb(16 13 9 / .94);
        box-shadow: 0 -1px 0 var(--line-night);
        transform: translate3d(0, 110%, 0);
        transition: transform .3s var(--ease), visibility 0s linear .3s;
        visibility: hidden;
    }

    .cta-bar.is-visible {
        transform: none;
        visibility: visible;
        transition-delay: 0s;
    }

    .cta-bar .btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: 52px;
        padding-inline: 1rem;
    }
}

@media (max-width: 380px) {
    .hero-illustration {
        width: min(58vw, 210px);
    }
}

@media (min-width: 769px) {
    .cta-bar {
        display: none;
    }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    .cta-bar {
        transition: none !important;
    }
}
