/* ============================================
   LONGSWORD DEFENSE SYSTEMS
   ============================================ */

:root {
    --bg: #09090b;
    --bg-2: #0f0f12;
    --border: rgba(255, 255, 255, 0.06);
    --border-h: rgba(255, 255, 255, 0.12);
    --text: #fafafa;
    --text-2: rgba(255, 255, 255, 0.55);
    --text-3: rgba(255, 255, 255, 0.3);
    --accent: #c8a44e;
    --accent-dim: rgba(200, 164, 78, 0.12);
    --accent-glow: rgba(200, 164, 78, 0.3);
    --sans: 'Inter', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

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

body.loading { overflow: hidden; }

::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(24px, 5vw, 64px); }

/* ============ LOADER ============ */
.loader {
    position: fixed; inset: 0; z-index: 10000; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.loader-svg { width: 56px; height: 56px; color: var(--accent); }
.loader-path { stroke-dasharray: 200; stroke-dashoffset: 200; animation: drawP 2s var(--ease) forwards; }
.loader-path-inner { stroke-dasharray: 150; stroke-dashoffset: 150; animation: drawP 2s var(--ease) 0.3s forwards; }
@keyframes drawP { to { stroke-dashoffset: 0; } }
.loader-text { font-size: 16px; font-weight: 700; letter-spacing: 0.3em; }
.loader-bar { width: 160px; height: 1px; background: var(--border); overflow: hidden; }
.loader-bar-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.3s; }
.loader-status { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--text-3); }

/* ============ CURSOR GLOW ============ */
.cursor-glow {
    position: fixed; width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
    pointer-events: none; z-index: 0; transform: translate(-50%, -50%);
    opacity: 0; transition: opacity 0.3s;
}
body:hover .cursor-glow { opacity: 1; }

/* ============ NAV ============ */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 0 clamp(24px, 5vw, 64px);
    transition: all 0.4s var(--ease);
}
.nav.scrolled {
    background: rgba(9,9,11,0.9); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 72px; transition: height 0.4s var(--ease);
}
.nav.scrolled .nav-inner { height: 56px; }

.nav-logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 14px; letter-spacing: 0.2em;
    transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.7; }
.logo-icon { width: 28px; height: 28px; color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
    font-size: 12px; font-weight: 500; color: var(--text-2);
    letter-spacing: 0.05em; transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
    padding: 7px 18px !important; border: 1px solid var(--border-h); border-radius: 4px;
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent) !important; }

.nav-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span { display: block; width: 20px; height: 1.5px; background: var(--text); transition: all 0.3s var(--ease); }
.nav-toggle.active span:first-child { transform: rotate(45deg) translate(2px, 2px); }
.nav-toggle.active span:last-child { transform: rotate(-45deg) translate(2px, -2px); }

.mobile-menu {
    position: fixed; inset: 0; z-index: 99;
    background: rgba(9,9,11,0.98); backdrop-filter: blur(40px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease);
}
.mobile-menu.active { opacity: 1; pointer-events: all; }
.mobile-menu-inner { display: flex; flex-direction: column; gap: 28px; text-align: center; }
.mobile-menu-inner a { font-size: 24px; font-weight: 600; color: var(--text-2); transition: color 0.2s; }
.mobile-menu-inner a:hover { color: var(--accent); }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 32px; font-family: var(--sans); font-size: 13px;
    font-weight: 600; letter-spacing: 0.04em; border-radius: 4px;
    cursor: pointer; border: none; position: relative; overflow: hidden;
    transition: all 0.3s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover {
    background: #d4b05e; transform: translateY(-1px);
    box-shadow: 0 8px 40px var(--accent-glow);
}
.btn-glow {
    position: absolute; inset: 0;
    background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(255,255,255,0.2) 0%, transparent 60%);
    opacity: 0; transition: opacity 0.3s;
}
.btn:hover .btn-glow { opacity: 1; }

