/* Pacaillou Design System V4 - Fluid & Responsive Refactor */

/* --- Imports --- */
@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Roboto:wght@400;500;700&display=swap');

/* --- Variables --- */
:root {
    /* Brand Colors (V4 Brief) */
    --color-green: #48BB60; /* R: 72 G: 187 B: 96 */
    --color-orange: #FF6135; /* R: 255 G: 97 B: 53 */
    --color-blue: #5575FE; /* R: 85 G: 117 B: 254 */

    /* Neutrals */
    --bg-white: #ffffff;
    --bg-light: #f3f6f8; /* Soft blue-grey tint */
    --bg-dark: #1a1a1a;
    --bg-carbon: #141414; /* V4 Carbon Black */
    --bg-orange-light: rgba(239, 183, 167, 0.5); /* Light Orange Tint */
    --bg-blue-light: rgba(85, 116, 254, 0.506); /* Light Blue Tint */
    --bg-green-light: rgba(72, 187, 97, 0.551); /* Light Green Tint */

    --text-main: #141414; /* Carbon Black */
    --text-muted: #64748b;
    --text-light: #f8fafc;

    /* Accents */
    --gradient-primary: linear-gradient(135deg, var(--color-orange), #ff8f6b);
    --gradient-organic: linear-gradient(120deg, var(--color-green) 0%, var(--color-blue) 100%);

    /* Layout & Spacing (Fluid) */
    --nav-height: clamp(80px, 15vw, 120px);
    --container-width: 1440px; /* Cap width for large screens */
    --container-padding: clamp(1.5rem, 5vw, 4rem); /* Fluid padding */


    /* Fluid Spacing Variables */
    --space-sm: clamp(1rem, 2vw, 1.5rem);
    --space-md: clamp(2rem, 4vw, 3rem);
    --space-lg: clamp(4rem, 8vw, 8rem);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 32px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(72, 187, 96, 0.3);
}

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Archivo Black', sans-serif;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
    text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); color: var(--text-main); }
h2 { font-size: clamp(2rem, 4vw, 3rem); color: var(--text-main); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); color: var(--text-main); } /* Made fluid */

p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    /* Fluid Typography for Body Text - Adjusted for smaller screens */
    font-size: clamp(0.9rem, 0.8rem + 0.5vw, 1.125rem);
    line-height: 1.5;
    max-width: 70ch; /* Readability cap */
    text-wrap: pretty;
    margin-inline: auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* --- Utilities --- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto; /* Modern centering */
    padding-inline: var(--container-padding);
}

.text-center { 
    text-align: center;
}

.text-muted { color: var(--text-muted); }
.text-highlight { color: var(--color-blue); }
.text-orange { color: var(--color-orange); }
.text-green { color: var(--color-green); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem); /* Fluid font size matching P */
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px; /* Touch target size */
    text-align: center;
}

.btn-primary {
    background: var(--color-orange);
    color: white;
    box-shadow: 0 4px 15px rgba(85, 117, 254, 0.4);
    z-index: 10;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(85, 117, 254, 0.6);
    background: #4a66e0;
}

.btn-blue {
    background: var(--color-blue);
    color: white;
    box-shadow: 0 4px 15px rgba(85, 117, 254, 0.4);
}

.btn-blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(85, 117, 254, 0.6);
    background: #4a66e0;
}

.btn-secondary {
    background: white;
    color: var(--color-blue);
    border: 2px solid var(--color-blue);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background: var(--color-blue);
    color: white;
}

.section-spacer {
    padding: var(--space-lg) 0; /* Fluid vertical padding */
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    /* Glassmorphism Optimization */
    @supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
        backdrop-filter: blur(10px);
    }
    /* Fallback handled by background opacity */

    border-bottom: 1px solid rgba(0,0,0,0.05);
    height: var(--nav-height);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    padding-left: clamp(1.5rem, 5vw, 2rem);
    padding-right: clamp(1.5rem, 5vw, 2rem);
}

.logo img {
    height: 80px;
    width: auto;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-main);
    position: relative;
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem); /* Fluid font size */
    min-height: 44px; /* Touch target help */
    display: inline-flex;
    align-items: center;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 5px; /* Adjusted due to flex centering */
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-green);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--color-green);
}

/* Mobile Menu Button */
.burger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    min-height: 44px; /* Touch target */
    justify-content: center;
}

