/**
 * Photorealistic-feel homepage styles for Proteiner Główna.
 * Brand-first hero, dual article rails, tool paths, product picks.
 */
.home-page {
    --home-ink: var(--text-dark);
    --home-muted: var(--text-muted);
    --home-line: color-mix(in srgb, var(--border) 80%, var(--primary) 20%);
}

.home-page .page-container {
    max-width: none;
    padding: 0;
}

.home-page .main-content {
    max-width: none;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.home-page .main-content::before {
    display: none;
}

/* —— Hero —— */
.home-hero {
    position: relative;
    isolation: isolate;
    min-height: min(78vh, 720px);
    display: grid;
    align-items: end;
    padding: clamp(72px, 12vh, 120px) clamp(20px, 5vw, 64px) clamp(48px, 8vh, 80px);
    overflow: hidden;
    color: var(--home-ink);
}

.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 90% 70% at 8% 18%, rgba(128, 0, 0, 0.18), transparent 55%),
        radial-gradient(ellipse 80% 60% at 92% 12%, rgba(30, 58, 95, 0.22), transparent 50%),
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(37, 99, 235, 0.1), transparent 45%),
        linear-gradient(165deg, #f8fafc 0%, #eef3f9 40%, #f6f1ef 100%);
}

.home-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 75% 70% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
}

.home-hero-inner {
    max-width: var(--site-content-max, 1180px);
    width: 100%;
    margin: 0 auto;
}

.home-brand {
    font-family: var(--font-display);
    font-size: clamp(3.2rem, 9vw, 6.4rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 0.92;
    margin: 0 0 18px;
    background: linear-gradient(105deg, var(--primary) 0%, #5c0a0a 38%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.home-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.8vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.25;
    max-width: 18ch;
    margin: 0 0 14px;
    color: var(--home-ink);
}

.home-hero-lead {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.55;
    color: var(--home-muted);
    max-width: 52ch;
    margin: 0 0 28px;
}

.home-hero-lead strong {
    color: var(--home-ink);
    font-weight: 800;
}

.home-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.home-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.home-cta--primary {
    background: linear-gradient(120deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 10px 28px rgba(128, 0, 0, 0.28);
}

.home-cta--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(128, 0, 0, 0.34);
}

.home-cta--ghost {
    background: rgba(255, 255, 255, 0.72);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    backdrop-filter: blur(8px);
}

.home-cta--ghost:hover {
    transform: translateY(-2px);
    background: #fff;
}

[data-theme='dark'] .home-hero::before {
    background:
        radial-gradient(ellipse 90% 70% at 8% 18%, rgba(128, 0, 0, 0.28), transparent 55%),
        radial-gradient(ellipse 80% 60% at 92% 12%, rgba(37, 99, 235, 0.22), transparent 50%),
        linear-gradient(165deg, #121a2e 0%, #1a243c 50%, #152036 100%);
}

[data-theme='dark'] .home-cta--ghost {
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
}

/* —— Article rails —— */
.home-section {
    max-width: none;
    margin: 0;
    padding: clamp(40px, 7vw, 72px) clamp(20px, 4vw, 40px);
    background: var(--surface-cool);
    border-block: 1px solid var(--border-soft);
}

.home-section > .home-section-head,
.home-section > .home-articles,
.home-section > .home-picks-grid {
    max-width: var(--site-content-max, 1180px);
    margin-left: auto;
    margin-right: auto;
}

.home-paths + .home-section {
    background: var(--surface);
    border-block: 1px solid var(--border-soft);
}

.home-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.home-section-head h2 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0;
}

.home-section-head a {
    font-size: 0.9rem;
    font-weight: 650;
    color: var(--primary-dark);
    text-decoration: none;
}

.home-section-head a:hover {
    text-decoration: underline;
}

.home-articles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(28px, 5vw, 56px);
}

@media (max-width: 820px) {
    .home-articles {
        grid-template-columns: 1fr;
        gap: 36px;
    }
}

.home-rail-label {
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 14px;
}

.home-rail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--home-line);
}

.home-rail-list li {
    border-bottom: 1px solid var(--home-line);
}

.home-rail-link {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    padding: 16px 4px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, padding-left 0.2s ease;
}

.home-rail-link:hover {
    background: color-mix(in srgb, var(--primary) 5%, transparent);
    padding-left: 8px;
}

