/* ============================================================================
 * ECG hero — inline SVG composition + hover-on-area + floating HTML labels.
 * Sekcja 1B (cytat) i sekcja 2 (Diagnoza vs Obietnica) też tu — to są style
 * "intro" landingu (od hero do split column), zanim wskoczymy w "ecg-sections".
 * ========================================================================== */

.ecg-hero {
    padding: 150px 0 60px;
    overflow: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.ecg-hero-row {
    align-items: center;
    flex-wrap: nowrap; /* na desktop nigdy nie zawijamy */
}

/* --- LEFT column (headline + subcopy + CTA) --- */
.ecg-hero-content {
    padding-right: 40px;
    flex: 0 0 42%;
    max-width: 42%;
}

.ecg-hero-title {
    font-family: var(--bs-font-sans-serif, 'Inter', system-ui, sans-serif);
    font-size: clamp(2.5rem, 5.6vw, 5.5rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 32px;
    color: #fff;
}

.ecg-hero-sub {
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 40px;
    max-width: 480px;
}

.ecg-hero-cta { display: inline-flex; align-items: center; gap: 12px; }

/* --- 4 przyciski w hero (loom1 fallback B: paragrafy + listy poszly do sekcji #o-ecg-intro) --- */
.ecg-hero-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 540px;
    margin-top: 32px;
}
.ecg-hero-btn {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 200ms ease, background 200ms ease, border-color 200ms ease;
    line-height: 1.35;
}
.ecg-hero-btn:hover { transform: translateY(-2px); text-decoration: none; }
.ecg-hero-btn span {
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ecg-hero-btn small {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.75;
    line-height: 1.4;
}
.ecg-hero-btn--primary {
    background: var(--ecg-accent, #3F5AF3);
    color: #fff;
}
.ecg-hero-btn--primary:hover { background: #2c45d6; color: #fff; }
.ecg-hero-btn--secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}
.ecg-hero-btn--secondary:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.22); color: #fff; }
.ecg-hero-btn--ghost {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
}
.ecg-hero-btn--ghost:hover { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.32); color: #fff; }
.ecg-hero-btn--primary .small,
.ecg-hero-btn--primary small { color: rgba(255, 255, 255, 0.85); opacity: 1; }

/* --- RIGHT column: SVG composition + floating labels --- */
.ecg-hero-svg-wrap {
    position: relative;
    width: 100%;
    flex: 0 0 58%;
    max-width: 58%;
}

/* --- Inline SVG hero — outline grid (statyczny) + 5 fillów (toggle przez opacity) --- */
.ecg-hero-svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 720px;
    margin-left: auto;
    aspect-ratio: 1 / 1;
}

/* Nowy hero SVG (z Figmy) — 16 tiles ulozonych w 4 kwadrantach po 4 tiles.
   Kazda grupa quadrantu (svg-area) ma 1 tile oznaczony .ecg-tile--center —
   te 4 centery razem skladaja sie na ksztalt EMS. */
.ecg-tile {
    fill: transparent;
    transition: fill 700ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stan idle (nic nie wybrane) ORAZ hover EMS → tylko 4 centery zapalone */
.ecg-hero-svg:not(.is-quadrant-active) .ecg-tile--center {
    fill: #2764F3;
}

/* Hover/focus na kwadrancie → wszystkie 4 tiles tego kwadrantu zapalone */
.ecg-hero-svg.is-quadrant-active .svg-area.is-active .ecg-tile {
    fill: #2764F3;
}

/* Nakładające się paths blokują hover — używamy zewnętrznych hit-area
   buttonów ułożonych na 3×3 gridzie nad SVG (rogi + środek). */
.svg-area { pointer-events: none; }

.svg-hit {
    position: absolute;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    outline: none;
    z-index: 2;
}
.svg-hit:focus-visible {
    outline: 2px solid #3F5AF3;
    outline-offset: -4px;
    border-radius: 12px;
}
/* Rogi po 50% — pokrywają cały viewport bez "martwych" stref między quadrantami.
   Środek (ems) jest ostatni w DOM i siedzi na top → wygrywa hit-test w środkowym 33%. */
.hit-interim   { top: 0;       left: 0;       width: 50%;    height: 50%;    }
.hit-omnira    { top: 0;       right: 0;      width: 50%;    height: 50%;    }
.hit-strategia { bottom: 0;    left: 0;       width: 50%;    height: 50%;    }
.hit-doradztwo { bottom: 0;    right: 0;      width: 50%;    height: 50%;    }
.hit-ems       { top: 33.33%;  left: 33.33%;  width: 33.34%; height: 33.34%; }

/* Hit grid wycelowany w SVG: SVG ma margin-left:auto + max-width:720, więc
   przyklejamy grid do prawej krawędzi wrappera. */
.svg-hit-grid {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 720px;
    aspect-ratio: 1 / 1;
    pointer-events: none;
}
.svg-hit-grid > .svg-hit { pointer-events: all; }

/* Hover — aktywna grupa z lekkim glowem. Bordery i fille ZAWSZE 100% — bez dimu,
   bo nakladajace sie krzywe z polprzezroczystoscia tworza brzydkie artefakty. */
.ecg-hero-svg.is-quadrant-active .svg-area.is-active {
    filter: drop-shadow(0 0 24px rgba(39, 100, 243, 0.4));
}

/* --- Floating labels (HTML, position absolute over SVG) --- */
.ecg-label {
    position: absolute;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(20, 22, 30, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-family: var(--bs-font-sans-serif, 'Inter', system-ui, sans-serif);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    z-index: 3;
    transition:
        opacity 220ms ease,
        transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
        background 200ms ease,
        border-color 200ms ease,
        box-shadow 240ms ease;
    white-space: nowrap;
}
.ecg-label:hover,
.ecg-label:focus-visible,
.ecg-label.is-active {
    transform: translateY(-2px);
    background: rgba(28, 32, 44, 0.95);
    border-color: rgba(63, 90, 243, 0.5);
    box-shadow: 0 8px 24px rgba(63, 90, 243, 0.22);
    outline: none;
}
.ecg-label.is-dim { opacity: 0.35; }

.label-omnira    { top: 4%;  right: 6%;  }
.label-interim   { top: 6%;  left: 8%;   }
.label-ems       { top: 48%; right: 0;   }
.label-strategia { top: 60%; left: 4%;   }
.label-doradztwo { bottom: 4%; right: 4%; }

/* ============================================================================
 * Sekcja 1B — pojedynczy cytat foundera (redesign — eleganckie spacing)
 * ========================================================================== */
.ecg-quote-section { text-align: center; padding: 60px 0 100px; }

.ecg-quote-icon {
    color: var(--ecg-accent, #3F5AF3);
    margin: 0 auto 32px;
    display: inline-block;
    opacity: 0.85;
    filter: drop-shadow(0 0 24px rgba(63, 90, 243, 0.35));
}
.ecg-quote-icon svg { width: 56px; height: 42px; }

.ecg-quote {
    font-family: var(--bs-font-sans-serif, 'Inter', system-ui, sans-serif);
    font-size: clamp(1.5rem, 2.6vw, 2.5rem);
    line-height: 1.3;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 0 auto;
    max-width: 820px;
    border: none;
    padding: 0;
}
.ecg-quote p {
    margin: 0 0 32px;
    font-style: italic;
}
.ecg-quote footer {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: relative;
    padding-top: 24px;
}
.ecg-quote footer::before {
    content: "";
    display: block;
    width: 40px;
    height: 1px;
    background: var(--ecg-accent, #3F5AF3);
    margin: 0 auto 24px;
    opacity: 0.5;
}
.ecg-quote cite { font-style: normal; }

/* ============================================================================
 * Sekcja 2 — Diagnoza vs Obietnica (split column)
 * ========================================================================== */
.ecg-pain-promise .section-heading { margin-bottom: 32px; }

.ecg-pain-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 16px;
}
.ecg-pain-item {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.ecg-pain-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(63, 90, 243, 0.3);
    transform: translateX(4px);
}
.ecg-pain-marker {
    font-family: Georgia, serif; font-size: 2.5rem; line-height: 1;
    color: #3F5AF3; flex-shrink: 0; margin-top: -6px;
}
.ecg-pain-item p {
    margin: 0; font-size: 1.0625rem; line-height: 1.5;
    color: rgba(255, 255, 255, 0.85); font-style: italic;
}

.ecg-promise-items { display: flex; flex-direction: column; gap: 24px; margin-bottom: 32px; }
.ecg-promise-item { display: flex; align-items: flex-start; gap: 18px; }
.ecg-promise-item .icon {
    flex-shrink: 0; width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(63, 90, 243, 0.12); border-radius: 12px;
    color: var(--ecg-accent, #3F5AF3);
    font-size: 1.5rem;
}
.ecg-promise-item .icon img { width: 30px; height: 30px; object-fit: contain; }
.ecg-promise-item .icon i { color: var(--ecg-accent, #3F5AF3); }
.ecg-promise-item .title { margin: 0 0 6px; font-size: 1.125rem; color: #fff; }
.ecg-promise-item .content p { margin: 0; color: rgba(255, 255, 255, 0.65); font-size: 0.9375rem; line-height: 1.5; }

/* ============================================================================
 * Mobile fallback (≤ 991px)
 * ========================================================================== */
@media (max-width: 991px) {
    .ecg-hero {
        padding-top: 100px;
        min-height: auto;
        display: block;
    }
    .ecg-hero-row { flex-wrap: wrap; }
    .ecg-hero-content,
    .ecg-hero-svg-wrap {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .ecg-hero-content { padding-right: 0; margin-bottom: 48px; }

    .ecg-hero-svg-wrap { margin-top: 24px; }
    .ecg-hero-svg { max-width: 100%; }

    .ecg-hero-buttons { grid-template-columns: 1fr; max-width: 100%; }

    .ecg-label {
        position: relative;
        top: auto !important; left: auto !important;
        right: auto !important; bottom: auto !important;
        display: inline-block;
        margin: 6px 4px;
        white-space: normal;
    }
}

@media (max-width: 575px) {
    .ecg-hero-title { font-size: 2.25rem; }
    .ecg-pain-item { padding: 16px 18px; }
}

/* ============================================================================
 * Light mode override
 * ========================================================================== */
[data-theme="light"] .ecg-hero-title { color: #0a0a14; }
[data-theme="light"] .ecg-hero-sub { color: rgba(10, 10, 20, 0.65); }
[data-theme="light"] .ecg-label {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(10, 10, 20, 0.08);
    color: #0a0a14;
}
/* light-mode overrides celowo nieaktywne — strona w pełnym dark mode wymuszonym */
[data-theme="light"] .ecg-quote,
[data-theme="dark"] .ecg-quote { color: #fff; }
[data-theme="light"] .ecg-quote footer,
[data-theme="dark"] .ecg-quote footer,
[data-theme="light"] .ecg-quote cite,
[data-theme="dark"] .ecg-quote cite { color: rgba(255, 255, 255, 0.5) !important; }
[data-theme="light"] .ecg-pain-item {
    background: rgba(10, 10, 20, 0.03);
    border-color: rgba(10, 10, 20, 0.06);
}
[data-theme="light"] .ecg-pain-item p { color: rgba(10, 10, 20, 0.85); }
[data-theme="light"] .ecg-promise-item .title { color: #0a0a14; }
[data-theme="light"] .ecg-promise-item .content p { color: rgba(10, 10, 20, 0.65); }
