/* ===== 1. CORE VARIABLES (Titanium & Blue Theme) ===== */
:root {
    --bg-depth: #050b14;
    --bg-surface: #0f172a;
    --bg-light: #1e293b;

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;

    --brand: #3b82f6;
    --brand-glow: #60a5fa;
    --accent: #06b6d4;

    --radius: 8px;
    --nav-height: 70px;
    --font-ui: 'Inter', sans-serif;
    --font-tech: 'JetBrains Mono', monospace;
}

/* ===== 2. RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-depth);
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

ul {
    list-style: none;
}

/* ===== 3. UTILITIES ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== 4. HEADER ===== */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    height: var(--nav-height);
    background: rgba(5, 11, 20, 0.9);
    /* Slightly darker for mobile readability */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 101;
}

.brand-mark {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    font-family: var(--font-tech);
    font-weight: 700;
    display: grid;
    place-items: center;
    border-radius: 6px;
    font-size: 1.1rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-weight: 700;
    letter-spacing: -0.5px;
    font-size: 1.1rem;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Desktop Nav */
.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav a:hover {
    color: white;
}

.btn-nav {
    border: 1px solid var(--brand);
    padding: 8px 20px;
    border-radius: 4px;
    color: var(--brand) !important;
}

.btn-nav:hover {
    background: var(--brand);
    color: white !important;
}

/* Mobile Toggle (Hidden on Desktop) */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== 5. HERO SECTION ===== */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
    overflow: hidden;
}

.hero-bg-simulation {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--bg-depth);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.hero-bg-simulation::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(6, 182, 212, 0.05) 40%, transparent 70%);
    transform: translateY(-50%);
    border-radius: 50%;
    filter: blur(60px);
}

.hero-inner {
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 700px;
}

.badge-pill {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--accent);
    font-family: var(--font-tech);
    margin-bottom: 24px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.highlight {
    background: linear-gradient(to right, var(--brand-glow), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero .lead {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 550px;
}

.cta-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn.primary:hover {
    background: var(--brand-glow);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--bg-light);
    color: var(--text-main);
}

.btn.ghost:hover {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* ===== 6. TRUST GRID ===== */
.panel-auto {
    padding: 40px 0;
    border-bottom: 1px solid var(--bg-light);
    background: rgba(15, 23, 42, 0.5);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    text-align: center;
}

.trust-item h3 {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    font-family: var(--font-tech);
    margin-bottom: 4px;
}

.trust-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== 7. SERVICES ===== */
.panel {
    padding: 100px 0;
}

.section-header {
    margin-bottom: 60px;
    max-width: 600px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature {
    background: var(--bg-surface);
    border: 1px solid var(--bg-light);
    padding: 32px;
    border-radius: var(--radius);
    transition: 0.3s;
}

.feature:hover {
    border-color: var(--brand);
    transform: translateY(-5px);
}

.icon-box {
    width: 48px;
    height: 48px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--brand);
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.feature h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.feature .tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== 8. CONTACT ===== */
.panel-accent {
    background: linear-gradient(to bottom, var(--bg-depth), #08101f);
    text-align: center;
}

.contact-card {
    margin-top: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--bg-light);
    display: inline-block;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
}

.email-link {
    display: block;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 700;
    color: var(--brand);
    margin: 16px 0;
    word-break: break-all;
}

.email-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.social-links a:hover {
    color: white;
}

/* ===== 9. FOOTER ===== */
.site-footer {
    border-top: 1px solid var(--bg-light);
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ===== 10. MOBILE & TABLET ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    .nav {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: var(--bg-surface);
        flex-direction: column;
        padding: 2rem 0;
        border-bottom: 1px solid var(--bg-light);
        transform: translateY(-150%);
        /* Hide by default */
        transition: transform 0.3s ease-in-out;
        z-index: 90;
    }

    /* Class added by JS to show menu */
    .nav.active {
        transform: translateY(0);
    }

    .nav a {
        font-size: 1.2rem;
        padding: 10px;
    }

    .btn-nav {
        width: 80%;
        text-align: center;
        margin-top: 10px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero .lead {
        font-size: 1.1rem;
    }

    .trust-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Stack CTA buttons on very small screens */
    .cta-row {
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}

/* ===== 11. BIO & RESEARCH LINK ===== */
.bio-section {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 3rem;
}

.bio-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.7;
}

.bio-highlight {
    color: var(--text-main);
    font-weight: 600;
    border-bottom: 1px solid var(--brand);
}

.research-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bg-light);
    padding: 12px 20px;
    border-radius: 6px;
    color: var(--accent);
    font-weight: 600;
    transition: 0.2s;
    margin-top: 10px;
    text-decoration: none;
}

.research-link:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent);
    color: var(--brand-glow);
    cursor: pointer;
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    font-family: var(--font-tech);
    /* Uses the coding font */
    font-size: 0.9rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 20px;
}

.lang-switch a,
.lang-switch span {
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

/* The clickable link (inactive language) */
.lang-switch a {
    color: var(--text-muted);
    cursor: pointer;
}

.lang-switch a:hover {
    color: white;
}

/* The active language (highlighted) */
.lang-switch span.active {
    color: var(--brand);
    cursor: default;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .lang-switch {
        margin-left: 0;
        border-left: none;
        padding-left: 0;
        margin-top: 15px;
        justify-content: center;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 15px;
    }
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    font-family: var(--font-tech);
    /* Uses the coding font */
    font-size: 0.9rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 20px;
}

.lang-switch a,
.lang-switch span {
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

/* The clickable link (inactive language) */
.lang-switch a {
    color: var(--text-muted);
    cursor: pointer;
}

.lang-switch a:hover {
    color: white;
}

/* The active language (highlighted) */
.lang-switch span.active {
    color: var(--brand);
    cursor: default;
}


/* ===== MOBILE TEXT REFINEMENTS ===== */
@media (max-width: 768px) {

    /* 1. More breathing room for the main container */
    .container {
        padding-left: 30px;
        /* Increased from standard 24px */
        padding-right: 30px;
    }

    /* 2. Adjust Hero Text Width */
    .hero-content {
        width: 100%;
        /* Ensure text doesn't hit the absolute edge even inside the container */
        max-width: 100%;
    }

    /* 3. Resize Headline to fit "High-End Engineering" on one line */
    .hero h1 {
        /* Reduce minimum size from 2.5rem to 1.8rem on mobile */
        font-size: clamp(1.75rem, 5vw, 2.5rem);
        line-height: 1.2;
        margin-bottom: 20px;
    }

    /* 4. Adjust the "High-End Engineering" nowrap span */
    /* This ensures it shrinks to fit rather than breaking the screen width */
    .hero h1 span[style*="nowrap"] {
        display: inline-block;
        max-width: 100%;
        /* If screen is TINY, allow wrap to prevent broken layout */
        white-space: normal !important;
    }

    /* 5. Make the sub-text (Lead) slightly smaller and tighter */
    .hero .lead {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 25px;
        padding-right: 10px;
        /* Visual balance */
    }
}
