/* ========================================================================
   HEILPRAKTIKER DESIGN MASTERPIECE
   Refined Boutique Aesthetic for Specialized Webdesign
   ======================================================================== */

:root {
    --niche-placeholder-bg: #e5e7eb;
    --niche-placeholder-text: #9ca3af;
    --niche-glass-bg: rgba(255, 255, 255, 0.85);
    --niche-glass-border: rgba(255, 255, 255, 0.5);
    --niche-dark-glass-bg: rgba(238, 242, 247, 0.92);
    /* Stylish Premium Grey */
    --niche-accent-soft: rgba(0, 0, 0, 0.03);
    --niche-shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.05);
    --niche-glass-border-dark: rgba(0, 0, 0, 0.05);
    --niche-text-dark: #1a1c1e;
}

/* --- Scroll Reveal Foundation (Progressive Enhancement) --- */
.js-reveal .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.js-reveal .reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Immersive Full-Height Sections --- */
.immersive-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: var(--space-xxl) 0;
}

.immersive-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.immersive-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.85);
}

/* --- Glassmorphism Overlay System --- */
.glass-pod {
    position: relative;
    z-index: 5;
    background: var(--niche-glass-bg);
    backdrop-filter: blur(15px);
    padding: var(--space-xl);
    border-radius: calc(var(--border-radius) * 2);
    border: 1px solid var(--niche-glass-border);
    box-shadow: var(--niche-shadow-soft);
    max-width: 500px;
}

.glass-pod.dark {
    background: var(--niche-dark-glass-bg);
    color: var(--niche-text-dark);
    border: 1px solid var(--niche-glass-border-dark);
}

.services-pod {
    margin-right: auto;
    margin-left: 0;
    max-width: 500px;
    /* Optional constraint to keep it manageable if the container gets too wide */
}

.container--services {
    max-width: 100%;
    padding-left: clamp(1rem, 4vw, 5%);
}

/* --- Philosophy Layout Overhaul --- */
.philosophy-section {
    padding: var(--space-xxl) 0 clamp(6rem, 15vw, 10rem);
    background: var(--theme-color-surface);
    position: relative;
    overflow: visible;
}

.container--philosophy {
    position: relative;
    max-width: 1400px;
}

.philosophy-visual {
    width: 100%;
    max-width: 1500px;
    height: 600px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--niche-shadow-soft);
    position: relative;
    z-index: 1;
}

.philosophy-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.philosophy-pod {
    position: absolute;
    bottom: -60px;
    left: 0;
    /* Move to left side */
    right: auto;
    max-width: 520px;
    margin: 0;
    transform: none;
    /* Reset reveal transform if any */
}

/* --- Hero Redesign --- */
.niche-hero-masterpiece {
    background: var(--theme-color-surface);
    /* Removed green background */
    overflow: hidden;
    padding-top: var(--space-md);
}

.hero-visual-blend {
    position: absolute;
    right: 0;
    top: 12%;
    /* Aligning with subtitle baseline */
    transform: translateY(0);
    width: 53%;
    /* Scaled for full vertical coverage */
    max-width: 850px;
    height: auto;
    aspect-ratio: 4 / 3;
    /* Updated to 4:3 */
    z-index: 1;
    pointer-events: none;
    mask-image: linear-gradient(to right, transparent 0%, black 25%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 25%);
}

.hero-visual-blend img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right top;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.2));
}

/* --- Magazine-Style Grids --- */
.magazine-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto;
    gap: var(--space-md);
    align-items: center;
    padding-right: clamp(1rem, 5vw, 60px);
    /* Space for sticky icons */
}

.magazine-content {
    grid-column: 1 / 8;
    z-index: 3;
}

.magazine-visual {
    grid-column: 6 / 12;
    z-index: 2;
    position: relative;
}