.burger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-main);
    transition: 0.3s;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    /* Dynamic Viewport Units for Mobile */
    min-height: 90vh; /* Fallback */
    min-height: 90dvh; /* Modern */

    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
    background: radial-gradient(circle at 10% 20%, rgba(85, 117, 254, 0.05) 0%, rgba(255, 255, 255, 0) 40%),
                radial-gradient(circle at 90% 80%, rgba(72, 187, 96, 0.05) 0%, rgba(255, 255, 255, 0) 40%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    container-type: inline-size;
}

.hero-title {
    margin-bottom: 1.5rem;
}

.hero-title span {
    position: relative;
    display: inline-block;
}

.hero-title .highlight-blue { color: var(--color-blue); }
.hero-title .highlight-green { color: var(--color-green); }

.hero-subtitle {
    font-size: 1.25rem; /* Fallback for browsers without container queries */
    font-size: clamp(1rem, 5cqi, 1.5rem);
    margin-bottom: 2.5rem;
    color: var(--text-muted);
}

/* Background Curve/Flow Animation */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Wave Shadow Animation --- */
@keyframes waveShadowCycle {
    0% {filter: drop-shadow(0 var(--shadow-thick) var(--shadow-blur) transparent);}
    10% {filter: drop-shadow(0 var(--shadow-thick) var(--shadow-blur) var(--color-orange)); }
    12.5% {filter: drop-shadow(0 var(--shadow-thick) var(--shadow-blur) transparent);}
    32.5% {filter: drop-shadow(0 var(--shadow-thick) var(--shadow-blur) transparent);}
    45% {filter: drop-shadow(0 var(--shadow-thick) var(--shadow-blur) var(--color-blue)); }
    47.5% { filter: drop-shadow(0 var(--shadow-thick) var(--shadow-blur) transparent); }
    70% { filter: drop-shadow(0 var(--shadow-thick) var(--shadow-blur) transparent); }
    80% {filter: drop-shadow(0 var(--shadow-thick) var(--shadow-blur) var(--color-green));}
    82.5% {filter: drop-shadow(0 var(--shadow-thick) var(--shadow-blur) transparent);}
    100% {filter: drop-shadow(0 var(--shadow-thick) var(--shadow-blur) transparent);}
}

.wave-animated-shadow {
    overflow: visible !important;
    --shadow-thick: -0.1px;
    --shadow-blur: 0;
}

.wave-animated-shadow path {
    animation: waveShadowCycle 12s infinite;
    will-change: filter;
}

.wave-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    overflow: visible;
    line-height: 0;
    z-index: 1;
    pointer-events: none;
}

.wave-divider svg {
    display: block;
    width: calc(100% + 2px);
    margin-left: -1px;
    height: 121px;
    transform: translateY(1px);
}

.shape-fill {
    fill: var(--bg-light);
}

.wave-animated-color path {
    animation: waveShadowCycle 8s ease-in-out infinite;
    will-change: filter;
}

/* --- Grid Systems (Refactored) --- */

/* Generic Grid 2 */
.grid-2 {
    display: grid;
    /* RAM Method: min 350px or 100% if smaller, flexible columns */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 450px), 1fr));
    gap: var(--space-md);
    align-items: center;
}

/* --- Features / Expertise Section --- */
.section-features {
    background-color: var(--bg-light);
    position: relative;
}

/* Modern Grid Layout (RAM Method) */
.features-grid {
    display: grid;
    /* Automatically fits columns based on available width.
       Uses max(350px, 45%) to ensure 2 columns on Tablet/Desktop but 1 on Mobile. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, max(350px, 45%)), 1fr));
    gap: var(--space-md); /* Fluid gap */
    margin-top: var(--space-lg);
}

/* Fallback for specific breakpoint behavior if exact 2-col match is desired on tablets?
   The RAM method handles it naturally, but sometimes design wants 2 cols specifically.
   The user request specifically asked to stop using @media to switch manually.
   RAM above does exactly that.
*/

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(72, 187, 96, 0.2);
}

