/* Homepage — centered hero layout */

body:has(.page--home) {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.page--home {
    max-width: clamp(22rem, 55vi, 100rem);
}

.page--home .intro {
    max-inline-size: 34ch;
    text-wrap: pretty;
    margin-bottom: var(--space-l);
}

@media (min-width: 541px) {
    .page--home { text-align: center; }
    .page--home .intro { margin-inline: auto; }
}

.page--home h1 {
    letter-spacing: 0.05em;
    margin-bottom: var(--space-m);
}

.page--home a {
    color: var(--color-accent);
    border-bottom: 1px dotted var(--color-subtle);
    padding-bottom: 2px;
    transition: border-color 0.2s ease;
}

.page--home a:hover {
    border-bottom-color: var(--color-heading);
}

/* Entry animations (reduced-motion aware via .js-animated on html) */

.js-animated .page--home h1 {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.7s forwards;
}

.js-animated .page--home .intro {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.js-animated .page--home .intro:nth-of-type(1) {
    animation-delay: 0.9s;
}

.js-animated .page--home .intro:nth-of-type(2) {
    animation-delay: 1.1s;
}

/* Trivia typing cursor */

#trivia-text {
    will-change: contents;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.cursor {
    opacity: 0;
    will-change: opacity;
    transform: translateZ(0);
}

@keyframes blink {
    0% { opacity: 0; }
    15% { opacity: 1; }
    65% { opacity: 1; }
    100% { opacity: 0; }
}
