/* Tokens globaux centralisés dans design-system.css */

html {
    --bulma-family-primary: var(--font-family-base);
    --bulma-body-family: var(--font-family-base);
    font-family: var(--font-family-base);
    background:
        radial-gradient(
            circle at 50% -12%,
            var(--surface-atmosphere-glow-blue),
            transparent 34rem
        ),
        linear-gradient(180deg, var(--surface-page), var(--surface-deep));
    color: var(--text-primary);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: var(--font-family-base);
    color: var(--text-secondary);
    position: relative;
    isolation: isolate;

    &::before {
        content: "";
        position: fixed;
        inset: 0;
        pointer-events: none;
        background-image:
            linear-gradient(
                var(--surface-atmosphere-grid) 1px,
                transparent 1px
            ),
            linear-gradient(
                90deg,
                var(--surface-atmosphere-grid) 1px,
                transparent 1px
            );
        background-size: 44px 44px;
        mask-image: radial-gradient(circle at top, black, transparent 72%);
        opacity: 0.72;
        z-index: 0;
    }

    .title,
    strong {
        color: var(--text-primary);
    }
    .subtitle {
        color: var(--text-secondary);
    }
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.section {
    padding: clamp(0.9rem, 4vw, 2rem) var(--layout-page-gutter);
}

.header {
    display: flex;
    justify-content: space-between;
    margin-bottom: clamp(18px, 5vw, 24px);
}

.logo {
    display: block;
    height: clamp(50px, 14vw, 60px);
}

#app {
    width: min(100%, 500px);
    margin: auto;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.app-shell {
    position: relative;
    z-index: 2;
}

.effect-sticker-physics-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    contain: layout paint style;
}

.effect-sticker-physics-item {
    position: absolute;
    top: 0;
    left: 0;
    width: clamp(34px, 9.5vw, 52px);
    height: clamp(34px, 9.5vw, 52px);
    object-fit: contain;
    user-select: none;
    opacity: 0.84;
    filter:
        drop-shadow(0 8px 12px rgba(7, 20, 36, 0.2))
        drop-shadow(0 2px 2px rgba(7, 20, 36, 0.24));
    transform-origin: center;
    transform: translate3d(-120vw, -120vh, 0);
    backface-visibility: hidden;
    image-rendering: auto;
}

@media (prefers-reduced-motion: reduce) {
    .effect-sticker-physics-layer {
        display: none;
    }
}

p,
strong,
H1,
H2,
H3,
span,
.title {
    font-family: var(--font-family-base);
    &.is-red {
        color: var(--color-red-500);
    }
    &.is-blue {
        color: var(--color-blue-500);
    }
    &.is-green {
        color: var(--color-green-500);
    }
    &.is-gold {
        color: var(--color-gold-500);
    }
}

.sw-update-banner {
    position: fixed;
    bottom: max(1rem, calc(env(safe-area-inset-bottom) + 0.5rem));
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    width: min(calc(100vw - (var(--layout-page-gutter) * 2)), 640px);
    padding: 0.85rem 0.9rem;
    background: var(--surface-system);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    font-size: var(--font-size-body-sm);
    z-index: var(--layer-sticky);
    box-shadow: var(--shadow-system);
    backdrop-filter: blur(10px);
}

.sw-update-banner-copy {
    display: grid;
    gap: 0.24rem;

    strong {
        color: var(--text-primary);
        font-size: var(--font-size-body-md);
        line-height: 1.25;
        text-wrap: balance;
    }

    span {
        color: var(--text-secondary);
        line-height: var(--font-leading-copy);
        text-wrap: pretty;
    }
}

.sw-update-banner-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;

    .button {
        width: 100%;
        min-height: 2.45rem;
        padding: 0.55rem 0.75rem;
        white-space: normal;
        font-size: var(--font-size-body-sm);
    }
}

@media (min-width: 560px) {
    .sw-update-banner {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 0.9rem;
    }

    .sw-update-banner-actions {
        width: auto;
        grid-template-columns: none;
        grid-auto-flow: column;
        justify-content: end;

        .button {
            min-width: 132px;
            width: auto;
            white-space: nowrap;
        }
    }
}

@media (max-width: 420px) {
    .sw-update-banner {
        padding: 0.8rem;
    }

    .sw-update-banner-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

.install-prompt {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: 480px;
    margin: 0 auto;
    background: var(--surface-system);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-system);
    backdrop-filter: blur(10px);
    z-index: 9998;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
}

.install-prompt-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.install-prompt-text {
    flex: 1;
    font-size: var(--font-size-body-sm);
    line-height: var(--font-leading-copy);
    color: var(--text-secondary);
}

.install-prompt-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.install-prompt--ios .install-prompt-content {
    justify-content: space-between;
}
