/* miris-project.net — Technical Documentation Portal */

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

:root {
    --bg-main: #FFFFFF;
    --bg-sidebar: #F7F8FA;
    --bg-code: #F0F2F5;
    --text-heading: #1A1F36;
    --text-body: #3E4C5E;
    --text-muted: #8B95A5;
    --accent-blue: #2E5AAC;
    --accent-hover: #1A73E8;
    --border: #E2E6EA;
    --accent-green: #0D9F6E;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background: var(--bg-main);
    color: var(--text-body);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.sidebar-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-heading);
}

.sidebar-version {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-left: 3px solid transparent;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease, border-color 0.2s ease;
}

.nav-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.nav-item:hover {
    background: #EEF0F4;
}

.nav-item.active {
    border-left-color: var(--accent-blue);
    background: rgba(46, 90, 172, 0.04);
}

.nav-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-status.green {
    background: var(--accent-green);
}

.nav-status.blue {
    background: var(--accent-blue);
}

.nav-status.gray {
    background: var(--text-muted);
}

.nav-link {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: var(--text-body);
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav-item:hover .nav-link {
    color: var(--text-heading);
}

.nav-item.active .nav-link {
    color: var(--accent-blue);
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-stat {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 11px;
    color: var(--text-muted);
    width: 100%;
}

.stat-value {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--text-heading);
}

.sparkline {
    width: 60px;
    height: 20px;
}

/* Main Content */
#main-content {
    margin-left: 260px;
    flex: 1;
    padding: 32px 48px;
    max-width: calc(760px + 96px + 260px);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.breadcrumb.visible {
    opacity: 1;
}

.crumb {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--text-muted);
}

.crumb.active {
    color: var(--accent-blue);
}

.crumb-sep {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--border);
}

/* Document Sections */
.doc-section {
    margin-bottom: 64px;
    position: relative;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.doc-section.reveal {
    opacity: 1;
    transform: translateY(0);
}

.section-number {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 14px;
    color: var(--text-muted);
    position: absolute;
    left: -44px;
    top: 6px;
}

.section-h1 {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 32px;
    letter-spacing: -0.01em;
    color: var(--text-heading);
    margin-bottom: 24px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.section-h1.visible {
    opacity: 1;
}

h2 {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 24px;
    letter-spacing: -0.01em;
    color: var(--text-heading);
    margin-bottom: 16px;
}

h3 {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 20px;
    letter-spacing: -0.01em;
    color: var(--text-heading);
    margin-bottom: 12px;
}

.doc-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-body);
    margin-bottom: 20px;
    max-width: 760px;
}

.doc-text code {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: var(--accent-blue);
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.doc-text code:hover {
    background: #E8EDFB;
}

.doc-list {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-body);
    margin-bottom: 20px;
    padding-left: 24px;
    max-width: 760px;
}

.doc-list li {
    margin-bottom: 8px;
}

.doc-list strong {
    color: var(--text-heading);
}

/* Summary Lines (line-by-line reveal) */
.summary-line {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-body);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.summary-line.visible {
    opacity: 1;
}

#summary-lines {
    margin-bottom: 24px;
    max-width: 760px;
}

/* Code Blocks */
.code-block {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
    max-width: 760px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.code-block.reveal {
    opacity: 1;
    transform: translateY(0);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.5);
}

.code-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: var(--text-muted);
}

.copy-btn {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.code-block:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: var(--bg-main);
    color: var(--text-heading);
}

.code-content {
    padding: 16px;
    margin: 0;
    overflow-x: auto;
}

.code-content code {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-heading);
}

/* Data Table */
.data-table {
    max-width: 760px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

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

thead {
    background: var(--bg-code);
}

th {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

td {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: var(--text-body);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

.status-badge {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.status-badge.green {
    color: var(--accent-green);
    background: rgba(13, 159, 110, 0.1);
}

.status-badge.blue {
    color: var(--accent-blue);
    background: rgba(46, 90, 172, 0.1);
}

/* Diagram Container */
.diagram-container {
    position: relative;
    margin: 32px -48px;
    padding: 32px 48px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-main);
    margin-bottom: 24px;
}

.diagram-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
}

.isometric-diagram {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: block;
}

.diagram-layer {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.diagram-container.reveal .diagram-layer {
    opacity: 1;
}

.diagram-container.reveal .layer-1 { transition-delay: 0s; }
.diagram-container.reveal .layer-2 { transition-delay: 0.2s; }
.diagram-container.reveal .layer-3 { transition-delay: 0.4s; }
.diagram-container.reveal .layer-connections { transition-delay: 0.6s; }
.diagram-container.reveal .layer-nodes { transition-delay: 0.8s; }
.diagram-container.reveal .layer-arrows { transition-delay: 1.0s; }

/* Network node hover */
.network-node {
    transition: stroke 0.2s ease;
    cursor: pointer;
}

.network-node:hover {
    stroke: var(--accent-green);
    stroke-width: 2;
}

/* Links */
a {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        display: none;
    }

    #main-content {
        margin-left: 0;
        padding: 24px 16px;
    }

    .section-number {
        position: static;
        margin-bottom: 4px;
    }

    .diagram-container {
        margin: 24px -16px;
        padding: 24px 16px;
    }
}
