/* =============================================
   holos.dev - Holistic System Design Platform
   Sci-fi engineering console aesthetic
   ============================================= */

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

/* CSS Custom Properties */
:root {
    --void-deep: #0A1018;
    --void-mid: #141E28;
    --frost-bg: rgba(16, 24, 40, 0.85);
    --frost-border: rgba(64, 192, 192, 0.15);
    --accent-teal: #40C0C0;
    --accent-amber: #C0A040;
    --text-light: #B0C0D0;
    --node-glow: rgba(64, 192, 192, 0.2);

    --sidebar-width: 260px;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

html {
    height: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--void-deep);
    color: var(--text-light);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.75;
    font-size: clamp(14px, 1vw, 16px);
    font-weight: 400;
}

/* =============================================
   Sidebar
   ============================================= */

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 100;
    background: var(--frost-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--frost-border);
    transform: translateX(calc(var(--sidebar-width) * -1));
    transition: transform 600ms ease-out;
    display: flex;
    flex-direction: column;
}

#sidebar.visible {
    transform: translateX(0);
}

#sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px 0;
    overflow-y: auto;
}

/* Logotype */
#logotype {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(24px, 3.5vw, 48px);
    color: var(--text-light);
    padding: 16px 24px 32px;
    letter-spacing: -0.02em;
    user-select: none;
    white-space: nowrap;
}

.logo-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.logo-char.animate {
    opacity: 1;
}

.logo-dot {
    display: inline-block;
    color: var(--accent-teal);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.logo-dot.animate {
    opacity: 1;
}

/* Nav Tree */
#nav-tree {
    flex: 1;
    padding: 0 12px;
}

.nav-section {
    margin-bottom: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    transition: background 200ms, color 200ms;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: rgba(64, 192, 192, 0.06);
    color: #fff;
}

.nav-section.active .nav-item {
    border-left-color: var(--accent-teal);
    color: var(--accent-teal);
    background: rgba(64, 192, 192, 0.08);
}

.nav-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-teal);
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-section.active .nav-icon {
    opacity: 1;
}

.nav-subitems {
    padding-left: 45px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease;
}

.nav-section.expanded .nav-subitems {
    max-height: 200px;
}

.nav-subitem {
    padding: 6px 12px;
    font-size: 13px;
    color: rgba(176, 192, 208, 0.6);
    cursor: pointer;
    border-radius: 4px;
    transition: color 200ms, background 200ms;
}

.nav-subitem:hover {
    color: var(--text-light);
    background: rgba(64, 192, 192, 0.04);
}

/* Sidebar Footer */
#sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--frost-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-version {
    font-family: var(--font-code);
    font-size: 12px;
    color: rgba(176, 192, 208, 0.4);
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-code);
    font-size: 11px;
    color: rgba(176, 192, 208, 0.5);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-teal);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* =============================================
   Main Panel
   ============================================= */

#main-panel {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    position: relative;
}

/* =============================================
   Hero Visualization
   ============================================= */

#hero-visualization {
    position: relative;
    width: 100%;
    height: 100vh;
    background: var(--void-deep);
    overflow: hidden;
}

#system-graph {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
    max-width: 600px;
    opacity: 0;
    transition: opacity 800ms ease 400ms;
}

#hero-content.visible {
    opacity: 1;
}

#hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(28px, 4vw, 56px);
    color: #fff;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

#hero-subtitle {
    font-size: clamp(14px, 1.2vw, 18px);
    color: var(--text-light);
    line-height: 1.75;
    opacity: 0.8;
}

/* SVG Node Styles */
#system-graph .node-circle {
    fill: var(--frost-bg);
    stroke: var(--accent-teal);
    stroke-width: 1.5;
    cursor: pointer;
    transition: stroke-opacity 300ms, filter 300ms;
}

#system-graph .node-circle:hover {
    stroke-opacity: 0.8;
    filter: drop-shadow(0 0 8px var(--node-glow));
}

#system-graph .node-label {
    font-family: var(--font-code);
    font-size: 10px;
    fill: var(--accent-teal);
    text-anchor: middle;
    pointer-events: none;
}

#system-graph .connection-path {
    fill: none;
    stroke: var(--accent-teal);
    stroke-opacity: 0.2;
    stroke-width: 1;
    transition: stroke-opacity 300ms;
}

#system-graph .connection-path.highlighted {
    stroke-opacity: 0.6;
    stroke-width: 1.5;
}

/* Node Detail Overlay */
#node-detail {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 320px;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms ease, transform 400ms ease;
}

#node-detail.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

#node-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--frost-border);
}

#node-detail-name {
    font-family: var(--font-code);
    font-size: 14px;
    color: var(--accent-teal);
    font-weight: 400;
}

