/* ============================================================
   Bastion Microsystems
   Premium dark theme — sensors / defense / mission-ready
   ============================================================ */

:root {
    --bg:           #07070a;
    --bg-2:         #0d0d12;
    --surface:      #11111a;
    --surface-2:    #161621;
    --line:         #20202c;
    --line-strong:  #2c2c3a;
    --text:         #f4f4f7;
    --text-dim:     #a3a3b0;
    --text-mute:    #6b6b78;
    --accent:       #d62828;
    --accent-2:     #ff3b3b;
    --accent-glow:  rgba(214, 40, 40, 0.35);
    --gold:         #c9a45c;

    --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
    --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --max:          1240px;
    --radius:       4px;
    --radius-lg:    8px;
    --ease:         cubic-bezier(.2,.7,.2,1);
}

/* RESET ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--accent); color: #fff; }

/* SCROLLBAR -------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a4a; }

/* LAYOUT ----------------------------------------------------- */
.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 28px;
}
@media (min-width: 768px) { .container { padding: 0 48px; } }

.skip-link {
    position: absolute; top: -100px; left: 16px;
    background: var(--accent); color: #fff;
    padding: 10px 16px; z-index: 1000; border-radius: 4px;
}
.skip-link:focus { top: 16px; }

/* TYPOGRAPHY ------------------------------------------------- */
.eyebrow {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 24px;
}
.eyebrow .rule {
    display: inline-block;
    width: 38px; height: 1px;
    background: var(--accent);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(32px, 4.4vw, 54px);
    line-height: 1.08;
    letter-spacing: -0.015em;
    margin: 0 0 24px;
}

.lede {
    font-size: clamp(16px, 1.3vw, 19px);
    color: var(--text-dim);
    max-width: 62ch;
    margin: 0 0 36px;
    line-height: 1.7;
}

