/**
 * Medella Hero Section
 * Fullscreen hero z logo na środku, poświatą i efektem głębi (mouse parallax)
 */

/* ===== Zmienne CSS ===== */
:root {
    --mh-text-dark: #121212;
    --mh-text-medium: #121212;
    --mh-text-light: rgba(18, 18, 18, 0.7);
    --mh-text-subtle: rgba(18, 18, 18, 0.5);

    --mh-bg-white: #F7F6F3;
    --mh-bg-light: #F7F6F3;
    --mh-bg-subtle: #E8E9EB;
    --mh-gray: #9CA3AF;

    --mh-gold: #C6A96B;
    --mh-gold-light: #D4BC8A;
    --mh-gold-dark: #A68B4B;
    --mh-sage: #B5CBBF;
    --mh-sage-dark: #7A8A72;

    --mh-font-base: 'DM Sans', sans-serif;
    --mh-font-accent: 'Instrument Serif', serif;
}

/* ===== PREMIUM HEADER ===== */
.mh-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(198, 169, 107, 0.0);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mh-header.is-scrolled,
.mh-header.menu-open {
    background: rgba(247, 246, 243, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(198, 169, 107, 0.12);
    box-shadow:
        0 4px 24px rgba(18, 18, 18, 0.06),
        0 2px 12px rgba(198, 169, 107, 0.06);
}

.mh-header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 80px;
    gap: 40px;
}

/* Logo w headerze */
.mh-header__logo {
    display: flex;
    align-items: center;
    line-height: 0;
}

.mh-header__logo-link {
    font-family: var(--mh-font-accent);
    font-style: italic;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--mh-text-dark);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.mh-header__logo-link:hover {
    color: var(--mh-gold-light);
}

.mh-header__logo-img {
    height: 50px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    transition: opacity 0.3s ease, filter 0.5s ease;
    filter: none;
}

.mh-header__logo-link:hover .mh-header__logo-img {
    opacity: 0.85;
}

/* Po scrollu - logo ciemne na jasnym tle */
.mh-header.is-scrolled .mh-header__logo-img {
    filter: none;
}

.mh-header.is-scrolled .mh-header__logo-link {
    color: var(--mh-text-dark);
}

.mh-header.is-scrolled .mh-header__logo-link:hover {
    color: var(--mh-gold);
}

/* Desktop Navigation */
.mh-header__nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    justify-content: center;
}

.mh-header__nav-link {
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--mh-text-light);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
    font-family: var(--mh-font-base);
    font-weight: 500;
}

.mh-header__nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 1px;
    background: var(--mh-sage-dark);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mh-header__nav-link:hover {
    color: var(--mh-text-dark);
}

.mh-header__nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Po scrollu - linki ciemne */
.mh-header.is-scrolled .mh-header__nav-link {
    color: var(--mh-text-light);
}

.mh-header.is-scrolled .mh-header__nav-link::after {
    background: var(--mh-gold);
}

.mh-header.is-scrolled .mh-header__nav-link:hover {
    color: var(--mh-text-dark);
}

/* Booksy CTA Button */
.mh-header__booksy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    background: transparent;
    text-decoration: none;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

}

.mh-header__booksy::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(18, 18, 18, 0.85);
    transform: translateX(calc(-100% - 2px));
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mh-header__booksy:hover {
    border-color: rgba(18, 18, 18, 0.6);
}

.mh-header__booksy:hover::before {
    transform: translateX(0);
}

.mh-header__booksy:hover .mh-header__booksy-img {
    transform: scale(1.05);
}

/* Po scrollu - booksy button solidny */
.mh-header.is-scrolled .mh-header__booksy {
    background: var(--mh-sage);
    border-color: rgba(181, 203, 191, 0.4);
}

.mh-header.is-scrolled .mh-header__booksy-img {
    filter: brightness(0) invert(1);
}

.mh-header.is-scrolled .mh-header__booksy-fallback {
    color: #ffffff;
}

.mh-header.is-scrolled .mh-header__booksy::before {
    background: #9ab5a8;
}

.mh-header__booksy-img {
    position: relative;
    z-index: 1;
    height: 22px;
    width: auto;
    display: block;
    transition: transform 0.3s ease, filter 0.4s ease;
    filter: brightness(0);
}

.mh-header__booksy:hover .mh-header__booksy-img {
    filter: brightness(0) invert(1);
}

.mh-header__booksy-fallback {
    position: relative;
    z-index: 1;
    color: var(--mh-sage);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 500;
    transition: color 0.4s ease;
}

.mh-header__booksy:hover .mh-header__booksy-fallback {
    color: #ffffff;
}

/* Mobile toggle - po scrollu ciemny */
.mh-header.is-scrolled .mh-header__toggle-line {
    background: var(--mh-text-dark);
}

/* Mobile Menu Toggle */
.mh-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.mh-header__toggle:hover,
.mh-header__toggle:focus,
.mh-header__toggle:active {
    background: none;
    outline: none;
    box-shadow: none;
}

