/*
=====================================================
    Theme: Case Study
    Author: Michel's Repair & Maintenance
    Version: 18.0
=====================================================
*/

/* 1. Variables & Root Styles */
:root {
    --primary-color: #6A0DAD;
    /* Intellectual Violet */
    --dark-color: #212529;
    --medium-color: #6c757d;
    --light-color: #F8F9FA;
    --bg-color: #FFFFFF;
    --border-color: #DEE2E6;
--white-color: #FFFFFF;
    --font-primary: 'IBM Plex Sans', sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;

    --transition-speed: 0.3s;
    --container-width: 1140px;
    --section-padding: 120px 0;
}

/* 2. Base & Reset Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.7;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
}

h1 {
    font-size: clamp(3rem, 7vw, 4.5rem);
}

h2 {
    font-size: clamp(2rem, 6vw, 3rem);
}

h3 {
    font-size: 1.25rem;
}

p {
    color: var(--medium-color);
    margin-bottom: 1.5rem;
    max-width: 60ch;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-speed);
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* 3. Animations & Utilities */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-load {
    opacity: 0;
    animation: slideInUp 0.8s ease-out forwards;
}

.animate-on-load:nth-child(2) {
    animation-delay: 0.2s;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.section-padding {
    padding: var(--section-padding);
}

.text-center {
    text-align: center;
}

.text-center p,
.text-center h2 {
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    margin-bottom: 4rem;
}

.section-title .subtitle {
    color: var(--medium-color);
    font-weight: var(--font-weight-bold);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.section-title h2 {
    margin-top: 0.5rem;
}

/* 4. Header & Navigation */
#main-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 25px 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

#main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link img {
    height: 80px;
}

.nav-links {
    display: flex;
    gap: 40px;
}

#hamburger-btn {
    display: none;
    background: none;
    border: none;
    z-index: 1001;
}

#hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    transition: all var(--transition-speed);
}

#hamburger-btn span:not(:last-child) {
    margin-bottom: 5px;
}

/* 5. CTA Button */
.cta-button {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: var(--white-color);
    border: 2px solid var(--primary-color);
    transition: all var(--transition-speed);
}

.cta-button:hover {
    background: #5a0ca0;
    border-color: #5a0ca0;
}

.header-cta {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--primary-color);
}

.header-cta:hover {
    background: var(--primary-color);
    color: var(--white-color);
}

/* 6. Hero Section */
#hero {
    background: var(--bg-color);
}

#hero .container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 0 40px;
}

#hero .highlight {
    color: var(--primary-color);
}

#hero p {
    font-size: 1.25rem;
    max-width: 50ch;
    margin: 1.5rem 0 2rem;
}

.hero-image img {
    border: 1px solid var(--border-color);
}

/* 7. Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background-color: var(--border-color);
    border: 1px solid var(--border-color);
}

.service-card {
    padding: 2rem;
    background-color: var(--bg-color);
    transition: background-color var(--transition-speed);
}

.service-card:hover {
    background-color: var(--white-color);
}

.service-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 8. Results Section */
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-item {
    position: relative;
}

.stat-item h2 {
    font-size: 4rem;
    color: var(--primary-color);
    margin: 0;
}

.stat-item p {
    font-weight: var(--font-weight-medium);
    margin-top: 0.5rem;
}

.tooltip-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--medium-color);
    position: absolute;
    top: 0;
    right: 0;
    font-weight: bold;
    cursor: help;
}

.stat-item .tooltip-icon:hover::after {
    content: attr(data-story);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-color);
    color: var(--white-color);
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    width: 250px;
    text-align: left;
    z-index: 10;
    font-family: var(--font-primary);
    font-weight: normal;
}

/* 9. Philosophy (Tenets) Section */
#philosophy {
    background-color: var(--bg-color);
}

.philosophy-tabs {
    max-width: 900px;
    margin: auto;
}

.philosophy-triggers {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.philosophy-trigger {
    background: none;
    border: none;
    padding: 1rem;
    flex-grow: 1;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: var(--medium-color);
    transition: all var(--transition-speed);
}

.philosophy-trigger.active {
    color: var(--dark-color);
    border-bottom-color: var(--primary-color);
}

.philosophy-content {
    padding-top: 2rem;
}

.philosophy-panel {
    display: none;
}

.philosophy-panel.active {
    display: block;
    animation: slideInUp 0.5s;
}

/* 10. Process Section */
#process {
    background-color: var(--bg-color);
}

.process-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

.process-steps {
    border-left: 2px solid var(--border-color);
    padding-left: 2rem;
}

.process-step:not(:last-child) {
    margin-bottom: 2rem;
}

.step-number {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* 11. Testimonial Section */
#testimonial {
    background: var(--dark-color);
    color: var(--white-color);
}

.testimonial-content {
    max-width: 700px;
    margin: auto;
    text-align: center;
}

blockquote p {
    font-size: 1.75rem;
    line-height: 1.6;
    font-family: var(--font-primary);
    font-style: italic;
    font-weight: 500;
}

cite {
    display: block;
    margin-top: 1.5rem;
    font-style: normal;
}

/* 12. Final CTA Section */
#final-cta {
    background-color: var(--primary-color);
    color: var(--white-color);
}

#final-cta h2,
#final-cta p {
    color: var(--white-color);
}

#final-cta p {
    max-width: 600px;
    margin: 1rem auto 2rem;
}

#final-cta .cta-button {
    background-color: var(--white-color);
    color: var(--primary-color);
}

#final-cta .cta-button:hover {
    background-color: var(--light-color);
    border-color: var(--light-color);
}

/* 13. Page & Legal Styles */
.page-header {
    background: var(--light-color);
    padding: 140px 0 80px;
}

.legal-content .container {
    max-width: 800px;
}

.legal-content h2 {
    margin-top: 2rem;
}

#contact-page .contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.contact-item {
    margin-bottom: 2rem;
}

/* 14. Footer */
#main-footer {
    padding: 80px 0;
    background-color: var(--dark-color);
    color: var(--white-color);
}

#main-footer a,
#main-footer p,
#main-footer h4 {
    color: var(--white-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    opacity: 0.5;
}

/* 15. Responsive Design */
@media (max-width: 991px) {
    .header-cta {
        display: none;
    }

    #hamburger-btn {
        display: block;
    }

    .nav-open #main-nav {
        transform: translateX(0);
    }

    .nav-open #hamburger-btn span:first-of-type {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-open #hamburger-btn span:nth-of-type(2) {
        opacity: 0;
    }

    .nav-open #hamburger-btn span:last-of-type {
        transform: translateY(-8px) rotate(-45deg);
    }

    #main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--white-color);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(-100%);
        transition: transform var(--transition-speed);
        z-index: 1000;
    }

    body.nav-open {
        overflow: hidden;
    }

    .nav-links {
        flex-direction: column;
        gap: 2rem;
    }

    #hero .container,
    .process-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    #hero p {
        margin: 1rem auto 2rem;
    }
}

@media (max-width: 768px) {

    .services-grid,
    .results-grid,
    #contact-page .contact-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        text-align: center;
    }

    .process-image {
        display: none;
    }
}