/* ============================================
   FENSTER â€“ Page-Specific Styles
   Stefan Kübrich GmbH & Co. KG
   ============================================ */

/* ============================================
   1. HERO
   ============================================ */
.f-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: url('../img/gallery-window-1.webp') center center / cover no-repeat;
    color: var(--white);
    overflow: hidden;
    padding: 8rem 0 6rem;
}

.f-hero-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        rgba(20, 25, 35, 0.82) 0%,
        rgba(20, 25, 35, 0.55) 60%,
        rgba(20, 25, 35, 0.20) 100%
    );
    z-index: 0;
}

.f-hero-inner {
    position: relative;
    z-index: 1;
}

.f-hero-content {
    max-width: 680px;
}

.f-hero-title {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: var(--fw-bold);
    color: var(--white);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.f-hero-sub {
    font-size: var(--fs-lg);
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 560px;
}

.f-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.f-hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.f-hero-trust span {
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.8);
    font-weight: var(--fw-medium);
}

/* ============================================
   2. PORTFOLIO-KACHELN (3 + 2 Grid)
   ============================================ */
.f-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    margin-top: 3rem;
}

/* Row 2: 2 cards centred â€“ span the middle column gap */
.f-kachel--row2:first-of-type {
    grid-column: 1 / 2;
    margin-left: calc(50% + 0.875rem);
}

/* Simpler, bulletproof approach: wrap row 2 with a pseudo-row */
/* We use a CSS trick: name the 4th and 5th children and offset them */
.f-portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.75rem;
    margin-top: 3rem;
}

.f-kachel {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    display: flex;
    flex-direction: column;
    /* Base: 3 cards fit on desktop */
    width: calc(33.333% - 1.2rem);
    min-width: 280px;
}

.f-kachel--row2 {
    /* Row 2: 2 cards centered, slightly wider for visual balance */
    width: calc(40% - 1rem);
    max-width: 480px;
}

.f-kachel:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.f-kachel-img {
    height: 200px;
    overflow: hidden;
}

.f-kachel-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.f-kachel:hover .f-kachel-img img {
    transform: scale(1.07);
}

.f-kachel-body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.f-kachel-body h3 {
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.f-kachel-body p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 1.5rem;
}

/* Jump Button */
.btn-jump {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    font-family: var(--font-family);
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base), transform var(--transition-fast);
    align-self: flex-start;
}

.btn-jump:hover {
    background: var(--accent-red);
    color: var(--white);
    transform: translateX(4px);
}

@media (max-width: 900px) {
    .f-kachel {
        width: calc(50% - 0.875rem);
    }
}

@media (max-width: 580px) {
    .f-kachel {
        width: 100%;
    }
}

/* ============================================
   3. 3-SÃ„ULEN EXPERTENSEKTION
   ============================================ */
.f-expert {
    background: var(--bg-white);
}

.f-expert-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.f-pillar {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.f-pillar:last-child {
    margin-bottom: 0;
}

.f-pillar-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--accent-red-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.f-pillar h3 {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.f-pillar p {
    font-size: var(--fs-base);
    color: var(--text-muted);
    line-height: 1.7;
}

.f-expert-image {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.f-expert-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@media (max-width: 992px) {
    .f-expert-inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .f-expert-image {
        order: -1;
    }
}

/* ============================================
   4. SCROLLYTELLING: STICKY VIEWPORT & SLIDES
   ============================================ */
.sticky-viewport {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--text-dark);
}

/* ALL slides are absolutely stacked */
.scrolly-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: opacity, filter;
    transition: none;
}

/* SLIDE 0: Intro (centered) */
#f-slide-0 {
    flex-direction: column;
    text-align: center;
    background: var(--text-dark);
}

/* Content slides: image left, text right */
#f-slide-1, #f-slide-2, #f-slide-3, #f-slide-4, #f-slide-5 {
    flex-direction: row;
}

.slide-img-col {
    flex: 1 1 50%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

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

.slide-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent 60%, var(--text-dark) 100%);
}

.slide-text-col {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 4rem clamp(2rem, 5%, 4rem);
    background: var(--text-dark);
}

.slide-text-inner {
    max-width: 520px;
}

