/* ========================================
   Observable Labs v3.0 - Cybernetic Blueprint Theme (Refined)
   Multi-page layout with cleaner, modern aesthetic
   ======================================== */

/* === COLOR SYSTEM === */
:root {
    /* Core Colors */
    --bg-deep-navy: #0f172a;
    --accent-cyan: #22d3ee;
    --accent-cyan-bright: #67e8f9;
    --text-primary: #f1f5f9;
    --text-muted: #cbd5e1;

    /* Glassmorphism */
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(34, 211, 238, 0.15);

    /* Component Colors */
    --section-bg: #1e293b;
    --border-subtle: rgba(203, 213, 225, 0.12);

    /* Typography */
    --font-main: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", "Courier New", Courier, monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
}

/* === BASE STYLES === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-deep-navy);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Blueprint Grid Background - Refined (less busy) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.02) 0%, transparent 50%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 59px,
            rgba(34, 211, 238, 0.04) 59px,
            rgba(34, 211, 238, 0.04) 60px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 59px,
            rgba(34, 211, 238, 0.04) 59px,
            rgba(34, 211, 238, 0.04) 60px
        ),
        var(--bg-deep-navy);
    background-attachment: fixed;
}

/* === NAVIGATION === */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-logo img {
    height: 40px;
    width: auto;
}

.nav-logo span {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    transform: none;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-cyan);
    transform: none;
}

.nav-cta {
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-cyan);
    border-radius: 4px;
    color: var(--accent-cyan) !important;
    transition: all 0.2s ease;
}

.nav-cta:hover {
    background: rgba(34, 211, 238, 0.1);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* === CONTAINER === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-3xl) 2rem;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-3xl) 2rem;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

/* === PAGE HEADER === */
.page-header {
    padding: var(--space-3xl) 0 var(--space-2xl);
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-cyan-bright) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* === HERO SECTION (Homepage) === */
.hero {
    padding: var(--space-3xl) 0;
    text-align: center;
}

.hero-logo {
    width: 100%;
    max-width: 500px;
    height: auto;
    margin-bottom: var(--space-2xl);
    mix-blend-mode: lighten;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-cyan-bright) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto var(--space-xl);
}

.terminal-cursor::after {
    content: '_';
    color: var(--accent-cyan);
    animation: blink-cursor 1s infinite;
    font-family: var(--font-mono);
}

@keyframes blink-cursor {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-xl);
}

.hero-location {
    margin-top: var(--space-xl);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* === METADATA === */
.metadata {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}

/* === SECTION STYLES === */
.section {
    padding: var(--space-3xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--accent-cyan);
}

/* Centered section label (for narrow containers) */
.section-label-centered {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-cyan);
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Subsection header (smaller, for detail sections) */
.subsection-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.subsection-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subsection-header p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* === GLASSMORPHISM CARDS === */
.glassmorphism {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.glassmorphism:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.3);
    box-shadow: 0 8px 32px rgba(34, 211, 238, 0.1);
}

/* === SERVICE CARDS === */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.3);
    box-shadow: 0 8px 32px rgba(34, 211, 238, 0.1);
}

.service-card h3 {
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    font-weight: 700;
}

.service-card p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.service-card ul {
    list-style: none;
    padding: 0;
}

.service-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9375rem;
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
}

.service-card li:last-child {
    border-bottom: none;
}

.service-card li::before {
    content: '→';
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    margin-right: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent-cyan);
    margin-top: 1rem;
}

/* === AUTHORITY SECTION === */
.authority-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-2xl);
    align-items: start;
}

.authority-photo {
    width: 100%;
    max-width: 250px;
    border-radius: 8px;
    border: 2px solid var(--glass-border);
}

.authority-text h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.authority-text p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.highlight {
    color: var(--accent-cyan);
    font-weight: 600;
}

.credentials-list {
    list-style: none;
    margin-top: var(--space-lg);
    padding: 0;
}

.credentials-list li {
    padding: 0.5rem 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.credentials-list li::before {
    content: '✓';
    color: var(--accent-cyan);
    font-weight: 700;
}

/* === HIGHLIGHT BOX (SR&ED) === */
.highlight-box {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.08) 0%, rgba(34, 211, 238, 0.03) 100%);
    border-left: 3px solid var(--accent-cyan);
    padding: var(--space-lg);
    margin: var(--space-2xl) 0;
    border-radius: 0 8px 8px 0;
}

