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

/* Ensure brand link in header does not change color on :visited */
.nav-logo a { color: inherit; text-decoration: none; }
.nav-logo a:visited { color: inherit; }

:root {
    --primary-color: #FF5436;
    --primary-dark: #E04527;
    
    /* Light theme (default) */
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-light: #999999;
    --background: #FFFFFF;
    --surface: #F8F9FA;
    --border: #E5E5E5;
    --border-light: #F0F0F0;
    --card-bg: #FFFFFF;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-bg-scrolled: rgba(255, 255, 255, 0.98);
    --shadow-color: rgba(0, 0, 0, 0.1);
    /* Footer (light) */
    --footer-bg: #1A1A1A;
    --footer-text: #FFFFFF;
    --footer-border: rgba(255, 255, 255, 0.1);
    --footer-text-muted: rgba(255, 255, 255, 0.7);
    --footer-link: #FFFFFF;
    --footer-link-hover: #FFDDD6; /* lighter tint of primary on dark bg */
    
    /* Shared tokens */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --container-max: 1200px;
    --section-padding: 120px;
    --section-padding-mobile: 80px;
}

/* Dark theme */
[data-theme="dark"] {
    --text-primary: #F5F5F5;
    --text-secondary: #B0B0B0;
    --text-light: #8A8A8A;
    --background: #121212;
    --surface: #1E1E1E;
    --border: #333333;
    --border-light: #2A2A2A;
    --card-bg: #1E1E1E;
    --nav-bg: rgba(30, 30, 30, 0.95);
    --nav-bg-scrolled: rgba(30, 30, 30, 0.98);
    --shadow-color: rgba(0, 0, 0, 0.3);
    /* Footer (dark) */
    --footer-bg: #0E0E0E;
    --footer-text: #EAEAEA;
    --footer-border: rgba(255, 255, 255, 0.12);
    --footer-text-muted: rgba(234, 234, 234, 0.7);
    --footer-link: #EAEAEA;
    --footer-link-hover: #FF7357; /* primary on dark */
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Skip link: visible on keyboard focus */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 16px;
    background: var(--primary-color);
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    z-index: 1001;
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.skip-link:focus,
.skip-link:focus-visible {
    left: 16px;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

p {
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Global focus-visible styles for interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.contact-option:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Navigation */
/* Theme Toggle Button */
.theme-toggle {
    position: relative;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    margin-right: 12px;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background: var(--surface);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    position: absolute;
    transition: transform 0.3s ease, opacity 0.2s ease;
    transform-origin: 50% 50%;
}

/* Light by default: show sun */
.theme-toggle .sun-icon { opacity: 1; transform: scale(1) rotate(0deg); }
.theme-toggle .moon-icon { opacity: 0; transform: scale(0.8) rotate(-90deg); }

/* Dark: cross-fade/rotate */
[data-theme="dark"] .theme-toggle .sun-icon { opacity: 0; transform: scale(0.8) rotate(90deg); }
[data-theme="dark"] .theme-toggle .moon-icon { opacity: 1; transform: scale(1) rotate(0deg); }

.nav-actions {
    display: flex;
    align-items: center;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.nav.scrolled {
    background: var(--nav-bg-scrolled);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
    text-decoration: none;
}

.logo {
    width: 32px;
    height: 32px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 40px;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Improve visibility: underline nav links on keyboard focus */
.nav-link:focus-visible {
    text-decoration: underline;
}

.nav-link.contact-btn {
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-link.contact-btn:hover {
    background: var(--primary-dark);
    color: white;
}

.nav-toggle {
    display: none;
    -webkit-tap-highlight-color: transparent;
    background: none;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: transform 0.3s ease, opacity 0.2s ease, background-color 0.2s ease;
    display: block;
}

.nav-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    background: var(--surface);
}

/* Hamburger animation when expanded */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Hero Section */
.hero {
    position: relative;
    padding: 160px 0 var(--section-padding);
    background: #000000; /* Fallback color */
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.6) 100%), 
                url('images/hero-bg.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    overflow: hidden;
    color: #ffffff; /* Base text color for hero section */
}

/* Utility: hero with no background (e.g., for 404 page) */
.hero.no-bg {
    background: none !important;
    padding: 120px 0 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3); /* Lighter overlay to show more of the image */
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 80px;
    align-items: center;
}

.hero-title-main {
    display: block;
    font-size: 64px;
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff; /* White text for better contrast */
    margin-bottom: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* Subtle shadow for better readability */
}

.hero-title-sub {
    display: block;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9); /* Lighter white with transparency */
    margin-bottom: 40px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Hero section specific button styles */
.hero .btn-secondary {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.hero .btn-secondary:hover {
    color: #ffffff;
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

/* Hero Animation */
.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
}

.torque-animation {
    position: relative;
    width: 450px;
    height: 450px;
}

.gear {
    position: absolute;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.gear-1 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: rotate 8s linear infinite;
    width: 200px;
    height: 200px;
}

.gear-2 {
    top: 30px;
    right: 30px;
    animation: rotate-reverse 6s linear infinite;
    width: 140px;
    height: 140px;
}

.gear-3 {
    bottom: 50px;
    left: 50px;
    animation: rotate 4s linear infinite;
    width: 100px;
    height: 100px;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotate-reverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

/* Sections */
section {
    padding: var(--section-padding) 0;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 80px;
}

.section-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
}

/* Services Section */
.services {
    background: var(--surface);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.service-card, .testimonial-card, .step-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    border: 1px solid var(--border);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    margin-bottom: 24px;
}

.service-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.service-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.service-features {
    list-style: none;
}

.service-features li {
    padding: 8px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 20px;
}

.service-features li::before {
    content: '→';
    color: var(--primary-color);
    font-weight: 600;
    position: absolute;
    left: 0;
}

/* Approach Section */
.approach-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 80px;
    align-items: start;
}

.approach-title {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 16px;
}

.approach-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

.pillars {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.pillar {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.pillar-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    min-width: 60px;
}

.pillar-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.pillar-description {
    color: var(--text-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.stat {
    text-align: center;
    padding: 32px 24px;
    background: var(--background);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* About Section */
.about {
    background: var(--surface);
}

.about-title {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 24px;
}

.about-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
    line-height: 1.7;
}

.about-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.value {
    background: var(--background);
    padding: 32px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.value-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.value-description {
    color: var(--text-secondary);
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.cta-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.cta-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}

.cta-description {
    font-size: 20px;
    margin-bottom: 48px;
    color: rgba(255, 255, 255, 0.9);
}

.contact-options {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.contact-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.contact-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-4px);
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}

.contact-method {
    font-weight: 600;
    font-size: 16px;
}

.contact-detail {
    font-size: 14px;
    opacity: 0.8;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 48px 0 32px;
}

.footer-tools {
    margin-top: 12px;
    text-align: center;
}

.footer-reset {
    font-size: 14px;
    color: var(--footer-link);
    opacity: 0.9;
}

.footer-reset:hover,
.footer-reset:focus {
    color: var(--footer-link-hover);
    opacity: 1;
}

/* Footer links */
.footer a {
    color: var(--footer-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover,
.footer a:focus {
    color: var(--footer-link-hover);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--footer-border);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
}

.footer-tagline {
    font-style: italic;
    color: var(--footer-text-muted);
}

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

.footer-copyright p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
    }
    
    .hero-visual {
        display: none;
    }
    
    .approach-content {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root { --section-padding: var(--section-padding-mobile); }
    
    /* Keep rendered for transitions; hide via opacity/visibility */
    .nav-menu { position: fixed; top: 80px; left: 0; right: 0; 
        background: var(--background); color: var(--text-primary); border-bottom: 1px solid var(--border-light); z-index: 2000; 
        display: flex; flex-direction: column; gap: 0; padding: 12px 24px; box-shadow: 0 8px 24px var(--shadow-color);
        opacity: 0; transform: translateY(-8px); visibility: hidden; pointer-events: none; transition: opacity 180ms ease, transform 200ms ease; }
    /* Dark theme: slightly lighter dark panel */
    [data-theme="dark"] .nav-menu { background: var(--surface) !important; color: var(--text-primary) !important; }
    [data-theme="dark"] .nav-menu li a.nav-link { color: var(--text-primary) !important; }
    /* Animate menu open: slide/fade in */
    .nav-menu.open { opacity: 1; transform: translateY(0); visibility: visible; pointer-events: auto; }
    .nav-menu li { border-bottom: 1px solid var(--border-light); }
    .nav-menu li:last-child { border-bottom: 0; }
    .nav-menu li a.nav-link { display: block; padding: 14px 0; color: var(--text-primary); font-weight: 600; }
    .nav-menu li a.nav-link:hover, .nav-menu li a.nav-link:focus-visible { color: var(--primary-color) !important; }
    /* Remove decorative underline animation inside mobile menu */
    .nav-menu .nav-link::after { content: none; display: none; }

    /* Ensure the red Get Started button has breathing room in the mobile menu */
    /* Ensure the red Get Started button has breathing room in the mobile menu and overrides generic nav-link padding */
    .nav-menu li a.nav-link.contact-btn {
        display: inline-block;
        padding: 12px 20px !important; /* override the 14px 0 rule */
        margin: 8px 0;
        border-radius: var(--radius-sm);
        background: var(--primary-color);
        color: #fff;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero {
        padding: 120px 0 80px;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: 0;
        text-align: center;
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-title-main {
        font-size: 48px;
    }
    
    .hero-title-sub {
        font-size: 18px;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .section-title {
        font-size: 36px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .service-card {
        padding: 32px 24px;
    }
    
    .pillars {
        gap: 24px;
    }
    
    .pillar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .about-values {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .contact-options {
        flex-direction: column;
        gap: 16px;
    }
    
    .contact-option {
        padding: 20px 24px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    .hero-title-main {
        font-size: 36px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .approach-title,
    .about-title {
        font-size: 32px;
    }
    
    .cta-title {
        font-size: 32px;
    }
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
    .service-card,
    .btn,
    .contact-option {
        transition: all 0.3s ease;
    }
    
    .nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: -4px;
        left: 0;
        background: var(--primary-color);
        transition: width 0.3s ease;
    }
    
    .nav-link:hover::after,
    .nav-link:active::after {
        width: 100%;
    }
}

/* Focus States */
.btn:focus,
.nav-link:focus,
.contact-option:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .nav,
    .torque-animation,
    .cta {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}