/* assets/components.css */

/* --- NAVIGATION --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(3, 3, 4, 0.85);
    /* Slightly darker/more opaque for institutional feel */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

/* Dynamic Depth + Vignette */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(900px 520px at calc(50% + var(--mouse-x, 0px)) calc(18% + var(--mouse-y, 0px)), rgba(212, 175, 55, 0.08), transparent 62%),
        radial-gradient(820px 520px at calc(85% - var(--mouse-x, 0px)) calc(70% - var(--mouse-y, 0px)), rgba(212, 175, 55, 0.045), transparent 65%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.6));
    opacity: 1;
    transition: opacity 0.5s ease;
    transform: translate(var(--mouse-x, 0px), var(--mouse-y, 0px));
}

body.mouse-moving::after {
    /* Slight shift enabling via JS transform */
    transition: transform 0.1s linear;
}

.nav-inner {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.1rem;
    font-weight: 700;
    /* Clean weight */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    gap: 8px;
}

.brand-primary {
    color: var(--text-primary);
}

.brand-secondary {
    color: var(--accent-primary);
}

.site-nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: background 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: transform 0.3s, top 0.3s;
    left: 0;
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    top: 6px;
}

/* Mobile Nav Logic */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .site-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px;
        background: var(--bg-void);
        padding: 80px 32px 32px;
        flex-direction: column;
        align-items: flex-start;
        border-left: 1px solid var(--border-subtle);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .site-nav.is-open {
        transform: translateX(0);
    }

    .nav-link {
        font-size: 1rem;
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-link::after {
        display: none;
    }

    .nav-cta {
        margin-top: 24px;
        width: 100%;
        text-align: center;
    }

    /* Animate Hamburger */
    .nav-toggle[aria-expanded="true"] .hamburger {
        background: transparent;
    }

    .nav-toggle[aria-expanded="true"] .hamburger::before {
        top: 0;
        transform: rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] .hamburger::after {
        top: 0;
        transform: rotate(-45deg);
    }
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-cta {
    background: transparent;
    border: 1px solid var(--border-highlight);
    padding: 8px 18px;
    border-radius: 2px;
    color: var(--accent-primary);
    font-family: var(--font-sans);
    /* Use Sans for primary UI actions generally, Mono for data */
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

/* Institutional Gold Hover: Dark Text */
.nav-cta:hover {
    background: var(--accent-primary);
    color: #050505;
    border-color: var(--accent-primary);
}

/* --- HERO SECTION --- */
/* Institutional: No grid, subtle radial glow, vignette */
.hero {
    min-height: 80vh;
    /* Reduced from 90vh to fix spacing */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-top: var(--header-height);
    /* Subtle background drift handled by body::after now, but keeping a fallback or adjusting */
    background: transparent;
    overflow: hidden;
}

/* Optional noise overlay via CSS */
.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
}

.hero-tag {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 32px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.hero h1 {
    /* Responsive Clamp: Min 2.5rem, Preferred 5vw, Max 4.5rem */
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 700;
    color: #f8fafc;
    /* Solid near-white */
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.15rem;
    text-align: center;
    max-width: 600px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    /* Space before next element */
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: 2px;
    /* Sharp institutional look */
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
}

.btn-primary {
    background: #f1f5f9;
    /* Off-white */
    color: #0f172a;
    /* Dark text */
    border: 1px solid transparent;
}

.btn-primary:hover {
    background: var(--accent-primary);
    /* Gold */
    color: #050505;
    /* Black text */
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: #f8fafc;
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.02);
}

/* =========================
   CAPABILITY CONSOLE (NEW)
   Premium interactive replacement for old 4-box grid
========================= */

.capability-console-section {
    padding-top: 56px;
    padding-bottom: 56px;
}

.console-head {
    text-align: left;
    margin-bottom: 28px;
    max-width: 880px;
}

.console-kicker {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.console-title {
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

.console-subtitle {
    color: var(--text-secondary);
    max-width: 62ch;
    line-height: 1.6;
    margin: 0;
    font-size: 0.98rem;
}

.capability-console {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
    align-items: stretch;
    position: relative;
}

.capability-console::before {
    content: "";
    position: absolute;
    inset: -18px;
    background: radial-gradient(circle at 30% 20%, rgba(212, 175, 55, 0.09), transparent 55%),
        radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.05), transparent 60%);
    filter: blur(2px);
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
}

.capability-tabs,
.capability-panel {
    position: relative;
    z-index: 1;
}

.capability-tabs {
    border: 1px solid var(--border-subtle);
    background: rgba(10, 10, 12, 0.55);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    overflow: hidden;
}

.cap-tab {
    width: 100%;
    text-align: left;
    padding: 18px 18px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    display: grid;
    grid-template-columns: 42px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 6px;
    transition: background 0.18s ease, border-color 0.18s ease;
    position: relative;
}

.cap-tab:last-child {
    border-bottom: none;
}

.cap-tab::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 2px;
    width: 0%;
    background: var(--accent-primary);
    transition: width 0.22s ease;
    opacity: 0.9;
}

.cap-tab:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(212, 175, 55, 0.3);
}

.cap-tab:hover::after {
    width: 100%;
}

.cap-tab.is-active {
    background: rgba(255, 255, 255, 0.035);
}

