:root {
    --home-page-width: 1220px;
    --home-background: #e7ebe8;
    --home-surface: #ffffff;
    --home-cream: #f4efcf;
    --home-green: #46544d;
    --home-green-light: #dce4df;
    --home-green-medium: #82988e;
    --home-green-dark: #2d3732;
    --home-text: #171c18;
    --home-muted: #53605a;
    --home-border: #151a17;
    --home-danger: #8d3030;
    --home-danger-light: #f5dddd;
    --home-safe: #526f60;
    --home-safe-light: #dfeae3;
    --home-shadow: 0 14px 34px rgba(22, 30, 25, 0.16);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.home-body {
    min-height: 100vh;
    margin: 0;
    color: var(--home-text);

    /*
     * Das gleiche Bahn-Hintergrundbild wie auf den Signalseiten.
     * Die helle Deckschicht hält Texte und Karten gut lesbar.
     */
    background:
        linear-gradient(
            rgba(231, 235, 232, 0.84),
            rgba(231, 235, 232, 0.78)
        ),
        url("/images/background/Zugschiene-1500px.jpg")
        center top / cover fixed no-repeat;

    font-family: Arial, Helvetica, sans-serif;
}

.home-body a {
    color: inherit;
}

.home-main {
    width: min(
        var(--home-page-width),
        calc(100% - 36px)
    );
    margin: 0 auto;
    padding: 34px 0 70px;
}

.home-hero {
    min-height: 600px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.97);
    border: 4px solid var(--home-border);
    border-radius: 18px;
    box-shadow: var(--home-shadow);
}

.hero-copy {
    padding: 58px 54px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.99),
            rgba(244, 239, 207, 0.96)
        );
}