.mh-header__toggle-line {
    width: 100%;
    height: 2px;
    background: var(--mh-text-dark);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mh-header__toggle[aria-expanded="true"] .mh-header__toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mh-header__toggle[aria-expanded="true"] .mh-header__toggle-line:nth-child(2) {
    opacity: 0;
}

.mh-header__toggle[aria-expanded="true"] .mh-header__toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mh-header__mobile-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: calc(100vh - 72px);
    background: rgba(247, 246, 243, 0.98) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
    z-index: 9998;
    overflow-y: auto;
}

.mh-header__mobile-menu.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0);
}

.mh-header__mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 40px 24px 60px;
    min-height: calc(100vh - 72px);
}

.mh-header__mobile-link {
    font-family: var(--mh-font-base);
    font-size: 1.125rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(18, 18, 18, 0.75) !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mh-header__mobile-link:hover {
    color: var(--mh-gold-dark) !important;
}

.mh-header__mobile-link--cta {
    margin-top: 20px;
    padding: 16px 40px;
    background: var(--mh-sage);
    color: #ffffff !important;
}

.mh-header__mobile-link--cta:hover {
    background: #9ab5a8;
    color: #ffffff !important;
}

/* ===== NAVBAR STANDALONE (bez hero) ===== */
.mh-header--standalone {
    background: rgba(247, 246, 243, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(198, 169, 107, 0.12);
    box-shadow:
        0 4px 24px rgba(18, 18, 18, 0.06),
        0 2px 12px rgba(198, 169, 107, 0.06);
}

/* ===== SEKCJA HERO - Fullscreen ===== */
.mh-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    max-height: 100vh;
    width: 100%;
    overflow: hidden;
    /* Gradient bazowy - widoczny gdy brak zdjęcia */
    background:
        radial-gradient(ellipse 120% 90% at 20% 110%, rgba(181, 203, 191, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse 100% 80% at 80% -10%, rgba(198, 169, 107, 0.12) 0%, transparent 50%),
        linear-gradient(160deg, #F7F6F3 0%, #F2F0EC 40%, #EEEce7 70%, #F0EDE8 100%);
}

/* ===== TŁO FULLSCREEN - Zdjęcie z parallax ===== */
.mh-hero__bg-layer {
    position: absolute;
    inset: -60px;
    z-index: 0;
    will-change: transform;
    transform-style: preserve-3d;
}

.mh-hero__bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    filter: blur(3px) brightness(1.05);
    transform: scale(1.04); /* kompensacja rozmycia przy krawędziach */
}

/* Overlay - vignette */
.mh-hero__bg-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 80% at 50% 50%, transparent 20%, rgba(0, 0, 0, 0.12) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.03) 40%, rgba(0, 0, 0, 0.15) 100%);
}

/* Gdy brak zdjęcia - dodatkowe animowane akcenty gradientowe */
.mh-hero:not(.has-bg-image) .mh-hero__bg-overlay {
    background:
        radial-gradient(ellipse 60% 50% at 50% 50%, rgba(198, 169, 107, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 40% 35% at 15% 85%, rgba(122, 138, 114, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 15%, rgba(166, 139, 75, 0.10) 0%, transparent 60%);
    animation: mh-bg-breathe 8s ease-in-out infinite;
}

@keyframes mh-bg-breathe {
    0%, 100% { opacity: 0.7; }
    50%       { opacity: 1; }
}

/* ===== DEKORACYJNE OKRĘGI ===== */
.mh-hero__decor {
    display: none;
}

/* ===== CENTRALNY CONTENT ===== */
.mh-hero__content {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    will-change: transform;
    transform-style: preserve-3d;
}

.mh-hero__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
}

/* ===== LOGO Z POŚWIATĄ ===== */
.mh-hero__logo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 36px;
}

/* Poświata (glow) pod logo */
.mh-hero__logo-glow {
    position: absolute;
    width: 140%;
    height: 140%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(
        ellipse 70% 60% at 50% 50%,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(255, 255, 255, 0.25) 35%,
        rgba(255, 255, 255, 0.05) 65%,
        transparent 100%
    );
    filter: blur(24px);
    animation: mh-glow-pulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes mh-glow-pulse {
    0%, 100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08);
    }
}

.mh-hero__logo-img {
    position: relative;
    z-index: 1;
    height: auto;
    width: auto;
    max-width: min(380px, 60vw);
    max-height: 220px;
    object-fit: contain;
    display: block;
}

.mh-hero__logo-text {
    position: relative;
    z-index: 1;
    font-family: var(--mh-font-accent);
    font-style: italic;
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 400;
    color: #ffffff;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

/* ===== SEPARATOR ===== */
.mh-hero__separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.mh-hero__separator-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--mh-gold-dark) 50%, transparent 100%);
    box-shadow: none;
}