/* ============ HERO ============ */
.hero {
    min-height: 100vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    position: relative; overflow: hidden; padding: 120px 24px 0;
}

.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-video {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.hero-video-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(8,8,12,0.55) 0%, rgba(8,8,12,0.7) 50%, rgba(8,8,12,0.9) 100%);
    z-index: 1;
}
.grid-overlay {
    position: absolute; inset: 0; z-index: 2;
    background-image:
        linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
}
.hero-gradient {
    position: absolute; top: -30%; left: 50%; transform: translateX(-50%);
    width: 140%; height: 80%; z-index: 2;
    background: radial-gradient(ellipse at center, var(--accent-dim) 0%, transparent 60%);
    opacity: 0.5;
}
.scan-line {
    position: absolute; top: 0; left: 0; right: 0; height: 1px; z-index: 2;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
    animation: scanDown 10s ease-in-out infinite; opacity: 0.2;
}
@keyframes scanDown {
    0%, 100% { top: 0; opacity: 0; } 10% { opacity: 0.2; } 90% { opacity: 0.2; } 50% { top: 100%; }
}

.hero-content {
    position: relative; z-index: 1; text-align: center;
    max-width: 900px; margin: 0 auto;
}

.hero-title {
    font-size: clamp(52px, 10vw, 110px);
    font-weight: 800; line-height: 0.95; letter-spacing: -0.04em;
    margin-bottom: 24px;
    color: #ffffff;
}

.hero-sub {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-2); max-width: 480px;
    margin: 0 auto 40px; line-height: 1.6; font-weight: 400;
}

.hero-actions { margin-bottom: 0; }

.hero-bottom {
    position: absolute; bottom: 48px; left: 0; right: 0; z-index: 1;
    display: flex; justify-content: center; gap: 64px;
}

.hero-stat { text-align: center; }
.stat-value {
    display: block; font-size: 28px; font-weight: 700;
    letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.stat-label {
    display: block; font-family: var(--mono); font-size: 10px;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--text-3); margin-top: 4px;
}

/* Hero animate */
.animate-in { opacity: 0; transform: translateY(24px); }
body.loaded .animate-in { animation: fadeUp 0.7s var(--ease) forwards; }
body.loaded .animate-in:nth-child(1) { animation-delay: 0.05s; }
body.loaded .animate-in:nth-child(2) { animation-delay: 0.15s; }
body.loaded .animate-in:nth-child(3) { animation-delay: 0.25s; }
body.loaded .hero-bottom { animation: fadeUp 0.7s var(--ease) 0.4s forwards; opacity: 0; transform: translateY(24px); }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* Split text chars */
.split-char {
    display: inline-block; opacity: 0;
    transform: translateY(30px);
    animation: charIn 0.5s var(--ease) forwards;
}
@keyframes charIn { to { opacity: 1; transform: translateY(0); } }

/* ============ SECTIONS ============ */
.section { padding: clamp(100px, 14vw, 180px) 0; position: relative; }
.section-dark { background: var(--bg-2); }

.section-tag {
    display: inline-block; font-family: var(--mono);
    font-size: 11px; font-weight: 500; letter-spacing: 0.15em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 20px;
}

.big-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800; line-height: 1.0; letter-spacing: -0.04em;
}

/* Reveal */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============ CAPABILITIES ============ */
.cap-row {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}

.cap-block {
    padding: clamp(32px, 4vw, 56px);
    border-right: 1px solid var(--border);
    transition: background 0.4s;
}
.cap-block:last-child { border-right: none; }
.cap-block:hover { background: rgba(200, 164, 78, 0.02); }

.cap-num {
    font-family: var(--mono); font-size: 12px;
    color: var(--accent); display: block; margin-bottom: 20px;
}

