/* ==========================================================================
   Ashlar Blue — Master Institutional Design System (Shared CSS)
   ========================================================================== */

:root {
    --ground: #040508;
    --surface-card: rgba(8, 14, 28, 0.78);
    --surface-card-hover: rgba(14, 24, 48, 0.85);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-cobalt: rgba(46, 107, 255, 0.28);
    --border-cobalt-hover: rgba(0, 210, 255, 0.5);
    --ink-primary: #ffffff;
    --ink-muted: #c8daf8;
    --ink-dim: #7d9bc8;
    --cobalt: #2e6bff;
    --cobalt-deep: #102a7a;
    --sapphire: #00d2ff;
    --sapphire-glow: rgba(0, 210, 255, 0.35);
    --emerald: #10b981;
    --gold: #f59e0b;
    --font-display: 'Space Grotesk', -apple-system, sans-serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Strict 0px Hard Corners Enforcement for Ashlar Stonework ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0px !important;
}
html {
    scroll-behavior: smooth;
    max-width: 100vw;
    overflow-x: clip;
}

body {
    background-color: var(--ground);
    color: var(--ink-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    max-width: 100vw;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

section, .section, [id] {
    scroll-margin-top: 100px;
}

/* ── Master Enterprise Header (Dynamic Fortress Scale with Silky Scroll Contraction) ── */
header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px clamp(24px, 5vw, 80px);
    background: rgba(4, 8, 20, 0.90);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(0, 210, 255, 0.25);
    box-shadow: 0 10px 40px rgba(0, 4, 16, 0.85);
    transition: padding 0.3s var(--ease), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    padding: 12px clamp(24px, 5vw, 80px);
    background: rgba(2, 6, 16, 0.98);
    border-bottom-color: rgba(0, 210, 255, 0.45);
    box-shadow: 0 14px 50px rgba(0, 0, 0, 0.95);
}

.brand-logo {
    display: flex; align-items: center; gap: 14px;
    text-decoration: none; color: inherit;
    position: relative;
    transition: gap 0.3s var(--ease);
}

header.scrolled .brand-logo {
    gap: 11px;
}

/* ── Seamless Hover Bridge so moving cursor to button never breaks hover ── */
.brand-logo::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 28px;
    background: transparent;
    pointer-events: auto;
}

/* ── Smooth Logo "Home" Button (Electric Ashlar Blue Match) ── */
.brand-logo::after {
    content: '⌂ HOME';
    position: absolute;
    top: calc(100% + 6px);
    left: 56px; /* Aligned under the words Ashlar Blue */
    background: linear-gradient(180deg, rgba(0, 210, 255, 0.28) 0%, rgba(46, 107, 255, 0.45) 100%);
    border: 1px solid var(--sapphire);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 8px 18px;
    border-radius: 0px;
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.55), 0 10px 30px rgba(0, 0, 0, 0.9), inset 0 0 10px rgba(0, 210, 255, 0.30);
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s ease;
    pointer-events: auto;
    cursor: pointer;
    white-space: nowrap;
    z-index: 1000;
}

/* Fade in Electric Ashlar Blue button on brand hover */
.brand-logo:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ── Mobile & Tablet: Disable hover popup for pure 1-tap touch navigation ── */
@media (max-width: 960px), (hover: none) {
    .brand-logo::after,
    .brand-logo::before {
        display: none !important;
    }
}

.ashlar-logo-svg {
    width: 44px; height: 48px;
    display: block;
    transform-origin: center center;
    filter: drop-shadow(0 0 16px rgba(0, 210, 255, 0.75));
    transition: width 0.3s var(--ease), height 0.3s var(--ease), filter 0.3s ease;
}

header.scrolled .ashlar-logo-svg {
    width: 32px; height: 36px;
    filter: drop-shadow(0 0 12px rgba(0, 210, 255, 0.65));
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.brand-title {
    font-family: var(--font-display);
    font-size: 24px; font-weight: 800; color: #ffffff;
    letter-spacing: 0.04em; line-height: 1.05; text-transform: uppercase;
    transition: font-size 0.3s var(--ease);
}

header.scrolled .brand-title {
    font-size: 19px;
}

.brand-title .blue-accent, .brand-title span {
    color: var(--sapphire);
    text-shadow: 0 0 18px rgba(0, 210, 255, 0.75);
}

.brand-sub {
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--sapphire); letter-spacing: 0.20em;
    text-transform: uppercase; font-weight: 700;
    margin-top: 3px;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.45);
    transition: font-size 0.3s var(--ease), opacity 0.3s ease;
}

header.scrolled .brand-sub {
    font-size: 9px;
    margin-top: 1px;
}

/* ── Ashlar Precision Fit Navigation (Electric Sapphire & Cobalt) ── */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    background: rgba(8, 18, 44, 0.85);
    border: 1px solid rgba(0, 210, 255, 0.40);
    padding: 4px 6px;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.15);
    backdrop-filter: blur(16px);
}

