/* --- Variables & Reset --- */
:root {
    /* Grayscale Palette - Logical Progression */
    --bg-dark: #121212;
    --bg-medium: #2c2c2c;
    --bg-light: #4a4a4a;
    --text-main: #e0e0e0;
    --text-muted: #d0d0d0;
    --accent: #ffffff;
    --overlay: rgba(0, 0, 0, 0.7);

    /* Spacing & Layout */
    --container-width: 1200px;
    --section-padding: 100px 0;
    --footer-height: 60px;

    /* Fonts */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Roboto', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    /* Padding bottom ensures content isn't hidden behind fixed footer */
    padding-bottom: var(--footer-height);
}

/* --- ADA Accessibility --- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: var(--bg-dark);
    padding: 8px;
    z-index: 10000;
    transition: top 0.3s;
}
.skip-link:focus {
    top: 0;
}

/* Focus states for keyboard navigation */
a:focus, button:focus, input:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Layout --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--accent);
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); text-align: center; margin-bottom: 2rem; }
h3 { font-size: 1.5rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; }

.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: transparent;
    color: var(--accent);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid var(--accent);
    cursor: pointer;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: transparent;
    color: var(--accent);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid var(--accent);
    cursor: pointer;
    margin-left: 20px;
    min-height: 44px;
}

.btn-secondary:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-primary, .btn-secondary {
    animation: pulse 3s infinite;
}

/* --- Hero Section (Video + Fallback) --- */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000; /* Fallback color */
    position: relative; /* Context for absolute positioning */
    text-align: center;
    overflow: hidden;
    /* Mobile Fallback Image (Visible on mobile, covered by video on desktop) */
    background-image: url('images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
}

/* --- Logo Placeholder (Top-Left Positioning) --- */
.logo-placeholder {
    position: absolute;
    top: 30px;       /* Distance from top */
    left: 30px;      /* Distance from left */
    z-index: 3;      /* Ensures logo is above video, overlay, and content */
    width: 150px;    /* Reduced size */
    height: 150px;   /* Reduced size */
    margin: 0;       /* Reset margins for absolute positioning */
}

.logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Maintains logo aspect ratio */
    border: none;        /* Removed border */
    border-radius: 0;    /* Removed circle shape */
    display: block;
}

/* --- Vimeo Background Video Styling (Desktop) --- */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none; /* Prevents clicking/pausing */
}

.video-background iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;

    /* --- CONTINUITY SETTINGS (Matches Carousel) --- */
    filter: grayscale(100%) brightness(0.4);
}

/* --- Overlay & Content --- */
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Additional darkness */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2; /* Above video and overlay */
    max-width: 800px;
}

/* --- Sections General --- */
section {
    padding: var(--section-padding);
    border-bottom: 1px solid #333;
}

/* Grayscale Progression */
#about { background-color: var(--bg-dark); }
#services { background-color: var(--bg-medium); }
#team { background-color: var(--bg-light); }
#contact { background-color: var(--bg-dark); }

/* --- Services Carousel (FIXED for 1920x1080 Images) --- */
.section-services {
    position: relative;
    overflow: hidden;
    color: var(--accent);
    /* FIX: Set height to match 16:9 image ratio */
    height: 100vh;
    min-height: 1080px;
    /* FIX: Remove default padding to prevent image stretching */
    padding: 0;
}

.carousel-background {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    z-index: 1;
    /* Hide scrollbar */
    scrollbar-width: none;
}
.carousel-background::-webkit-scrollbar { display: none; }

.carousel-slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center; /* FIX: Center the image to minimize cropping */
    scroll-snap-align: center;
    filter: grayscale(100%) brightness(0.4); /* Muted effect */
}

/* Carousel Pause Button */
.carousel-pause {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 3;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid #555;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 4px;
    transition: background 0.3s;
    font-family: monospace;
}

