/* Intro cinématique — visible dès le premier paint */

html:not(.sq-booted) {
    background: #000;
}

html:not(.sq-booted) body {
    overflow: hidden;
}

.sq-boot {
    display: grid;
    place-items: center;
    place-content: center;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(ellipse at 50% 42%, #2a0a52 0%, #07010f 42%, #000 78%);
    pointer-events: auto;
}

html.sq-booted .sq-boot {
    display: none !important;
}

.sq-boot__fx {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.sq-boot__nebula {
    position: absolute;
    inset: -20%;
    z-index: 0;
    background:
        radial-gradient(circle at 32% 38%, #df42f455 0%, transparent 36%),
        radial-gradient(circle at 70% 62%, #28d9f340 0%, transparent 34%);
    filter: blur(8px);
    animation: sq-boot-nebula 4.5s ease-in-out infinite alternate;
}

.sq-boot__hex {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(#9b4dff16 1px, transparent 1px),
        linear-gradient(90deg, #28d9f314 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at 50% 48%, #000 12%, transparent 68%);
    transform: perspective(700px) rotateX(62deg) scale(1.8) translateY(12%);
    animation: sq-boot-grid 5s linear infinite;
    opacity: 0.55;
}

.sq-boot__scan {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    background:
        repeating-linear-gradient(180deg, transparent 0 2px, #ffffff06 2px 3px),
        linear-gradient(180deg, #0006 0%, transparent 18%, transparent 82%, #0008 100%);
    animation: sq-boot-scan 5s linear infinite;
}

.sq-boot__shock,
.sq-boot__shock--2 {
    position: absolute;
    left: 50%;
    top: 44%;
    width: 120px;
    height: 120px;
    margin: -60px 0 0 -60px;
    border-radius: 50%;
    border: 2px solid #c77dff;
    opacity: 0;
    z-index: 2;
    animation: sq-boot-shock 2.4s 0.45s ease-out infinite;
}

.sq-boot__shock--2 {
    border-color: #28d9f3;
    animation-delay: 1.15s;
}

.sq-boot__core {
    position: relative;
    width: min(58vw, 420px);
    aspect-ratio: 720 / 649;
    z-index: 3;
    animation: sq-boot-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sq-boot__orbit {
    position: absolute;
    inset: -18%;
    width: 136%;
    height: 136%;
    left: -18%;
    top: -18%;
    overflow: visible;
}

.sq-boot__orbit circle {
    fill: none;
    transform-origin: 100px 100px;
}

.sq-boot__orbit-a {
    stroke: #df42f4;
    stroke-width: 1.4;
    stroke-dasharray: 80 380;
    filter: drop-shadow(0 0 6px #df42f4);
    animation: sq-boot-orbit 2.2s linear infinite;
}

.sq-boot__orbit-b {
    stroke: #28d9f3;
    stroke-width: 1.2;
    stroke-dasharray: 50 520;
    filter: drop-shadow(0 0 6px #28d9f3);
    animation: sq-boot-orbit-rev 3.1s linear infinite;
}

.sq-boot__orbit-c {
    stroke: #ffffff2a;
    stroke-width: 0.7;
    stroke-dasharray: 6 14;
    animation: sq-boot-orbit 9s linear infinite;
}

.sq-boot__mark,
.sq-boot__ghost {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.sq-boot__mark {
    z-index: 2;
    filter:
        drop-shadow(0 0 22px #df42f4aa)
        drop-shadow(0 0 56px #28d9f366);
    animation: sq-boot-pulse 1.6s 0.8s ease-in-out infinite;
}

.sq-boot__ghost {
    mix-blend-mode: screen;
    opacity: 0;
}

.sq-boot__ghost--violet {
    animation: sq-boot-chroma-v 1.1s 0.15s ease-out both;
}

.sq-boot__ghost--cyan {
    animation: sq-boot-chroma-c 1.1s 0.15s ease-out both;
}

.sq-boot__bloom {
    position: absolute;
    inset: 16%;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #c77dff99 26%, transparent 70%);
    opacity: 0;
    filter: blur(22px);
    mix-blend-mode: screen;
    animation: sq-boot-bloom 0.9s 0.2s ease-out both;
}

.sq-boot__flare {
    position: absolute;
    left: 6%;
    right: 6%;
    top: 47%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fff, #28d9f3, #df42f4, transparent);
    opacity: 0;
    transform: scaleX(0.15);
    animation: sq-boot-flare 0.85s 0.35s ease-out both;
}

.sq-boot__word-wrap {
    position: relative;
    z-index: 4;
    display: grid;
    place-items: center;
    margin: 14px 0 0;
}

.sq-boot__word-wrap:before {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    top: 28%;
    height: 55%;
    background: radial-gradient(ellipse at center, #b56dff3d 0%, transparent 72%);
    filter: blur(10px);
    pointer-events: none;
    z-index: 0;
}

.sq-boot__word {
    position: relative;
    z-index: 1;
    display: block;
    width: min(380px, 68vw);
    height: auto;
    opacity: 0;
    transform: translateY(16px);
    filter:
        drop-shadow(0 0 4px #fff6)
        drop-shadow(0 6px 10px #0005);
    animation: sq-boot-text 0.7s 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sq-boot__tag {
    position: relative;
    z-index: 4;
    margin: 10px 0 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.46em;
    color: #cbb8e8;
    opacity: 0;
    animation: sq-boot-text 0.6s 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sq-boot__meter {
    position: relative;
    z-index: 4;
    width: min(240px, 56vw);
    height: 2px;
    margin-top: 28px;
    border-radius: 99px;
    background: #ffffff14;
    overflow: hidden;
}

.sq-boot__meter i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #df42f4, #fff, #28d9f3);
    box-shadow: 0 0 12px #28d9f3;
    animation: sq-boot-meter 2.4s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sq-boot.is-flash::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 6;
    background: radial-gradient(circle at 50% 44%, #fff 0%, #e0b3ff 18%, #6a1fff33 46%, transparent 70%);
    mix-blend-mode: screen;
    animation: sq-boot-flash 0.55s ease-out forwards;
}

.sq-boot.is-out {
    opacity: 0;
    filter: blur(18px);
    transform: scale(1.08);
    transition: opacity 0.55s ease, filter 0.55s ease, transform 0.55s ease;
}

.sq-boot.is-out .sq-boot__core {
    animation: sq-boot-dive 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes sq-boot-enter {
    from { opacity: 0; transform: scale(0.22) rotate(-14deg); filter: blur(22px) brightness(2.4); }
    to { opacity: 1; transform: scale(1) rotate(0deg); filter: none; }
}

@keyframes sq-boot-dive {
    to { transform: scale(7.2); filter: blur(12px) brightness(2.6); opacity: 0; }
}

@keyframes sq-boot-text {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes sq-boot-orbit {
    to { transform: rotate(360deg); }
}

@keyframes sq-boot-orbit-rev {
    to { transform: rotate(-360deg); }
}

@keyframes sq-boot-grid {
    to { background-position: 0 54px, 54px 0; }
}

@keyframes sq-boot-scan {
    to { transform: translateY(10px); }
}

@keyframes sq-boot-nebula {
    from { transform: scale(1) translate3d(-2%, -1%, 0); }
    to { transform: scale(1.08) translate3d(2%, 2%, 0); }
}

@keyframes sq-boot-bloom {
    0% { opacity: 0; transform: scale(0.35); }
    40% { opacity: 1; transform: scale(1.12); }
    100% { opacity: 0; transform: scale(1.8); }
}

@keyframes sq-boot-chroma-v {
    0% { opacity: 0.95; transform: translate(-16px, 8px); }
    100% { opacity: 0; transform: none; }
}

@keyframes sq-boot-chroma-c {
    0% { opacity: 0.95; transform: translate(16px, -8px); }
    100% { opacity: 0; transform: none; }
}

@keyframes sq-boot-flare {
    0% { opacity: 0; transform: scaleX(0.12); }
    40% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1.45); }
}

@keyframes sq-boot-pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 22px #df42f4aa) drop-shadow(0 0 56px #28d9f366); }
    50% { transform: scale(1.045); filter: drop-shadow(0 0 34px #df42f4) drop-shadow(0 0 80px #28d9f388); }
}

@keyframes sq-boot-shock {
    0% { opacity: 0.7; transform: scale(0.4); }
    100% { opacity: 0; transform: scale(4.2); }
}

@keyframes sq-boot-flash {
    0% { opacity: 0; }
    35% { opacity: 0.9; }
    100% { opacity: 0; }
}

@keyframes sq-boot-meter {
    to { width: 100%; }
}

@media (max-width: 700px) {
    .sq-boot__core { width: min(78vw, 300px); }
    .sq-boot__word { width: min(260px, 72vw); }
}

@media (prefers-reduced-motion: reduce) {
    .sq-boot__nebula,
    .sq-boot__hex,
    .sq-boot__scan,
    .sq-boot__shock,
    .sq-boot__orbit circle,
    .sq-boot__ghost,
    .sq-boot__bloom,
    .sq-boot__flare,
    .sq-boot__mark {
        animation: none !important;
    }
    .sq-boot__core,
    .sq-boot__mark,
    .sq-boot__word-wrap,
    .sq-boot__word,
    .sq-boot__tag,
    .sq-boot__meter i {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        animation: none !important;
    }
    .sq-boot__meter i { width: 100%; }
}
