/*
Theme Name: M4K AI Theme
Theme URI: https://m4k.ch
Author: M4K Consulting
Description: A futuristic, AI-focused theme for M4K Consulting.
Version: 4.0
*/

/* Legal Page Formatting */
.legal-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #fff;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 10px;
}

.legal-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.legal-content ul {
    margin-bottom: 2rem;
    padding-left: 20px;
    list-style-type: disc;
    color: var(--text-muted);
}

.legal-content li {
    margin-bottom: 10px;
    padding-left: 10px;
}

.legal-content strong {
    color: #fff;
}

:root {
    --bg-dark: #050508;
    --bg-surface: #12121e;
    /* LIGHTER for clear contrast */
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --text-main: #ECECF1;
    --text-muted: #94949E;
    --accent-primary: #00f2ff;
    /* Cyan Neon */
    --accent-secondary: #7000ff;
    /* Purple Neon */
    --accent-alert: #ff0055;
    /* Alert/Help Color */
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --surface-border: rgba(255, 255, 255, 0.08);
    --font-main: 'Outfit', sans-serif;
    --spacing-container: 1280px;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
    color-scheme: dark;
    /* Force dark mode UI */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) #050508;
}

/* --- Premium Scrollbar --- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    border: 3px solid #050508;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* Fix horizontal scroll */
    font-size: 16px;
    width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 1rem;
}

h2.section-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.container {
    max-width: var(--spacing-container);
    margin: 0 auto;
    padding: 0 40px;
}

/* Header & Nav */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--surface-border);
    padding: 20px 0;
    /* Slightly tighter */
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@keyframes pulse-white {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, #fff 0%, var(--accent-primary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo svg {
    height: 32px;
    width: auto;
    fill: url(#logoGradient);
    /* Will link to defs in SVG */
}

.logo span {
    font-weight: 300;
    color: #fff;
    -webkit-text-fill-color: initial;
    /* Reset gradient for the suffix if desired, or keep it */
    background: none;
    font-size: 0.8em;
}

/* Nav Grouping */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.main-navigation a.nav-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.main-navigation a.nav-link:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 8px;
    border-left: 1px solid var(--surface-border);
    padding-left: 20px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 2px 5px;
    transition: var(--transition-smooth);
}

.lang-btn:hover,
.lang-btn.active {
    color: var(--accent-primary);
}

/* Buttons */
.btn-cta {
    background: #fff;
    padding: 12px 28px;
    border-radius: 4px;
    color: #000 !important;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.btn-cta:hover {
    background: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 242, 255, 0.2);
}

.btn-cta.secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

.btn-cta.secondary:hover {
    border-color: #fff;
}

