/* ======================================================
   J&M Security Solutions — Shared Stylesheet
   Theme: "Operations Brief" — light professional, federal/tactical
   ====================================================== */

/* ---------- Tokens ---------- */
:root {
    /* Light paper-feel surfaces */
    --bg-0: #f6f4ef;          /* page bg, warm cream */
    --bg-1: #ffffff;          /* card surfaces */
    --bg-2: #eeece4;          /* alternate surfaces */
    --bg-3: #ddd9cc;          /* heavier surfaces */

    /* Dark surfaces for video, terminals, footer, hero */
    --bg-dark: #0c1f3a;        /* federal navy — hero / cta band / monitor */
    --bg-dark-2: #06101d;      /* deeper navy — gradients */
    --bg-dark-3: #102842;      /* lighter accent on dark surfaces */

    --line: rgba(12,31,58,0.10);
    --line-strong: rgba(12,31,58,0.22);
    --line-dark: rgba(245,243,239,0.10);

    /* Ink */
    --ink: #1a1f2a;            /* primary near-black slate */
    --ink-dim: #455468;        /* secondary */
    --ink-faint: #7c8693;      /* tertiary */
    --ink-inverse: #f5f3ee;    /* text on dark backgrounds */
    --ink-inverse-dim: rgba(245,243,238,0.7);

    /* Accents */
    --navy: #0c1f3a;           /* federal brand navy (matches bg-dark) */
    --navy-deep: #06101d;
    --red: #c81d2c;            /* tactical red — deeper for light bg contrast */
    --red-hot: #e8313f;
    --red-bright: #ff5566;     /* used on dark backgrounds for legibility */
    --gold: #b8870c;
    --green: #2d7d3e;
    --amber: #d97706;
    --cyan: #1a7a8e;
    --cyan-bright: #4cd9e8;    /* on dark backgrounds */
    --violet: #6d5cc7;
    --violet-bright: #a78bfa;  /* on dark backgrounds */
    --amber-bright: #ffb547;   /* on dark backgrounds */

    /* Shadows for elevation on light bg */
    --shadow-soft: 0 6px 18px rgba(12,31,58,0.08), 0 2px 6px rgba(12,31,58,0.04);
    --shadow-strong: 0 18px 50px rgba(12,31,58,0.14), 0 4px 14px rgba(12,31,58,0.06);
    --shadow-red: 0 0 20px rgba(200,29,44,0.25), 0 8px 24px rgba(200,29,44,0.18);

    /* Fonts */
    --font-display: 'Chakra Petch', sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --max: 1320px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg-0);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain */
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image:
        radial-gradient(circle at 25% 35%, rgba(12,31,58,0.02) 1px, transparent 1px),
        radial-gradient(circle at 75% 65%, rgba(12,31,58,0.02) 1px, transparent 1px);
    background-size: 3px 3px, 5px 5px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.5;
}
::selection { background: var(--red); color: #fff; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.012em; color: var(--ink); }
.mono { font-family: var(--font-mono); }
.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--red);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}
.eyebrow::before {
    content: '';
    display: inline-block;
    width: 22px; height: 2px;
    background: var(--red);
    vertical-align: middle;
    margin-right: 10px;
}
.stroke {
    -webkit-text-stroke: 1.5px var(--ink);
    color: transparent;
}

