/* ============================================
   STRONA GŁÓWNA (nowy układ)
   Kolory marki: czerń + czerwień szpiku. Nagłówki: Bree Serif (nawiązanie do logo),
   tekst: Montserrat (jak na całej stronie).
   ============================================ */
.home {
    --h-bg: #0a0a0a;
    --h-surface: #121212;
    --h-line: #262626;
    --h-red: #c41e3a;
    --h-red-bright: #e0243f;
    --h-text: #f5f5f5;
    --h-muted: #b0b0b0;
    --h-soft: #8c8c8c;
    --h-display: 'Bree Serif', Georgia, 'Times New Roman', serif;
    background: var(--h-bg);
    color: var(--h-text);
    display: block;
}

.home .h-nav-spacer {
    height: 90px;
}

/* ---------- Hero ---------- */
.h-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: min(100vh, 900px);
    display: flex;
    align-items: flex-end;
    padding: 150px 0 110px;
    background: var(--h-bg);
}

.h-hero__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% center;
}

.h-hero__shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(10, 10, 10, 0.97) 0%, rgba(10, 10, 10, 0.9) 30%, rgba(10, 10, 10, 0.5) 60%, rgba(10, 10, 10, 0.25) 100%),
        linear-gradient(0deg, #0a0a0a 0%, rgba(10, 10, 10, 0) 32%);
}

.h-hero__inner {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 720px) minmax(0, 1fr);
    align-items: end;
    gap: 40px;
}

.h-hero__logo {
    display: block;
    width: clamp(210px, 24vw, 330px);
    height: auto;
    margin-bottom: 30px;
}

.h-hero__title {
    font-family: var(--h-display);
    font-weight: 400;
    font-size: clamp(2.7rem, 5.6vw, 5.1rem);
    line-height: 0.98;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 0 0 24px;
    text-wrap: balance;
}

.h-hero__lead {
    max-width: 34em;
    margin: 0 0 36px;
    color: #d4d4d4;
    font-size: clamp(1.02rem, 1.35vw, 1.18rem);
    line-height: 1.7;
}

.h-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.h-hero__content > * {
    animation: hRise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.h-hero__content > :nth-child(2) { animation-delay: 0.08s; }
.h-hero__content > :nth-child(3) { animation-delay: 0.16s; }
.h-hero__content > :nth-child(4) { animation-delay: 0.24s; }

@keyframes hRise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

/* Pasek „Ostatnia wpłata” */
.h-ticker {
    justify-self: end;
    width: min(100%, 340px);
    padding: 14px 18px 16px;
    border-radius: 14px;
    background: rgba(18, 18, 18, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: hRise 0.8s 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.h-ticker__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #bdbdbd;
    font-size: 0.78rem;
    font-weight: 600;
}

.h-ticker__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--h-red-bright);
    animation: hPulse 2s ease-out infinite;
}

@keyframes hPulse {
    0% { box-shadow: 0 0 0 0 rgba(224, 36, 63, 0.6); }
    70% { box-shadow: 0 0 0 9px rgba(224, 36, 63, 0); }
    100% { box-shadow: 0 0 0 0 rgba(224, 36, 63, 0); }
}

