/* Strona startowa eKSeF */
.md-content:has(.ek-home) { max-width: none; }
.md-content:has(.ek-home) .md-content__inner { margin: 0; padding: 0; }
.md-content:has(.ek-home) .md-content__inner::before { display: none; }
.md-main__inner:has(.ek-home) { margin-top: 0; }

.ek-home {
    --ek-red: #c21f42;
    --ek-dark: #7a1414;
    --ek-tint: rgba(194, 31, 66, 0.07);
    --ek-line: rgba(194, 31, 66, 0.2);
    --ek-card: #ffffff;
    --ek-muted: #6b5f62;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow-x: clip;
}
[data-md-color-scheme="slate"] .ek-home {
    --ek-red: #ef6a80;
    --ek-card: rgba(255, 255, 255, 0.04);
    --ek-muted: #b7a9ad;
    --ek-tint: rgba(239, 106, 128, 0.14);
    --ek-line: rgba(239, 106, 128, 0.25);
}
.ek-home * { box-sizing: border-box; }
.ek-home a { text-decoration: none; }
.ek-wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

/* HERO */
.ek-hero {
    background: linear-gradient(120deg, #6e1010 0%, #b71c1c 55%, #c62828 100%);
    color: #fff;
    padding: 4.5rem 0 7rem;
    position: relative;
}
.ek-hero::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 85% 10%, rgba(255, 255, 255, .16), transparent 40%);
    pointer-events: none;
}
.ek-hero .ek-wrap {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 3rem; align-items: center; position: relative; z-index: 1;
}
.ek-eyebrow {
    display: inline-block; padding: .3rem .8rem; border-radius: 999px;
    background: rgba(255, 255, 255, .15); font-size: .7rem; font-weight: 700; letter-spacing: .12em;
}
.ek-home .ek-hero h1 {
    color: #fff; margin: 1rem 0 1rem; font-size: 2.4rem; line-height: 1.12; letter-spacing: -.03em;
}
.ek-hero p { color: rgba(255, 255, 255, .9); font-size: .95rem; line-height: 1.65; margin: 0 0 1.8rem; text-align: left; }
.ek-hbtns { display: flex; flex-wrap: wrap; gap: .8rem; }
.ek-hbtn {
    display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.3rem;
    border-radius: 10px; font-weight: 700; font-size: .85rem;
    border: 1px solid rgba(255, 255, 255, .55); color: #fff !important;
}
.ek-hbtn--solid { background: #fff; color: var(--ek-dark) !important; border-color: #fff; }
.ek-shot { filter: drop-shadow(0 28px 40px rgba(0, 0, 0, .35)); }
.ek-shot img { display: block; width: 100%; height: auto; border-radius: 8px !important; }

/* PASEK */
.ek-stats { margin-top: -3.2rem; position: relative; z-index: 2; }
.ek-stats-box {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--md-default-bg-color); border: 1px solid var(--ek-line);
    border-radius: 16px; box-shadow: 0 18px 45px rgba(0, 0, 0, .12);
}
.ek-stat { min-width: 0; padding: 1.4rem 1.2rem; text-align: center; border-right: 1px solid var(--ek-line); }
.ek-stat:last-child { border-right: 0; }
.ek-stat strong { display: block; color: var(--ek-red); font-size: 1.05rem; }
.ek-stat span { color: var(--ek-muted); font-size: .78rem; }

/* SEKCJE */
.ek-section { padding: 4.5rem 0 0; }
.ek-section:last-child { padding-bottom: 4rem; }
.ek-label { color: var(--ek-red); font-size: .72rem; font-weight: 700; letter-spacing: .14em; }
.ek-home .ek-section h2.ek-title { margin: .4rem 0 2rem; font-size: 1.9rem; letter-spacing: -.02em; }