.mh-hero__separator-diamond {
    width: 6px;
    height: 6px;
    background: var(--mh-gold-dark);
    transform: rotate(45deg);
    box-shadow: none;
}

/* ===== TAGLINE ===== */
.mh-hero__tagline {
    font-family: var(--mh-font-accent);
    font-style: italic;
    font-size: clamp(1.5rem, 2vw, 1.675rem);
    font-weight: 400;
    color: rgba(18, 18, 18, 0.65);
    margin: 0 0 36px 0;
    letter-spacing: 0.06em;
    text-shadow: none;
}

/* ===== PRZYCISKI CTA ===== */
.mh-hero__ctas {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.mh-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    font-family: var(--mh-font-base);
    font-size: 0.975rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mh-hero__cta--primary {
    padding: 18px 44px;
    background: transparent;
    color: var(--mh-text-dark);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(18, 18, 18, 0.35);
    backdrop-filter: none;
}

.mh-hero__cta--primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--mh-sage);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mh-hero__cta--primary:hover {
    color: #ffffff;
    border-color: var(--mh-sage);
    box-shadow: 0 8px 32px rgba(181, 203, 191, 0.25);
}

.mh-hero__cta--primary:hover::before {
    transform: translateX(0);
}

.mh-hero__cta--primary:hover .mh-hero__cta-arrow {
    transform: translateX(5px);
}

.mh-hero__cta--secondary {
    padding: 13px 28px;
    color: rgba(18, 18, 18, 0.6);
    background: transparent;
    font-size: 0.75rem;
    border: 1px solid rgba(18, 18, 18, 0.2);
    position: relative;
    overflow: hidden;
    transition:
        color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        border-color 0.4s ease;
}

.mh-hero__cta--secondary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(128, 156, 141, 0.15);
    transform: translateX(calc(-100% - 2px));
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mh-hero__cta--secondary:hover {
    color: rgba(18, 18, 18, 0.85);
    border-color: rgba(181, 203, 191, 0.7);
}

.mh-hero__cta--secondary:hover::before {
    transform: translateX(0);
}

.mh-hero__cta--secondary:hover::after {
    transform: scaleX(1);
}

.mh-hero__cta-text,
.mh-hero__cta-arrow {
    position: relative;
    z-index: 1;
}

.mh-hero__cta-arrow {
    display: flex;
    transition: transform 0.4s ease;
}

.mh-hero__cta-arrow svg {
    width: 18px;
    height: 18px;
}

/* ===== ANIMACJE WEJŚCIA ===== */
.mh-hero__logo-wrap,
.mh-hero__separator,
.mh-hero__tagline,
.mh-hero__ctas {
    opacity: 0;
    transform: translateY(24px);
}

.mh-hero.is-visible .mh-hero__logo-wrap {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s,
                transform 1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s;
}

.mh-hero.is-visible .mh-hero__separator {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s,
                transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s;
}

.mh-hero.is-visible .mh-hero__tagline {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s,
                transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s;
}

.mh-hero.is-visible .mh-hero__ctas {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.85s,
                transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.85s;
}

/* ===== RESPONSYWNOŚĆ ===== */
@media (max-width: 1200px) {
    .mh-header__container {
        padding: 20px 60px;
    }

    .mh-header__nav {
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .mh-header__container {
        padding: 22px 40px;
        align-items: center;
    }

    .mh-header__nav {
        display: none;
    }

    .mh-header__booksy {
        display: none;
    }

    .mh-header__toggle {
        display: flex;
    }

    .mh-hero__logo-img {
        max-width: min(300px, 70vw);
        max-height: 180px;
    }
}

@media (max-width: 768px) {
    .mh-header__container {
        padding: 20px 20px;
        align-items: center;
    }

    .mh-header__logo-img {
        height: 40px;
        max-width: 140px;
    }

    .mh-hero__logo-img {
        max-width: min(240px, 75vw);
        max-height: 140px;
    }

    .mh-hero__cta--primary {
        padding: 14px 32px;
    }

    .mh-hero__cta--secondary {
        padding: 10px 18px;
        font-size: 0.88rem;
    }

    .mh-hero__decor--circle-1 {
        width: 350px;
        height: 350px;
        top: -100px;
        right: -80px;
    }

    .mh-hero__decor--circle-2 {
        display: none;
    }
}

@media (max-width: 480px) {
    .mh-hero__ctas {
        flex-direction: column;
        gap: 16px;
    }

    .mh-hero__cta--primary {
        width: 100%;
        justify-content: center;
    }

    .mh-hero__cta--secondary {
        width: 100%;
        justify-content: center;
    }
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .mh-hero__logo-wrap,
    .mh-hero__separator,
    .mh-hero__tagline,
    .mh-hero__ctas {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .mh-hero__logo-glow {
        animation: none !important;
    }

    .mh-hero__bg-layer,
    .mh-hero__content,
    .mh-hero__decor {
        transform: none !important;
        transition: none !important;
    }
}