.h-ticker__list {
    position: relative;
    min-height: 66px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.h-ticker__item {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 14px;
    align-content: start;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.h-ticker__item.is-active {
    opacity: 1;
    transform: none;
}

.h-ticker__amount {
    grid-row: 1 / span 3;
    align-self: center;
    font-family: var(--h-display);
    font-weight: 400;
    font-size: 1.75rem;
    line-height: 1;
    color: #fff;
}

.h-ticker__donor,
.h-ticker__target {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h-ticker__donor {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.h-ticker__target {
    color: #c4c4c4;
    font-size: 0.8rem;
}

.h-ticker__time {
    color: var(--h-soft);
    font-size: 0.72rem;
}

/* ---------- Liczby ---------- */
.h-stats {
    padding: 0;
    background: var(--h-surface);
    border-top: 1px solid var(--h-line);
    border-bottom: 1px solid var(--h-line);
}

.h-stats__list {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
    margin: 0;
}

.h-stats__item {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    gap: 6px;
    padding: 36px 32px;
    border-left: 1px solid var(--h-line);
}

.h-stats__item:first-child {
    border-left: 0;
    padding-left: 0;
}

.h-stats__value {
    margin: 0;
    font-family: var(--h-display);
    font-weight: 400;
    font-size: clamp(1.9rem, 3.2vw, 2.8rem);
    line-height: 1.05;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.h-stats__label {
    color: var(--h-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ---------- Wspólne ---------- */
.h-section {
    padding: 100px 0;
}

.h-head {
    max-width: 720px;
    margin-bottom: 44px;
}

.h-head--split {
    max-width: none;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 40px;
}

.h-head--split > div {
    max-width: 720px;
}

.h-title {
    margin: 0 0 12px;
    font-family: var(--h-display);
    font-weight: 400;
    font-size: clamp(2rem, 3.6vw, 2.9rem);
    line-height: 1.1;
    color: #fff;
    text-wrap: balance;
}

.h-head--split .h-title {
    margin-bottom: 0;
}

.h-head--split .h-intro {
    margin-top: 12px;
}

.h-intro {
    max-width: 38em;
    color: var(--h-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.h-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--h-red);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.3;
}

.h-link i {
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.h-link:hover {
    color: var(--h-red-bright);
}

.h-link:hover i {
    transform: translateX(3px);
}

.home a:focus-visible,
.home button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.h-prose p {
    margin: 0 0 1.1em;
    color: #c9c9c9;
    font-size: 1.03rem;
    line-height: 1.8;
}

.h-prose strong {
    color: #fff;
    font-weight: 700;
}

/* ---------- Podopieczni ---------- */
.h-featured {
    background: var(--h-bg);
}

.h-featured .bcard-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ---------- O nas ---------- */
.h-about {
    background: var(--h-surface);
}

.h-about__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 80px;
    align-items: center;
}

.h-about__grid--text {
    grid-template-columns: minmax(0, 760px);
}

.h-about__media {
    position: relative;
    margin: 0 22px 22px 0;
}

.h-about__media::before {
    content: '';
    position: absolute;
    inset: 22px -22px -22px 22px;
    border: 2px solid var(--h-red);
    border-radius: 18px;
}

.h-about__media img {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 18px;
}

.h-about__body .btn {
    margin-top: 10px;
}

/* ---------- Jak pomóc ---------- */
.h-help {
    background: var(--h-bg);
}

.h-help__list {
    display: grid;
    grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--h-line);
}

.h-help__item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 36px 30px 8px 0;
}

.h-help__item + .h-help__item {
    padding-left: 30px;
    border-left: 1px solid var(--h-line);
}

.h-help__icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1.5px solid rgba(196, 30, 58, 0.6);
    color: var(--h-red-bright);
    font-size: 1.1rem;
}

.h-help__title {
    margin: 6px 0 0;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

.h-help__text {
    flex: 1;
    color: var(--h-muted);
    font-size: 0.94rem;
    line-height: 1.65;
}

.h-help__link {
    align-self: flex-start;
    margin-top: 6px;
    font-size: 0.9rem;
}

/* ---------- Misja ---------- */
.h-mission {
    background: var(--h-surface);
}

.h-mission__grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
    gap: 72px;
    align-items: start;
}

.h-mission__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 48px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.h-mission__item {
    display: flex;
    gap: 18px;
}

.h-mission__icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(145deg, #c41e3a, #7d0b1d);
    color: #fff;
    font-size: 1.15rem;
}

.h-mission__title {
    margin: 2px 0 6px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.h-mission__text {
    color: var(--h-muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

/* ---------- Ostatnie wpłaty (karuzela) ---------- */
.h-section.h-donations {
    padding: 100px 0;
    background: var(--h-bg);
}

/* ---------- Wezwanie do kontaktu ---------- */
.h-cta {
    padding: 76px 0;
    background: linear-gradient(120deg, #9e1229 0%, #c41e3a 55%, #8b0000 100%);
}

.h-cta--image {
    background:
        linear-gradient(90deg, rgba(120, 8, 26, 0.95) 0%, rgba(196, 30, 58, 0.82) 100%),
        var(--cta-img) center / cover no-repeat;
}

.h-cta__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 28px 48px;
}

.h-cta__title {
    max-width: 22em;
    margin: 0;
    font-family: var(--h-display);
    font-weight: 400;
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    line-height: 1.15;
    color: #fff;
}

.h-cta__text {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
}

.h-cta .h-cta__btn {
    background: #fff;
    color: #8b0000;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.h-cta .h-cta__btn:hover {
    background: #0a0a0a;
    color: #fff;
}

/* ---------- Responsywność ---------- */
@media (max-width: 1024px) {
    .h-help__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .h-help__item,
    .h-help__item + .h-help__item {
        padding: 30px 26px 26px 0;
        border-left: 0;
    }

    .h-help__item:nth-child(even) {
        padding-left: 26px;
        border-left: 1px solid var(--h-line);
    }

    .h-help__item:nth-child(n + 3) {
        border-top: 1px solid var(--h-line);
    }

    .h-mission__grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .h-about__grid {
        gap: 56px;
    }
}

@media (max-width: 900px) {
    .h-hero {
        min-height: 0;
        padding: 120px 0 40px;
    }

    .h-hero__inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .h-hero__shade {
        background:
            linear-gradient(180deg, rgba(10, 10, 10, 0.55) 0%, rgba(10, 10, 10, 0.8) 40%, #0a0a0a 100%);
    }

    .h-ticker {
        justify-self: stretch;
        width: 100%;
    }

    .h-stats__list {
        grid-template-columns: 1fr;
    }

    .h-stats__item,
    .h-stats__item:first-child {
        padding: 22px 0;
        border-left: 0;
        border-top: 1px solid var(--h-line);
    }

    .h-stats__item:first-child {
        border-top: 0;
    }

    .h-about__grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .h-section,
    .h-section.h-donations {
        padding: 72px 0;
    }
}

@media (max-width: 600px) {
    .h-hero__actions .btn {
        width: 100%;
        text-align: center;
    }

    .h-help__list {
        grid-template-columns: 1fr;
    }

    .h-help__item,
    .h-help__item + .h-help__item,
    .h-help__item:nth-child(even) {
        padding: 28px 0;
        border-left: 0;
        border-top: 1px solid var(--h-line);
    }

    .h-help__item:first-child {
        border-top: 0;
    }

    .h-mission__list {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .h-about__media {
        margin: 0 14px 14px 0;
    }

    .h-about__media::before {
        inset: 14px -14px -14px 14px;
    }

    .h-cta__inner .btn {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .h-hero__content > *,
    .h-ticker,
    .h-ticker__dot {
        animation: none;
    }

    .h-ticker__item {
        transition: none;
    }
}