/* BUTTONS ---------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 28px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--radius);
    transition: all 0.3s var(--ease);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    line-height: 1;
}
.btn svg { transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 1px var(--accent), 0 12px 30px -10px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-2);
    box-shadow: 0 0 0 1px var(--accent-2), 0 18px 40px -10px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-ghost {
    background: transparent;
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.04);
    box-shadow: inset 0 0 0 1px #4a4a5a;
}
.btn-block { width: 100%; padding: 18px 28px; }

/* HEADER ----------------------------------------------------- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    transition: all 0.4s var(--ease);
    padding: 22px 0;
    background: rgba(245, 245, 248, 0.92);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.site-header.scrolled {
    background: rgba(250, 250, 252, 0.96);
    border-bottom-color: rgba(0, 0, 0, 0.10);
    box-shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.25);
    padding: 14px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand { display: inline-flex; align-items: center; }
.brand-logo {
    height: 64px;
    width: auto;
    transition: height 0.4s var(--ease), opacity 0.2s var(--ease);
}
.brand:hover .brand-logo { opacity: 0.85; }
.site-header.scrolled .brand-logo { height: 52px; }

.primary-nav ul {
    display: flex;
    align-items: center;
    gap: 40px;
}
.primary-nav a {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #2a2a35;
    position: relative;
    padding: 8px 0;
    transition: color 0.2s var(--ease);
}
.primary-nav a::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 2px;
    background: var(--accent);
    transition: width 0.3s var(--ease);
}
.primary-nav a:hover { color: var(--accent); }
.primary-nav a:hover::after { width: 100%; }

.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
}
.nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: #1a1a22;
    transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: rgba(250, 250, 252, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
    box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.25);
}
.mobile-nav ul {
    display: flex;
    flex-direction: column;
    padding: 16px 28px 28px;
}
.mobile-nav a {
    display: block;
    padding: 16px 0;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #2a2a35;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.mobile-nav a:hover { color: var(--accent); }
.mobile-nav.open { display: block; }

@media (max-width: 880px) {
    .primary-nav { display: none; }
    .nav-toggle { display: flex; }
}

/* HERO ------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 180px 0 100px;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(214,40,40,0.10), transparent 60%),
        linear-gradient(180deg, #0a0a10 0%, #07070a 60%, #050507 100%);
}
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 75%);
}
.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    animation: drift 18s ease-in-out infinite alternate;
}
.hero-glow-1 {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(214,40,40,0.55), transparent 70%);
    top: 10%; left: -120px;
}
.hero-glow-2 {
    width: 620px; height: 620px;
    background: radial-gradient(circle, rgba(80,80,255,0.18), transparent 70%);
    bottom: -100px; right: -160px;
    animation-delay: -8s;
}
@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -30px) scale(1.08); }
}
.hero-scan {
    position: absolute;
    left: 0; right: 0; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.35;
    animation: scan 6s linear infinite;
}
@keyframes scan {
    0%   { transform: translateY(0); opacity: 0; }
    10%  { opacity: 0.4; }
    90%  { opacity: 0.4; }
    100% { transform: translateY(100vh); opacity: 0; }
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1100px;
}
.hero-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(40px, 6.4vw, 84px);
    line-height: 1.02;
    letter-spacing: -0.025em;
    margin: 0 0 28px;
    max-width: 16ch;
}
.hero-title .accent {
    display: inline;
    background: linear-gradient(180deg, var(--text-dim) 0%, var(--text-mute) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 400;
}
.hero-sub {
    font-size: clamp(16px, 1.4vw, 20px);
    color: var(--text-dim);
    line-height: 1.6;
    max-width: 64ch;
    margin: 0 0 44px;
}
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 80px;
}
.hero-marks {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-mute);
}
.hero-marks .dot {
    width: 4px; height: 4px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.6;
}

.hero-scroll {
    position: absolute;
    bottom: 36px; left: 50%;
    transform: translateX(-50%);
    width: 28px; height: 46px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    z-index: 2;
    display: none;
}
.hero-scroll span {
    position: absolute;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 2px; height: 8px;
    background: var(--accent);
    border-radius: 1px;
    animation: mouseScroll 1.8s ease-in-out infinite;
}
@keyframes mouseScroll {
    0%, 100% { opacity: 1; transform: translate(-50%, 0); }
    50%      { opacity: 0; transform: translate(-50%, 16px); }
}
@media (min-width: 1024px) { .hero-scroll { display: block; } }

/* CAPABILITY STRIP ------------------------------------------ */
.strip {
    background: var(--bg-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 80px 0;
    position: relative;
}
.strip-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 48px;
}
.strip-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.strip-num {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 300;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -0.02em;
}
.strip-text h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}
.strip-text p {
    margin: 0;
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.65;
}

/* ABOUT ------------------------------------------------------ */
.about {
    padding: 140px 0;
    position: relative;
}
.about-copy {
    max-width: 760px;
    margin: 0 auto 72px;
    text-align: center;
}
.about-copy .eyebrow { justify-content: center; }
.pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.pillar {
    background: var(--surface);
    padding: 40px 36px;
    transition: background 0.35s var(--ease);
    position: relative;
}
.pillar:hover { background: var(--surface-2); }
.pillar-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    background: rgba(214, 40, 40, 0.08);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    box-shadow: inset 0 0 0 1px rgba(214, 40, 40, 0.2);
}
.pillar h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 19px;
    margin: 0 0 12px;
    letter-spacing: -0.005em;
}
.pillar p {
    margin: 0;
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.65;
}
.pillar-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d0d18 0%, #14141f 100%);
}
.pillar-mark:hover { background: linear-gradient(135deg, #14141f 0%, #1a1a26 100%); }
.pillar-logo {
    max-height: 120px;
    width: auto;
    opacity: 0.9;
}

/* SERVICES --------------------------------------------------- */
.services {
    padding: 140px 0;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    position: relative;
}
.services-head {
    max-width: 760px;
    margin: 0 auto 72px;
    text-align: center;
}
.services-head .eyebrow { justify-content: center; }

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}
.service-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease);
}
.service-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}
.service-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-3px);
    background: var(--surface-2);
}
.service-card:hover::before { opacity: 1; }

