/* ==========================================
   Design tokens – "chokolade & hindbær"
   ========================================== */
:root {
    --choko: #1b1310;        /* page background, dark chocolate */
    --choko-lys: #241a15;    /* card background, milk chocolate */
    --floede: #f3e9dd;       /* main text, cream */
    --floede-dim: #b9a898;   /* secondary text */
    --hindbaer: #e26d8f;     /* accent, raspberry */
}

/* ==========================================
   Page layout
   ========================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: var(--choko);
    color: var(--floede);
    font-family: "Poppins", system-ui, sans-serif;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.25rem;
    padding: 3rem 1.25rem;
}

.eyebrow {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--floede-dim);
}

h1 {
    margin: 0;
    font-family: "Fraunces", serif;
    font-weight: 600;
    font-size: clamp(2rem, 7vw, 4rem);
    line-height: 1.1;
    max-width: 14ch;
}

h1 em {
    font-style: italic;
    color: var(--hindbaer);
}

.note {
    margin: 0;
    font-size: 0.9rem;
    color: var(--floede-dim);
    max-width: 32ch;
}

footer {
    padding: 1.25rem;
    text-align: center;
}

footer p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--floede-dim);
}

/* ==========================================
   Flavor roller – from Uiverse.io by kennyotsu (MIT), adapted
   ========================================== */
.card {
    /* --bg-color also clips top/bottom of the rolling words */
    --bg-color: var(--choko-lys);
    background-color: var(--bg-color);
    padding: 1rem 1.5rem;
    border-radius: 1.25rem;
    display: inline-block;
    max-width: 100%;
}

.loader {
    /* one row = 1.6em, scales with the font size below */
    --row-h: 1.6em;
    color: var(--floede-dim);
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    font-size: clamp(17px, 4.5vw, 25px);
    padding: 10px;
    display: flex;
    flex-wrap: wrap;           /* on narrow screens the words drop below the text */
    justify-content: center;
    border-radius: 8px;
}

.loader p {
    margin: 0;
    height: var(--row-h);
    line-height: var(--row-h);
}

.words {
    overflow: hidden;
    position: relative;
    height: var(--row-h);
}

.words::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        var(--bg-color) 10%,
        transparent 30%,
        transparent 70%,
        var(--bg-color) 90%
    );
    z-index: 20;
}

.word {
    display: block;
    height: var(--row-h);
    line-height: var(--row-h);
    padding-left: 6px;
    color: var(--hindbaer);
    animation: spin_4991 4s infinite;
}

@keyframes spin_4991 {
    10%  { transform: translateY(-102%); }
    25%  { transform: translateY(-100%); }
    35%  { transform: translateY(-202%); }
    50%  { transform: translateY(-200%); }
    60%  { transform: translateY(-302%); }
    75%  { transform: translateY(-300%); }
    85%  { transform: translateY(-402%); }
    100% { transform: translateY(-400%); }
}

/* Respect users who prefer less motion: show the first flavor, still */
@media (prefers-reduced-motion: reduce) {
    .word {
        animation: none;
    }
}