/* ---------- Top Nav ---------- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(246,244,239,0.85);
    border-bottom: 1px solid var(--line);
    transition: transform 0.4s ease, background 0.4s ease;
}
.nav-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 14px 28px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 32px;
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; color: var(--ink); }
.brand-mark {
    width: 56px;
    height: 36px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.brand-mark svg, .brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name span { color: var(--red); }
.brand-name small {
    display: block;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 9px;
    letter-spacing: 0.3em;
    color: var(--ink-faint);
    margin-top: 2px;
}

.nav-links { display: flex; gap: 32px; justify-content: center; }
.nav-links a {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
    padding: 4px 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--red); }
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -2px;
    width: 0; height: 2px;
    background: var(--red);
    transition: width 0.3s;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 18px; justify-content: flex-end; }
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--green);
    padding: 7px 12px;
    border: 1px solid rgba(45,125,62,0.3);
    background: rgba(45,125,62,0.06);
    border-radius: 2px;
    font-weight: 600;
}
.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}
.nav-cta {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    padding: 10px 16px;
    background: var(--red);
    color: #fff;
    text-transform: uppercase;
    font-weight: 600;
    transition: all 0.25s;
    box-shadow: var(--shadow-red);
}
.nav-cta:hover { background: var(--red-hot); transform: translateY(-1px); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 26px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    transition: all 0.25s;
    border: 1px solid transparent;
    line-height: 1;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: var(--shadow-red); }
.btn-primary:hover { background: var(--red-hot); transform: translateY(-2px); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--red); color: var(--red); background: rgba(200,29,44,0.04); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-deep); transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--ink); border-color: rgba(255,255,255,0.4); }
.btn-light:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn .arrow { transition: transform 0.25s; font-family: var(--font-mono); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Sections ---------- */
.section {
    padding: 120px 28px;
    position: relative;
}
.section-inner {
    max-width: var(--max);
    margin: 0 auto;
}
.section-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 40px;
    margin-bottom: 60px;
}
.section-head h2 {
    font-size: clamp(36px, 4.5vw, 60px);
    line-height: 1.02;
    text-transform: uppercase;
    letter-spacing: -0.015em;
    margin-top: 12px;
}
.section-head h2 .red { color: var(--red); }
.section-head .desc {
    color: var(--ink-dim);
    max-width: 460px;
    font-size: 15.5px;
    line-height: 1.6;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Footer (kept dark for anchor) ---------- */
.footer {
    background: var(--bg-dark-2);
    color: var(--ink-inverse);
    border-top: 4px solid var(--red);
    padding: 70px 28px 30px;
    position: relative;
    overflow: hidden;
}
.footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}
.footer .brand { color: var(--ink-inverse); }
.footer .brand-name span { color: var(--red-bright); }
.footer .brand-name small { color: rgba(245,243,238,0.5); }
/* On the dark footer, the black eye-only logo gets inverted to white silhouette */
.footer .brand-mark img { filter: brightness(0) invert(1); }
.footer-brand p {
    font-size: 13.5px;
    color: var(--ink-inverse-dim);
    margin-top: 18px;
    max-width: 320px;
    line-height: 1.65;
}
.footer-col h5 {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--red-bright);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 20px;
    font-weight: 700;
}
.footer-col ul { list-style: none; }
.footer-col li {
    font-size: 13.5px;
    color: var(--ink-inverse-dim);
    margin-bottom: 11px;
    transition: color 0.2s;
}
.footer-col a { color: var(--ink-inverse-dim); transition: color 0.2s; }
.footer-col li:hover, .footer-col a:hover { color: var(--red-bright); cursor: pointer; }
.footer-bottom {
    max-width: var(--max);
    margin: 0 auto;
    padding-top: 28px;
    border-top: 1px solid rgba(245,243,238,0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(245,243,238,0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}
.footer-bottom .certs { display: flex; gap: 18px; }
.footer-bottom .certs span {
    padding: 5px 11px;
    border: 1px solid rgba(245,243,238,0.18);
    color: var(--ink-inverse);
    font-weight: 600;
}

/* ---------- Live stats strip (navy, visible against light bg) ---------- */
.stats-strip {
    background: var(--bg-dark);
    color: var(--ink-inverse);
    padding: 50px 28px;
    position: relative;
    overflow: hidden;
}
.stats-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}
.stats-strip-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 50px;
    position: relative;
    z-index: 1;
}
.stat {
    border-left: 2px solid var(--red-bright);
    padding-left: 22px;
}
.stat-num {
    font-family: var(--font-display);
    font-size: clamp(38px, 4.5vw, 58px);
    font-weight: 700;
    line-height: 1;
    color: var(--ink-inverse);
    letter-spacing: -0.02em;
}
.stat-num .unit { color: var(--red-bright); font-size: 0.55em; }
.stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(245,243,238,0.65);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-top: 12px;
    font-weight: 600;
}

/* ---------- Page header (sub-pages) ---------- */
.page-head {
    padding: 180px 28px 80px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-1);
    position: relative;
    overflow: hidden;
}
.page-head::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, var(--line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--line) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at 70% 50%, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 70% 50%, black 10%, transparent 70%);
    opacity: 0.7;
}
.page-head::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 50%; height: 100%;
    background: radial-gradient(circle at 80% 50%, rgba(200,29,44,0.06), transparent 60%);
    pointer-events: none;
}
.page-head-inner { max-width: var(--max); margin: 0 auto; position: relative; z-index: 1; }
.page-head h1 {
    font-size: clamp(48px, 7vw, 96px);
    line-height: 0.95;
    text-transform: uppercase;
    letter-spacing: -0.025em;
    margin: 18px 0 24px;
    font-weight: 700;
    color: var(--ink);
}
.page-head h1 .red { color: var(--red); }
.page-head p {
    color: var(--ink-dim);
    font-size: 17.5px;
    max-width: 640px;
    line-height: 1.6;
}
.breadcrumbs {
    display: flex;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
}
.breadcrumbs a:hover { color: var(--red); }
.breadcrumbs .sep { color: var(--red); }

/* ---------- Card baseline ---------- */
.card-elevated {
    background: var(--bg-1);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.3s, transform 0.3s;
}
.card-elevated:hover {
    box-shadow: var(--shadow-strong);
    transform: translateY(-2px);
}

/* ---------- Dark "operations terminal" frame ----------
   For canvases / live data visuals embedded in a light page. */
.tactical-frame {
    background: var(--bg-dark);
    color: var(--ink-inverse);
    border: 1px solid var(--bg-dark-3);
    box-shadow: var(--shadow-strong);
    position: relative;
    overflow: hidden;
}
.tactical-frame::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 38px; height: 38px;
    border-top: 2px solid var(--red-bright);
    border-left: 2px solid var(--red-bright);
    z-index: 5;
}
.tactical-frame::after {
    content: '';
    position: absolute;
    bottom: -1px; right: -1px;
    width: 38px; height: 38px;
    border-bottom: 2px solid var(--red-bright);
    border-right: 2px solid var(--red-bright);
    z-index: 5;
}

/* ---------- Photo placeholder system (reused across pages) ----------
   Each photo slot has an <img> with onerror fallback to a styled placeholder. */
.ph-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-2) 100%);
    display: grid;
    place-items: center;
    color: rgba(255,255,255,0.4);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
    padding: 24px;
    font-weight: 500;
}
.photo-tone img {
    filter: contrast(1.02) saturate(0.92);
}

/* ---------- Responsive base ---------- */
@media (max-width: 1000px) {
    .nav-links { display: none; }
    .nav-inner { grid-template-columns: 1fr auto; }
    .stats-strip-inner { grid-template-columns: repeat(2, 1fr); gap: 36px; }
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 36px; }
    .section { padding: 80px 24px; }
    .section-head { grid-template-columns: 1fr; gap: 16px; }
    .page-head { padding: 130px 24px 60px; }
}
@media (max-width: 600px) {
    .stats-strip-inner { grid-template-columns: 1fr 1fr; }
    .stat { padding-left: 14px; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 16px; }
    .nav-cta { display: none; }
}
