/* Global Design System */
:root {
    --pure-white: #FFFFFF;
    --off-white: #F4F6F7;
    --dark-grey: #1A1A1A;
    --espresso-red: #D81B36;
    --dark-blue: #3E5963;
    --light-blue: #B8CAD2;
    --border-radius-large: 16px; 
    --border-radius-button: 12px;
}

html {
    scroll-padding-top: 80px; 
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--pure-white);
    color: var(--dark-grey);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    color: #333;
}

/* Utility Classes (Refactored from Inline Styles) */
.text-center { text-align: center; }
.text-white { color: var(--pure-white) !important; }
.text-red { color: var(--espresso-red); }
.section-title { font-size: 2.5rem; color: var(--dark-blue); }
.section-title-light { font-size: 2.5rem; }
.section-subtitle { font-size: 1.25rem; }
.no-top-margin { margin-top: 0; }
.max-w-800 { max-width: 800px; margin-left: auto; margin-right: auto; }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--espresso-red);
    color: var(--pure-white);
    padding: 14px 32px;
    text-decoration: none;
    border-radius: var(--border-radius-button);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.3s ease;
    font-size: 1.1rem;
}

.btn:hover {
    opacity: 0.95;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--pure-white);
    border: 2px solid var(--pure-white);
}

.btn-outline:hover {
    background-color: var(--pure-white);
    color: var(--espresso-red);
}

.submit-btn { width: 100%; box-sizing: border-box; }

/* Sticky Header & Shrink Animations */
header {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    padding: 15px 0;
    transition: padding 0.3s ease; 
}

header.scrolled { padding: 5px 0; }

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none; 
}

.logo img {
    height: 60px;
    width: auto;
    transition: height 0.3s ease; 
}

header.scrolled .logo img { height: 36px; }

/* Navigation Links */
nav { display: flex; align-items: center; }

.nav-link {
    color: var(--dark-blue);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 600;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--espresso-red);
    transition: width 0.3s ease;
}

.nav-link:hover, .nav-link.active { color: var(--espresso-red); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

nav .btn { 
    margin-left: 30px;
    height: 60px; 
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: height 0.3s ease, padding 0.3s ease, font-size 0.3s ease, transform 0.2s ease, opacity 0.3s ease; 
}

header.scrolled nav .btn {
    height: 36px; 
    padding: 0 20px; 
    font-size: 0.95rem;
}

nav .btn-login {
    background-color: var(--pure-white);
    color: var(--dark-blue);
    border: 1px solid #d1d5db; 
}

nav .btn-login:hover {
    background-color: var(--off-white);
    color: var(--dark-blue);
    opacity: 1; 
}

/* General Section Styling */
.content-section {
    padding: 100px 0;
    background-color: var(--pure-white);
    position: relative;
    z-index: 10;
}

.bg-light { background-color: var(--off-white); }
.bg-dark { background-color: var(--dark-blue); color: var(--pure-white); }
.bg-dark p { color: var(--light-blue); }

/* Dynamic Parallax Infrastructure */
.parallax {
    position: relative;
    background-position: 50% 0; 
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
}

.hero-parallax { height: 80vh; }

.parallax-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(38, 38, 38, 0.5); 
    z-index: 2;
}

.parallax-content {
    position: relative;
    z-index: 3;
    width: 100%;
}

/* Specific Parallax Backgrounds & Overlays */
.hero-bg { background-image: url('images/EspressoInAction-WhiteBorders.jpeg'); }
.challenge-bg { background-image: url('images/Woman3.png'); }
.challenge-overlay { background-color: rgba(62, 89, 99, 0.85); }
.break-bg { background-image: url('images/Man+Woman.png'); min-height: 50vh; background-color: var(--light-blue); }
.break-overlay { background-color: rgba(38, 38, 38, 0.3); }

/* Hero Styling */
.hero {
    margin-top: 100px; 
    padding-top: 60px;
}

.hero h1 {
    font-size: 5rem;
    letter-spacing: -1px;
    margin-bottom: 2px; 
}

.hero p {
            font-size: 1.65rem; /* Slightly larger */
            font-weight: 400;   /* Heavier, more confident weight */
            letter-spacing: 0.5px; /* Adds a touch of breathing room to the strapline */
        }
        
.hero-btn { margin-top: 30px; }

/* Philosophy Boxes */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: -100px; 
    margin-bottom: 20px; 
    position: relative;
    z-index: 20;
}

.problem-section { padding-top: 40px; }
#problem { padding-top: 20px !important; }

/* Philosophy Card - Locked Height & Flexbox */
.philosophy-card {
    background-color: var(--pure-white);
    padding: 40px 30px;
    border-radius: var(--border-radius-large);
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid #eaeaea;
    transition: transform 0.3s ease;
    
    /* Locks the height so it NEVER grows */
    height: 240px; 
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* This automatically pushes the icon UP when the text appears */
}

