/* ═══════════════════════════════════════════════════════
   EMERGY AI OPS — v7.0 shared system
   Deep-navy tech premium. Used by index.html and every
   blog page. Page-specific rules stay inline on the page.
   ═══════════════════════════════════════════════════════ */

:root {
    --bg: #050A14;
    --bg-2: #07101E;
    --bg-3: #0A1527;
    --panel: rgba(12, 26, 46, 0.72);
    --panel-solid: #0C1A2E;
    --line: rgba(94, 196, 255, 0.14);
    --line-soft: rgba(94, 196, 255, 0.08);
    --line-strong: rgba(94, 196, 255, 0.30);
    --text: #EAF2FF;
    --muted: #A3B5CF;
    --dim: #6F829E;
    --cyan: #38BDF8;
    --sky: #8BD5FF;
    --blue: #2E63E7;
    --blue-bright: #4F86FF;
    --amber: #F7B955;
    --mint: #34D3B8;
    --glow: rgba(56, 189, 248, 0.28);
    --grotesk: 'Space Grotesk', 'Inter', sans-serif;
    --sans: 'Inter', -apple-system, sans-serif;
    --mono: 'IBM Plex Mono', 'SF Mono', monospace;
    --width-text: 760px;
    --width-wide: 1160px;
    --section-spacing: clamp(96px, 12vw, 150px);
    --radius-btn: 12px;
    --radius-card: 18px;
}

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

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
}

::selection { background: var(--cyan); color: #04101C; }

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Fine dot grid texture — the "engineered surface" */
.grid-bg {
    position: relative;
    background-image: radial-gradient(rgba(139, 213, 255, 0.13) 1px, transparent 1.2px);
    background-size: 28px 28px;
}

.grid-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(56, 189, 248, 0.10), transparent 60%),
        linear-gradient(180deg, rgba(5, 10, 20, 0) 0%, rgba(5, 10, 20, 0.55) 100%);
}

/* ── Progress bar ── */
.progress-bar {
    position: fixed; top: 0; left: 0; height: 2px; width: 0;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    z-index: 300;
    transition: width 0.1s linear;
}

/* ── Navigation ── */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 18px 48px;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(5, 10, 20, 0.55);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border-bottom: 1px solid transparent;
    transition: padding 0.35s ease, background 0.35s ease, border-color 0.35s ease;
}

nav.scrolled {
    padding: 12px 48px;
    background: rgba(5, 10, 20, 0.82);
    border-bottom-color: var(--line-soft);
}

.nav-logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-mark { width: 30px; height: 30px; flex-shrink: 0; }
.logo-word {
    font-family: var(--grotesk); font-size: 17px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--text);
}
.logo-word span { color: var(--sky); }

.nav-right { display: flex; align-items: center; gap: 34px; }
.nav-links { display: flex; gap: 30px; list-style: none; }
.nav-links a {
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--muted); text-decoration: none;
    position: relative; transition: color 0.3s ease;
}
.nav-links a::after {
    content: ''; position: absolute; left: 0; bottom: -6px; width: 100%; height: 2px;
    border-radius: 2px; background: var(--cyan);
    transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--sky); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-cta {
    font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
    color: #fff; text-decoration: none; padding: 11px 22px; border-radius: 10px;
    background: linear-gradient(120deg, var(--blue), #2457D6);
    border: 1px solid rgba(139, 213, 255, 0.25);
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    white-space: nowrap;
}
.nav-cta:hover {
    border-color: rgba(139, 213, 255, 0.55);
    box-shadow: 0 8px 28px -6px rgba(56, 189, 248, 0.45);
    transform: translateY(-1px);
}

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; z-index: 201; }
.nav-toggle span {
    display: block; width: 24px; height: 2px; border-radius: 2px; background: var(--text);
    margin: 6px 0; transition: transform 0.35s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

.mobile-menu {
    position: fixed; inset: 0; z-index: 200; background: rgba(5, 10, 20, 0.98);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu a {
    font-family: var(--grotesk); font-size: 30px; font-weight: 500; color: var(--text);
    text-decoration: none; padding: 12px 0; opacity: 0; transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease, color 0.3s ease;
}
.mobile-menu.open a { opacity: 1; transform: translateY(0); }
.mobile-menu.open a:nth-child(1) { transition-delay: 0.08s; }
.mobile-menu.open a:nth-child(2) { transition-delay: 0.14s; }
.mobile-menu.open a:nth-child(3) { transition-delay: 0.20s; }
.mobile-menu.open a:nth-child(4) { transition-delay: 0.26s; }
.mobile-menu.open a:nth-child(5) { transition-delay: 0.32s; }
.mobile-menu.open a:nth-child(6) { transition-delay: 0.40s; }
.mobile-menu a:hover { color: var(--sky); }
.mobile-menu .mobile-cta {
    font-family: var(--sans); font-size: 15px; font-weight: 600; color: #fff;
    background: var(--blue); padding: 15px 34px; border-radius: var(--radius-btn); margin-top: 26px;
}

/* ── Layout ── */
section { padding-left: 48px; padding-right: 48px; scroll-margin-top: 84px; }
.container { max-width: var(--width-text); margin: 0 auto; }
.container-wide { max-width: var(--width-wide); margin: 0 auto; }
.section-center { text-align: center; }

.section-head {
    display: inline-flex; align-items: center; gap: 12px; margin-bottom: 22px;
    padding: 8px 16px; border: 1px solid var(--line); border-radius: 100px;
    background: rgba(56, 189, 248, 0.05);
}
.section-head .tick { width: 6px; height: 6px; border-radius: 2px; background: var(--cyan); transform: rotate(45deg); box-shadow: 0 0 10px var(--glow); }
.section-num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--dim); }
.section-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sky); }