.cap-block h2 {
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 700; line-height: 1.15; letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.cap-block p {
    font-size: 14px; color: var(--text-2); line-height: 1.6;
}

/* ============ PLATFORMS ============ */
.platforms-header { margin-bottom: 40px; }
.globe-header { text-align: center; margin-bottom: 48px; }

.platform-tabs {
    display: flex; gap: 2px; margin-bottom: 2px;
    border-bottom: 1px solid var(--border);
}
.platform-tab {
    flex: 1; padding: 14px 20px; font-family: var(--mono);
    font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
    color: var(--text-3); background: none; border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer; transition: all 0.3s;
}
.platform-tab:hover { color: var(--text-2); }
.platform-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Touch devices: no hover, make tabs more tappable */
@media (hover: none) {
    .platform-tab { padding: 16px 20px; font-size: 13px; color: var(--text-2); }
    .platform-tab:hover { color: var(--text-2); }
    .platform-tab.active { color: var(--accent); background: var(--accent-dim); }
}

.platform-showcase {
    border: 1px solid var(--border); border-top: none;
    background: var(--bg);
}

.platform-panel {
    display: none; grid-template-columns: 1.2fr 1fr;
    min-height: 420px; animation: panelIn 0.35s var(--ease);
}
.platform-panel.active { display: grid; }
@keyframes panelIn { from { opacity: 0; } to { opacity: 1; } }

.platform-visual {
    position: relative; background: var(--bg);
    border-right: 1px solid var(--border);
    min-height: 420px; overflow: hidden;
}
.radar-canvas, .wireframe-canvas, .swarm-canvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
}

