/* ========================================
   Defrost Unmanned - Tactical Arctic Design
   ======================================== */

/* CSS Variables */
:root {
    --bg-primary: #0B0F17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --accent: #38BDF8;
    --accent-hover: #0EA5E9;
    --text-primary: #F4F6FB;
    --text-secondary: #A9B3C2;
    --text-muted: #6B7280;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
    --transition-slow: 0.6s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ========================================
   Navigation
   ======================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4vw;
    background: linear-gradient(to bottom, rgba(11, 15, 23, 0.9) 0%, transparent 100%);
    backdrop-filter: blur(10px);
    transition: var(--transition-medium);
}

.nav.scrolled {
    background: rgba(11, 15, 23, 0.95);
    padding: 1rem 4vw;
}

.nav-brand a {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: var(--transition-fast);
}

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

.nav-link:hover::after {
    width: 100%;
}

.nav-cta {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--accent);
}

.nav-cta::after {
    display: none;
}

.nav-cta:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-fast);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 23, 0.98);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-medium);
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-link {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-small {
    padding: 0.6rem 1.2rem;
    font-size: 0.7rem;
}

.btn-full {
    width: 100%;
}

/* ========================================
   Sections
   ======================================== */
.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.section-pinned {
    height: 100vh;
    display: flex;
    align-items: center;
}

.section-flowing {
    padding: 8vh 0;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4vw;
}

/* Section Backgrounds */
.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.section-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.85) contrast(1.05);
}

.section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(11, 15, 23, 0.85) 0%,
        rgba(11, 15, 23, 0.5) 50%,
        rgba(11, 15, 23, 0.3) 100%
    );
    z-index: 1;
}

.section-content {
    position: relative;
    z-index: 2;
    padding: 0 4vw;
    max-width: 60vw;
}

/* Section Typography */
.section-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.section-title span {
    display: block;
}

.section-body {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 2rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: -1rem;
    margin-bottom: 3rem;
}

/* ========================================
   Hero Section
   ======================================== */
.section-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.85) contrast(1.05);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(11, 15, 23, 0.4) 0%,
        rgba(11, 15, 23, 0.6) 50%,
        rgba(11, 15, 23, 0.8) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 80vw;
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.title-line:nth-child(2) {
    animation-delay: 0.15s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.3s forwards;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.45s forwards;
}

/* Hero HUD */
.hero-hud {
    position: absolute;
    bottom: 4vh;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 4vw;
    z-index: 2;
}

.hud-left {
    text-align: left;
}

.hud-right {
    text-align: right;
    align-self: flex-end;
}

.hud-line {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.8;
    opacity: 0;
    animation: fadeIn 0.8s ease 0.6s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ========================================
   Metric Cards
   ======================================== */
.metric-cards {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    min-width: 160px;
    transition: var(--transition-fast);
}

.metric-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.metric-value {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.metric-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ========================================
   Feature Lists
   ======================================== */
.section-product .section-content {
    max-width: 40vw;
}

.feature-list {
    position: absolute;
    right: 4vw;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    text-align: right;
    max-width: 300px;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.feature-icon {
    color: var(--accent);
    font-size: 0.6rem;
}

.feature-list .btn {
    margin-top: 1.5rem;
}

/* ========================================
   Product Grid
   ======================================== */
.section-header {
    margin-bottom: 4rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition-fast);
}

.product-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.product-image {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.85);
    transition: var(--transition-medium);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.product-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.product-accent {
    width: 30px;
    height: 2px;
    background: var(--accent);
    margin-top: 1rem;
}

.product-highlight {
    grid-column: span 1;
    border-color: var(--accent);
}

/* ========================================
   Architecture Diagram
   ======================================== */
.architecture-diagram {
    position: absolute;
    right: 4vw;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.arch-layer {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 2rem;
    text-align: center;
    min-width: 240px;
}

.arch-label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.arch-desc {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.arch-connector {
    font-size: 1.2rem;
    color: var(--accent);
    line-height: 1;
}

/* ========================================
   Deployment Cards
   ======================================== */
.deployment-cards {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
}

.deploy-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    min-width: 180px;
    transition: var(--transition-fast);
}

.deploy-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.deploy-card h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.deploy-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ========================================
   Contact Section
   ======================================== */
.section-contact {
    background: var(--bg-primary);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

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

.contact-details {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.contact-item a,
.contact-item span {
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.contact-item a:hover {
    color: var(--accent);
}

/* Contact Form */
.contact-form-wrapper {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2.5rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A9B3C2' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.form-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #EF4444;
    color: #EF4444;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
}

.footer-logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

.footer-links a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: right;
}

.footer-bottom p {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ========================================
   Scroll Animations
   ======================================== */
[data-scroll] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-scroll].visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for children */
.metric-card[data-scroll]:nth-child(1) { transition-delay: 0s; }
.metric-card[data-scroll]:nth-child(2) { transition-delay: 0.1s; }
.metric-card[data-scroll]:nth-child(3) { transition-delay: 0.2s; }

.product-card[data-scroll]:nth-child(1) { transition-delay: 0s; }
.product-card[data-scroll]:nth-child(2) { transition-delay: 0.08s; }
.product-card[data-scroll]:nth-child(3) { transition-delay: 0.16s; }
.product-card[data-scroll]:nth-child(4) { transition-delay: 0.24s; }
.product-card[data-scroll]:nth-child(5) { transition-delay: 0.32s; }
.product-card[data-scroll]:nth-child(6) { transition-delay: 0.4s; }
.product-card[data-scroll]:nth-child(7) { transition-delay: 0.48s; }

.deploy-card[data-scroll]:nth-child(1) { transition-delay: 0s; }
.deploy-card[data-scroll]:nth-child(2) { transition-delay: 0.1s; }
.deploy-card[data-scroll]:nth-child(3) { transition-delay: 0.2s; }

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-content {
        max-width: 70vw;
    }
    
    .feature-list {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        text-align: left;
        margin-top: 2rem;
        max-width: 100%;
    }
    
    .feature-item {
        justify-content: flex-start;
    }
    
    .architecture-diagram {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-top: 2rem;
        align-items: flex-start;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .mobile-menu {
        display: flex;
    }
    
    .section-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }
    
    .section-content {
        max-width: 92vw;
        padding: 0 4vw;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-hud {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hud-right {
        text-align: left;
    }
    
    .metric-cards,
    .deployment-cards {
        flex-direction: column;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        flex-direction: column;
        gap: 2rem;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .contact-form-wrapper {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav {
        padding: 1rem 4vw;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .metric-card,
    .deploy-card {
        min-width: auto;
    }
    
    .arch-layer {
        min-width: auto;
        width: 100%;
        padding: 1rem;
    }
}

/* ========================================
   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;
    }
    
    [data-scroll] {
        opacity: 1;
        transform: none;
    }
    
    .title-line {
        opacity: 1;
        transform: none;
    }
    
    .hero-subtitle,
    .hero-cta,
    .hud-line {
        opacity: 1;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .nav,
    .grain-overlay,
    .hero-hud,
    .btn {
        display: none !important;
    }
    
    .section {
        min-height: auto;
        page-break-inside: avoid;
    }
    
    body {
        background: white;
        color: black;
    }
}