.section-title {
    font-family: var(--grotesk); font-size: clamp(30px, 4vw, 46px); font-weight: 600;
    letter-spacing: -0.018em; color: var(--text); line-height: 1.12;
}
.section-title em, .grad {
    font-style: normal;
    background: linear-gradient(92deg, #FFFFFF 0%, var(--sky) 55%, var(--cyan) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-sub {
    font-family: var(--sans); font-size: clamp(15px, 1.5vw, 17px); color: var(--muted);
    max-width: 620px; margin: 16px auto 0; line-height: 1.75;
}

/* ── Buttons ── */
.btn-primary {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
    color: #fff; text-decoration: none; padding: 15px 30px; border-radius: var(--radius-btn);
    background: linear-gradient(120deg, var(--blue), #2457D6);
    border: 1px solid rgba(139, 213, 255, 0.28);
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.btn-primary:hover {
    border-color: rgba(139, 213, 255, 0.6);
    box-shadow: 0 14px 40px -8px rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
}
.btn-primary .arrow { font-family: var(--mono); font-size: 13px; opacity: 0.85; }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--sky);
    text-decoration: none; padding: 15px 30px; border-radius: var(--radius-btn);
    border: 1px solid var(--line-strong); background: rgba(56, 189, 248, 0.04);
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}
.btn-ghost:hover { border-color: var(--cyan); background: rgba(56, 189, 248, 0.09); transform: translateY(-2px); }

.btn-whatsapp {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--sans); font-size: 14px; font-weight: 500; color: #9EEBCB;
    padding: 15px 28px; border-radius: var(--radius-btn);
    border: 1px solid rgba(52, 211, 184, 0.35); background: rgba(52, 211, 184, 0.06);
    text-decoration: none; transition: all 0.3s ease;
}
.btn-whatsapp:hover { border-color: rgba(52, 211, 184, 0.7); background: rgba(52, 211, 184, 0.12); transform: translateY(-2px); }
.btn-whatsapp svg { width: 17px; height: 17px; fill: var(--mint); }

/* ── Glass card (shared) ── */
.card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, rgba(14, 30, 52, 0.85), rgba(8, 17, 32, 0.9));
    box-shadow: 0 1px 0 rgba(139, 213, 255, 0.06) inset, 0 24px 60px -30px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 8%; right: 8%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 213, 255, 0.55), transparent);
    opacity: 0.7; transition: opacity 0.4s ease;
}
.card:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: 0 1px 0 rgba(139, 213, 255, 0.1) inset, 0 30px 70px -24px rgba(56, 189, 248, 0.25); }
.card:hover::before { opacity: 1; }

/* ── Footer ── */
footer {
    padding: 52px 48px;
    background: #04080F;
    border-top: 1px solid var(--line-soft);
}
.footer-content { display: flex; justify-content: space-between; align-items: center; max-width: var(--width-wide); margin: 0 auto; gap: 20px; flex-wrap: wrap; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; }
.footer-brand .logo-mark { width: 22px; height: 22px; }
.footer-brand span { font-family: var(--grotesk); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.footer-copy { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: 0.1em; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a {
    color: var(--muted); text-decoration: none; font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.12em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px;
    transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--sky); }
.footer-links svg { width: 14px; height: 14px; fill: #7FA6D6; }

/* ── Blog cards (homepage + listing) ── */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.post-cover { aspect-ratio: 16 / 9; overflow: hidden; background: #081120; border-bottom: 1px solid var(--line-soft); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.post-card:hover .post-cover img { transform: scale(1.03); }
.post-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-meta { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.post-tag { color: var(--sky); padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; background: rgba(56, 189, 248, 0.06); }
.post-title { font-family: var(--grotesk); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); line-height: 1.3; }
.post-excerpt { font-size: 14px; color: var(--muted); line-height: 1.7; }
.post-read { margin-top: auto; padding-top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sky); }
.post-empty { grid-column: 1 / -1; text-align: center; padding: 48px 24px; color: var(--dim); font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; border: 1px dashed var(--line); border-radius: var(--radius-card); }

/* ── Reveal (shared) ── */
.fade-in { opacity: 0; transform: translateY(22px); transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1), transform 0.85s cubic-bezier(0.22, 1, 0.36, 1); transition-delay: var(--d, 0s); }
.fade-in.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .fade-in { opacity: 1; transform: none; transition: none; }
    .card, .btn-primary, .btn-ghost, .btn-whatsapp, .post-cover img { transition: none; }
}

@media (max-width: 1024px) {
    .post-grid { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
}

@media (max-width: 768px) {
    nav { padding: 14px 22px; }
    nav.scrolled { padding: 11px 22px; }
    .nav-links, .nav-cta { display: none; }
    .nav-toggle { display: block; }
    .logo-word { font-size: 15px; }
    .logo-mark { width: 26px; height: 26px; }
    section { padding-left: 22px; padding-right: 22px; }
    .btn-primary, .btn-ghost, .btn-whatsapp { width: min(320px, 100%); justify-content: center; }
    footer { padding: 40px 22px; }
    .footer-content { flex-direction: column; text-align: center; }
}