/* Let's Talk Button (Inverted for Visibility) */
.btn-lets-talk {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
    padding: 6px 6px 6px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn-lets-talk:hover {
    background: #ffffff !important;
    color: #000000 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
}

.btn-lets-talk .btn-text {
    font-family: var(--font-main);
}

.btn-lets-talk .btn-icon-circle {
    width: 32px;
    height: 32px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
    animation: pulse-white 2s infinite;
}

.btn-lets-talk svg {
    width: 18px;
    height: 18px;
    stroke: #000000;
    fill: none;
    transition: stroke 0.3s ease;
}

.btn-lets-talk:hover .btn-icon-circle {
    background: #000000;
    color: #ffffff;
    transform: rotate(-45deg);
}

.btn-lets-talk:hover svg {
    stroke: #ffffff;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 30%, rgba(112, 0, 255, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(0, 242, 255, 0.05) 0%, transparent 60%);
    z-index: -1;
}

.hero-content {
    max-width: 900px;
    padding: 40px;
    /* Added padding to prevent text from touching edges (the "umrandung") */
}

.hero-label {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 50px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 5rem;
    letter-spacing: -2px;
    margin-bottom: 2rem;
    line-height: 1.05;
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 650px;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

/* Stats Scroller */
.stats-scroller {
    border-top: 1px solid var(--surface-border);
    border-bottom: 1px solid var(--surface-border);
    padding: 40px 0;
    /* margin-top: -80px;  REMOVED to fix overlap */
    margin-bottom: 0px !important;
    /* FIXED GAP: Removed excessive bottom margin */
    background: rgba(5, 5, 8, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item h3 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.stat-item p {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

/* Services Sections */
.section-padding {
    padding: 100px 0;
    /* Reduced from 120px overall */
}

/* SECTION BACKGROUNDS (High Contrast Alternating) */

/* 1. Process Section (First after Stats) */
.process-section {
    background: var(--bg-surface);
    /* Lighter Surface (#12121e) */
    position: relative;
    border-bottom: 1px solid var(--surface-border);
    padding-top: 80px !important;
    /* Reduced top padding to close gap with stats */
}

/* 2. Services Section - Darker */
#services {
    background-color: var(--bg-dark);
    /* Darker (#050508) */
    border-bottom: 1px solid var(--surface-border);
    position: relative;
}

/* 3. About Section - Lighter */
#about {
    background-color: var(--bg-surface);
    /* Lighter Surface again */
}

/* Reference Style Cards */
.service-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(0, 242, 255, 0.3);
    /* Top Glow */
    padding: 40px;
    border-radius: 16px;
    height: 100%;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.service-card:hover {
    transform: translateY(-5px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(0, 0, 0, 0) 100%);
    border-top-color: var(--accent-primary);
    box-shadow: 0 10px 40px rgba(0, 242, 255, 0.1);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 30px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

/* Process Timeline */


.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    counter-reset: process-counter;
}

.process-step {
    position: relative;
}

.process-step::before {
    counter-increment: process-counter;
    content: "0" counter(process-counter);
    font-size: 4rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.08);
    /* Slightly more visible */
    position: absolute;
    top: -40px;
    left: 0;
    z-index: 0;
}

.process-content {
    position: relative;
    z-index: 1;
}

.process-content h4 {
    margin-top: 20px;
    font-size: 1.5rem;
}

/* About Us Text */
.about-text {
    max-width: 800px;
    margin: 0 auto 60px auto;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-main);
}

/* Team Section */
.team-grid {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.team-member {
    text-align: left;
    max-width: 300px;
}

.team-avatar {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 25px;
    filter: grayscale(100%);
    transition: var(--transition-smooth);
}

.team-member:hover .team-avatar {
    filter: grayscale(0%);
}

/* Mobile Avatar Behavior Override */
@media (max-width: 768px) {
    .team-avatar {
        filter: grayscale(0%);
    }

    .team-member:active .team-avatar,
    .team-member:hover .team-avatar {
        filter: grayscale(100%);
    }
}

.role-badge {
    display: inline-block;
    font-size: 0.8rem;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 10px;
    color: #fff;
}

/* Footer */
.site-footer {
    padding: 80px 0 40px;
    background: var(--bg-surface);
    border-top: 1px solid var(--surface-border);
}

.footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 60px;
}

.footer-title {
    font-size: 3rem;
    max-width: 600px;
    margin-bottom: 30px;
}

/* Responsive */
@media (max-width: 1024px) {

    /* Instead of hiding, we rearrange for tablet/mobile */
    .site-header {
        padding: 10px 0;
    }

    .nav-flex {
        flex-wrap: wrap;
        gap: 15px;
    }

    .logo {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .nav-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .main-navigation ul {
        gap: 15px;
        font-size: 0.8rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .stats-grid {
        flex-direction: column;
        gap: 30px;
    }

    h2.section-title {
        font-size: 2.5rem;
    }
}




/* MOBILE STYLES (v12/v13/v14 Consolidated) */
@media (max-width: 768px) {

    /* GLOBAL LANGUAGE SWITCHER FIX (Desktop & Mobile) */
    .widget_polylang ul,
    .widget_polylang li,
    .lang-switcher ul,
    .lang-switcher li,
    #lang_choice_1,
    .pll-parent-menu-item ul,
    .pll-parent-menu-item li,
    .site-header ul,
    .site-header li {
        list-style: none !important;
        list-style-type: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }

    .widget_polylang li::before,
    .lang-switcher li::before,
    .site-header li::before {
        content: none !important;
        /* Remove any pseudo-element bullets */
        display: none !important;
    }

    /* Modern Browser Marker Removal */
    .widget_polylang li::marker,
    .lang-switcher li::marker,
    .site-header li::marker {
        content: none !important;
        display: none !important;
    }

    /* 2. BUTTON VERTICAL ALIGNMENT FORCE */
    .hero-buttons .btn,
    .hero-buttons .btn-cta {
        /* FIXED: Added correct class selector */
        width: 100% !important;
        margin: 0 !important;
        display: flex !important;
        /* Switch back to Flex for 100% reliability */
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
        font-size: 0.8rem !important;
        white-space: normal !important;
        line-height: 1.2 !important;
        height: 100% !important;
        min-height: 54px !important;
        border-radius: 6px !important;
    }

    .hero-buttons .btn span,
    .hero-buttons .btn-cta span {
        display: inline-block !important;
        /* Inline block centers better in line flow */
        vertical-align: middle !important;
        line-height: 1.1 !important;
        margin: 0 !important;
    }

    /* 1. HUGE SPACE FIX & FONT SIZES */
    .container {
        padding: 0 10px !important;
        /* Reduced from 20px to give more width */
        width: 100% !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .hero-section {
        padding-top: 240px !important;
        min-height: 100vh !important;
        /* Force Full Height to push stats off */
        padding-bottom: 60px !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    .hero-content {
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
        margin: 0 auto !important;
    }

    .hero-label {
        display: inline-block !important;
        margin: 0 auto 15px auto !important;
        white-space: nowrap !important;
        /* Force Single Line */
        font-size: 0.85rem !important;
        /* Slightly smaller to ensure fit if needed */
        max-width: 100% !important;
        padding: 6px 16px !important;
        /* Optimize internal padding */
    }

    h1.hero-title {
        font-size: 2.4rem !important;
        line-height: 1.1 !important;
        margin-bottom: 20px !important;
        text-align: center !important;
        width: 100% !important;
    }

    .hero-subtitle {
        font-size: 1.15rem !important;
        line-height: 1.5 !important;
        margin-bottom: 25px !important;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    /* Fix for German Buttons (GRID LAYOUT - 50/50 FORCE) */
    .hero-buttons {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        /* Mathematically equal columns */
        gap: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .hero-buttons .btn {
        width: 100% !important;
        margin: 0 !important;
        display: inline-flex !important;
        /* Flex allows align-items to work */
        justify-content: center !important;
        align-items: center !important;
        /* This is the key for vertical centering */
        text-align: center !important;
        padding: 0 4px !important;
        /* REMOVED top/bottom padding to let Flexbox handle vertical centering perfectly */
        font-size: 0.8rem !important;
        white-space: normal !important;
        line-height: 1.3 !important;
        /* Slightly relaxed line-height */
        height: auto !important;
        min-height: 50px !important;
        /* Defined height container for centering */
        border-radius: 6px !important;
    }

    /* Back to Top Button (Premium Glassmorphism) - Mobile Overrides */


    /* 2. HEADER - 2 Line Layout Force */
    .nav-flex {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 15px !important;
        gap: 10px 5px !important;
    }

    .nav-actions {
        display: contents !important;
        /* Allow children to participate in .nav-flex parent flex */
    }

    /* ROW 1: Logo(1), Button(2), Flag(3) */
    .logo {
        order: 1 !important;
        width: auto !important;
        margin: 0 !important;
        font-size: 1.3rem !important;
        white-space: nowrap !important;
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;

        /* FIX: Logo Visibility (Resetting gradient clipping) */
        background: none !important;
        background-clip: border-box !important;
        -webkit-background-clip: initial !important;
        -webkit-text-fill-color: #fff !important;
        color: #fff !important;
    }

    .logo svg {
        width: 28px !important;
        height: 28px !important;
        margin-right: 6px !important;
        flex-shrink: 0 !important;
    }

    .btn-lets-talk {
        order: 2 !important;
        margin: 0 auto !important;
        /* Centered in Row 1 */
        font-size: 1.05rem !important;
        padding: 8px 14px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    .lang-switcher,
    .widget_polylang,
    .lang-switcher-widget {
        order: 3 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }

    .lang-switcher img,
    .widget_polylang img {
        width: 22px !important;
        /* Smaller Flag */
        height: auto !important;
        display: block !important;
    }

    /* ROW 2: Navigation Links(4) */
    .main-navigation {
        order: 4 !important;
        width: 100% !important;
        margin: 10px 0 0 0 !important;
        padding: 10px 0 0 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center !important;
    }

    .main-navigation ul {
        display: flex !important;
        justify-content: center !important;
        gap: 15px !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .nav-link {
        font-size: 0.9rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    /* SCROLL EFFECTS (Compact & Consistent) */
    body.scrolled .site-header {
        padding: 5px 0 !important;
        background: rgba(5, 5, 8, 0.95);
        backdrop-filter: blur(10px);
    }

    body.scrolled .logo span {
        display: none !important;
        /* Hide "Technologies" on scroll */
    }

    body.scrolled .nav-flex {
        padding: 5px 15px !important;
        gap: 5px !important;
    }

    body.scrolled .main-navigation {
        margin-top: 5px !important;
        padding-top: 5px !important;
    }

    /* Ensure span is visible initially */
    .logo span {
        display: inline !important;
    }

    /* Remove bullet points from Polylang widget */
    .lang-switcher-widget ul,
    .widget_polylang ul {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        gap: 10px !important;
    }

    .lang-switcher-widget li,
    .widget_polylang li {
        list-style-type: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .lang-switcher-widget a {
        display: flex;
        align-items: center;
        text-decoration: none;
        border: none;
    }

    /* Spacing & Gap Reductions */
    .stats-scroller {
        margin-top: 0px !important;
        /* Fixed: Removed negative margin */
        margin-bottom: 20px !important;
        padding: 20px 0 !important;
    }

    .section-padding {
        padding: 40px 0 !important;
    }

    .process-section {
        padding-top: 20px !important;
    }
}

/* GLOBAL OVERFLOW FIX */
html,
body {
    max-width: 100%;
    overflow-x: hidden !important;
    scroll-padding-top: 100px;
    /* Fix anchor link offset */
    scroll-behavior: smooth;
}

img {
    max-width: 100%;
    height: auto;
}