.highlight-box p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin: 0;
}

/* === ENGAGEMENT MODELS === */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.model-card {
    background: var(--section-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 2rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.model-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
}

.model-card h3 {
    color: var(--accent-cyan);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.model-card p {
    color: var(--text-muted);
    line-height: 1.8;
}

.model-card .metadata {
    margin-top: 1.5rem;
    margin-bottom: 0;
}

/* === BUTTONS === */
.cta-button {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-cyan);
    background: transparent;
    border: 2px solid var(--accent-cyan);
    padding: 1rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow:
        inset 0 0 20px rgba(34, 211, 238, 0.15),
        0 0 20px rgba(34, 211, 238, 0.08);
}

.cta-button:hover {
    transform: translateY(-2px);
    background: rgba(34, 211, 238, 0.1);
    box-shadow:
        inset 0 0 30px rgba(34, 211, 238, 0.3),
        0 0 40px rgba(34, 211, 238, 0.2);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button-secondary {
    background: transparent;
    border-color: var(--text-muted);
    color: var(--text-muted);
    box-shadow: none;
}

.cta-button-secondary:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

/* === LINKS === */
a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-cyan-bright);
}

/* === CONTACT SECTION === */
.contact-section {
    text-align: center;
    padding: var(--space-3xl) 0;
}

.contact-section h2 {
    margin-bottom: 1rem;
}

.contact-section > p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

.contact-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.contact-email {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-primary);
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.contact-email:hover {
    border-bottom-color: var(--accent-cyan);
}

/* === CONTACT FORM (Page) === */
.contact-form-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--section-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: var(--space-2xl);
}

.contact-form label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
    font-weight: 700;
}

.contact-form label:first-of-type {
    margin-top: 0;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    background: rgba(15, 23, 42, 0.8);
}

.contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

.contact-form button[type="submit"] {
    margin-top: var(--space-lg);
    width: 100%;
}

.contact-info {
    margin-top: var(--space-2xl);
    text-align: center;
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.response-time {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent-cyan);
}

/* === FOOTER === */
footer {
    margin-top: var(--space-3xl);
    padding: var(--space-xl) 2rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-location {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.location-flag {
    width: 24px;
    height: auto;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.footer-links a,
.footer-links button {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.footer-links a:hover,
.footer-links button:hover {
    opacity: 1;
    color: var(--accent-cyan);
}

.footer-legal {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.footer-legal button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.footer-legal button:hover {
    opacity: 1;
}

/* === MODAL SYSTEM === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.modal-content {
    position: relative;
    z-index: 2;
    background: var(--section-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--accent-cyan);
}

.modal-body {
    color: var(--text-muted);
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.modal-body strong {
    color: var(--text-primary);
}

/* === AERIAL PAGE SPECIFIC === */
.aerial-hero {
    text-align: center;
    padding: var(--space-2xl) 0;
}

.certification-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid var(--accent-cyan);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent-cyan);
    margin-top: var(--space-lg);
}

.deliverables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: var(--space-lg);
}

.deliverable-item {
    background: var(--section-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

/* === RESPONSIVE DESIGN === */

/* Tablet (1024px) */
@media (max-width: 1024px) {
    .container,
    .container-narrow {
        padding: var(--space-2xl) 1.5rem;
    }

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

    .services-grid,
    .models-grid {
        grid-template-columns: 1fr;
    }

    .authority-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .authority-photo {
        margin: 0 auto var(--space-lg);
    }
}

/* Mobile (768px) */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .container,
    .container-narrow {
        padding: var(--space-xl) 1rem;
    }

    /* Mobile Navigation */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        border-bottom: 1px solid var(--border-subtle);
        flex-direction: column;
        padding: 1rem 2rem;
        gap: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

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

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .hero-logo {
        max-width: 100%;
        margin-bottom: var(--space-xl);
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .cta-button {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .contact-actions {
        flex-direction: column;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Small mobile (480px) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.875rem;
    }

    .nav-logo span {
        display: none;
    }

    .cta-button {
        padding: 0.875rem 1.5rem;
        font-size: 0.8125rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