.carousel-pause:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-pause:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .carousel-pause {
        padding: 12px 18px;
        font-size: 1.4rem;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.service-content {
    position: relative;
    z-index: 2;
    text-align: center;
    /* FIX: Add padding here instead of on section */
    padding-top: 200px;
    padding-left: 20px;
    padding-right: 20px;
}

.simulator-list {
    list-style: none;
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}
.simulator-list li {
    margin-bottom: 10px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

.services-list {
    list-style: none;
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}
.services-list li {
    margin-bottom: 10px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    text-align: left;
}

/* --- Team Section --- */
.state-group {
    margin-bottom: 60px;
}
.state-label {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #666;
    display: inline-block;
    padding-bottom: 10px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    justify-items: center;
}

.team-card {
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 4px;
    width: 300px;
    text-align: center;
    border: 1px solid #555;
    transition: box-shadow 0.3s ease;
}

.team-card:hover {
    box-shadow: 0 4px 8px rgba(255,255,255,0.1);
}

.team-card img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    filter: grayscale(100%);
}

/* Christie Smith Text Only Class */
.team-card.text-only {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 250px;
}

.role {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 15px;
}

.contact-details {
    list-style: none;
    font-size: 0.9rem;
}
.contact-details li {
    margin-bottom: 5px;
}
.contact-details a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dotted #666;
}

/* --- Contact Form --- */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-medium);
    padding: 40px;
    border-radius: 4px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input, textarea {
    width: 100%;
    padding: 12px;
    background: #121212; /* Fallback for IE */
    background: var(--bg-dark);
    border: 1px solid #555;
    color: #e0e0e0; /* Fallback for IE */
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 4px;
}

input:focus, textarea:focus {
    border-color: #e0e0e0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(224, 224, 224, 0.1);
}

input.valid, textarea.valid {
    border-color: #4CAF50;
}

input.invalid, textarea.invalid {
    border-color: #f44336;
}

/* Remove default appearance on iOS for better styling control */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    -webkit-appearance: none;
    -webkit-border-radius: 4px;
    appearance: none;
    border-radius: 4px;
}

input.valid::after, textarea.valid::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #4CAF50;
    font-weight: bold;
}

input.invalid::after, textarea.invalid::after {
    content: '✗';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #f44336;
    font-weight: bold;
}

textarea.valid::after, textarea.invalid::after {
    top: 15px;
}

/* --- Fixed Footer --- */
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--footer-height);
    background: #000;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    font-size: 0.8rem;
    color: #c4c4c4;
}

.fixed-footer .container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: var(--container-width);
}

.url-display {
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
}

.footer-nav {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-nav a:hover {
    color: var(--accent);
}

/* --- Why Choose Us Section --- */
.centered-paragraph {
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 40px;
}

.why-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.why-btn {
    min-width: 150px;
    min-height: 44px;
    padding: 12px 24px;
}

/* --- Callout Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    overflow-y: auto;
    padding: 20px 0;
}

.modal-overlay.show {
    display: block;
}

.callout {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #121212; /* Fallback for IE */
    background: var(--bg-dark);
    color: #e0e0e0; /* Fallback for IE */
    color: var(--accent);
    border: 2px solid #e0e0e0; /* Fallback for IE */
    border: 2px solid var(--accent);
    padding: 20px;
    max-width: 400px;
    width: calc(100% - 40px); /* Better mobile handling */
    z-index: 1001;
    display: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 4px;
}

.callout.show {
    display: block;
}

.callout-content {
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--accent);
}

.close-btn:hover {
    color: var(--text-muted);
}

.callout h3 {
    margin-top: 0;
    color: var(--accent);
}

.callout p {
    line-height: 1.6;
}

/* --- Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 2rem; }
    .team-grid { grid-template-columns: 1fr; }
    .team-card { width: 100%; }
    .hero-content a { display: block; margin: 10px 0; }
    .why-buttons { flex-direction: column; align-items: center; }
    .footer-nav { flex-direction: column; gap: 10px; align-items: center; }
    .fixed-footer .container { flex-direction: column; text-align: center; gap: 5px; }
    
    /* Prevent fixed footer overlap with keyboard */
    body.keyboard-open {
        padding-bottom: 0;
    }
    
    /* Ensure modals are readable on small screens */
    .callout {
        max-width: 95vw;
        max-height: 90vh;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }

    /* MOBILE FALLBACK: Hide Video, Show Image */
    .video-background {
        display: none;
    }
    .hero-section {
        background-image: url('images/hero-bg.jpg');
        background-size: cover;
        background-position: center;
    }

    /* MOBILE LOGO: Center and Reset Position */
    .logo-placeholder {
        position: relative;      /* Reset to flow */
        top: auto;
        left: auto;
        width: 120px;            /* Slightly smaller on mobile */
        height: 120px;
        margin: 0 auto 20px auto; /* Center horizontally */
    }

    .hero-content {
        text-align: center;      /* Ensure text is centered */
    }

    /* MOBILE SERVICES: Adjust height for mobile */
    .section-services {
        height: auto;
        min-height: 600px;
    }

    .service-content {
        padding-top: 100px;
    }
}