/* --- Global Variables & Resets --- */
:root {
    --bg-dark: #1A1A1A;
    --accent-cyan: #00E5FF;
    --text-light: #FFFFFF;
    --text-muted: #B3B3B3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* We can change this to a Google Font later */
}

body {
    background-color: #F5F5F5; /* Light background for the main page content */
    color: #333333;
}

/* --- Header & Navigation --- */

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo Section */
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 15px;
}

.logo-img {
    height: 50px; /* Adjust this based on how you crop the image */
    width: auto;
}

.logo-text {
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Navigation Links */
.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Hover Effect - Turns text cyan when hovered */
.nav-links a:hover {
    color: var(--accent-cyan);
}

/* Language Switcher Styling */
.lang-switch a {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
}

.lang-switch a:hover {
    background-color: rgba(0, 229, 255, 0.2);
    color: var(--text-light);
}

/* --- Footer Layout --- */
.site-footer {
    background-color: var(--bg-dark);
    color: var(--text-muted);
    padding: 60px 0 20px; /* Lots of space on top */
    margin-top: 80px;     /* Pushes the footer down from the main content */
    font-size: 0.9rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap; /* Allows columns to stack on mobile */
    gap: 40px;
}

.footer-col {
    flex: 1;
    min-width: 200px; /* Prevents columns from getting too squished */
    text-align: center;
}

/* Brand Column Special Styling */
.brand-col {
    flex: 1.5; /* Gives the description text a bit more breathing room */
    display: flex;             /* <-- Added to center the logo and icons */
    flex-direction: column;    /* <-- Added to keep them stacked */
    align-items: center;
}

.contact-col {
    flex: 1.5; 
}

.contact-col .map-container {
    max-width: 200px; /* Stops the map from stretching too wide */
    margin: 0 auto;   /* Centers the map horizontally */
}

.footer-logo {
    height: 50px;
    margin-bottom: 20px;
}

.brand-col p {
    line-height: 1.6;
    margin-bottom: 20px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

/* Update this rule if needed to remove the uppercase text styles */
.social-icons a {
    color: var(--text-muted); /* SVGs inherit this color via fill="currentColor" */
    transition: color 0.3s ease, transform 0.3s ease; /* Smooth fade and jump */
    display: flex;
    align-items: center;
}

/* This is the new magic hover effect */
.social-icons a:hover {
    color: var(--accent-cyan);
    transform: translateY(-3px); /* Makes the icon "hop" up slightly */
}

/* Footer Typography & Links */
.footer-col h3 {
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a, 
.contact-col p {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.6;
}

.footer-col ul li a:hover {
    color: var(--text-light); /* Highlights white on hover */
}

/* Footer Bottom Bar */
.footer-bottom {
    max-width: 1200px;
    margin: 50px auto 0;
    padding: 20px 20px 0;
    border-top: 1px solid #333333;
    text-align: center;
    font-size: 0.85rem;
}

/* Removes default blue from phone/email links */
.contact-col a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-col a:hover {
    color: var(--text-light);
}

/* --- Reusable Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* --- SECTION 1: Hero Slider Placeholder --- */
.hero-section {
    position: relative;
    height: 85vh;
    overflow: hidden;
    /* Add these three lines back */
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay h1 {
    font-size: 3rem;
    color: var(--accent-cyan);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.hero-overlay h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 400;
    color: var(--text-light);
}

.hero-overlay p {
    font-size: 1.2rem;
    letter-spacing: 3px;
    color: var(--text-muted);
}

/* --- SECTION 2: Hover Cards (Services) --- */
.services-section {
    background-color: #F5F5F5;
}

.service-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Auto-responsive columns! */
    gap: 30px;
}

.hover-card {
    height: 400px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    background-color: #333; /* Fallback color if image is missing */
}

/* The Background Image */
.card-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease; /* Smooth zoom effect */
}

/* Make image zoom slightly on hover */
.hover-card:hover .card-background {
    transform: scale(1.1);
}

/* The Dark Overlay & Text */
.card-content {
    position: absolute;
    inset: 0;
    /* Gradient goes from solid black at the bottom to transparent at the top */
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Pushes text to the bottom */
    padding: 30px;
    color: var(--text-light);
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--accent-cyan);
    padding-bottom: 10px;
    display: inline-block;
    width: fit-content;
}

/* The Hidden Text Logic */
.hover-text {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s ease;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Reveal text when the card is hovered */
.hover-card:hover .hover-text {
    max-height: 150px; /* Expands to fit text */
    opacity: 1;
    margin-top: 10px;
}

/* --- SECTION 3: Location Section (Refined) --- */
.location-section {
    position: relative;
    overflow: hidden;
    background-color: transparent; 
    color: var(--text-light);
}

/* 1. This loads your new skyline image! */
.background-image-container {
    position: absolute;
    inset: 0;
    background-image: url('/images/santo-domingo-skyline.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Parallax effect */
}

/* 2. This adds the dark tint so text is readable */
.content-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.80); /* Dark tint */
    z-index: 1; 
}

/* 3. Updated Grid & Z-indexes to sit on top of the image */
.location-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Gives the map slightly more room */
    gap: 60px;
    align-items: center;
}