.philosophy-card:hover {
    transform: translateY(-8px);
}

.philosophy-icon {
    height: 48px;
    width: auto;
    margin-bottom: 15px;
}

.philosophy-card h4 {
    color: var(--dark-blue);
    font-size: 1.25rem;
    margin: 0;
}

/* Hidden Text Animation */
.hover-text {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--dark-grey);
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
}

.philosophy-card:hover .hover-text {
    max-height: 100px; 
    opacity: 1;
    margin-top: 15px; 
}

/* 2. Moves the title UP to follow the icon */
.philosophy-card:hover h4 {
    transform: translateY(-5px);
}

/* 3. Expands the invisible text box and fades the text in */
.philosophy-card:hover .hover-text {
    max-height: 100px; 
    opacity: 1;
    margin-top: 15px; 
}

/* Challenge Box */
.challenge-text h3 {
    font-size: 2.5rem;
    font-weight: 700; 
    color: var(--pure-white); 
    line-height: 1.4;
    margin: 0;
}

/* Solution Box */
.solution-logo {
    width: 100%; 
    max-width: 180px; 
    height: auto; 
    margin-bottom: 30px;
}

/* Approach List */
.approach-list {
    list-style: none;
    padding: 0;
    margin-top: 50px;
    text-align: center; 
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.approach-list li {
    background-color: var(--dark-blue);
    color: var(--light-blue); 
    padding: 40px;
    border-radius: var(--border-radius-large);
    border: 8px solid var(--light-blue);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    font-size: 1.125rem;
    flex: 1 1 calc(50% - 15px); 
    box-sizing: border-box;
    margin-bottom: 0;
}

.approach-list li strong {
    display: block; 
    color: var(--pure-white); 
    font-size: 1.75rem; 
    margin-bottom: 15px; 
}

.approach-list li:last-child { flex: 0 1 calc(50% - 15px); }

/* Benefits Grid */
.benefits-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; 
    gap: 30px;
    margin-top: 50px;
}

.benefit-card {
    background: var(--pure-white);
    padding: 40px;
    border-radius: var(--border-radius-large);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #eaeaea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 1 1 320px; 
    max-width: 380px; 
    box-sizing: border-box;
    text-align: center; 
}

.benefit-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border-color: var(--light-blue);
}

.benefit-icon {
    height: 64px; 
    width: auto;  
    margin-bottom: 5px; 
}

.benefit-card h4 { margin-top: 10px; }

/* YouTube Attention Section */
.youtube-section {
    background-color: var(--dark-blue);
    color: var(--pure-white);
    text-align: center;
    padding: 80px 0;
    border-radius: var(--border-radius-large);
    border: 8px solid var(--light-blue);
    margin: 100px 5%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.youtube-section h2 { font-size: 2.5rem; margin-bottom: 20px; color: var(--pure-white); }
.youtube-section p { color: var(--light-blue); font-size: 1.25rem; margin-bottom: 30px; }

/* Form */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.form-group { margin-bottom: 20px; }

input, textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius-button);
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    background-color: var(--pure-white);
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus { outline: none; border-color: var(--light-blue); }
textarea { resize: vertical; min-height: 150px; }

/* Footer */
footer { background-color: var(--dark-grey); color: white; padding: 60px 0 30px; text-align: center; }
.footer-links { margin-bottom: 20px; }
footer a { color: var(--light-blue); text-decoration: none; margin: 0 15px; transition: color 0.2s ease; }
footer a:hover { color: var(--pure-white); }
.copyright-text { color: var(--light-blue); font-size: 0.9rem; }

/* Mailing List Pop-up Modal */
#mailing-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(6px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--pure-white);
    padding: 50px;
    border-radius: var(--border-radius-large);
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    position: relative;
}

