/* Startseite FROST – Farben aus docs/corporate-design.md */

:root {
    --ehv-gruen: #009036;
    --ehv-rot: #e2001a;
    --ehv-weiss: #ffffff;
    --text: #1a1a1a;
    --text-leise: #5a6470;
    --hintergrund: #f4f7fa;
}

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

html,
body {
    margin: 0;
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 50% 35%, var(--ehv-weiss) 0%, var(--hintergrund) 70%);
}

.start {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.start__logo {
    width: min(70vw, 320px);
}

.start__logo svg {
    display: block;
    width: 100%;
    height: auto;
}

.start__titel {
    margin: 1.75rem 0 0.25rem;
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.3em;
    /* Ausgleich für den Buchstabenabstand nach dem letzten Zeichen */
    padding-left: 0.3em;
}

.start__claim {
    margin: 0;
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--text-leise);
}

.start__hinweis {
    margin: 1.5rem 0 0;
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--ehv-rot);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--ehv-rot);
}

/* ------------------------------------------------------------------
   Logo-Animation
   Reihenfolge: Ring → NRW-Streifen → dünne Kreise → Ringschrift → „EHV“
   → Titel. Selektoren beziehen sich auf die IDs in assets/brand/ehv-logo.svg;
   Umlaute in IDs werden bewusst nicht verwendet (ellipse/nth-child statt ID).
   ------------------------------------------------------------------ */

@media (prefers-reduced-motion: no-preference) {

    .start__logo svg * {
        animation-fill-mode: both;
        animation-timing-function: cubic-bezier(.2, .7, .2, 1);
    }

    /* 1) Innenfläche und schwarzer Ring: einblenden und leicht wachsen */
    .start__logo #Innenhintergrund,
    .start__logo #Schwarzer-Ring-Hintergrund {
        transform-box: view-box;
        transform-origin: 750px 750px;
        animation: ehv-ring .8s 0s;
    }

    /* 2) NRW-Streifen: links von links, rechts von rechts; rot → weiß → grün.
          Reihenfolge im SVG: rechts rot, links rot, rechts weiß, links weiß, rechts grün, links grün */
    .start__logo #NRW > path:nth-child(odd)  { animation-name: ehv-von-rechts; }
    .start__logo #NRW > path:nth-child(even) { animation-name: ehv-von-links; }
    .start__logo #NRW > path { animation-duration: .7s; }
    .start__logo #NRW > path:nth-child(1),
    .start__logo #NRW > path:nth-child(2) { animation-delay: .55s; }
    .start__logo #NRW > path:nth-child(3),
    .start__logo #NRW > path:nth-child(4) { animation-delay: .67s; }
    .start__logo #NRW > path:nth-child(5),
    .start__logo #NRW > path:nth-child(6) { animation-delay: .79s; }

    /* 3) Dünne graue Kreise: werden gezeichnet (Umfang ≈ 4250 bzw. 2670) */
    .start__logo ellipse:first-of-type {
        stroke-dasharray: 4300;
        animation: ehv-zeichnen-aussen 1.1s 1.1s;
    }
    .start__logo ellipse:last-of-type {
        stroke-dasharray: 2700;
        animation: ehv-zeichnen-innen 1s 1.2s;
    }

    /* 4) Ringschrift: Buchstabe für Buchstabe (--i setzt index.php je Pfad) */
    .start__logo #Eishockeyverband path,
    .start__logo #NRW-e\.V\. path {
        animation: ehv-einblenden .4s;
        animation-delay: calc(1.5s + var(--i, 0) * .045s);
    }

    /* 5) „EHV“: je Buchstabe erst Kontur zeichnen, dann Füllung */
    .start__logo #EHV > path:nth-child(odd) {
        stroke-dasharray: 1600;
        animation: ehv-kontur .7s;
    }
    .start__logo #EHV > path:nth-child(even) {
        animation: ehv-einblenden .5s;
    }
    .start__logo #EHV > path:nth-child(1) { animation-delay: 2.45s; }
    .start__logo #EHV > path:nth-child(2) { animation-delay: 2.85s; }
    .start__logo #EHV > path:nth-child(3) { animation-delay: 2.6s; }
    .start__logo #EHV > path:nth-child(4) { animation-delay: 3.0s; }
    .start__logo #EHV > path:nth-child(5) { animation-delay: 2.75s; }
    .start__logo #EHV > path:nth-child(6) { animation-delay: 3.15s; }

    /* 6) Titel und Texte darunter */
    .start__titel,
    .start__claim,
    .start__hinweis {
        animation: ehv-hoch .7s cubic-bezier(.2, .7, .2, 1) both;
    }
    .start__titel   { animation-delay: 3.3s; }
    .start__claim   { animation-delay: 3.45s; }
    .start__hinweis { animation-delay: 3.6s; }
}

@keyframes ehv-ring {
    from { opacity: 0; transform: scale(.85); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes ehv-von-links {
    from { opacity: 0; transform: translateX(-320px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes ehv-von-rechts {
    from { opacity: 0; transform: translateX(320px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes ehv-zeichnen-aussen {
    from { stroke-dashoffset: 4300; }
    to   { stroke-dashoffset: 0; }
}

@keyframes ehv-zeichnen-innen {
    from { stroke-dashoffset: 2700; }
    to   { stroke-dashoffset: 0; }
}

@keyframes ehv-kontur {
    from { stroke-dashoffset: 1600; }
    to   { stroke-dashoffset: 0; }
}

@keyframes ehv-einblenden {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes ehv-hoch {
    from { opacity: 0; transform: translateY(.75rem); }
    to   { opacity: 1; transform: translateY(0); }
}