.magazine-visual .img-wrapper {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    overflow: hidden;
    transform: rotate(2deg);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Globalized rotation hover effect for all visuals */
.overlap-item:hover .visual-side .img-wrapper,
.magazine-visual:hover .img-wrapper {
    /* slower, more professional animation */
    transform: scale(1.02);
    transition: transform 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* --- Feature Overlap Section --- */
.overlap-cards {
    display: flex;
    flex-direction: column;
    gap: clamp(4rem, 8vw, 8rem);
    padding-right: clamp(1rem, 5vw, 60px);
    /* Buffer from fixed icons */
}

.overlap-item {
    display: flex;
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
}

.overlap-item:nth-child(even) {
    flex-direction: row-reverse;
}

.overlap-item .text-side {
    flex: 1;
}

.overlap-item .visual-side {
    flex: 0 0 350px;
    /* Fixed uniform width */
    height: 400px;
    /* Fixed uniform height */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlap-item .visual-side .img-wrapper {
    width: 100%;
    height: 100%;
}

.overlap-item .visual-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--niche-shadow-soft);
}

/* --- Typographical Masterpiece --- */
.niche-title-large {
    font-size: clamp(3rem, 8vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    font-weight: 800;
    margin-bottom: var(--space-md);
}

.niche-subtitle {
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    color: var(--theme-color-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: var(--space-sm);
}

/* --- FAQ / Transparenz Section --- */
.niche-faq-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.faq-card {
    background: transparent;
    padding: var(--space-lg) var(--space-md);
    border-radius: 0;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    transition: all 0.4s ease;
    position: relative;
}

/* Add custom top border for animation */
.faq-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    /* Base width */
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    transition: width 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), background-color 0.4s ease;
}

.faq-card:hover {
    transform: translateY(-5px);
    box-shadow: none;
}

.faq-card:hover::before {
    width: 100%;
    background-color: var(--theme-color-primary);
}

.faq-icon-wrapper {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: var(--theme-color-primary);
    font-size: 1.5rem;
    transform: none;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    margin-bottom: var(--space-xs);
    transform-origin: left center;
}

.faq-card:hover .faq-icon-wrapper {
    transform: scale(1.2);
}

.accent-rule {
    width: 60px;
    height: 4px;
    background: var(--theme-color-accent);
    margin: var(--space-md) 0;
    border: none;
}

/* --- CTA Mastery Redesign --- */
.cta-masterpiece {
    background: var(--theme-color-surface);
    color: var(--theme-text-on-surface);
    position: relative;
    padding: clamp(6rem, 12vw, 10rem) 0;
    text-align: center;
    overflow: hidden;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.cta-masterpiece::before {
    display: none;
}

.cta-content-wrap {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.cta-title-huge {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    color: var(--theme-text-on-surface);
    background: none;
    background-clip: initial;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
}

/* --- Responsive Masterpiece --- */
@media (max-width: 968px) {
    .magazine-grid {
        display: flex;
        flex-direction: column;
        padding: var(--space-lg) var(--space-md);
    }

    /* Keep the visual on tablet but adjust opacity/size, hide on smaller mobile if needed */
    .hero-visual-blend {
        top: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        opacity: 0.15;
        /* Make it a subtle background layer on tablet/mobile */
        mask-image: none;
        -webkit-mask-image: none;
        z-index: 1;
        /* Behind content */
    }

    .hero-visual-blend img {
        object-fit: cover;
        object-position: center;
        filter: none;
    }

    .immersive-section {
        min-height: auto;
        padding: var(--space-xl) 0;
    }

    .overlap-item,
    .overlap-item:nth-child(even) {
        flex-direction: column;
        gap: var(--space-lg);
    }

    .overlap-item .visual-side {
        width: 100%;
        max-width: 500px;
        flex: 0 0 auto;
        height: auto;
        aspect-ratio: 4/3;
    }

    /* Philosophy Section Adjustments for Tablet */
    .philosophy-section {
        padding-top: var(--space-xl);
        padding-bottom: var(--space-xl);
    }

    .philosophy-visual {
        height: 400px;
        /* Reduced highly for tablet */
    }

    .philosophy-pod {
        position: relative;
        bottom: auto;
        left: auto;
        transform: translateY(-50px);
        margin: 0 auto;
        /* Center on tablet */
        max-width: 90%;
    }

    /* Feature Grid Adjustments */
    .niche-faq-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .niche-title-large {
        font-size: clamp(2.5rem, 10vw, 3rem);
    }

    .philosophy-visual {
        height: 300px;
        border-radius: 0;
    }

    .philosophy-pod {
        transform: translateY(-30px);
        border-radius: var(--border-radius);
        padding: var(--space-md);
    }

    .glass-pod {
        padding: var(--space-md);
    }

    .container--services {
        padding-left: var(--space-sm);
        padding-right: var(--space-sm);
    }

    .services-pod {
        max-width: 100%;
        margin: 0;
    }

    .niche-faq-grid {
        grid-template-columns: 1fr;
    }

    .cta-masterpiece {
        padding: var(--space-xl) var(--space-sm);
    }

    .cta-title-huge {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    /* Enhance hero text readability on mobile */
    .niche-hero-masterpiece .magazine-content {
        position: relative;
        z-index: 5;
        background: radial-gradient(circle at center, rgba(238, 242, 247, 0.85) 0%, rgba(238, 242, 247, 0.4) 70%, transparent 100%);
        padding: var(--space-md);
        border-radius: var(--border-radius);
    }

    /* Stack hero buttons on mobile */
    .niche-hero-masterpiece .flex.gap-md {
        flex-direction: column;
        align-items: stretch;
    }

    .niche-hero-masterpiece .flex.gap-md .btn {
        width: 100%;
        text-align: center;
    }

    /* Dark ghost button for secondary on mobile — matches primary button text color */
    .niche-hero-masterpiece .flex.gap-md .btn--secondary {
        color: var(--niche-text-dark);
        border-color: var(--theme-color-primary);
        background: transparent;
    }
}

/* iPad Pro (1024x1366) Specific Adjustments */
@media (min-width: 969px) and (max-width: 1024px) {
    .niche-hero-masterpiece.immersive-section {
        min-height: auto;
        /* Kill the 100vh default */
        padding-top: var(--space-xl);
        padding-bottom: var(--space-xl);
        /* Add sensible bottom padding instead of fixed height */
        align-items: flex-start;
        /* Ensure everything aligns to the top */
    }

    .hero-visual-blend {
        top: var(--space-xl);
        /* Match section top padding */
        bottom: auto;
        width: 65%;
        /* Adjusted for safe overlap */
        right: -8%;
    }

    .niche-hero-masterpiece .magazine-content {
        grid-column: 1 / 8;
        align-self: flex-start;
        /* Push text up to align with image */
        margin-top: var(--space-md);
        /* Minor offset to match visual whitespace */
    }
}

/* iPad Mini (820x1180) Specific Adjustments */
@media (min-width: 601px) and (max-width: 968px) {

    /* Push the visual down and right to prevent overlapping the face */
    .hero-visual-blend {
        opacity: 0.3;
        /* Increase opacity slightly for better visibility */
        top: auto;
        bottom: -5%;
        right: -10%;
        width: 80%;
        mask-image: linear-gradient(to right, transparent 0%, black 40%);
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 40%);
    }

    .niche-hero-masterpiece .magazine-content {
        background: radial-gradient(ellipse at left, rgba(238, 242, 247, 0.9) 0%, rgba(238, 242, 247, 0.6) 60%, transparent 100%);
        padding: var(--space-lg);
        border-radius: var(--border-radius);
    }
}