.location-text {
    z-index: 2; /* Pushes text above the dark tint */
}

.location-text h2 {
    font-size: 2.8rem;
    margin-bottom: 25px;
    color: var(--text-light);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.location-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

.highlight {
    color: var(--accent-cyan);
}

.address-block {
    margin: 30px 0;
    line-height: 1.6;
    font-size: 1.1rem;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.service-areas h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.service-areas ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns for the list */
    gap: 10px;
}

.service-areas ul li {
    color: var(--text-light);
}

.location-map {
    z-index: 2; /* Pushes map above the dark tint */
}

/* --- Header & Navigation --- */
.site-header {
    background-color: var(--bg-dark);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    
    /* The new sticky magic */
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensures it stays on top of all other elements */
}

.slider-container, .slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.slide {
    background-size: contain; /* Changed from cover */
    background-repeat: no-repeat; /* Added so the image doesn't tile/repeat in the empty space */
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out; 
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

/* General overlay used across all pages */
.hero-overlay {
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

/* SPECIFIC TO INDEX PAGE: The Cinematic Intro */
#index-hero-overlay {
    position: absolute;
    inset: 0;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Start in dead center */
    text-align: center;
    z-index: 100;
    transition: background-color 1.5s ease-in-out;
}

/* The state triggered by JavaScript */
#index-hero-overlay.move-to-top {
    background-color: transparent !important;
    pointer-events: none;
}

/* The magic line that glides the text */
#index-hero-overlay.move-to-top .intro-content {
    /* 42.5vh is exactly half of your 85vh hero section.
       Subtracting that puts the text at the very top (0).
       Adding 60px back gives it a perfect margin from the header.
    */
    transform: translateY(calc(-42.5vh + 60px)); 
}

/* Add the bar back with better positioning */
#index-hero-overlay.move-to-top .intro-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: -1;
    opacity: 0;
    animation: fadeInBackground 1s forwards;
    animation-delay: 1s;
}

/* The fade-in animation for the bar */
@keyframes fadeInBackground {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Ensure the content itself remains relative so the bar can sit behind it */
.intro-content {
    position: relative;
    transition: transform 1.5s ease-in-out;
    will-change: transform;
    padding: 10px 20px;
}

/* --- The Intro Logo --- */
.intro-logo {
    width: 280px; /* Scales down the 707px width to look elegant */
    height: auto;
    margin: 0 auto 30px auto; /* Centers it and gives space below */
    display: block;
    opacity: 1;
    max-height: 200px;
    
    /* We transition opacity, height, margin, and scale to make it "melt" away smoothly */
    transition: opacity 1.2s ease-in-out, 
                max-height 1.5s ease-in-out, 
                margin 1.5s ease-in-out,
                transform 1.2s ease-in-out;
}

/* --- What happens to the logo when the text glides up --- */
#index-hero-overlay.move-to-top .intro-logo {
    opacity: 0;           /* Fades to invisible */
    max-height: 0;        /* Collapses its height */
    margin-bottom: 0;     /* Removes the bottom spacing */
    transform: scale(0.8);/* Shrinks slightly as it fades */
    pointer-events: none;
}

/* Scaling the text down as it glides */
#index-hero-overlay.move-to-top h1 { 
    font-size: 2rem; 
    transition: font-size 1.5s ease-in-out; 
}
#index-hero-overlay.move-to-top h2 { 
    font-size: 1.4rem; 
    transition: font-size 1.5s ease-in-out; 
}

