:root {
    --bg: #0d0f14;
    --fg: #e8ecf1;
    --muted: rgba(232, 236, 241, 0.6);
    --accent: #6da8ff;
    --border: #1f2430;
    --card-bg: rgba(17, 21, 28, 0.72);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: 'JetBrains Mono', monospace, -apple-system, sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

/* NAVIGATION */

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(13, 15, 20, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

nav .wrap {
    max-width: 950px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

nav .wrap::-webkit-scrollbar {
    display: none;
}

nav a {
    color: var(--fg);
    text-decoration: none;
    font-size: 12px;
    opacity: 0.7;
    transition: 0.25s;
    margin-right: 16px;
    flex-shrink: 0;
}

nav a:last-child {
    margin-right: 0;
}

nav a:hover {
    opacity: 1;
    color: var(--accent);
}

nav a.active {
    opacity: 1;
    color: var(--accent);
    font-weight: 600;
}

/* CONTAINER */

.container {
    max-width: 950px;
    margin: auto;
    padding: 110px 20px 80px;
}

/* BREADCRUMB */

.node-path {
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--accent);
    opacity: 0.85;
    margin-bottom: 12px;
    text-transform: uppercase;
}

/* TYPOGRAPHY */

h1, h2, h3, p {
    margin: 0;
}

h1 {
    font-size: 28px;
    line-height: 1.3;
    letter-spacing: -0.8px;
    border-left: 2px solid var(--accent);
    padding-left: 14px;
    margin-bottom: 12px;
}

.atlas-subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 30px;
}

/* ATLAS LAYOUT (GRID + PANEL) */

.atlas-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* MATRIX GRAPH VIEW */

.matrix-visual {
    border: 1px solid var(--border);
    background: var(--card-bg);
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.phase-node {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.25s;
    font-size: 11px;
    font-family: inherit;
    color: var(--fg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 75px;
    box-sizing: border-box;
}

.phase-node:hover {
    border-color: var(--accent);
    background: rgba(109, 168, 255, 0.05);
}

.phase-node.active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
}

.phase-node .p-id {
    font-size: 9px;
    opacity: 0.7;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.phase-node.active .p-id {
    opacity: 0.9;
    color: var(--bg);
}

/* RIGHT INSPECTION PANEL (EXPANDED SKELETON) */

.inspection-panel {
    border: 1px solid var(--border);
    background: var(--card-bg);
    padding: 24px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.panel-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.panel-tag {
    font-size: 10px;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
}

.panel-sections {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.panel-section-title {
    font-size: 10px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.9;
    margin-bottom: 2px;
}

.panel-section-body {
    font-size: 12px;
    opacity: 0.85;
    line-height: 1.5;
    word-break: break-word;
}

.panel-references-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
}

.panel-references-list li {
    margin-bottom: 4px;
}

.panel-references-list a {
    color: var(--accent);
    text-decoration: none;
}

.panel-references-list a:hover {
    text-decoration: underline;
}

.panel-metrics {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    font-size: 11px;
    opacity: 0.7;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* FOOTER */

footer {
    margin-top: 80px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
}

.footer-nav {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--fg);
    text-decoration: none;
    opacity: 0.7;
    transition: 0.2s;
}

.footer-nav a:hover {
    color: var(--accent);
    opacity: 1;
}

/* MOBILE */

@media (max-width: 768px) {
    .atlas-layout {
        grid-template-columns: 1fr;
    }
    h1 {
        font-size: 24px;
    }
    .container {
        padding-top: 90px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .matrix-visual {
        padding: 14px;
    }
    .inspection-panel {
        padding: 18px;
        min-height: auto;
    }
}