.feature-card:hover .feature-icon {
    background: var(--bg-orange-light);
    color: var(--color-orange);
    box-shadow: 0 4px 10px rgba(85, 117, 254, 0.3);
    transition: all 0.3s ease;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.card-header h3 {
    margin: 0;
    flex: 1;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: rgba(85, 117, 254, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-blue);
    font-size: 1.5rem;
    flex-shrink: 0; /* Prevent icon shrinking */
}

.feature-icon svg {
     width: 30px;
     height: 30px;
    display: block;
}

/* --- Service Morph Logic --- */
.section-morph-spacer {
    width: 100%;
    height: auto;
    position: relative;
    z-index: 40;
}

.service-morph-wrapper {
    position: fixed;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;

    width: calc(100% - (2 * var(--container-padding)));
    max-width: calc(var(--container-width) - (2 * var(--container-padding)));

    background-color: var(--bg-carbon);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    overflow: hidden;

    will-change: width, height, border-radius, opacity;
    transition: box-shadow 0.3s ease;
    
}

body:has(.service-morph-wrapper) main {
    padding-top: 160px !important;
}

.morph-view-large,
.morph-view-small {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.1s linear;
}

.morph-view-large { z-index: 10; }
.morph-view-small { z-index: 20; }

body:has(.service-morph-wrapper) main {
    padding-top: 160px !important;
}

.needs-assessment {
    text-align: center;
    padding: 2rem 1.5rem;
    width: 100%;
    container-type: inline-size;
    
}

.needs-assessment h2 {
    font-size: 2.5rem; /* Fallback */
    font-size: clamp(1.5rem, 8cqi, 3rem);
    margin-bottom: 0.5rem;
    color: white;
}

.needs-assessment > p {
    font-size: 1.2rem; /* Fallback */
    font-size: clamp(1rem, 4cqi, 1.5rem);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-inline: auto;
}

.needs-options {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0 4rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.need-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;

    flex: 1;
    min-width: 260px;
    max-width: 100%;
    text-align: center;
    transition: background 0.2s;
    min-height: 44px; /* Touch target */
}

/* Mobile Adjustments for Morph */
@media (max-width: 768px) {
    .needs-assessment {
        padding: 1.5rem 0.5rem;
    }

    .needs-options {
        gap: 0.5rem;
        margin-top: 1rem;
        flex-direction: column;
    }

    .need-btn {
        width: 100%;
        min-width: unset;
        padding: 0.8rem 1rem;
    }

    .need-btn h4 {
        font-size: 1.1rem;
        margin-bottom: 0.2rem;
    }

    .need-btn p {
        font-size: 0.85rem;
        margin-bottom: 0;
    }
}

.need-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--color-blue);
}

.need-btn h4 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.25rem; /* Fallback */
    font-size: clamp(1rem, 5cqi, 1.4rem);
}

.need-btn p {
    color: rgba(255,255,255,0.7);
    font-size: 1rem; /* Fallback */
    font-size: clamp(0.85rem, 3.5cqi, 1rem);
}

.service-toggle {
    display: flex;
    width: 97%;
    height: 84%;
    padding: 4px;
    box-sizing: border-box;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-pill);
    position: relative;
}

.toggle-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    padding: 0.6rem 0;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.3s;
}

/* Recaptcha Z-Index Fix */
.grecaptcha-badge {
    z-index: 9999;
}

.toggle-bg {
    position: absolute;
    top: 4px;
    left: 4px;
    bottom: 4px;
    width: calc(50% - 4px);
    background: var(--color-blue);
    border-radius: var(--radius-pill);
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-option.active {
    color: white;
}

#serviceContentArea {
    margin-top: 0;
    padding-top: 2rem;
    position: relative;
    z-index: 10;
}

.service-container-light {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-md); /* Fluid padding */
    position: relative;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03);
}

.service-section-dark {
    background: var(--bg-carbon);
    color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-md); /* Fluid padding */
    position: relative;
    overflow: hidden;
}

.service-section-dark h1,
.service-section-dark h2,
.service-section-dark h3 {
    color: white;
}

.service-section-dark p {
    color: rgba(255,255,255,0.7);
}

.service-section-dark .text-highlight { color: var(--color-blue); }
.service-section-dark .text-green { color: var(--color-green); }
.service-section-dark .text-orange { color: var(--color-orange); }

