/* === IFNDEF Corp — Tactical Engineering Site === */

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

:root {
    --color-bg: #0E1116;
    --color-card: #151922;
    --color-border: #242C3D;
    --color-border-muted: #1B212D;
    --color-accent: #F59E0B;
    --color-accent-hover: #D97706;
    --color-green: #10B981;
    --color-text: #E2E8F0;
    --color-text-muted: #94A3B8;
    --font-sans: 'Space Grotesk', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
    --max-width: 1200px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* Background grid */
.bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(36, 44, 61, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(36, 44, 61, 0.15) 1px, transparent 1px);
}

/* Navigation */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(14, 17, 22, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    text-decoration: none;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.2s;
}

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

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
}

.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    transition: all 0.2s;
}

.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* Main content */
main {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero */
.hero {
    min-height: calc(100vh - 4rem);
    display: flex;
    align-items: center;
    padding: 4rem 0;
    border-bottom: 1px solid var(--color-border);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-text h1 {
    font-family: var(--font-sans);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.2rem;
    color: white;
}

.hero-text h1 .accent {
    color: var(--color-accent);
}

.hero-sub {
    font-family: var(--font-sans);
    font-size: 0.92rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 540px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1.2rem;
    border: 1px solid var(--color-border);
    background: rgba(21, 25, 34, 0.5);
    margin-bottom: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    font-weight: 700;
}

.stat-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.8rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--color-accent);
    color: #000;
    border: 1px solid var(--color-accent);
}

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

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

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

/* Radar visualization */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.radar-container {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1;
    border: 1px solid var(--color-border);
    background: rgba(21, 25, 34, 0.3);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-svg {
    width: 100%;
    height: 100%;
    color: var(--color-border);
}

.radar-label-top,
.radar-label-bottom {
    position: absolute;
    font-size: 0.5rem;
    letter-spacing: 0.05em;
    opacity: 0.6;
}

.radar-label-top { top: 0.5rem; left: 0.5rem; color: var(--color-accent); }
.radar-label-bottom { bottom: 0.5rem; right: 0.5rem; color: var(--color-text-muted); }

.radar-badge {
    position: absolute;
    font-size: 0.55rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    letter-spacing: 0.03em;
}

.radar-badge-bl { bottom: -0.8rem; left: -0.8rem; color: var(--color-accent); }
.radar-badge-tr { top: -0.8rem; right: -0.8rem; }
.radar-badge-green { color: var(--color-green); }

/* Section shared */
.section {
    padding: 5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.section-tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.section-header h2 {
    font-family: var(--font-sans);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
}

.section-desc {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text-muted);
    max-width: 640px;
    line-height: 1.6;
    margin-bottom: 3rem;
}

/* Capability pillars */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

.pillar {
    padding: 2rem;
    border: 1px solid var(--color-border);
    background: rgba(21, 25, 34, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color 0.2s;
}

.pillar:hover {
    border-color: var(--color-accent);
}

.pillar-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-accent);
    background: rgba(245, 158, 11, 0.08);
}

.pillar-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    color: var(--color-accent);
}

.pillar h3 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pillar p {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.pillar-formula {
    font-size: 0.6rem;
    color: var(--color-accent);
    background: rgba(245, 158, 11, 0.05);
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(245, 158, 11, 0.1);
    margin-top: auto;
}

/* Bento grid (benchmarks) */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.2rem;
}

.bento-card {
    grid-column: span 4;
    border: 1px solid var(--color-border);
    background: rgba(21, 25, 34, 0.3);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s;
}

.bento-card:hover {
    border-color: var(--color-accent);
}

.bento-wide { grid-column: span 8; }
.bento-full { grid-column: span 12; }

.bento-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.bento-tag {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 0.08em;
}

.bento-context {
    font-size: 0.6rem;
    color: var(--color-text-muted);
}

.bento-body {
    flex: 1;
}

.bento-metric {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.bento-unit {
    font-size: 0.5em;
    color: var(--color-accent);
    font-weight: 400;
    margin-left: 0.2em;
}

.bento-body h3 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.bento-body p {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.bento-footer {
    font-size: 0.6rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    padding-top: 0.8rem;
    margin-top: 1.5rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

/* Programs grid */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
}

.program-card {
    padding: 1.8rem;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: background 0.2s;
}

.program-card:hover {
    background: var(--color-card);
}

.program-top {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.program-top h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.program-sponsor {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    padding: 0.15rem 0.5rem;
    opacity: 0.85;
}

.program-card p {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    flex: 1;
}

.program-spec {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.6rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    padding-top: 0.7rem;
    margin-top: 0.5rem;
}

/* IP Table */
.ip-table-wrap {
    border: 1px solid var(--color-border);
    overflow-x: auto;
    background: rgba(21, 25, 34, 0.3);
}

.ip-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.ip-table thead tr {
    border-bottom: 1px solid var(--color-border);
    background: rgba(21, 25, 34, 0.6);
}

.ip-table th {
    padding: 1rem 1.5rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    text-align: left;
}

.ip-table tbody tr {
    border-bottom: 1px solid var(--color-border-muted);
    transition: background 0.15s;
}

.ip-table tbody tr:last-child {
    border-bottom: none;
}

.ip-table tbody tr:hover {
    background: rgba(21, 25, 34, 0.4);
}

.ip-table td {
    padding: 1.2rem 1.5rem;
    vertical-align: top;
}

.ip-ref {
    font-weight: 700;
    color: var(--color-accent);
    font-size: 0.8rem;
    white-space: nowrap;
}

.ip-ref-pub {
    color: var(--color-green);
}

.ip-title {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.3rem;
}

.ip-desc {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.ip-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Contact */
.contact-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    border-bottom: none;
}

.contact-card {
    border: 1px solid var(--color-border);
    background: rgba(21, 25, 34, 0.4);
    padding: 3rem 4rem;
    max-width: 600px;
    width: 100%;
    text-align: center;
    position: relative;
}

.contact-dots {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    display: flex;
    gap: 0.3rem;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.dot-red { background: rgba(239, 68, 68, 0.4); }
.dot-yellow { background: rgba(234, 179, 8, 0.4); }
.dot-green { background: rgba(16, 185, 129, 0.4); }

.contact-card h2 {
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin: 1rem 0 0.75rem;
}

.contact-card p {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-actions {
    margin-bottom: 1.5rem;
}

.contact-meta {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    letter-spacing: 0.1em;
}

/* Footer */
footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--color-border);
    padding: 2.5rem 2rem;
}

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

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.footer-sub {
    font-size: 0.6rem;
    opacity: 0.7;
}

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

.footer-links a {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* Responsive */
@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero-visual {
        order: -1;
    }

    .radar-container {
        max-width: 280px;
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr;
    }

    .bento-card,
    .bento-wide,
    .bento-full {
        grid-column: span 12;
    }

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

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

    .contact-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 640px) {
    main {
        padding: 0 1.2rem;
    }

    nav {
        padding: 1rem 1.2rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-bg);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        display: none;
        z-index: 90;
    }

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

    .nav-links a {
        font-size: 1rem;
    }

    .mobile-toggle {
        display: flex;
        z-index: 95;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding: 6rem 0 3rem;
    }

    .section {
        padding: 3rem 0;
    }

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