/* SZYBKIE LINKI */
.ek-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.ek-link {
    display: block; padding: 1.4rem 1.5rem; border-radius: 16px;
    border: 1px solid var(--ek-line); background: var(--ek-card);
}
.ek-link strong { display: block; color: var(--ek-red); font-size: 1rem; }
.ek-link span { color: var(--ek-muted); font-size: .82rem; }

/* OBSZARY */
.ek-bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ek-tile { padding: 1.5rem; border-radius: 16px; background: var(--ek-card); border: 1px solid var(--ek-line); }
.ek-ico {
    display: flex; align-items: center; justify-content: center;
    width: 2.6rem; height: 2.6rem; border-radius: 12px;
    background: var(--ek-tint); color: var(--ek-red);
}
.ek-ico svg { width: 1.4rem; height: 1.4rem; }
.ek-tile h3 { margin: .8rem 0 .4rem; font-size: 1rem; }
.ek-tile p { margin: 0; color: var(--ek-muted); font-size: .85rem; line-height: 1.6; text-align: left; }

/* treść pod spodem: zwykły tekst dokumentacji */
.ek-text { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

@media screen and (max-width: 40em) {
    .ek-hero { padding: 3rem 0 6rem; }
    .ek-section { padding-top: 3rem; }
    .ek-home .ek-section h2.ek-title { font-size: 1.5rem; margin-bottom: 1.2rem; }
    .ek-stat { padding: 1rem .5rem; }
    .ek-stat strong { font-size: .9rem; overflow-wrap: anywhere; }
    .ek-stat span { font-size: .72rem; overflow-wrap: anywhere; }
}

@media screen and (max-width: 56em) {
    .ek-hero .ek-wrap, .ek-links, .ek-bento { grid-template-columns: minmax(0, 1fr); }
    .ek-stats-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ek-stat:nth-child(2) { border-right: 0; }
    .ek-stat:nth-child(-n+2) { border-bottom: 1px solid var(--ek-line); }
    .ek-home .ek-hero h1 { font-size: 1.9rem; }
}

/* ANIMACJE */
@keyframes ek-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}
@keyframes ek-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: no-preference) {
    .ek-hero .ek-wrap > div:first-child > * {
        opacity: 0;
        animation: ek-fade-up .7s cubic-bezier(.2, .7, .2, 1) forwards;
    }
    .ek-hero .ek-wrap > div:first-child > :nth-child(2) { animation-delay: .1s; }
    .ek-hero .ek-wrap > div:first-child > :nth-child(3) { animation-delay: .2s; }
    .ek-hero .ek-wrap > div:first-child > :nth-child(4) { animation-delay: .3s; }
    .ek-hero .ek-shot {
        opacity: 0;
        animation: ek-fade-up .9s cubic-bezier(.2, .7, .2, 1) .25s forwards,
                   ek-float 6s ease-in-out 1.2s infinite;
    }
    .ek-stats-box { animation: ek-fade-up .8s cubic-bezier(.2, .7, .2, 1) .5s both; }

    /* wejście przy przewijaniu (klasy dodaje home-anim.js) */
    .ek-anim .ek-reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity .6s ease var(--ek-delay, 0ms),
                    transform .6s cubic-bezier(.2, .7, .2, 1) var(--ek-delay, 0ms);
    }
    .ek-anim .ek-reveal.ek-in { opacity: 1; transform: none; }

    .ek-tile, .ek-link, .ek-hbtn {
        transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    }
    .ek-anim .ek-reveal.ek-in.ek-tile:hover,
    .ek-anim .ek-reveal.ek-in.ek-link:hover,
    .ek-tile:hover, .ek-link:hover {
        transform: translateY(-5px);
        box-shadow: 0 16px 34px rgba(194, 31, 66, .16);
        border-color: var(--ek-red);
    }
    .ek-hbtn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
    .ek-tile:hover .ek-ico { background: var(--ek-red); color: #fff; }
    .ek-ico { transition: background .25s ease, color .25s ease; }
}