.nav-link {
    color: #93c5fd;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 8px 18px;
    transition: all 0.2s var(--ease);
    border: 1px solid transparent;
    text-transform: uppercase;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
    background: linear-gradient(180deg, rgba(0, 210, 255, 0.24) 0%, rgba(46, 107, 255, 0.38) 100%);
    border-color: var(--sapphire);
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.50);
}

.header-actions { display: flex; align-items: center; gap: 14px; }

/* ── Agent MCP Drawer Toggle & Button (Luminous Sapphire) ── */
.btn-mcp-toggle {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.14) 0%, rgba(46, 107, 255, 0.24) 100%);
    border: 1px solid rgba(0, 210, 255, 0.50);
    color: var(--sapphire);
    font-family: var(--font-mono);
    font-size: 13px; font-weight: 700;
    padding: 9px 18px; border-radius: 0px;
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    transition: all 0.2s ease;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.18);
}

.btn-mcp-toggle:hover {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.30) 0%, rgba(46, 107, 255, 0.45) 100%);
    border-color: #ffffff;
    box-shadow: 0 0 26px rgba(0, 210, 255, 0.70);
    color: #ffffff;
    text-shadow: 0 0 14px #ffffff;
}

.mcp-pulse {
    width: 8px; height: 8px; border-radius: 0px;
    background: var(--sapphire);
    box-shadow: 0 0 12px var(--sapphire);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

.btn-header-cta {
    background: linear-gradient(135deg, var(--cobalt), #133db5);
    color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: var(--font-sans); font-size: 14px; font-weight: 700;
    padding: 9px 20px; border-radius: 0px; text-decoration: none;
    transition: all 0.25s var(--ease);
}

.btn-header-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(46, 107, 255, 0.6);
}

/* ── Slide-over MCP Drawer ── */
.mcp-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px); z-index: 2000;
    opacity: 0; visibility: hidden; pointer-events: none;
    display: none;
    transition: opacity 0.3s var(--ease), visibility 0.3s ease;
}

.mcp-backdrop.active {
    opacity: 1; visibility: visible; pointer-events: auto;
    display: block;
}

.mcp-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(640px, 92vw);
    background: #060912;
    border-left: 1px solid var(--border-cobalt);
    z-index: 2001;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s var(--ease), visibility 0.35s ease;
    padding: clamp(20px, 5vw, 40px);
    display: flex; flex-direction: column;
    overflow-y: auto;
    box-shadow: -20px 0 80px rgba(0, 0, 0, 0.9);
}

.mcp-backdrop.active .mcp-drawer {
    transform: translateX(0);
    visibility: visible;
}

.drawer-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 28px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.drawer-title { font-size: 22px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 10px; }
.drawer-close {
    background: rgba(255, 255, 255, 0.08); border: none; color: #fff;
    width: 32px; height: 32px; border-radius: 0px; font-size: 18px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ── Master Institutional Footer with Clean Obsidian Gradient (Generous Fortress Headroom) ── */
footer {
    background: linear-gradient(180deg, rgba(2, 6, 20, 0.96) 0%, #010208 100%);
    border-top: 1px solid rgba(0, 210, 255, 0.25);
    margin-top: clamp(80px, 10vw, 140px);
    padding: clamp(100px, 9vw, 140px) clamp(24px, 5vw, 80px) 48px;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, #00d2ff, transparent);
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.7);
}

.footer-grid {
    max-width: 1380px; margin: 0 auto;
    display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: 40px; margin-bottom: 48px;
}

.footer-col-h {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 20px;
}

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { 
    color: var(--sapphire); 
    text-decoration: none; 
    font-size: 14px; 
    transition: all 0.2s ease; 
}
.footer-links a:hover { 
    color: #ffffff; 
    text-shadow: 0 0 12px rgba(0, 210, 255, 0.85); 
    transform: translateX(3px);
}

.footer-email-link {
    color: var(--sapphire) !important;
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 0;
    transition: all 0.2s ease;
    border-bottom: 1px dashed rgba(0, 210, 255, 0.4);
}

.footer-email-link:hover {
    color: #ffffff !important;
    text-shadow: 0 0 14px rgba(0, 210, 255, 0.95);
    border-bottom-color: #ffffff;
    transform: translateX(3px);
}

.footer-email-link .email-icon {
    color: #38bdf8;
    font-size: 12px;
}

.footer-bottom {
    max-width: 1380px; margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-dim);
}

/* ── Universal Subpage Framework (Scaled for 14" Laptop Displays) ── */
.page-hero {
    padding: 110px clamp(24px, 5vw, 80px) 44px;
    max-width: 1380px;
    margin: 0 auto;
    border-bottom: 1px solid var(--border-cobalt);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(46, 107, 255, 0.15);
    border: 1px solid rgba(0, 210, 255, 0.35);
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--sapphire);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 18px;
}