.feature-grid-dark {
    display: grid;
    /* RAM Method */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.feature-card-dark {
    background: rgba(255,255,255,0.05);
    padding: 2.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card-dark:hover {
    transform: translateY(-5px);
    border-color: var(--color-blue);
    background: rgba(255,255,255,0.08);
}

.feature-card-dark .feature-icon {
    background: rgba(85, 117, 254, 0.2);
    color: var(--color-blue);
}

.hidden-section {
    display: none;
    opacity: 0;
}

.visible-section {
    display: block;
    animation: fadeInSection 0.5s ease forwards;
}

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

/* --- Screenshots / Services Preview --- */
.section-services {
    background: var(--bg-white);
    padding: 4rem 0;
}

.service-preview {
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.service-item.reverse {
    flex-direction: row-reverse;
}

.service-text {
    flex: 1;
}

.service-image {
    flex: 1;
    position: relative;
}

.service-image img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transition: transform 0.4s ease;
    width: 100%;
    height: auto;
}

.service-image::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100%;
    height: 100%;
    background: var(--color-orange);
    opacity: 0.1;
    border-radius: var(--radius-md);
    z-index: -1;
    transition: transform 0.4s ease;
}

.service-item:hover .service-image img {
    transform: scale(1.02);
}

.service-item:hover .service-image::before {
    transform: translate(-10px, -10px);
}

/* --- Contact Section --- */
.section-contact {
    background: var(--bg-light);
    position: relative;
    padding-bottom: 8rem;
}

.contact-container {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-input, .form-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: border-color 0.3s;
    font-size: 1rem; /* Prevent zoom on mobile */
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-orange);
}

/* --- Footer --- */
.footer {
    background: var(--bg-carbon);
    color: white;
    padding: 4rem 0 2rem;
    text-align: center;
}


.footer-links {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    min-height: 44px; /* Touch target */
    display: inline-flex;
    align-items: center;
}

.footer-links a:hover {
    color: var(--color-orange);
}



/* Update for the "Team" section on smaller screens */
@media (max-width: 992px) {
    #equipe .content-wrapper {
        text-align: left;        /* Keeps the text aligned to the left */
        max-width: 600px;        /* Limits the width so it looks like a centered block */
        margin-left: auto;       /* Centers the block horizontally */
        margin-right: auto;      /* Centers the block horizontally */
        width: 100%;             /* Ensures it doesn't collapse too much */
    }
}

