/* ─── Manrope, self-hosted (SIL Open Font License) ────────────────── */

/* latin */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../assets/fonts/manrope-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../assets/fonts/manrope-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../assets/fonts/manrope-500-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../assets/fonts/manrope-500-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../assets/fonts/manrope-600-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../assets/fonts/manrope-600-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../assets/fonts/manrope-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../assets/fonts/manrope-700-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ─── Variables ──────────────────────────────────────────────────── */
:root {
    --surface: rgba(255, 255, 255, 0.22);
    --border:  rgba(255, 255, 255, 0.55);
}

/* ─── Base ───────────────────────────────────────────────────────── */
body {
    background: linear-gradient(135deg, #add8e6, #f2a6d2);
    background-size: 500% 500%;
    animation: gradientAnimation 7s ease infinite;
    min-height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Manrope', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

html {
    overflow: hidden;
    height: 100%;
}

@keyframes gradientAnimation {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ─── Layout ─────────────────────────────────────────────────────── */
.center-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44vh;
}

.dflex {
    display: flex;
    gap: 22px;
    justify-content: center;
    align-items: center;
    transform: translate(-50%, -50%);
    position: absolute;
    top: 50%;
    left: 50%;
    opacity: 0;
    animation: fadeInUp 1.5s ease forwards;
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    0%   { opacity: 0; transform: translate(-50%, -40%); }
    100% { opacity: 1; transform: translate(-50%, -50%); }
}

/* ─── Social Cards ───────────────────────────────────────────────── */
.dflex a {
    position: relative;
    width: 87px;
    height: 87px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    box-shadow:
        0 4px 24px rgba(255, 255, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(255, 255, 255, 0.15);
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    opacity: 0;
    animation:
        slideInScale 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
        float 6s ease-in-out infinite;
    will-change: transform, opacity;
    transition:
        transform   0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow  0.4s ease,
        background  0.4s ease,
        border-color 0.4s ease;
}

/* Liquid glass inner highlight + bottom reflection */
.dflex a::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(160deg,
            rgba(255, 255, 255, 0.55) 0%,
            rgba(255, 255, 255, 0.15) 40%,
            transparent 70%,
            rgba(255, 255, 255, 0.08) 100%);
    pointer-events: none;
}

/* Tooltip */
.dflex a::after {
    content: attr(data-label);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    font-size: 9px;
    font-weight: 500;
    font-family: 'Manrope', sans-serif;
    color: rgba(0, 0, 0, 0.5);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.dflex a:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dflex a img {
    width: 45px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
    z-index: 2;
    position: relative;
}

/* Stagger delays */
.dflex a:nth-child(1) { animation-delay: 0.8s;  animation-duration: 0.8s, 6s;   }
.dflex a:nth-child(2) { animation-delay: 0.9s;  animation-duration: 0.8s, 7s;   }
.dflex a:nth-child(3) { animation-delay: 1.0s;  animation-duration: 0.8s, 8s;   }
.dflex a:nth-child(4) { animation-delay: 1.1s;  animation-duration: 0.8s, 5s;   }
.dflex a:nth-child(5) { animation-delay: 1.2s;  animation-duration: 0.8s, 7.5s; }
.dflex a:nth-child(6) { animation-delay: 1.3s;  animation-duration: 0.8s, 6.5s; }
.dflex a:nth-child(7) { animation-delay: 1.4s;  animation-duration: 0.8s, 8.5s; }
.dflex a:nth-child(8) { animation-delay: 1.5s;  animation-duration: 0.8s, 5.5s; }

@keyframes slideInScale {
    0%   { opacity: 0; transform: translateY(30px) scale(0.8); }
    100% { opacity: 1; transform: translateY(0)    scale(1);   }
}

@keyframes float {
    0%, 100% { transform: translateY(0);   }
    50%       { transform: translateY(-6px); }
}

/* Hover */
.dflex a:hover {
    transform: translateY(-12px) scale(1.08) rotateY(5deg);
    border-color: rgba(255, 255, 255, 0.5);
}

.dflex a:hover img {
    transform: scale(1.15) rotateZ(-5deg);
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.2)) brightness(1.1) saturate(1.2);
}

.dflex a:active {
    transform: translateY(-8px) scale(1.05) rotateY(2deg);
    transition-duration: 0.1s;
}

/* Platform glow on hover */
.osu:hover     { box-shadow: 0 12px 40px rgba(255,126,179,0.55), 0 0 0 1px rgba(255,126,179,0.3); background: rgba(255,126,179,0.12); }
.steam:hover   { box-shadow: 0 12px 40px rgba(108,43,199,0.55),  0 0 0 1px rgba(108,43,199,0.3);  background: rgba(108,43,199,0.12); }
.discord:hover { box-shadow: 0 12px 40px rgba(88,101,242,0.55),  0 0 0 1px rgba(88,101,242,0.3);  background: rgba(88,101,242,0.12); }
.github:hover  { box-shadow: 0 12px 40px rgba(64,144,204,0.55),  0 0 0 1px rgba(64,144,204,0.3);  background: rgba(64,144,204,0.12); }
.dofus:hover   { box-shadow: 0 12px 40px rgba(112,167,3,0.55),   0 0 0 1px rgba(112,167,3,0.3);   background: rgba(112,167,3,0.12);  }
.youtube:hover { box-shadow: 0 12px 40px rgba(255,0,0,0.55),     0 0 0 1px rgba(255,0,0,0.3);     background: rgba(255,0,0,0.12);    }
.twitch:hover  { box-shadow: 0 12px 40px rgba(146,68,255,0.55),  0 0 0 1px rgba(146,68,255,0.3);  background: rgba(146,68,255,0.12); }
.pc:hover      { box-shadow: 0 12px 40px rgba(82,145,255,0.55),  0 0 0 1px rgba(82,145,255,0.3);  background: rgba(82,145,255,0.12); }

/* ─── Footer (back to home) ──────────────────────────────────────── */
.page-foot {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 30px;
    text-align: center;
    z-index: 3;
    opacity: 0;
    animation: footFadeIn 1s ease forwards;
    animation-delay: 1.8s;
}

@keyframes footFadeIn {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0);   }
}