.page-h1 {
    font-family: var(--font-display);
    font-size: clamp(24px, 2.6vw, 36px);
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
    margin-bottom: 22px;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.page-lead {
    font-size: clamp(16px, 1.2vw, 18.5px);
    color: var(--ink-muted);
    max-width: 780px;
    line-height: 1.75;
    margin-bottom: 32px;
}

.content-card {
    background: var(--surface-card);
    border: 1px solid var(--border-cobalt);
    padding: 30px;
    position: relative;
}

.content-card p, .card-p {
    font-size: 16.5px;
    line-height: 1.80;
    color: var(--ink-muted);
    margin-bottom: 20px;
}
.content-card p:last-child, .card-p:last-child {
    margin-bottom: 0;
}

.card-h {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 24px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    line-height: 1.25;
}

.content-card::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px dashed rgba(0, 210, 255, 0.18);
    pointer-events: none;
}

.code-block {
    background: #020306;
    border: 1px solid rgba(0, 210, 255, 0.2);
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #38bdf8;
    line-height: 1.65;
    overflow-x: auto;
    margin: 14px 0;
}

@media (max-width: 960px) {
    header { padding: 14px 20px; }
    header.scrolled { padding: 10px 20px; }
    .brand-title { font-size: 18px; }
    .brand-sub { font-size: 9px; }
    .nav-menu { display: none; }
    .page-hero { padding: 88px 20px 32px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    h1, .hero-title, .page-title { font-size: clamp(24px, 5.5vw, 40px); line-height: 1.2; }
    h2, .section-title { font-size: clamp(20px, 4.5vw, 30px); }
    .card, .glass-card, .matrix-card { padding: 24px 20px; }
}

@media (max-width: 640px) {
    header { padding: 10px 16px; }
    header.scrolled { padding: 8px 16px; }
    .ashlar-logo-svg { width: 34px; height: 38px; }
    .brand-title { font-size: 16px; }
    .brand-sub { font-size: 8.5px; }
    .page-hero { padding: 68px 16px 24px; }
    .hero-badge { margin-bottom: 10px; font-size: 10.5px; }
    .page-h1 { font-size: clamp(24px, 6vw, 32px); margin-bottom: 12px; }
    .page-lead { font-size: 14.5px; margin-bottom: 18px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
    h1, .hero-title, .page-title { font-size: clamp(22px, 6vw, 28px); }
    .hero-lead, .lead { font-size: 14.5px; line-height: 1.6; }
    .card, .glass-card, .matrix-card { padding: 20px 16px; }
    .code-block { font-size: 11.5px; padding: 12px 14px; }
    .badge-cluster { gap: 8px; }
}

/* ── Sovereign Patent & Standard Micro-Capsules ── */
.badge-cluster {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.patent-capsule {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: linear-gradient(135deg, rgba(8, 24, 60, 0.90), rgba(2, 10, 28, 0.96));
    border: 1px solid rgba(0, 210, 255, 0.55);
    padding: 7px 16px;
    border-radius: 0px;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
}

.patent-capsule span.patent-text {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 800;
    color: var(--sapphire);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.6);
}

.tailored-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 14, 34, 0.75);
    border: 1px solid rgba(46, 107, 255, 0.35);
    padding: 7px 16px;
    border-radius: 0px;
    backdrop-filter: blur(12px);
}

/* ── Universal Mobile Navigation Hamburger & Drawer System ── */
.mobile-hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
}

.mobile-hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #00d2ff, #2e6bff);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-hamburger-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
}

.mobile-hamburger-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 4, 10, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 86vw);
    background: #040814;
    border-left: 1px solid var(--border-cobalt);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.95);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    z-index: 2001;
}

.mobile-nav-backdrop.active .mobile-nav-drawer {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(46, 107, 255, 0.2);
}

.mobile-nav-brand {
    font-family: var(--font-cinzel);
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-nav-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(46, 107, 255, 0.3);
    color: var(--ink-primary);
    width: 32px;
    height: 32px;
    border-radius: 0px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.mobile-nav-close:hover {
    background: rgba(0, 210, 255, 0.2);
    border-color: var(--sapphire);
    color: var(--sapphire);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 28px 0;
}

.mobile-nav-link {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-muted);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 0px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--sapphire);
    background: rgba(0, 210, 255, 0.06);
    border-left-color: var(--sapphire);
    padding-left: 18px;
}

.mobile-nav-footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 20px;
    border-top: 1px solid rgba(46, 107, 255, 0.2);
}

.btn-mcp-toggle-mobile {
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid var(--sapphire);
    color: var(--sapphire);
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 700;
    padding: 11px 14px;
    border-radius: 0px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.08em;
    transition: all 0.2s ease;
}

.btn-mcp-toggle-mobile:hover {
    background: rgba(0, 210, 255, 0.18);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

.btn-lab-mobile {
    background: linear-gradient(135deg, #00d2ff, #2e6bff);
    color: #020617;
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 800;
    padding: 11px 14px;
    border-radius: 0px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.08em;
    transition: all 0.2s ease;
}

.btn-lab-mobile:hover {
    box-shadow: 0 0 25px rgba(0, 210, 255, 0.6);
}

.mobile-nav-meta {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
}

@media (max-width: 960px) {
    .mobile-hamburger-btn {
        display: flex;
    }
}
