:root {
    --paper: #fffbf5;
    --ink: #0f2a3d;
    --graphite: #1c2b33;
    --muted: #6b7a85;
    --accent: #ef9b47;
    --accent-dark: #c97a2e;
    --ok: #3fa37a;

    --rule: rgba(15, 42, 61, 0.14);
    --rule-invert: rgba(255, 255, 255, 0.16);

    --header-height: 72px;
    --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

/* -----------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

html {
    scroll-behavior: smooth;
    /* Empêche l'en-tête collant de masquer la cible d'une ancre. */
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    overflow-x: hidden;
}

::selection {
    background: var(--accent);
    color: #fff;
}

:where(a, button):focus-visible {
    outline: 2px solid var(--accent-dark);
    outline-offset: 3px;
    border-radius: 3px;
}

.skip-link {
    position: absolute;
    top: -64px;
    left: 16px;
    z-index: 100;
    padding: 11px 18px;
    border-radius: 4px;
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 16px;
}

.u-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.u-label--invert {
    color: rgba(255, 255, 255, 0.5);
}

.u-label--link {
    transition: color 0.2s ease;
}

.u-label--link:hover {
    color: var(--accent-dark);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn--accent {
    background: var(--accent);
    color: #fff;
}

.btn--accent:hover {
    background: var(--accent-dark);
}

.btn--ghost {
    border-color: var(--rule);
    color: var(--ink);
}

.btn--ghost:hover {
    border-color: var(--accent-dark);
    color: var(--accent-dark);
}

.btn--invert {
    border-color: var(--rule-invert);
    color: #fff;
}

.btn--invert:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* -----------------------------------------------------------------------------
   4. En-tête
   -------------------------------------------------------------------------- */

/* Le filet n'apparaît qu'une fois la page défilée : en haut, l'en-tête doit
   se fondre dans le hero. */
.site-header {
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease;
}

.site-header.is-scrolled {
    border-bottom-color: var(--rule);
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
}

.nav-toggle__bar {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:first-of-type {
    transform: translateY(3.25px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:last-of-type {
    transform: translateY(-3.25px) rotate(-45deg);
}

/* -----------------------------------------------------------------------------
   5. Bandeau « manifeste » du hero
   -------------------------------------------------------------------------- */

/* Filets internes uniquement : la première cellule de chaque rangée n'a pas
   de bord gauche, sinon il doublerait celui du conteneur. */
.manifest > * {
    border-left: 1px solid var(--rule);
}

.manifest > *:nth-child(odd) {
    border-left: 0;
}

.manifest > *:nth-child(n + 3) {
    border-top: 1px solid var(--rule);
}

@media (min-width: 768px) {
    .manifest > *:nth-child(odd) {
        border-left: 1px solid var(--rule);
    }

    .manifest > *:first-child {
        border-left: 0;
    }

    .manifest > * {
        border-top: 0;
    }
}

/* -----------------------------------------------------------------------------
   6. Mockup téléphone
   -------------------------------------------------------------------------- */

.phone {
    --phone-scale: 1;

    position: relative;
    flex: none;
    width: 268px;
    height: 548px;
    padding: 9px;
    border-radius: 36px;
    background: #0b1620;
    box-shadow:
        0 30px 60px -24px rgba(15, 42, 61, 0.5),
        0 6px 18px rgba(15, 42, 61, 0.12);
    transform: scale(var(--phone-scale));
}

.phone__notch {
    position: absolute;
    top: 9px;
    left: 50%;
    z-index: 2;
    width: 92px;
    height: 18px;
    border-radius: 0 0 12px 12px;
    background: #0b1620;
    transform: translateX(-50%);
}

.phone__screen {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 28px;
    background: var(--paper);
}

.phone__statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 30px;
    padding: 0 18px;
    font-family: var(--mono);
    font-size: 9px;
    color: var(--ink);
}

.phone__body {
    flex: 1;
    overflow: hidden;
    padding: 4px 14px 16px;
}

/* -----------------------------------------------------------------------------
   7. Contenu des écrans
   ----------------------------------------------------------------------------- */

.screen {
    font-size: 10.5px;
    line-height: 1.4;
    color: var(--graphite);
}

.screen-label {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.screen-label--invert {
    color: rgba(255, 255, 255, 0.55);
}

.screen-ref {
    font-family: var(--mono);
    font-size: 9.5px;
}

.screen-card {
    padding: 9px 10px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: #fff;
}

.screen-field {
    padding: 7px 9px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: #fff;
    font-size: 9.5px;
    color: var(--muted);
}

.screen-cta {
    padding: 9px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
}

.screen-ticket {
    padding: 13px;
    border-radius: 14px;
    background: linear-gradient(135deg, #13213e, #22406b);
    color: #fff;
}

.screen-chip {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: rgba(239, 155, 71, 0.16);
    color: var(--accent-dark);
    font-family: var(--mono);
    font-size: 8px;
}

.screen-badge {
    flex: none;
    padding: 2px 6px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 7.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.screen-badge--ok {
    background: rgba(63, 163, 122, 0.12);
    color: var(--ok);
}

.screen-badge--pending {
    background: rgba(239, 155, 71, 0.16);
    color: var(--accent-dark);
}

.screen-dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(15, 42, 61, 0.16);
}

.screen-dot--done {
    background: var(--ok);
}

.screen-dot--current {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(239, 155, 71, 0.2);
}

.screen-switch {
    position: relative;
    flex: none;
    width: 28px;
    height: 16px;
    border-radius: 999px;
    background: rgba(15, 42, 61, 0.14);
}

.screen-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #fff;
}

.screen-switch--on {
    background: var(--accent);
}

.screen-switch--on::after {
    transform: translateX(12px);
}

/* Barre d'avancement du dédouanement : remplie par guide.js à l'entrée dans
   le viewport, la largeur cible étant portée par data-clearance. */
.clearance {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.clearance__fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    transition: width 1.4s cubic-bezier(0.16, 0.8, 0.3, 1);
}

/* -----------------------------------------------------------------------------
   8. Guide : sommaire collant
   -------------------------------------------------------------------------- */

.step-link {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--rule);
    font-size: 13px;
    color: var(--muted);
    transition: color 0.2s ease;
}

.step-link:hover {
    color: var(--ink);
}

.step-link[aria-current="true"] {
    color: var(--accent-dark);
}

/* -----------------------------------------------------------------------------
   9. FAQ
   -------------------------------------------------------------------------- */

.faq-item__panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.faq-item__panel > * {
    overflow: hidden;
}

.faq-item.is-open .faq-item__panel {
    grid-template-rows: 1fr;
}

.faq-item__trigger {
    transition: opacity 0.2s ease;
}

.faq-item__trigger:hover {
    opacity: 0.65;
}

/* Le « + » devient « − » à l'ouverture : deux pseudo-éléments, pas d'icône. */
.faq-item__sign {
    position: relative;
    display: block;
    flex: none;
    width: 13px;
    height: 13px;
}

.faq-item__sign::before,
.faq-item__sign::after {
    content: "";
    position: absolute;
    background: currentColor;
}

.faq-item__sign::before {
    top: 5.75px;
    left: 0;
    width: 13px;
    height: 1.5px;
}

.faq-item__sign::after {
    top: 0;
    left: 5.75px;
    width: 1.5px;
    height: 13px;
    transition: transform 0.3s ease;
}

.faq-item.is-open .faq-item__sign::after {
    transform: scaleY(0);
}

/* -----------------------------------------------------------------------------
   10. Apparition au défilement
   -------------------------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* -----------------------------------------------------------------------------
   11. Accessibilité : mouvement réduit
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