#node-detail-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 200ms;
    line-height: 1;
}

#node-detail-close:hover {
    opacity: 1;
}

#node-detail-body {
    padding: 16px 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(64, 192, 192, 0.06);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 12px;
    color: rgba(176, 192, 208, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-family: var(--font-code);
    font-size: 13px;
    color: var(--accent-teal);
}

/* =============================================
   Frost Panel (reusable)
   ============================================= */

.frost-panel {
    background: var(--frost-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--frost-border);
    border-radius: 8px;
}

/* =============================================
   Features Section
   ============================================= */

#features-section {
    padding: 100px 60px;
    background: var(--void-deep);
    position: relative;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(22px, 2.5vw, 36px);
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: clamp(13px, 1vw, 15px);
    color: rgba(176, 192, 208, 0.6);
    margin-bottom: 48px;
}

#features-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 800px;
}

.feature-card {
    padding: 32px;
    perspective: 800px;
    transform-style: preserve-3d;
    transform: rotateX(calc(var(--tiltY, 0) * 1deg)) rotateY(calc(var(--tiltX, 0) * 1deg));
    transition: transform 100ms ease-out;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at calc(var(--mouseX, 50) * 1%) calc(var(--mouseY, 50) * 1%),
        rgba(64, 192, 192, 0.06) 0%,
        transparent 60%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 300ms;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(64, 192, 192, 0.08), transparent);
    animation: shimmerSweep 400ms ease forwards;
    pointer-events: none;
}

@keyframes shimmerSweep {
    0% { left: -50%; }
    100% { left: 150%; }
}

.feature-icon {
    margin-bottom: 20px;
}

.feature-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    margin-bottom: 10px;
}

.feature-desc {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.75;
    opacity: 0.8;
}

/* =============================================
   Demo Section
   ============================================= */

#demo-section {
    padding: 80px 60px;
    background: var(--void-mid);
    position: relative;
}

#demo-container {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    background: var(--void-deep);
    border: 1px solid var(--frost-border);
    position: relative;
    overflow: hidden;
    margin-top: 32px;
}

#demo-graph {
    width: 100%;
    height: 100%;
}

#demo-graph .demo-node {
    cursor: grab;
}

#demo-graph .demo-node:active {
    cursor: grabbing;
}

#demo-graph .demo-node-circle {
    fill: var(--frost-bg);
    stroke: var(--accent-teal);
    stroke-width: 1.5;
    transition: stroke-opacity 300ms, filter 300ms;
}

#demo-graph .demo-node:hover .demo-node-circle {
    stroke-opacity: 0.8;
    filter: drop-shadow(0 0 10px var(--node-glow));
}

#demo-graph .demo-node-label {
    font-family: var(--font-code);
    font-size: 9px;
    fill: var(--accent-teal);
    text-anchor: middle;
    pointer-events: none;
}

#demo-graph .demo-connection {
    fill: none;
    stroke: var(--accent-teal);
    stroke-opacity: 0.2;
    stroke-width: 1;
    transition: stroke-opacity 300ms;
}

#demo-graph .demo-connection.highlighted {
    stroke-opacity: 0.6;
}

/* =============================================
   Footer
   ============================================= */

#main-footer {
    padding: 32px 60px;
    background: var(--void-deep);
}

.footer-rule {
    height: 1px;
    background: var(--frost-border);
    margin-bottom: 24px;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-code);
    font-size: 12px;
}

.footer-link {
    color: rgba(176, 192, 208, 0.5);
    cursor: pointer;
    transition: color 200ms;
}

.footer-link:hover {
    color: var(--accent-teal);
}

.footer-separator {
    color: rgba(176, 192, 208, 0.2);
}

.footer-spacer {
    flex: 1;
}

.footer-version {
    color: rgba(176, 192, 208, 0.3);
}

/* =============================================
   Utility
   ============================================= */

.hidden {
    display: none;
}

/* =============================================
   Entrance Animations
   ============================================= */

@keyframes nodeAppear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pathDraw {
    from {
        stroke-dashoffset: var(--path-length, 500);
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* Logotype character oscillation (applied via JS) */
@keyframes charFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(var(--float-distance, -2px));
    }
}

/* Logo dot heartbeat */
@keyframes dotPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.logo-dot.animate {
    animation: dotPulse 2s ease-in-out infinite;
}

.logo-char.floating {
    animation: charFloat var(--float-duration, 3s) ease-in-out infinite;
    animation-delay: var(--float-delay, 0s);
}

/* =============================================
   Scrollbar
   ============================================= */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(64, 192, 192, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(64, 192, 192, 0.3);
}