.service-no {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: 18px;
}
.service-card h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 21px;
    margin: 0 0 14px;
    letter-spacing: -0.01em;
}
.service-card p {
    margin: 0;
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.7;
}
.service-card-wide {
    grid-column: 1 / -1;
}
@media (min-width: 600px) {
    .service-card-wide { grid-column: span 2; }
}
@media (min-width: 980px) {
    .service-card-wide {
        grid-column: 1 / -1;
        background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    }
    .service-card-wide h3 { font-size: 26px; }
    .service-card-wide p { font-size: 16px; max-width: 80ch; }
}

/* CONTACT ---------------------------------------------------- */
.contact {
    padding: 140px 0;
    position: relative;
}
.contact-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 64px;
}
@media (min-width: 980px) {
    .contact-inner {
        grid-template-columns: 1fr 1.1fr;
        gap: 96px;
        align-items: start;
    }
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 36px;
    padding: 16px 22px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    transition: all 0.3s var(--ease);
}
.contact-email:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(214, 40, 40, 0.05);
}
.contact-email svg { color: var(--accent); }

.contact-meta {
    border-top: 1px solid var(--line);
    padding-top: 28px;
    display: grid;
    gap: 14px;
}
.contact-meta li {
    color: var(--text-dim);
    font-size: 14px;
}
.contact-meta span {
    display: inline-block;
    min-width: 110px;
    color: var(--text-mute);
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-right: 8px;
}

.contact-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 36px;
}
@media (min-width: 768px) { .contact-form { padding: 48px; } }

.field { margin-bottom: 22px; }
.field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    margin-bottom: 0;
}
@media (min-width: 600px) {
    .field-row { grid-template-columns: 1fr 1fr; margin-bottom: 22px; }
    .field-row .field { margin-bottom: 0; }
}
.field label {
    display: block;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 10px;
}
.req { color: var(--accent); }

.field input,
.field textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 14px 16px;
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; font-family: inherit; }
.field input:hover,
.field textarea:hover { border-color: #3a3a4a; }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #08080d;
    box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.15);
}
.field input:invalid:not(:placeholder-shown):not(:focus),
.field textarea:invalid:not(:placeholder-shown):not(:focus) {
    border-color: rgba(214, 40, 40, 0.5);
}

.form-fineprint {
    margin: 18px 0 0;
    font-size: 12px;
    color: var(--text-mute);
    text-align: center;
}

/* FOOTER ----------------------------------------------------- */
.site-footer {
    background: var(--bg-2);
    border-top: 1px solid var(--line);
    padding: 60px 0 40px;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 36px;
    align-items: flex-start;
}
@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
.footer-brand { max-width: 380px; }
.footer-logo {
    height: 32px;
    width: auto;
    margin-bottom: 16px;
    opacity: 0.95;
}
.footer-brand p {
    margin: 0;
    font-size: 13px;
    color: var(--text-mute);
    line-height: 1.6;
}
.footer-meta {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
}
@media (min-width: 768px) {
    .footer-meta {
        align-items: flex-end;
    }
}
.footer-meta a {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--text-dim);
    transition: color 0.2s var(--ease);
}
.footer-meta a:hover { color: var(--accent); }
.footer-meta p {
    margin: 0;
    font-size: 12px;
    color: var(--text-mute);
    letter-spacing: 0.04em;
}
.footer-rule {
    display: none;
    width: 1px; height: 16px;
    background: var(--line);
}

/* TOAST ------------------------------------------------------ */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--accent);
    color: var(--text);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px -10px rgba(0,0,0,0.7);
    z-index: 200;
    transition: transform 0.5s var(--ease);
    font-size: 14px;
    max-width: calc(100% - 32px);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* REVEAL ANIMATION ------------------------------------------ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    will-change: opacity, transform;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}