/* Arrow Buttons */
.slider-prev, .slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    padding: 20px 15px;
    cursor: pointer;
    z-index: 20;
    font-size: 1.5rem;
    transition: background 0.3s;
}

.slider-prev:hover, .slider-next:hover {
    background: var(--accent-cyan);
}

.slider-prev { left: 0; border-radius: 0 5px 5px 0; }
.slider-next { right: 0; border-radius: 5px 0 0 5px; }


/* =========================================
   INTERNAL PAGES (Contact, About, Services)
   ========================================= */

/* --- Inner Page Hero --- */
.inner-hero {
    height: 40vh; /* Much shorter than the home page hero */
    background-color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-bottom: 2px solid var(--accent-cyan);
}

.inner-hero h1 {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.inner-hero p {
    color: var(--accent-cyan);
    letter-spacing: 2px;
    font-size: 1.1rem;
}

/* --- Contact Layout --- */
.contact-section {
    background-color: #F5F5F5;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 50/50 Split */
    gap: 60px;
    align-items: flex-start;
}

/* Left Info Styling */
.contact-info h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
}

.contact-info p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 40px;
}

.info-block {
    display: flex;
    align-items: center; 
    gap: 20px; 
    margin-bottom: 35px; /* Slightly increased margin to give them room to breathe */
    background: transparent; /* Stripped the white background */
    padding: 0; /* Removed padding */
    border: none; /* Removed the cyan border */
    box-shadow: none; /* Removed the shadow */
}

/* Optional: Make the h3 a bit larger since it's no longer constrained by a box */
.info-text h3 {
    font-size: 1.2rem;
    color: var(--bg-dark);
    margin-bottom: 4px;
}

.info-block p {
    margin-bottom: 0;
    color: #666;
}

.icon-circle {
    width: 50px;
    height: 50px;
    background-color: var(--bg-dark); /* Dark circle */
    color: var(--accent-cyan); /* Cyan SVG icon */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevents the circle from squishing */
    transition: transform 0.3s ease, background-color 0.3s ease;
}

/* Add a subtle hover effect to the blocks */
.info-block:hover .icon-circle {
    background-color: var(--accent-cyan);
    color: var(--bg-dark);
    transform: scale(1.1);
}

.info-text h3 {
    font-size: 1.1rem;
    color: var(--bg-dark);
    margin-bottom: 4px;
}

.info-text p {
    margin-bottom: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Cloudflare Turnstile Alignment */
.cf-turnstile-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
}

