:root {
    --bg-color: #0a0e14;
    --surface-color: #161b22;
    --primary-color: #00d4ff;
    --primary-glow: rgba(0, 212, 255, 0.3);
    --secondary-color: #58a6ff;
    --text-color: #c9d1d9;
    --text-muted: #8b949e;
    --heading-color: #ffffff;
    --border-color: #30363d;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    color: var(--heading-color);
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: 0.3s;
}

a:hover {
    color: var(--heading-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Nav */
header {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: rgba(10, 14, 20, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--heading-color);
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--primary-color);
}

.logo-mark {
    height: 44px;
    width: auto;
    margin-right: 0.75rem;
}

/* Grayscale header treatment — overrides the cyan accent on in-header elements */
header .logo span {
    color: var(--text-muted);
}

.nav-panel {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links a:hover {
    color: var(--heading-color);
}

.nav-cta {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Hamburger — hidden on desktop */
.nav-toggle {
    display: none;
    background: none;
    border: 0;
    padding: 0.5rem;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    z-index: 101;
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--heading-color);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

nav.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
nav.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}
nav.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Hero Section */
.hero {
    padding: 8rem 0;
    text-align: center;
    background: radial-gradient(circle at center, var(--primary-glow) 0%, transparent 70%);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
    color: var(--text-muted);
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: var(--heading-color);
    color: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

/* Sections */
section {
    padding: 6rem 0;
    scroll-margin-top: 96px;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
}

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

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

.card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: 0.3s;
}

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

.card h3 {
    margin-bottom: 0.75rem;
}

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

/* Product Specifics */
.product-card {
    display: flex;
    flex-direction: column;
}

.product-image {
    height: 200px;
    background: linear-gradient(45deg, #1e252e, #2a3441);
    border-radius: 4px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image::after {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 212, 255, 0.05) 10px, rgba(0, 212, 255, 0.05) 20px);
    pointer-events: none;
}

.product-image img {
    width: 100%;
    height: 100%;
    padding: 1rem;
    object-fit: contain;
    mix-blend-mode: screen;
    position: relative;
    z-index: 1;
}

/* Product card hosting a live 3D viewer — skip the diagonal scanline overlay
   so it doesn't cover the model. */
.product-image-3d::after {
    display: none;
}

.product-image-3d model-viewer {
    position: relative;
    z-index: 1;
    --poster-color: transparent;
}

.rnd-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: 0.3s;
}

.rnd-card:hover {
    border-color: var(--heading-color);
    transform: translateY(-5px);
}

.rnd-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.rnd-card figcaption {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.mission-visual {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px var(--primary-glow);
}

.mission-visual img {
    display: block;
    width: 100%;
    height: auto;
}

.product-image-placeholder {
    width: 80px;
    height: 15px;
    background: var(--secondary-color);
    border-radius: 5px;
    position: relative;
    z-index: 1;
}

.product-label {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.6rem;
    color: var(--text-muted);
    z-index: 2;
}

.stats {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* News List */
.news-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 2rem;
    align-items: baseline;
}

.news-date {
    font-family: monospace;
    color: var(--secondary-color);
    min-width: 100px;
}

.news-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.news-type {
    display: inline-block;
    padding: 2px 8px;
    background: var(--border-color);
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Footer */
footer {
    padding: 4rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Model Viewer */
model-viewer {
    width: 100%;
    height: 500px;
    background-color: var(--surface-color);
    border-radius: 8px;
    --poster-color: transparent;
}

.model-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.model-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.model-card figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 900px) {
    .container { padding: 0 1.25rem; }

    /* Header */
    header { padding: 1rem 0; }
    .logo { font-size: 1.15rem; }
    .logo-mark { height: 32px; margin-right: 0.5rem; }

    /* Mobile nav: hamburger + slide-down panel */
    .nav-toggle { display: flex; }
    .nav-panel {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.25rem 1.25rem 1.5rem;
        background: var(--bg-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 12px 24px rgba(0,0,0,0.5);
    }
    nav.nav-open .nav-panel { display: flex; }
    .nav-panel .nav-links {
        flex-direction: column;
        gap: 1.25rem;
        align-items: flex-start;
    }
    .nav-panel .nav-links a {
        font-size: 1rem;
        letter-spacing: 1.5px;
    }
    .nav-panel .nav-cta {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        text-align: center;
        width: 100%;
    }
    header .container,
    header nav { position: relative; }

    /* Hero */
    .hero { padding: 4rem 0 3rem; }
    .hero h1 { font-size: 2.25rem; }
    .hero p { font-size: 1rem; padding: 0 0.5rem; }
    .hero-btns { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
    .hero-btns .btn { margin: 0 !important; width: 100%; max-width: 320px; text-align: center; }

    /* Sections */
    section { padding: 3.5rem 0; scroll-margin-top: 72px; }
    .section-header { margin-bottom: 2.5rem; }
    .section-header h2 { font-size: 1.9rem; }
    .section-header p { font-size: 0.95rem; }

    /* Collapse every multi-column grid (including inline-styled ones) */
    .grid { grid-template-columns: 1fr !important; gap: 1.25rem !important; }

    /* Mission */
    #mission h2 { font-size: 1.9rem !important; }

    /* Product cards */
    .product-image { height: 180px; }
    .product-image-3d { height: 260px; }
    .stats { flex-wrap: wrap; gap: 0.5rem; }
    .stat-item { flex: 1 1 30%; }

    /* News list */
    .news-item { flex-direction: column; gap: 0.4rem; align-items: flex-start; padding: 1.25rem 0; }
    .news-date { min-width: auto; }
    .news-content h3 { font-size: 1.05rem; }

    /* Engineering / model viewers */
    .model-card model-viewer { height: 320px !important; }

    /* Contact card — override inline 4rem padding */
    #contact .card { padding: 2rem !important; }
    #contact h2 { font-size: 1.9rem; }

    /* Footer */
    footer { padding: 2.5rem 0; }
}

@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .hero { padding: 3rem 0 2rem; }
    .hero h1 { font-size: 1.85rem; }
    .section-header h2 { font-size: 1.6rem; }
    .logo { font-size: 1rem; }
    .logo-mark { height: 28px; }
    #contact .card { padding: 1.5rem !important; }
    .product-image { height: 150px; }
    .product-image-3d { height: 220px; }
    .model-card model-viewer { height: 260px !important; }
    .stat-value { font-size: 1rem; }
    .stat-label { font-size: 0.65rem; }
}

