/* Space Grotesk auto-hébergée (fonte variable, sous-ensemble latin) :
   zéro requête externe, rendu immédiat avec police de repli. */
@font-face {
    font-family: "Space Grotesk";
    src: url("../font/space-grotesk-latin.woff2") format("woff2");
    font-weight: 300 700;
    font-display: swap;
}

/* ----------------------------------------------------------
   Police d'affichage demandée : Anantason Expanded Bold.
   Si tu as le fichier (.woff2 / .otf), dépose-le dans /font
   et décommente le bloc ci-dessous. Sinon on retombe sur
   Big Shoulders Display 900 (Google Fonts), très proche
   visuellement (sans-serif expanded bold).
   ---------------------------------------------------------- */
/*
@font-face {
    font-family: "Anantason Expanded";
    src: url("../font/AnantasonExpanded-Bold.woff2") format("woff2"),
         url("../font/AnantasonExpanded-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
*/

:root {
    --bg: #000;
    --fg: #fff;
    --muted: rgba(255, 255, 255, 0.55);
    --accent: #ffffff;
    --display: "Anantason Expanded", "Space Grotesk", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #000;
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Canvas shader (fond animé type "aurora") ---------- */
#shaderBg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
    transition: filter 0.4s ease;
}

/* ---------- Canvas étoiles ---------- */
#stars {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
    /* Particules visibles uniquement sous la barre */
    /* le masque n'est plus nécessaire : les particules naissent
       déjà depuis la barre et descendent. */
}

/* ---------- Vignette ---------- */
.vignette {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(ellipse at center,
        rgba(0,0,0,0) 40%,
        rgba(0,0,0,0.45) 75%,
        rgba(0,0,0,0.9) 100%);
}

/* ---------- Grain ---------- */
.grain {
    position: fixed;
    inset: -50%;
    z-index: 3;
    pointer-events: none;
    opacity: 0.07;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    animation: grain 0.8s steps(6) infinite;
}

@keyframes grain {
    0%   { transform: translate(0, 0); }
    20%  { transform: translate(-2%, 1%); }
    40%  { transform: translate(1%, -2%); }
    60%  { transform: translate(-1%, 2%); }
    80%  { transform: translate(2%, 1%); }
    100% { transform: translate(0, 0); }
}

/* ---------- Intro / Contenu ---------- */
.intro {
    position: fixed;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5rem;
    transform-origin: 50% 42%;
    will-change: transform, opacity, filter;
}

.logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
    transform: translateY(-28px);
}

.logo {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.18))
            drop-shadow(0 0 90px rgba(255, 255, 255, 0.07));
}

.title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.brand {
    font-family: var(--display);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 700;
    letter-spacing: 0.35em;
    padding-left: 0.35em; /* compense le letter-spacing pour rester centré */
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.25);
    opacity: 0;
    animation: fadeUp 1.2s ease 0.3s forwards;
    /* effet expanded si la police custom n'est pas chargée */
    font-stretch: expanded;
    transform: scaleX(1.08);
    transform-origin: center;
}

/* trait bleu sous COCYTUS — couvre toute la largeur du mot (+ un peu) */
.rule {
    width: 0;
    height: 2px;
    background: linear-gradient(90deg,
        rgba(227,168,87,0) 0%,
        #e3a857 20%,
        #4FB3E8 50%,
        #e3a857 80%,
        rgba(227,168,87,0) 100%);
    box-shadow: 0 0 12px rgba(227,168,87,0.9),
                0 0 28px rgba(227,168,87,0.6),
                0 0 60px rgba(227,168,87,0.35),
                0 0 100px rgba(227,168,87,0.18);
    animation: ruleGrow 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards;
}

@keyframes ruleGrow {
    to { width: clamp(20rem, 38vw, 36rem); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px) scaleX(1.08); }
    to   { opacity: 1; transform: translateY(0)    scaleX(1.08); }
}

/* ---------- Loader ---------- */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    opacity: 0;
    animation: fadeUp 1s ease 1.1s forwards;
}

.bar {
    width: min(760px, 84vw);
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.bar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255,255,255,0.25),
        transparent);
    animation: shimmer 2.2s linear infinite;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.4), #fff);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.75),
                0 0 28px rgba(255, 255, 255, 0.35);
    transition: width 0.12s ease-out;
    position: relative;
    z-index: 1;
}

.meta {
    width: min(760px, 84vw);
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- Zoom final ---------- */
.intro.zoom {
    animation: zoomIn 1.5s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes zoomIn {
    0%   { transform: scale(1);    opacity: 1;    filter: blur(0) brightness(1); }
    45%  { transform: scale(4.5);  opacity: 0.95; filter: blur(2px) brightness(1.3); }
    75%  { transform: scale(14);   opacity: 0.6;  filter: blur(6px) brightness(1.8); }
    100% { transform: scale(34);   opacity: 0;    filter: blur(14px) brightness(2.2); }
}

/* halo/flash façon "warp" déclenché juste avant le blackout */
.flash {
    position: fixed;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at 50% 46%,
        rgba(255,255,255,0.95) 0%,
        rgba(160,215,245,0.55) 35%,
        rgba(227,168,87,0) 70%);
}

.flash.hit {
    animation: flashPulse 0.6s ease-out forwards;
}

@keyframes flashPulse {
    0%   { opacity: 0; }
    35%  { opacity: 1; }
    100% { opacity: 0; }
}

/* écran noir final avant la redirection vers index.html */
body.blackout::after {
    content: "";
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 5;
    animation: blackout 1s ease forwards;
    pointer-events: none;
}

@keyframes blackout {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ----- Bouton "Passer l'intro" ----- */
.skip {
    position: fixed;
    right: 1.4rem;
    bottom: 1.4rem;
    z-index: 7;
    padding: 0.6rem 1.1rem;
    font: inherit;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    cursor: pointer;
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
    opacity: 0;
    animation: skipIn 0.6s ease 1.4s forwards;
    transition: color 0.2s, border-color 0.2s, background 0.2s, opacity 0.4s;
}
.skip:hover {
    color: #fff;
    border-color: rgba(227, 168, 87, 0.8);
    background: rgba(227, 168, 87, 0.15);
}
@keyframes skipIn { to { opacity: 1; } }
body.blackout .skip { opacity: 0; pointer-events: none; }