.hero-status {
    width: fit-content;
    margin-bottom: 28px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #ffffff;
    background: var(--home-green);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.hero-status-dot {
    width: 9px;
    height: 9px;
    background: #bcd1c4;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(188, 209, 196, 0.20);
}

.home-eyebrow {
    margin: 0 0 9px;
    color: var(--home-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-copy h1 {
    max-width: 750px;
    margin: 0;
    font-size: clamp(2.55rem, 5vw, 4.55rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.hero-text {
    max-width: 760px;
    margin: 24px 0 0;
    color: #3f4b45;
    font-size: 1.08rem;
    line-height: 1.72;
}

.hero-actions {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.home-button {
    min-height: 48px;
    padding: 11px 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--home-border);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    transition:
        transform 140ms ease,
        filter 140ms ease,
        box-shadow 140ms ease;
}

.home-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 8px 18px rgba(22, 30, 25, 0.15);
}

.home-button-primary {
    color: #ffffff;
    background: var(--home-green);
}

.home-button-secondary {
    color: var(--home-text);
    background: var(--home-green-light);
}

.hero-facts {
    margin-top: 34px;
    padding-top: 25px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    border-top: 1px solid rgba(21, 26, 23, 0.17);
}

.hero-facts div {
    display: grid;
    gap: 4px;
}

.hero-facts strong {
    font-size: 0.91rem;
    line-height: 1.35;
}

.hero-facts span {
    color: var(--home-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.hero-media {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
    padding: 32px;

    background:
        linear-gradient(
            180deg,
            rgba(22, 29, 25, 0.04),
            rgba(22, 29, 25, 0.72)
        ),
        url("/images/background/Zugschiene-1500px.jpg")
        center / cover no-repeat;
}

.hero-media-overlay {
    width: 100%;
    padding: 25px;
    color: #ffffff;
    background: rgba(38, 49, 43, 0.89);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 13px;
    backdrop-filter: blur(5px);
}

.hero-media-label {
    display: inline-block;
    margin-bottom: 11px;
    color: #d7e4dc;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero-media h2 {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.2;
}

.hero-media p {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.55;
}

.home-section,
.safety-section,
.topics-callout {
    margin-top: 26px;
    padding: 38px;
    background: rgba(255, 255, 255, 0.96);
    border: 4px solid var(--home-border);
    border-radius: 17px;
    box-shadow: var(--home-shadow);
}

.home-section-heading,
.safety-intro {
    max-width: 860px;
    margin-bottom: 28px;
}

.home-section-heading h2,
.safety-intro h2,
.topics-callout h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3.5vw, 2.55rem);
    line-height: 1.18;
    letter-spacing: -0.025em;
}

.home-section-heading > p:last-child,
.safety-intro > p:last-child,
.topics-callout p {
    margin: 12px 0 0;
    color: var(--home-muted);
    font-size: 1rem;
    line-height: 1.68;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.feature-card {
    min-height: 285px;
    padding: 24px;
    background:
        linear-gradient(
            145deg,
            #eef2ef,
            #dce4df
        );
    border: 2px solid var(--home-border);
    border-radius: 13px;
}

.feature-mark {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--home-green-dark);
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.feature-card h3 {
    margin: 21px 0 10px;
    font-size: 1.23rem;
    line-height: 1.28;
}

.feature-card p {
    margin: 0;
    color: #415048;
    line-height: 1.63;
}

.safety-section {
    background:
        linear-gradient(
            145deg,
            #f7f3d9,
            #e5e9df
        );
}

.safety-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.safety-card {
    min-height: 390px;
    padding: 28px;
    border: 3px solid var(--home-border);
    border-radius: 14px;
}

.safety-card-critical {
    background: var(--home-danger-light);
    border-left: 9px solid var(--home-danger);
}

.safety-card-points {
    background: var(--home-safe-light);
    border-left: 9px solid var(--home-safe);
}

.safety-card-head {
    display: flex;
    align-items: center;
    gap: 11px;
}

.safety-symbol {
    width: 43px;
    height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--home-green-dark);
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 900;
}

.safety-label {
    color: var(--home-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.safety-card h3 {
    margin: 22px 0 13px;
    font-size: 1.48rem;
    line-height: 1.3;
}

.safety-card > p {
    margin: 0;
    color: #3e4a44;
    line-height: 1.69;
}

.example-box {
    margin-top: 22px;
    padding: 16px;
    display: grid;
    gap: 6px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(21, 26, 23, 0.17);
    border-radius: 9px;
    line-height: 1.55;
}

.safety-footnote {
    margin-top: 20px;
    padding: 16px 18px;
    color: #ffffff;
    background: var(--home-green);
    border-radius: 9px;
    line-height: 1.58;
}

.learning-section {
    background: #eef2ef;
}

.learning-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
}

.learning-grid article {
    min-height: 235px;
    padding: 23px;
    background: var(--home-cream);
    border: 2px solid var(--home-border);
    border-radius: 12px;
}

.learning-grid article > span {
    display: block;
    margin-bottom: 25px;
    color: var(--home-green);
    font-size: 1.5rem;
    font-weight: 900;
}

.learning-grid h3 {
    margin: 0 0 9px;
    font-size: 1.17rem;
}

.learning-grid p {
    margin: 0;
    color: var(--home-muted);
    line-height: 1.6;
}

.topics-callout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 34px;
    background:
        linear-gradient(
            115deg,
            #f7f3d9,
            #dce4df
        );
}

@media (max-width: 1080px) {
    .home-hero {
        grid-template-columns: 1fr;
    }

    .hero-media {
        min-height: 420px;
    }

    .feature-grid,
    .learning-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .home-main {
        width: calc(100% - 18px);
        padding: 18px 0 48px;
    }

    .home-hero {
        min-height: 0;
        border-width: 3px;
        border-radius: 14px;
    }

    .hero-copy {
        padding: 31px 21px;
    }

    .hero-copy h1 {
        font-size: clamp(2.1rem, 11vw, 3.3rem);
    }

    .hero-text {
        font-size: 1rem;
    }

    .hero-actions {
        display: grid;
    }

    .home-button {
        width: 100%;
    }

    .hero-facts {
        grid-template-columns: 1fr;
    }

    .hero-media {
        min-height: 370px;
        padding: 17px;
    }

    .hero-media-overlay {
        padding: 19px;
    }

    .home-section,
    .safety-section,
    .topics-callout {
        padding: 24px 18px;
        border-width: 3px;
        border-radius: 14px;
    }

    .feature-grid,
    .safety-grid,
    .learning-grid,
    .topics-callout {
        grid-template-columns: 1fr;
    }

    .feature-card,
    .safety-card,
    .learning-grid article {
        min-height: 0;
    }
}

@media (max-width: 760px) {
    body.home-body {
        background-attachment: scroll;
    }
}