.cap-tab.is-active::after {
    width: 100%;
}

.cap-tab-kicker {
    grid-row: 1 / span 2;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 6px;
    height: 36px;
    width: 36px;
}

.cap-tab-title {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--text-primary);
    letter-spacing: -0.005em;
}

.cap-tab-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

.capability-panel {
    border: 1px solid var(--border-subtle);
    background: rgba(14, 14, 16, 0.55);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    overflow: hidden;
    min-height: 240px;
    position: relative;
}

.capability-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(to right,
            rgba(255, 255, 255, 0.035) 0px,
            rgba(255, 255, 255, 0.035) 1px,
            transparent 1px,
            transparent 80px);
    opacity: 0.18;
    pointer-events: none;
}

.capability-panel::after {
    /* sheen sweep on change (triggered via JS class) */
    content: "";
    position: absolute;
    top: -40%;
    left: -60%;
    width: 60%;
    height: 220%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.12), transparent);
    transform: rotate(12deg);
    opacity: 0;
    pointer-events: none;
}

.capability-panel.is-sheen::after {
    animation: panelSheen 0.55s ease;
}

@keyframes panelSheen {
    0% {
        opacity: 0;
        transform: translateX(0) rotate(12deg);
    }

    15% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(220%) rotate(12deg);
    }
}

.capability-panel-inner {
    position: relative;
    padding: 22px 22px 18px;
}

.panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.panel-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.10);
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
}

.panel-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.panel-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.85);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12);
    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.38);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(212, 175, 55, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

.panel-title {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.panel-desc {
    margin: 0 0 14px 0;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 70ch;
    font-size: 0.98rem;
}

.panel-bullets {
    margin: 0 0 18px 0;
    padding-left: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.panel-bullets li {
    margin: 6px 0;
}

.panel-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 14px;
}

.panel-metrics {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.metric-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.metric-value {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-top: 2px;
}

.panel-cta.btn.btn-secondary {
    padding: 12px 18px;
}

/* Responsive: stack */
@media (max-width: 960px) {
    .capability-console {
        grid-template-columns: 1fr;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .capability-panel.is-sheen::after {
        animation: none;
    }
}

/* --- PORTAL PREVIEW SECTION (NEW) --- */
.portal-section {
    position: relative;
    padding-bottom: 80px;
    margin-top: 40px;
}

.portal-container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(20, 20, 23, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    height: 500px;
    overflow: hidden;
}

/* Sidebar */
.portal-sidebar {
    width: 240px;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid var(--border-subtle);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
}

.sidebar-tree {
    list-style: none;
    padding: 0;
}

.sidebar-tree li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 0;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-tree li::before {
    content: "📁";
    /* Simple unicode folder, can replace with SVG if strictly needed but robust for pure CSS */
    font-size: 0.9em;
    opacity: 0.6;
    filter: grayscale(1);
}

.sidebar-tree li.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding-left: 8px;
    border-radius: 4px;
    margin-left: -8px;
}

.sidebar-tree li.active::before {
    filter: none;
}

.sidebar-tree li:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    cursor: pointer;
}

/* Main Content */
.portal-main {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.portal-topbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.portal-breadcrumb {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
}

.doc-table th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.doc-table td {
    padding: 12px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.col-name {
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.col-name::before {
    content: "📄";
    font-size: 0.9em;
    opacity: 0.7;
    filter: grayscale(1);
}

/* Chips */
.status-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-updated {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* (Removed duplicates) */


/* --- CARDS (Value Pillars) --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 40px;
    /* Increased padding */
    transition: all 0.3s ease;
    /* No ease-out var to keep simple */
    position: relative;
    border-radius: 2px;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.25);
    /* No translateY */
}

.card-icon {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-size: 0.8rem;
    margin-bottom: 24px;
    display: block;
    opacity: 0.9;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.card p {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.6;
    color: var(--text-secondary);
}


/* --- FOOTER CONSOLE (Institutional Upgrade) --- */
footer {
    background: rgba(5, 5, 8, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    padding: 60px 0 24px;
    position: relative;
    overflow: hidden;
    margin-top: 80px;
}

footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.4;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.footer-brand-col {
    max-width: 400px;
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 16px 0 24px;
    max-width: 300px;
    line-height: 1.5;
}

.calibration-row {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    display: flex;
    gap: 8px;
    align-items: center;
    opacity: 0.7;
}

.calibration-kicker {
    color: var(--accent-primary);
    font-weight: 600;
    letter-spacing: 0.1em;
}

.footer-nav-col {
    text-align: right;
}

.footer-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-family: var(--font-mono);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 24px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.protocol-line {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.05em;
}

/* Animations + Mobile */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* CTA Card Override */
.card--cta {
    text-align: center;
    border-color: var(--accent-primary);
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.05), transparent);
}

.card--cta p {
    margin: 0 auto 32px auto;
    max-width: 500px;
}

@media (max-width: 768px) {
    .footer-top {
        flex-direction: column;
        gap: 40px;
    }

    .footer-nav-col {
        text-align: left;
    }

    .calibration-row {
        flex-wrap: wrap;
    }

    .portal-container {
        height: auto;
        flex-direction: column;
    }

    .portal-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }
}