.home-rail-emoji {
    font-size: 1.45rem;
    line-height: 1.2;
}

.home-rail-title {
    display: block;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    color: var(--home-ink);
}

.home-rail-desc {
    display: block;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--home-muted);
}

/* —— Paths —— */
.home-paths {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(48px, 8vw, 88px) clamp(20px, 4vw, 40px);
    background: var(--surface-warm);
    border-bottom: 1px solid var(--border-soft);
}

.home-paths::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 70% 55% at 12% 20%, rgba(128, 0, 0, 0.07), transparent 58%),
        radial-gradient(ellipse 65% 50% at 88% 75%, rgba(30, 58, 95, 0.08), transparent 55%),
        linear-gradient(165deg, var(--surface-warm) 0%, color-mix(in srgb, var(--surface-warm) 78%, #efe8e4 22%) 55%, color-mix(in srgb, var(--surface-warm) 65%, var(--surface-muted) 35%) 100%);
    pointer-events: none;
}

.home-paths::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(128, 0, 0, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 58, 95, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 85% 80% at 50% 45%, #000 25%, transparent 78%);
    opacity: 0.85;
    pointer-events: none;
}

[data-theme='dark'] .home-paths::before {
    background:
        radial-gradient(ellipse 70% 55% at 12% 20%, rgba(224, 122, 122, 0.1), transparent 58%),
        radial-gradient(ellipse 65% 50% at 88% 75%, rgba(96, 165, 250, 0.1), transparent 55%),
        linear-gradient(165deg, var(--surface-warm) 0%, color-mix(in srgb, var(--surface-warm) 70%, var(--surface-muted) 30%) 100%);
}

[data-theme='dark'] .home-paths::after {
    background-image:
        linear-gradient(rgba(248, 250, 252, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(147, 197, 253, 0.045) 1px, transparent 1px);
    opacity: 0.7;
}

.home-paths-inner {
    position: relative;
    z-index: 1;
    max-width: var(--site-content-max, 1180px);
    margin: 0 auto;
}

.home-paths h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    margin: 0 0 8px;
}

.home-paths-lead {
    margin: 0 0 32px;
    color: var(--home-muted);
    max-width: 42ch;
}

.home-path-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--home-line);
}

@media (max-width: 800px) {
    .home-path-list {
        grid-template-columns: 1fr;
    }
}

.home-path-list li {
    border-bottom: 1px solid var(--home-line);
}

@media (min-width: 801px) {
    .home-path-list li {
        border-right: 1px solid var(--home-line);
        border-bottom: 1px solid var(--home-line);
    }
    .home-path-list li:last-child {
        border-right: none;
    }
}

.home-path-link {
    display: block;
    padding: 28px 20px;
    text-decoration: none;
    color: inherit;
    min-height: 160px;
    text-align: center;
    transition: transform 0.2s ease;
}

.home-path-link:hover {
    transform: translateY(-3px);
}

.home-path-kicker {
    display: block;
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 10px;
}

.home-path-title {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.2vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.home-path-desc {
    display: block;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--home-muted);
}

/* —— Product picks —— */
.home-picks-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 960px) {
    .home-picks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

.home-pick-link {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--home-line);
    transition: border-color 0.15s ease;
}

.home-pick-link:hover {
    border-bottom-color: var(--primary);
}

.home-pick-emoji {
    font-size: 2rem;
    line-height: 1;
}

.home-pick-name {
    font-family: var(--font-display);
    font-weight: 750;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.home-pick-meta {
    font-size: 0.85rem;
    color: var(--home-muted);
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
    .home-brand,
    .home-hero h1,
    .home-hero-lead,
    .home-hero-cta {
        animation: homeRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .home-hero h1 { animation-delay: 0.08s; }
    .home-hero-lead { animation-delay: 0.16s; }
    .home-hero-cta { animation-delay: 0.24s; }

    .home-rail-list li {
        animation: homeRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .home-rail-list li:nth-child(1) { animation-delay: 0.05s; }
    .home-rail-list li:nth-child(2) { animation-delay: 0.1s; }
    .home-rail-list li:nth-child(3) { animation-delay: 0.15s; }
    .home-rail-list li:nth-child(4) { animation-delay: 0.2s; }

    .home-path-link {
        transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    }
}

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