.page-foot a {
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgba(35, 38, 46, 0.42);
    transition: color 0.3s ease;
}

.page-foot a:hover { color: rgba(35, 38, 46, 1); }

/* ─── Keyboard focus ─────────────────────────────────────────────── */
/* Keyboard focus reuses the hover look — no extra ring. */
.dflex a:focus-visible {
    outline: none;
    transform: translateY(-12px) scale(1.08) rotateY(5deg);
    border-color: rgba(255, 255, 255, 0.5);
}

.dflex a:focus-visible img {
    transform: scale(1.15) rotateZ(-5deg);
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.2)) brightness(1.1) saturate(1.2);
}

.dflex a:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }

.osu:focus-visible     { box-shadow: 0 12px 40px rgba(255,126,179,0.55), 0 0 0 1px rgba(255,126,179,0.3); background: rgba(255,126,179,0.12); }
.steam:focus-visible   { box-shadow: 0 12px 40px rgba(108,43,199,0.55),  0 0 0 1px rgba(108,43,199,0.3);  background: rgba(108,43,199,0.12); }
.discord:focus-visible { box-shadow: 0 12px 40px rgba(88,101,242,0.55),  0 0 0 1px rgba(88,101,242,0.3);  background: rgba(88,101,242,0.12); }
.github:focus-visible  { box-shadow: 0 12px 40px rgba(64,144,204,0.55),  0 0 0 1px rgba(64,144,204,0.3);  background: rgba(64,144,204,0.12); }
.dofus:focus-visible   { box-shadow: 0 12px 40px rgba(112,167,3,0.55),   0 0 0 1px rgba(112,167,3,0.3);   background: rgba(112,167,3,0.12);  }
.youtube:focus-visible { box-shadow: 0 12px 40px rgba(255,0,0,0.55),     0 0 0 1px rgba(255,0,0,0.3);     background: rgba(255,0,0,0.12);    }
.twitch:focus-visible  { box-shadow: 0 12px 40px rgba(146,68,255,0.55),  0 0 0 1px rgba(146,68,255,0.3);  background: rgba(146,68,255,0.12); }
.pc:focus-visible      { box-shadow: 0 12px 40px rgba(82,145,255,0.55),  0 0 0 1px rgba(82,145,255,0.3);  background: rgba(82,145,255,0.12); }

/* Text link with no hover lift to borrow, so it keeps a ring. */
.page-foot a:focus-visible {
    outline: 2px solid rgba(35, 38, 46, 0.45);
    outline-offset: 3px;
    border-radius: 4px;
    color: rgba(35, 38, 46, 1);
}

/* ─── Background overlay ─────────────────────────────────────────── */
.background-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    filter: brightness(1.4);
    z-index: -1;
    image-rendering: high-quality;
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
    .dflex {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
        padding: 0 30px;
        grid-row-gap: 40px;
        grid-column-gap: 80px;
        max-width: 320px;
    }

    .dflex a {
        margin: 0 auto;
        width: 75px;
        height: 75px;
    }

    .dflex a:hover { transform: translateY(-5px) scale(1.08); }
    .dflex a:active { transform: translateY(-3px) scale(1.05); }

    .dflex a img { width: 38px; }

    .osu img, .youtube img { width: 4.5em !important; }
    .github img { width: 3em !important; }
    .dofus img  { width: 1.8em !important; }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .dflex { gap: 20px; }
    .dflex a { width: 80px; height: 80px; }
    .dflex a img { width: 40px; }
}