/* Right Form Styling */
.contact-form-wrapper {
    background: var(--bg-dark);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.custom-form .input-group {
    margin-bottom: 20px;
}

.custom-form label {
    display: block;
    color: var(--text-light);
    margin-bottom: 8px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.custom-form input,
.custom-form select,
.custom-form textarea {
    width: 100%;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 4px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

/* Add a dark dropdown arrow for the select box */
.custom-form select option {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

/* Cyan highlight when typing */
.custom-form input:focus,
.custom-form select:focus,
.custom-form textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    background-color: rgba(255, 255, 255, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background-color: var(--accent-cyan);
    color: var(--bg-dark);
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 1px;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #fff;
}

/* --- SERVICES DETAIL PAGE --- */
/* --- SERVICES DETAIL PAGE (Alternating Bands) --- */

/* The full-width sections */
.service-section {
    padding: 80px 0;
    scroll-margin-top: 80px;
}

.light-bg {
    background-color: #ffffff;
}

.dark-bg {
    background-color: var(--bg-dark);
    /* Top and bottom border for contrast, just like Neo Automations */
    border-top: 4px solid var(--accent-cyan);
    border-bottom: 4px solid var(--accent-cyan);
}

/* The grid layout (Stripped of the card styling) */
.service-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    /* Removed background, shadow, and border-radius from the row */
}

/* Apply the styling directly to the image container instead */
.service-image {
    width: 100%;
    height: 400px; /* Changed from 100% to a strict, fixed height */
    border-radius: 12px; 
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2); 
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.service-row:hover .service-image img {
    transform: scale(1.05);
}

/* Color overrides for the Dark Background section */
.dark-bg .service-text h2 {
    color: var(--text-light);
}

.dark-bg .service-text p {
    color: var(--text-muted);
}

.dark-bg .service-features li {
    color: var(--text-muted);
}

/* Keep the padding for balance */
.service-text {
    padding: 20px 40px 20px 0;
}

.reverse-row .service-text {
    padding: 20px 0 20px 40px;
}

.service-text h2 {
    font-size: 2.2rem;
    color: var(--bg-dark);
    margin-bottom: 15px;
}

.service-text p {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 25px;
}

.service-features {
    list-style: none;
    padding: 0;
}

.service-features li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    color: #444;
    font-size: 1.05rem;
}

/* Custom Cyan Bullet Points */
.service-features li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    font-weight: bold;
}

/* Services Call To Action (Bottom of page) */
.services-cta {
    background-color: var(--bg-dark);
    color: var(--text-light);
    /* Reduced the top padding so it flows naturally from the cards above */
    padding: 20px 20px 80px 20px; 
    /* The cyan top border has been completely removed */
}

.text-center {
    text-align: center;
}

.services-cta h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.services-cta p {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* --- Specialized Services Grid --- */
.other-services {
    background-color: var(--bg-dark); /* Changed to dark background */
    padding: 80px 0;
    /* Added a top border to create a sharp line against the white section above */
    border-top: 4px solid var(--accent-cyan); 
}

/* Make sure the heading is white on the dark background */
.other-services h2 {
    color: var(--text-light);
}

.specialized-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.special-card {
    /* Slightly lighter dark gray for the cards to stand out */
    background: rgba(255, 255, 255, 0.05); 
    padding: 40px;
    border-radius: 10px;
    border-top: 4px solid var(--accent-cyan);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.special-card:hover {
    transform: translateY(-5px);
    /* Changed the shadow to a subtle cyan glow for the dark theme */
    box-shadow: 0 10px 25px rgba(0, 229, 255, 0.1);
}

.special-card h3 {
    color: var(--text-light); /* Inverted text to white */
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.special-card p {
    color: var(--text-muted); /* Inverted text to light gray */
    line-height: 1.6;
    font-size: 1rem;
}

/* =========================================
   PORTFOLIO PAGE (Wide Layout)
   ========================================= */

.project-section {
    padding: 60px 0 80px 0;
}

/* Removes the cyan borders ONLY on the Portfolio projects */
.project-section.dark-bg {
    border-top: none;
    border-bottom: none;
}

.project-header {
    margin-bottom: 25px;
}

.project-category {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--accent-cyan);
    margin-bottom: 5px;
}

.project-header h2 {
    font-size: 2.8rem;
    color: var(--bg-dark);
}

.dark-bg .project-header h2 {
    color: var(--text-light);
}

/* --- The Wide Gallery Slider --- */
.wide-gallery {
    position: relative;
    width: 100%;
    height: 500px; /* Taller to accommodate the text */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    background-color: #222;
}

.gallery-slide {
    position: absolute;
    inset: 0;
    width: calc(100% - 400px); /* This is the magic! It stops the image 400px from the right edge */
    height: 100%;
    background-size: contain; 
    background-repeat: no-repeat; 
    background-position: center; /* Put this back to 'center' so it floats perfectly in its new zone */
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.gallery-slide.active {
    opacity: 1;
    z-index: 2;
}

/* --- The Floating Text Overlay --- */
.gallery-text-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px; 
    background: rgba(0, 0, 0, 0.75); 
    backdrop-filter: blur(8px); 
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* <--- Changed from 'center' to 'flex-start' */
    z-index: 5; 
    color: var(--text-light);
    overflow-y: auto; /* Keeps your scrollbar active! */
}

.project-specs {
    list-style: none;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.project-specs li {
    margin-bottom: 12px;
    font-size: 1.05rem;
    color: var(--text-muted);
}

.project-specs strong {
    color: var(--text-light);
}

.project-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
}

/* Gallery Controls */
.gallery-prev, .gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 10px;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
    transition: background 0.3s;
}

.gallery-prev:hover, .gallery-next:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark);
}

/* Position controls: Prev on far left, Next on left edge of the text box */
.gallery-prev { left: 0; border-radius: 0 4px 4px 0; }
.gallery-next { right: 400px; border-radius: 4px 0 0 4px; }

/* =========================================
   MASTER MOBILE LAYOUT (900px and below)
   ========================================= */