.slide-badge {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-red);
    background: var(--accent-red-light);
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    margin-bottom: 1.25rem;
}

/* Intro Slide Typography */
.sg-intro-h3 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: var(--fw-bold);
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.sg-intro-p {
    font-size: var(--fs-lg);
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.75;
    max-width: 620px;
    margin: 0 auto 2rem;
}

.sg-scroll-hint {
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.05em;
    animation: bounce-hint 2s ease-in-out infinite;
}

@keyframes bounce-hint {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(8px); }
}

/* Content Slide Typography */
.sg-h3 {
    font-size: clamp(1.75rem, 3vw, 2.6rem);
    font-weight: var(--fw-bold);
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.sg-p {
    font-size: var(--fs-md);
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.8;
    margin-bottom: 2rem;
    max-width: 480px;
}

.sg-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sg-checklist li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--fs-base);
    color: rgba(255, 255, 255, 0.85);
}

.sg-check {
    flex-shrink: 0;
    color: var(--white);
    background: var(--accent-red);
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: var(--fw-bold);
    margin-top: 2px;
}

/* Navigation Dots */
.sg-nav {
    position: absolute;
    right: 1.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10;
}

.sg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    cursor: pointer;
    transition: background var(--transition-base), transform var(--transition-base);
    padding: 0;
}

.sg-dot--active,
.sg-dot:hover {
    background: var(--accent-red);
    transform: scale(1.4);
}

/* Scrollytelling: eyecatcher inside dark bg */
#super-scrolly-master .eyecatcher {
    color: var(--accent-red);
    background: var(--accent-red-light);
}

/* ============================================
   5. CTA SECTION (Index-Style with Mesh Gradient)
   ============================================ */
.final-cta-section {
    background: var(--bg-white);
    position: relative;
    z-index: 1; /* Stacking context for gradient ::before */
}

.final-cta-box {
    background: var(--bg-white);
    padding: 5rem 3rem; /* and more padding */
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 800px;
    position: relative;
    overflow: hidden; 
}

/* Red top bar from index page style */
.final-cta-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-red), #6B1011);
    z-index: 2;
}

/* Pulsating liquid gradient BEHIND the container */
.final-cta-section .testimonials-cta {
    position: relative;
    z-index: 1;
    /* Proportional scale variables for the mesh effect */
    --mesh-glow-inset-v: -30px;
    --mesh-glow-inset-h: -30px;
    --mesh-glow-blur: 25px;
    --mesh-glow-opacity: 0.7;
}

.final-cta-section .testimonials-cta::before {
    content: '';
    position: absolute;
    /* Center it precisely behind the final-cta-box */
    top: var(--mesh-glow-inset-v);
    bottom: var(--mesh-glow-inset-v);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% + 60px);
    max-width: 860px; /* 800px box + 60px glow */
    
    z-index: -1;
    background: 
        radial-gradient(circle at 10% 20%, rgba(157, 25, 27, 0.7) 0%, transparent 50%),
        radial-gradient(circle at 90% 30%, rgba(180, 40, 45, 0.6) 0%, transparent 50%),
        radial-gradient(circle at 30% 80%, rgba(130, 15, 18, 0.8) 0%, transparent 50%),
        radial-gradient(circle at 80% 90%, rgba(157, 25, 27, 0.5) 0%, transparent 60%);
    background-size: 150% 150%;
    filter: blur(var(--mesh-glow-blur));
    border-radius: var(--radius-lg);
    opacity: var(--mesh-glow-opacity);
    animation: liquid-gradient-cta 10s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes liquid-gradient-cta {
    0%   { background-position: 0% 0%;   transform: translateX(-50%) scale(0.9) rotate(-3deg); }
    33%  { background-position: 100% 50%; transform: translateX(-50%) scale(1.05) rotate(2deg); }
    66%  { background-position: 50% 100%; transform: translateX(-50%) scale(0.95) rotate(-2deg); }
    100% { background-position: 0% 100%;  transform: translateX(-50%) scale(1.1) rotate(3deg); }
}

.final-cta-box h3 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: var(--fw-bold);
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.final-cta-box p {
    font-size: var(--fs-md);
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height:1.6;
}

/* ============================================
   6. BERATER MODAL
   ============================================ */
