/* ITC Eras Ultra is the FromSoftware wordmark font; Oswald + skew approximates the slanted geometric look. */
@font-face {
    font-family: 'ErasBrand';
    src: url('../assets/fonts/eras-fallback.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: #f2f2f2;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#game {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
    background: #000;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.social-bar {
    position: fixed;
    top: clamp(12px, 2.5vw, 24px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: clamp(16px, 3vw, 32px);
    pointer-events: auto;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition:
        transform 180ms ease,
        opacity 180ms ease;
    opacity: 0.85;
}

.social-link:hover,
.social-link:focus-visible {
    transform: translateY(-2px) scale(1.05);
    opacity: 1;
    outline: none;
}

.social-link img {
    width: clamp(20px, 2.5vw, 28px);
    height: clamp(20px, 2.5vw, 28px);
    filter: invert(1);
}

.scoreboard {
    width: 100%;
    text-align: center;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    transition:
        opacity 400ms ease,
        transform 400ms ease;
}

#scoreboard-mount {
    width: 100%;
    display: flex;
    justify-content: center;
}

.score {
    font-size: clamp(28px, 6vw, 56px);
    font-weight: 700;
    line-height: 1;
}

.high-score {
    margin-top: 0.35rem;
    font-size: clamp(14px, 2.5vw, 20px);
    opacity: 0.65;
}

.hero {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 2.5vw, 24px);
    padding: clamp(72px, 12vw, 120px) clamp(16px, 4vw, 32px) clamp(120px, 18vw, 180px);
    text-align: center;
}

.hero-line {
    margin: 0;
    font-family: 'ErasBrand', 'Oswald', 'Arial Narrow', sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transform: skewX(-8deg);
    transition:
        opacity 600ms ease,
        transform 600ms ease;
    will-change: opacity, transform;
}

#hero-name {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(8px, 2vw, 18px);
    font-size: clamp(28px, 7vw, 72px);
    line-height: 1.1;
}

#hero-role {
    max-width: 18ch;
    font-size: clamp(16px, 3.2vw, 32px);
    line-height: 1.25;
}

#hero-dev {
    font-size: clamp(14px, 2.8vw, 28px);
    opacity: 0.9;
}

#hero-tagline {
    font-size: clamp(14px, 2.8vw, 28px);
    opacity: 0.9;
}

.is-hidden {
    opacity: 0;
    transform: skewX(-8deg) translateY(16px);
}

.is-visible {
    opacity: 1;
    transform: skewX(-8deg) translateY(0);
}

.hero-line.is-visible {
    animation: hero-in 600ms ease forwards;
}

.scoreboard.is-visible {
    animation: score-in 400ms ease forwards;
}

@keyframes hero-in {
    from {
        opacity: 0;
        transform: skewX(-8deg) translateY(16px);
    }
    to {
        opacity: 1;
        transform: skewX(-8deg) translateY(0);
    }
}

@keyframes score-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-line.shake {
    animation: text-shake 220ms ease;
}

@keyframes text-shake {
    0%,
    100% {
        transform: skewX(-8deg) translateX(0);
    }
    25% {
        transform: skewX(-8deg) translateX(-4px);
    }
    75% {
        transform: skewX(-8deg) translateX(4px);
    }
}

@media (max-width: 520px) {
    #hero-name {
        flex-direction: column;
        align-items: center;
        gap: 0.15em;
    }
}