@media (max-width: 900px) {

    /* --- About Page (Nosotros) --- */
    .floating-founder-card {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
        gap: 30px;
    }
    
    .founder-card-content {
        text-align: center;
    }
    
    .founder-card-image {
        flex: 0 0 250px;
        height: 250px;
    }

    /* --- Services & General Rows --- */
    .service-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .reverse-row {
        display: flex;
        flex-direction: column-reverse; /* Keeps image on top on mobile */
    }

    .service-text, .reverse-row .service-text {
        padding: 40px 30px;
    }
    
    .service-image {
        min-height: 300px;
    }

    /* --- Contact & Location Grids --- */
    .contact-grid {
        grid-template-columns: 1fr; /* Forces it into a single column */
        gap: 40px; /* Slightly reduces the gap between text and form for mobile */
    }

    .location-grid {
        grid-template-columns: 1fr; /* Forces it into a single vertical column */
        gap: 40px; /* Reduces the huge desktop gap so it looks natural on a phone */
    }

    /* --- Portfolio Wide Gallery --- */
    .wide-gallery {
        height: auto; 
        display: block; 
    }

    .gallery-slide {
        position: absolute;
        width: 100%;
        height: 350px; 
        bottom: auto; 
    }

    .gallery-text-overlay {
        position: relative;
        width: 100%;
        bottom: auto;
        right: auto;
        padding: 30px 20px;
        margin-top: 350px; 
    }

    .gallery-prev, .gallery-next {
        top: 175px; 
    }
    
    .gallery-next { right: 0; }

    .hero-overlay h1 {
        font-size: 1.6rem; /* Reduce el tamaño inicial grande */
        letter-spacing: 1px; /* Reduce un poco el espacio entre letras */
        padding: 0 10px; /* Asegura que no toque los bordes de la pantalla */
    }

    .hero-overlay h2 {
        font-size: 1.1rem;
    }

    #index-hero-overlay.move-to-top h1 { 
        font-size: 1.3rem; 
    }
    
    #index-hero-overlay.move-to-top h2 { 
        font-size: 0.9rem; 
    }
}

/* =========================================
   ABOUT US (NOSOTROS) PAGE
   ========================================= */

.about-story {
    padding: 80px 0 40px 0;
}

.about-story h2 {
    font-size: 2.8rem;
    color: var(--bg-dark);
    margin-bottom: 25px;
}

.intro-paragraph {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #555;
    max-width: 800px;
    margin: 0 auto 50px auto; /* Lo centra perfectamente */
}

/* --- Founder Spotlight Section --- */

.founder-section {
    padding: 80px 0;
}

/* Eliminamos los bordes cian SOLO en esta sección oscura de Nosotros */
.founder-section.dark-bg {
    border-top: none;
    border-bottom: none;
}

/* La Tarjeta Central Flotante */
.floating-founder-card {
    background: rgba(255, 255, 255, 0.03); /* Cristal oscuro muy sutil */
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 60px;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 60px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 1px solid rgba(0, 229, 255, 0.1); /* Borde cian casi invisible */
}

/* --- Elegant Editorial Portrait Frame --- */
.founder-card-image {
    flex: 0 0 350px; /* Slightly wider */
    height: 450px; /* Taller to create a structural portrait look */
    border-radius: 24px; /* Soft architectural corners instead of a circle */
    overflow: hidden;
    /* Cyan border completely removed */
    box-shadow: 0 20px 40px rgba(0,0,0,0.4); /* Deep, soft shadow */
}

.founder-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Adjusted slightly since the frame is now a tall rectangle */
    object-position: center 10%; 
    filter: contrast(1.05) saturate(1.05);
}

.founder-card-content {
    flex: 1;
    text-align: left;
}

.founder-card-content h2 {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.founder-title {
    font-size: 1.2rem;
    color: var(--accent-cyan);
    font-weight: 400;
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.founder-bio {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* --- Mobile Navigation (Hamburger Menu) --- */
.mobile-menu-btn {
    display: none; 
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    margin-left: auto; /* <-- This forces the button to the far right edge */
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block; /* Visible en móviles */
    }

    .nav-links {
        position: absolute;
        top: 100%; /* Justo debajo del header */
        left: 0;
        width: 100%;
        background-color: var(--bg-dark);
        flex-direction: column;
        gap: 0;
        /* Ocultar el menú por defecto */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }

    /* Clase que añadiremos con JavaScript para abrir el menú */
    .nav-links.active {
        max-height: 400px; 
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: 20px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    #index-hero-overlay.move-to-top .intro-content {
        /* We change the + 60px to + 120px to push it further down on mobile */
        transform: translateY(calc(-42.5vh + 78px)); 
    }
}