.berater-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 25, 35, 0.85);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    backdrop-filter: blur(6px);
}

.berater-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.berater-modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUpModal 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.berater-modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: color var(--transition-fast);
}

.berater-modal-close:hover {
    color: var(--text-dark);
}

.berater-progress-track {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.berater-progress-bar {
    height: 100%;
    background: var(--accent-red);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.modal-step {
    display: none;
}

.modal-step.active {
    display: block;
}

.modal-step-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-red);
    margin-bottom: 0.75rem;
}

.modal-step-title {
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: var(--text-dark);
    margin-bottom: 1.75rem;
    line-height: 1.3;
}

.modal-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.modal-option-btn {
    padding: 0.875rem 1rem;
    background: var(--bg-light-grey);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    font-family: var(--font-family);
    color: var(--text-dark);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.modal-option-btn:hover {
    border-color: var(--accent-red);
    background: var(--accent-red-light);
}

.modal-option-btn.selected {
    border-color: var(--accent-red);
    background: var(--accent-red-light);
    font-weight: var(--fw-bold);
}

.modal-optional-fields {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-optional-fields label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-muted);
}

.modal-optional-fields input,
.modal-optional-fields textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--fs-sm);
    color: var(--text-dark);
    background: var(--bg-white);
    transition: border-color var(--transition-fast);
    resize: vertical;
}

.modal-optional-fields input:focus,
.modal-optional-fields textarea:focus {
    outline: none;
    border-color: var(--accent-red);
}

.modal-contact-toggles {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-toggle {
    flex: 1;
    padding: 0.875rem;
    background: var(--bg-light-grey);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    font-family: var(--font-family);
    color: var(--text-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.contact-toggle:hover,
.contact-toggle.selected {
    border-color: var(--accent-red);
    background: var(--accent-red-light);
}

.modal-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.modal-input-group input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--fs-base);
    color: var(--text-dark);
    transition: border-color var(--transition-fast);
}

.modal-input-group input:focus {
    outline: none;
    border-color: var(--accent-red);
}

/* ============================================
   7. FADE-IN ANIMATIONS
   ============================================ */
.fade-in-element {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   8. SHARED EYECATCHER (dark bg variant)
   ============================================ */
.eyecatcher {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-red);
    margin-bottom: 1rem;
}

/* ============================================
   9. RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .f-hero {
        min-height: 80vh;
    }

    /* ===========================================================
       MOBILE SCROLLYTELLING — Stacked Sticky Layout
       =========================================================== */

    #super-scrolly-master {
        height: auto !important;
    }

    .sticky-viewport {
        position: relative !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
    }

    .scrolly-slide {
        position: relative !important;
        inset: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        opacity: 1 !important;
        filter: none !important;
        pointer-events: auto !important;
        min-height: auto !important;
    }

    #f-slide-0 {
        min-height: 50vh !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 3rem 1.5rem !important;
        background: var(--text-dark) !important;
    }

    #f-slide-1, #f-slide-2, #f-slide-3, #f-slide-4, #f-slide-5 {
        flex-direction: column !important;
        background: var(--text-dark) !important;
    }

    .slide-img-col {
        display: block !important;
        flex: none !important;
        width: 100% !important;
        height: 40vh !important;
        position: sticky !important;
        top: 64px !important;
        z-index: 1;
    }

    .slide-img-overlay {
        background: linear-gradient(to bottom, transparent 50%, var(--text-dark) 100%) !important;
    }

    .slide-text-col {
        flex: none !important;
        width: 100% !important;
        position: relative !important;
        z-index: 2;
        padding: 2rem 1.5rem 3rem !important;
        background: var(--text-dark) !important;
    }

    .slide-text-inner {
        max-width: 100% !important;
    }

    .sg-intro-h3 {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
    }

    .sg-h3 {
        font-size: clamp(1.4rem, 5vw, 1.8rem);
    }

    .sg-p {
        max-width: 100% !important;
    }

    .sg-nav,
    .scrolly-dots {
        display: none !important;
    }

    .modal-options {
        grid-template-columns: 1fr;
    }

    .berater-modal {
        padding: 2rem 1.5rem;
    }
}