.close-btn { position: absolute; top: 20px; right: 25px; font-size: 1.5rem; cursor: pointer; color: #999; transition: color 0.3s; }
.close-btn:hover { color: var(--espresso-red); }
.modal-title { margin-top: 0; color: var(--dark-blue); }
.modal-text { margin-bottom: 25px; }
.modal-input { text-align: center; }

/* =========================================
   Mobile Responsive Adjustments 
   ========================================= */
@media (max-width: 768px) {
    /* Mobile Hero Image Swap */
    .hero-bg { background-image: url('images/EspressoInAction-WhiteBorders-mobile.png') !important; }

    /* 1. Layout & Spacing Tweaks */
    .grid-2 { grid-template-columns: 1fr; }
    
    .nav-link, .btn-login { display: none !important; } 
    
    .youtube-section { margin: 50px 5%; padding: 40px 20px; border-width: 4px; }
    .content-section { padding: 60px 0; } 
    
    .hero { margin-top: -10px; } 
    .hero-parallax { height: 52vh; height: 52svh; min-height: 400px; }

    #problem { padding-bottom: 20px !important; padding-top: 10px !important; }
    .parallax:not(.hero-parallax) { min-height: 35vh !important; }
    
    /* 2. Mobile Philosophy Grid (Side-by-side) */
    .philosophy-grid { 
        grid-template-columns: repeat(3, 1fr); 
        margin-top: -20px; 
        margin-bottom: 10px; 
        gap: 10px; 
    }

    .philosophy-card { 
                padding: 15px 10px; 
                height: 130px; /* Lock mobile height */
                position: relative; /* Context for the pop-up */
            } 
            
            /* Transform the text into a floating pop-up bubble ABOVE the box */
            .hover-text {
                position: absolute;
                bottom: calc(100% + 15px); /* Positions it directly above the card */
                top: auto; 
                width: 250px; /* Slightly narrower to fit smaller screens perfectly */
                background-color: var(--dark-blue);
                color: var(--pure-white);
                padding: 12px 15px;
                border-radius: 8px;
                box-shadow: 0 10px 25px rgba(0,0,0,0.3);
                z-index: 100;
                font-size: 0.85rem !important;
                
                max-height: none;
                overflow: visible;
                margin: 0 !important;
                
                /* Hidden state */
                opacity: 0;
                visibility: hidden;
                pointer-events: none;
                transition: opacity 0.3s ease, transform 0.3s ease;
            }

            /* Downward-pointing triangle arrow */
            .hover-text::after {
                content: '';
                position: absolute;
                top: 100%; /* Hangs off the bottom of the bubble */
                bottom: auto;
                border-width: 8px;
                border-style: solid;
                /* Draws the triangle pointing down */
                border-color: var(--dark-blue) transparent transparent transparent; 
            }

            /* --- Edge-Bleed Prevention Logic --- */
            
            /* 1. Left Card (Mobile-first) */
            .philosophy-card:nth-child(1) .hover-text {
                left: -10px; /* Aligns left edge */
                transform: translateY(10px);
            }
            .philosophy-card:nth-child(1).active .hover-text { transform: translateY(0); opacity: 1; visibility: visible; }
            .philosophy-card:nth-child(1) .hover-text::after { left: 20%; } /* Puts arrow over the left card */

            /* 2. Middle Card (People-first) */
            .philosophy-card:nth-child(2) .hover-text {
                left: 50%;
                transform: translate(-50%, 10px); /* Centred */
            }
            .philosophy-card:nth-child(2).active .hover-text { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
            .philosophy-card:nth-child(2) .hover-text::after { left: 50%; transform: translateX(-50%); } /* Arrow dead centre */

            /* 3. Right Card (Video-first) */
            .philosophy-card:nth-child(3) .hover-text {
                right: -10px; /* Aligns right edge */
                left: auto;
                transform: translateY(10px);
            }
            .philosophy-card:nth-child(3).active .hover-text { transform: translateY(0); opacity: 1; visibility: visible; }
            .philosophy-card:nth-child(3) .hover-text::after { right: 20%; left: auto; } /* Puts arrow over the right card */
    .philosophy-card h4 { font-size: 0.85rem; } 
    .philosophy-icon { height: 28px; margin-bottom: 8px; }

    .approach-list li, .approach-list li:last-child { flex: 1 1 100%; }
    .approach-list li { padding: 25px; border-width: 4px; }
    .benefits-grid { gap: 20px; margin-top: 30px; }
    .benefit-card { padding: 25px; }
    
    /* 3. Typography Scaling */
    .hero h1 { 
        font-size: 2.5rem; 
        letter-spacing: -0.5px; 
        margin-bottom: 25px; 
    }
    h2 { font-size: 2rem !important; } 
    
    .challenge-text h3 { font-size: 13.5pt; } 
    
    .approach-list li strong { font-size: 1.4rem; }
    h4 { font-size: 1.15rem; }
    
    /* 4. General Text Scaling */
    p { font-size: 1.05rem !important; line-height: 1.5; }
    .hero p { 
        font-size: 1.25rem !important; 
        margin-bottom: 10px; 
    }
    
    /* 5. UI Polish & Header Sync */
    .logo img { height: 45px; } 
    header.scrolled .logo img { height: 32px; }
    
    nav .btn { 
        height: 45px; 
        font-size: 0.95rem;
        padding: 0 15px;
        width: auto; 
    }
    header.scrolled nav .btn { 
        height: 32px; 
        font-size: 0.85rem; 
        padding: 0 12px;
    }
    
    .btn { width: 100%; box-sizing: border-box; } 
    
    .hero .btn { 
        width: auto; 
        height: 45px; 
        font-size: 0.95rem; 
        padding: 0 24px; 
        display: inline-flex;       
        align-items: center;        
        justify-content: center;
        margin-top: 15px !important; 
    }
    
    .modal-content { padding: 30px 20px; }
}