/* --- Responsive (Additional to Fluid System) --- */
@media (max-width: 992px) {
    /* .grid-2 already handles column stacking via auto-fit, but service-item needs manual help */
    .service-item, .service-item.reverse {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .burger {
        display: flex;
        z-index: 1001;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 70%;
        background: var(--bg-white);
        flex-direction: column;
        padding: 6rem 2rem;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .wave-divider svg {
        height: 60px;
    }

    .hero {
        align-items: center;
        text-align: center;
        padding-top: calc(var(--nav-height) + 2rem);
    }
}

/* Floating Particles */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    20% { opacity: 0.3; }
    100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* --- Page Header (Sub-pages) --- */
.page-header {
    background: var(--gradient-organic);
    padding: calc(var(--nav-height) + 4rem) 0 6rem;
    position: relative;
    color: white;
    text-align: center;
    overflow: hidden;
}

.page-title {
    color: white;
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Image Helpers --- */
.img-restricted {
    max-width: 60%;
    margin: 0 auto;
    display: block;
    width: 100%;
    height: auto;
}

.team-photo-small {
    max-width: 400px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    width: 100%;
    height: auto;
}

/* --- Timeline (About Page) --- */
.timeline {
    position: relative;
    max-width: 90%;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: var(--color-green);
    transform: translateX(-50%);
    border-radius: 4px;
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    width: 50%;
    padding: 0 2rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.timeline-marker {
    position: absolute;
    top: 20px;
    width: 24px;
    height: 24px;
    background: var(--color-orange);
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 97, 53, 0.2);
    z-index: 2;
    transition: transform 0.3s ease, background 0.3s ease;
}

.timeline-item:nth-child(odd) .timeline-marker {
    right: -12px;
}

.timeline-item:nth-child(even) .timeline-marker {
    left: -12px;
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.5);
    background: var(--color-blue);
    box-shadow: 0 0 0 6px rgba(85, 117, 254, 0.2);
}

.timeline-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(72, 187, 96, 0.3);
}

.timeline-date {
    font-family: 'Archivo Black', sans-serif;
    color: var(--color-green);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Timeline Responsive */
@media (max-width: 768px) {
    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding-left: 80px;
        padding-right: 20px;
        text-align: left !important;
    }

    .timeline-item:nth-child(odd) .timeline-marker,
    .timeline-item:nth-child(even) .timeline-marker {
        left: 18px;
        right: auto;
    }

    .timeline-item:nth-child(odd) {
        text-align: left;
    }
}

/* --- Carousel (Method Section) --- */
/* --- Modern Stack Widget (Infinite Loop) --- */
@property --p { syntax: '<number>'; initial-value: 0; inherits: true; }
@property --v { syntax: '<number>'; initial-value: 0; inherits: true; }

.stack-section {
    container-type: inline-size;
    --p: var(--k);
    --abs-p: sign(var(--k) - var(--p)) * (var(--k) - var(--p));
    --end: clamp(0, var(--abs-p) - 1, 1);
    --dir: calc((1 - 2*var(--end))*sign(var(--k) - var(--p)));
    --fwd: calc(.5*(1 + var(--dir)));
    --v: var(--k);
    --abs-v: sign(var(--v) - var(--p)) * (var(--v) - var(--p));
    --prg: calc(var(--abs-v)/(1 - var(--end) + var(--end)*(var(--n) - 1)));

    display: grid;
    grid-template-columns: 1fr 250px;
    grid-template-rows: max-content 1fr max-content;
    gap: 1rem 3rem;

    max-width: 900px;
    width: 100%;
    margin: 2rem auto;
    min-height: 350px;

    font-family: 'Roboto', sans-serif;
    color: var(--text-main);

    counter-reset: k calc(1 + var(--k)) n var(--n);

    transition: --p 0s 0.8s, --v 0.8s;
}

.stack-counter {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-self: end;

    font-family: 'Archivo Black', sans-serif;
    font-size: 1.5rem;
    color: var(--color-blue);
    opacity: 0.6;
}


.stack-article {
    --abs-top: abs(var(--k) - var(--i));
    --not-top: min(1, var(--abs-top));
    --top: calc(1 - var(--not-top));

    --val-mov: ((1 - var(--fwd))*var(--p) + var(--fwd)*var(--k) - var(--i));
    --abs-mov: abs(var(--val-mov));
    --not-mov: min(1, var(--abs-mov));
    --mov: calc(1 - var(--not-mov));

    grid-column: 1 / -1;
    grid-row: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    grid-template-rows: subgrid;

    z-index: mod(calc(var(--n) - 1 + var(--i) - var(--k)), var(--n));
    transition: z-index 0.8s cubic-bezier(1, -.9, 0, 1.9);
    pointer-events: none;
}

.stack-text {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    align-self: center;
    opacity: var(--top);
    transform: translateY(calc(var(--not-top) * 2rem));
    transition: 0.4s calc(var(--top) * 0.4s);
    transition-property: opacity, transform;
}

.stack-text h3 {
    font-size: clamp(1.2rem, 8cqi, 2.5rem);
    
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.stack-text p {
   font-size: 1.25rem;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-right: 1rem;
}

.stack-img {
    grid-column: 2 / 3;
    grid-row: 2 / 3;

    --sin: sin(var(--prg) * 0.5turn);

    width: 250px;
    height: 300px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0,0,0,0.05);

    display: flex;
    align-items: center;
    justify-content: center;

    translate: calc(150% * var(--mov) * sqrt(var(--sin)));
    rotate: calc((1 - var(--sin)) * var(--a));
}

.method-icon-stack {
    font-size: 5rem;
    background: var(--bg-light);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stack-controls {
    margin-top: 2rem;
    grid-column: 2 / 3;
    grid-row: 3 / 4;
    justify-self: center;
    display: flex;
    gap: 1rem;
    z-index: calc((1 - min(1, var(--abs-p))) * var(--n) + 10);
    pointer-events: auto;
}

.stack-btn {
    --sgn: -1;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px; /* Touch target */
}

.stack-btn[data-inc='1'] { --sgn: 1; }

.stack-btn::before {
    content: '';
    border: solid 2px currentColor;
    border-width: 2px 2px 0 0;
    width: 30%;
    height: 30%;
    rotate: 45deg;
    scale: var(--sgn);
    translate: calc(var(--sgn) * -10%);
}

.stack-btn:hover {
    background: var(--text-main);
    color: var(--bg-white);
    border-color: var(--text-main);
}

@media (max-width: 700px) {
    .stack-section {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        text-align: center;
        gap: 1.5rem;
    }

    .stack-counter { grid-column: 1; grid-row: 1; justify-self: center; }

    .stack-img {
        grid-column: 1;
        grid-row: 2;
        margin: 0 auto;
        width: 200px;
        height: 240px;
    }

    .stack-text {
        grid-column: 1;
        grid-row: 3;
    }

    .stack-controls {
        grid-column: 1;
        grid-row: 4;
        justify-self: center;
    }
}

body.dark-mode .stack-img {
    background: var(--bg-carbon);
    border-color: #333;
}
body.dark-mode .method-icon-stack {
    background: var(--bg-dark);
}
body.dark-mode .stack-btn {
    background: var(--bg-dark);
    color: white;
}
body.dark-mode .stack-btn:hover {
    background: var(--color-blue);
    border-color: var(--color-blue);
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-white);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    z-index: 10;
    min-height: 44px; /* Touch target */
    min-width: 44px;
}

.modal-close:hover {
    color: var(--color-orange);
    transform: scale(1.1);
}

.modal-header {
    padding: 2.5rem 2.5rem 1rem;
    text-align: center;
    background: var(--bg-light);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.modal-subtitle {
    color: var(--color-blue);
    font-weight: 500;
    margin-bottom: 0;
}

.modal-body {
    padding: 2.5rem;
}

.modal-text {
    margin-bottom: 2rem;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.6;
}

.modal-text p {
    margin-bottom: 1rem;
}

.modal-form {
    margin: 0;
    padding: 0;
    box-shadow: none;
    max-width: 100%;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0;
}

.form-row .form-group {
    flex: 1;
}

.text-small {
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-header, .modal-body {
        padding: 1.5rem;
    }
}

/* --- Dark Mode --- */
body.dark-mode {
    --bg-white: #252525;
    --bg-light: #1a1a1a;
    --bg-carbon: #141414;

    --text-main: #f3f6f8;
    --text-muted: #a0a0a0;
    --text-light: #f8fafc;
}

body.dark-mode .header {
    background: rgba(37, 37, 37, 0.9);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

body.dark-mode .header.scrolled {
    background: rgba(37, 37, 37, 0.98);
}

body.dark-mode .nav-link {
    color: var(--text-main);
}

body.dark-mode .burger span {
    background-color: var(--text-main);
}

body.dark-mode .feature-card,
body.dark-mode .service-container-light,
body.dark-mode .method-card,
body.dark-mode .contact-container,
body.dark-mode .timeline-content,
body.dark-mode .modal-content {
    background: #2d2d2d;
    border: 1px solid rgba(255,255,255,0.05);
}

body.dark-mode .modal-header {
    background: #252525;
}

body.dark-mode .form-input,
body.dark-mode .form-textarea {
    background: #1a1a1a;
    border-color: #444;
    color: white;
}

body.dark-mode .form-input:focus,
body.dark-mode .form-textarea:focus {
    border-color: var(--color-orange);
}

body.dark-mode .hero {
    background: radial-gradient(circle at 10% 20%, rgba(85, 117, 254, 0.1) 0%, rgba(20, 20, 20, 0) 40%),
                radial-gradient(circle at 90% 80%, rgba(72, 187, 96, 0.1) 0%, rgba(20, 20, 20, 0) 40%);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, color 0.3s ease;
    width: 44px; /* Ensure touch target size */
    height: 44px;
    border-radius: 50%;
}

.theme-toggle:hover {
    background: rgba(125,125,125,0.1);
    transform: rotate(15deg);
    color: var(--color-orange);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: none;
}

/* --- SVG Logos (Inline) --- */
.logo-header-svg {
    height: 80px;
    width: auto;
    fill: var(--text-main);
    transition: fill 0.3s ease, filter 0.3s ease;
}
.logo-hero-svg {
    width: 100%;
    height: 250px;
    display: flex;
    margin: 0 auto 2rem;
    opacity: 0.9;
    fill: var(--text-main);
    transition: fill 0.3s ease, filter 0.3s ease;
}

body.dark-mode .logo-header-svg,
body.dark-mode .logo-hero-svg {
    fill: #ffffff;
    filter: drop-shadow(0 0 10px rgba(72, 187, 96, 0.5));
}