.platform-hud { position: absolute; inset: 0; pointer-events: none; }
.hud-corner {
    position: absolute; width: 18px; height: 18px;
    border-color: var(--accent); border-style: solid; border-width: 0; opacity: 0.3;
}
.hud-tl { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; }
.hud-tr { top: 12px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.hud-bl { bottom: 12px; left: 12px; border-bottom-width: 1px; border-left-width: 1px; }
.hud-br { bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; }
.hud-data {
    position: absolute; left: 18px; right: 18px;
    display: flex; justify-content: space-between;
    font-family: var(--mono); font-size: 9px; color: var(--text-3); letter-spacing: 0.05em;
}
.hud-data-top { top: 18px; }
.hud-data-bottom { bottom: 18px; }
.hud-status { color: var(--accent); animation: blink 2s step-start infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.platform-info {
    padding: clamp(32px, 3vw, 48px);
    display: flex; flex-direction: column; justify-content: center;
}
.platform-info h3 {
    font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
    margin-bottom: 12px; display: flex; align-items: center; gap: 12px;
}
.ops-badge {
    font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em;
    padding: 3px 8px; border: 1px solid var(--accent-dim);
    color: var(--accent); background: var(--accent-dim);
}
.platform-info > p { font-size: 14px; color: var(--text-2); line-height: 1.6; margin-bottom: 28px; }

.platform-spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.platform-spec { border-left: 2px solid var(--accent-dim); padding-left: 14px; }
.platform-spec-val {
    display: block; font-family: var(--mono); font-size: 22px;
    font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.platform-spec-lbl {
    display: block; font-size: 10px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-top: 2px;
}

/* ============ WORLD MAP ============ */
.world-map-container {
    position: relative; width: 100%;
    max-width: 900px; aspect-ratio: 2 / 1; margin: 0 auto;
}
.world-map-canvas { width: 100%; height: 100%; }

/* ============ CONTACT / CTA ============ */
.cta-block { max-width: 640px; margin: 0 auto; text-align: center; }
.cta-sub { font-size: 15px; color: var(--text-2); line-height: 1.6; margin: 16px 0 40px; }

.cta-form { text-align: left; }
.cta-form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.cta-form-row input,
.cta-form-row textarea {
    flex: 1; width: 100%; padding: 12px 16px; background: var(--bg);
    border: 1px solid var(--border); color: var(--text);
    font-family: var(--sans); font-size: 13px; outline: none;
    transition: border-color 0.2s;
}
.cta-form-row input:focus,
.cta-form-row textarea:focus { border-color: var(--accent); }
.cta-form-row input::placeholder,
.cta-form-row textarea::placeholder { color: var(--text-3); }
.cta-form-row textarea { resize: vertical; min-height: 80px; }
.cta-form .btn { width: 100%; justify-content: center; margin-top: 4px; }

.cta-note {
    font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
    color: var(--text-3); margin-top: 20px;
}

/* ============ FOOTER ============ */
.footer {
    border-top: 1px solid var(--border); padding: 28px 0;
}
.footer-inner {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: var(--text-3);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-3); transition: color 0.2s; }
.footer-links a:hover { color: var(--text-2); }

/* ============ SCRAMBLE TEXT ============ */
.scramble-text { display: inline-block; }

/* ============ 3D TILT / MAGNETIC ============ */
.tilt-card { transform-style: preserve-3d; will-change: transform; }
.card-shine {
    position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
    background: radial-gradient(600px circle at var(--shine-x, 50%) var(--shine-y, 50%), rgba(200,164,78,0.04) 0%, transparent 60%);
    opacity: 0; transition: opacity 0.3s;
}
.tilt-card:hover .card-shine { opacity: 1; }

/* ============ DEPLOYMENT STRIP ============ */
.deploy-strip {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}
.deploy-strip-header { margin-bottom: 24px; }
.deploy-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
}
.deploy-card {
    position: relative;
    padding: 28px 16px 24px;
    border: 1px solid var(--border);
    background: var(--bg);
    text-align: center;
    transition: all 0.4s var(--ease);
}
.deploy-card:hover {
    border-color: rgba(200, 164, 78, 0.15);
    background: rgba(200, 164, 78, 0.02);
}
.deploy-card-icon {
    width: 28px; height: 28px;
    margin: 0 auto 14px;
    color: var(--accent); opacity: 0.5;
    transition: opacity 0.3s;
}
.deploy-card:hover .deploy-card-icon { opacity: 0.8; }
.deploy-card-icon svg { width: 100%; height: 100%; }
.deploy-card h4 {
    font-family: var(--mono);
    font-size: 14px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text); margin-bottom: 14px;
}
.deploy-specs {
    display: flex; flex-direction: column; gap: 6px;
}
.deploy-specs span {
    font-family: var(--mono);
    font-size: 12px; letter-spacing: 0.02em;
    color: var(--text-2);
    transition: color 0.3s;
}
.deploy-card:hover .deploy-specs span { color: var(--text); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .cap-row { grid-template-columns: 1fr; }
    .cap-block { border-right: none; border-bottom: 1px solid var(--border); }
    .cap-block:last-child { border-bottom: none; }
    .platform-panel { grid-template-columns: 1fr; }
    .platform-visual { min-height: 300px; border-right: none; border-bottom: 1px solid var(--border); }
    .deploy-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    .hero-title { font-size: clamp(40px, 12vw, 64px); }
    .hero-bottom { gap: 32px; bottom: 32px; }
    .stat-value { font-size: 22px; }
    .cta-form-row { flex-direction: column; }
    .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
    .world-map-container { aspect-ratio: 1.4 / 1; }
    .big-title { font-size: clamp(30px, 8vw, 48px); }
    .deploy-grid { grid-template-columns: repeat(6, 1fr); }
    .deploy-grid .deploy-card:nth-child(-n+3) { grid-column: span 2; }
    .deploy-grid .deploy-card:nth-child(4) { grid-column: 1 / 4; }
    .deploy-grid .deploy-card:nth-child(5) { grid-column: 4 / 7; }
    /* Tabs: horizontal scroll on mobile */
    .platform-tabs {
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none; gap: 0;
    }
    .platform-tabs::-webkit-scrollbar { display: none; }
    .platform-tab { flex: 0 0 auto; white-space: nowrap; padding: 14px 16px; font-size: 11px; }
}

@media (max-width: 480px) {
    .hero { padding: 80px 20px 0; }
    .hero-bottom { flex-direction: column; gap: 16px; align-items: center; }
}
