/* holos.dev v2 — sci-fi engineering deck */

:root {
    --void-deep: #0A1018;
    --void-mid: #141E28;
    --frost-panel: rgba(16, 24, 40, 0.85);
    --frost-panel-elev: rgba(20, 30, 40, 0.78);
    --frost-border: rgba(64, 192, 192, 0.15);
    --frost-border-strong: rgba(64, 192, 192, 0.35);
    --accent-teal: #40C0C0;
    --accent-amber: #C0A040;
    --text-light: #B0C0D0;
    --text-dim: rgba(176, 192, 208, 0.55);
    --node-glow: rgba(64, 192, 192, 0.2);
    --sidebar-w: 280px;
    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;
}

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

html, body {
    width: 100%;
    min-height: 100vh;
    background: var(--void-deep);
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: clamp(14px, 1vw, 16px);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ----- Void background ----- */
.void-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(64, 192, 192, 0.06), transparent 50%),
        radial-gradient(ellipse at 80% 90%, rgba(192, 160, 64, 0.04), transparent 55%),
        linear-gradient(180deg, #0A1018 0%, #0d1622 100%);
    pointer-events: none;
}

.void-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(64, 192, 192, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(64, 192, 192, 0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
}

.void-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ----- Shell ----- */
.app-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: var(--sidebar-w);
    background: var(--frost-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--frost-border);
    transform: translateX(-100%);
    animation: sidebarSlideIn 600ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    overflow: hidden;
}

@keyframes sidebarSlideIn {
    from { transform: translateX(-100%); opacity: 0.4; }
    to   { transform: translateX(0); opacity: 1; }
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(64, 192, 192, 0.06), transparent 30%);
    pointer-events: none;
}

.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 28px 22px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(64, 192, 192, 0.25) transparent;
}

.sidebar-inner::-webkit-scrollbar { width: 5px; }
.sidebar-inner::-webkit-scrollbar-thumb { background: rgba(64, 192, 192, 0.25); }

/* ----- Logotype ----- */
.logotype {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(24px, 2.4vw, 32px);
    color: var(--text-light);
    letter-spacing: -0.01em;
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
    user-select: none;
}

.logotype-letter {
    display: inline-block;
    transform: translateY(-12px);
    opacity: 0;
    animation:
        letterDrop 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
        letterFloat 3s ease-in-out infinite;
    animation-delay:
        calc(var(--i, 0) * 60ms),
        calc(800ms + var(--i, 0) * 200ms);
}

.logotype-letter[data-i="0"] { --i: 0; }
.logotype-letter[data-i="1"] { --i: 1; }
.logotype-letter[data-i="2"] { --i: 2; }
.logotype-letter[data-i="3"] { --i: 3; }
.logotype-letter[data-i="4"] { --i: 4; }
.logotype-letter[data-i="6"] { --i: 6; }
.logotype-letter[data-i="7"] { --i: 7; }
.logotype-letter[data-i="8"] { --i: 8; }

@keyframes letterDrop {
    to { transform: translateY(0); opacity: 1; }
}

@keyframes letterFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}

.logotype-dot {
    display: inline-block;
    color: var(--accent-teal);
    font-weight: 700;
    transform-origin: center;
    animation: dotPulse 2s ease-in-out infinite;
    margin: 0 1px;
}

@keyframes dotPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.15); }
}

.logotype-sub {
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-teal);
    opacity: 0.7;
    letter-spacing: 0.04em;
}

/* ----- Nav tree ----- */
.nav-tree {
    margin-top: 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section {
    border-bottom: 1px solid rgba(64, 192, 192, 0.06);
    padding-bottom: 6px;
    margin-bottom: 6px;
}

.nav-section:last-of-type { border-bottom: none; }

.nav-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    cursor: pointer;
    color: var(--text-light);
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: lowercase;
    letter-spacing: 0.04em;
    transition: color 200ms ease;
}

.nav-section-header:hover { color: var(--accent-teal); }

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

.nav-label {
    flex: 1;
}

.nav-chevron {
    color: var(--text-dim);
    font-size: 14px;
    transition: transform 250ms ease;
    line-height: 1;
}

.nav-section.open .nav-chevron,
.nav-children.expanded ~ .nav-chevron {
    transform: rotate(90deg);
}

.nav-section-header[data-open="true"] .nav-chevron { transform: rotate(90deg); }

.nav-children {
    list-style: none;
    overflow: hidden;
    max-height: 0;
    transition: max-height 350ms ease;
    margin: 0;
    padding-left: 26px;
}

.nav-children.expanded {
    max-height: 240px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-dim);
    cursor: pointer;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
    border-radius: 0 4px 4px 0;
}

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

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

.nav-bullet {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

/* ----- Sidebar status ----- */
.sidebar-status {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--frost-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
}

.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-key, .status-label { width: 64px; opacity: 0.8; }

.status-value {
    margin-left: auto;
    color: var(--text-light);
}

.status-value.mono { font-family: var(--font-mono); color: var(--accent-teal); }

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

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent-teal); }
    50%      { opacity: 0.5; box-shadow: 0 0 4px var(--accent-teal); }
}

/* ----- Main panel ----- */
.main-panel {
    padding: 40px clamp(24px, 4vw, 64px) 0;
    display: flex;
    flex-direction: column;
    gap: 80px;
    min-width: 0;
}

/* ----- Hero ----- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 48px;
    padding-top: 24px;
    align-items: start;
}

.hero-header {
    display: flex;
    flex-direction: column;
    gap: 24px;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeUp 700ms 200ms ease-out forwards;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border: 1px solid var(--frost-border);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-teal);
    background: rgba(64, 192, 192, 0.04);
    letter-spacing: 0.05em;
    width: max-content;
    text-transform: lowercase;
}

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

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(36px, 4.6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-light);
}

.hero-title-line {
    display: block;
}

.hero-title-line.accent {
    color: var(--accent-teal);
    background: linear-gradient(90deg, var(--accent-teal), #80E0E0 70%, var(--accent-teal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-lede {
    font-size: clamp(15px, 1.05vw, 17px);
    line-height: 1.7;
    color: var(--text-light);
    max-width: 52ch;
}

.hero-meta {
    display: flex;
    gap: 24px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.meta-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    border-left: 1px solid var(--frost-border);
}

.meta-block:first-child { border-left: 1px solid var(--frost-border-strong); }

.meta-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.meta-value {
    font-size: 18px;
    color: var(--text-light);
}

.meta-value.mono { font-family: var(--font-mono); color: var(--accent-teal); }

/* ----- Frost panel ----- */
.frost-panel {
    background: var(--frost-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--frost-border);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.frost-panel::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(64, 192, 192, 0.08), transparent);
    animation: frostShimmer 1.2s ease-out 400ms 1 forwards;
    pointer-events: none;
}

@keyframes frostShimmer {
    to { left: 100%; }
}

/* ----- Hero visualization ----- */
.hero-visualization {
    padding: 18px 18px 14px;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeUp 700ms 350ms ease-out forwards;
}

.viz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--frost-border);
    font-family: var(--font-mono);
    font-size: 12px;
}

.viz-title {
    color: var(--accent-teal);
    letter-spacing: 0.04em;
}

.viz-coord {
    color: var(--text-dim);
    font-size: 11px;
}

.viz-svg {
    flex: 1;
    width: 100%;
    height: auto;
    min-height: 360px;
}

.viz-legend {
    display: flex;
    gap: 18px;
    padding-top: 10px;
    border-top: 1px solid var(--frost-border);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid currentColor;
}

.legend-swatch.teal { background: rgba(64, 192, 192, 0.3); border-color: var(--accent-teal); }
.legend-swatch.amber { background: rgba(192, 160, 64, 0.3); border-color: var(--accent-amber); }
.legend-swatch.dim { background: rgba(176, 192, 208, 0.1); border-color: var(--text-dim); }

/* ----- SVG node and edge styling ----- */
.viz-node, .demo-node-group {
    cursor: pointer;
}

.viz-node-circle {
    fill: rgba(16, 24, 40, 0.85);
    stroke: var(--accent-teal);
    stroke-width: 1.2;
    transition: stroke-width 250ms ease, filter 300ms ease;
}

.viz-node.amber .viz-node-circle { stroke: var(--accent-amber); }
.viz-node.dim .viz-node-circle { stroke: rgba(176, 192, 208, 0.3); }

.viz-node:hover .viz-node-circle {
    stroke-width: 2;
    filter: drop-shadow(0 0 8px var(--node-glow));
}

.viz-node-label {
    font-family: var(--font-mono);
    font-size: 9px;
    fill: var(--text-dim);
    pointer-events: none;
}

.viz-node:hover .viz-node-label { fill: var(--text-light); }

.viz-edge {
    fill: none;
    stroke: var(--accent-teal);
    stroke-width: 1;
    opacity: 0.3;
    stroke-dasharray: 4 4;
    transition: opacity 250ms ease, stroke-width 250ms ease;
}

.viz-edge.active { opacity: 0.85; stroke-width: 1.5; stroke-dasharray: none; }

.viz-grid-line {
    stroke: rgba(64, 192, 192, 0.06);
    stroke-width: 0.5;
}

/* ----- Section heading ----- */
.section-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.section-rule {
    width: 24px;
    height: 1px;
    background: var(--accent-teal);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(20px, 1.8vw, 26px);
    color: var(--text-light);
    letter-spacing: -0.005em;
}

.section-index {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 12px;
}

/* ----- Features grid ----- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 18px;
}

.feature-card {
    --tiltX: 0deg;
    --tiltY: 0deg;
    --hx: 50%;
    --hy: 50%;
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform-style: preserve-3d;
    transform: perspective(800px) rotateX(var(--tiltX)) rotateY(var(--tiltY));
    transition: transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1),
                border-color 300ms ease;
    will-change: transform;
}

.feature-card:hover {
    border-color: var(--frost-border-strong);
}

.card-illustration {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--frost-border);
    margin-bottom: 8px;
    padding-bottom: 10px;
}

.card-illustration svg {
    width: 100%;
    max-width: 140px;
    height: 80px;
}

.card-id {
    font-size: 10.5px;
    color: var(--accent-teal);
    opacity: 0.85;
    letter-spacing: 0.04em;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    color: var(--text-light);
    line-height: 1.2;
}

.card-body {
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text-light);
    opacity: 0.9;
}

.card-spec {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--frost-border);
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

.card-spec span:last-child { color: var(--accent-teal); }

.card-highlight {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--hx) var(--hy),
        rgba(64, 192, 192, 0.12),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 250ms ease;
    pointer-events: none;
    border-radius: inherit;
}

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

/* ----- Demo ----- */
.demo-shell {
    padding: 18px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.demo-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--frost-border);
}

.demo-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.demo-btn {
    background: rgba(20, 30, 40, 0.5);
    border: 1px solid var(--frost-border);
    color: var(--text-light);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.demo-btn:hover {
    border-color: var(--frost-border-strong);
    color: var(--accent-teal);
}

.demo-btn.active {
    border-color: var(--accent-teal);
    background: rgba(64, 192, 192, 0.08);
    color: var(--accent-teal);
}

.demo-hint {
    font-size: 11px;
    color: var(--text-dim);
}

.hint-key {
    color: var(--accent-teal);
    border: 1px solid var(--frost-border);
    padding: 1px 6px;
    border-radius: 3px;
    margin: 0 2px;
}

.demo-stage {
    position: relative;
    min-height: 540px;
    border-radius: 6px;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(64, 192, 192, 0.05), transparent 60%),
        rgba(10, 16, 24, 0.5);
}

.demo-svg {
    width: 100%;
    height: 100%;
    min-height: 540px;
    display: block;
}

.demo-node-circle {
    fill: rgba(16, 24, 40, 0.92);
    stroke: var(--accent-teal);
    stroke-width: 1.2;
    transition: stroke-width 250ms ease, filter 250ms ease;
}

.demo-node-group.amber .demo-node-circle { stroke: var(--accent-amber); }

.demo-node-group:hover .demo-node-circle,
.demo-node-group.pinned .demo-node-circle {
    stroke-width: 2;
    filter: drop-shadow(0 0 10px var(--node-glow));
}

.demo-node-group.pinned .demo-node-circle {
    filter: drop-shadow(0 0 14px rgba(64, 192, 192, 0.5));
}

.demo-node-label {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: var(--text-dim);
    pointer-events: none;
    text-anchor: middle;
}

.demo-node-group:hover .demo-node-label,
.demo-node-group.pinned .demo-node-label { fill: var(--text-light); }

.demo-edge {
    fill: none;
    stroke: var(--accent-teal);
    stroke-width: 1;
    opacity: 0.18;
    transition: opacity 250ms ease, stroke-width 250ms ease;
}

.demo-edge.highlight { opacity: 0.9; stroke-width: 1.6; }

.demo-detail {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 240px;
    background: rgba(16, 24, 40, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--frost-border);
    border-radius: 6px;
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-light);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
}

.demo-detail.visible {
    opacity: 1;
    transform: translateY(0);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--frost-border);
}

.detail-id {
    color: var(--accent-teal);
    font-size: 12px;
}

.detail-status {
    color: var(--accent-amber);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-dim);
    font-size: 11px;
}

.detail-row span:last-child { color: var(--text-light); }

/* ----- Footer ----- */
.footer {
    margin-top: 60px;
    padding: 24px 0 32px;
}

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

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 11px;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 200ms ease;
}

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

.footer-links .sep { color: var(--frost-border-strong); }

.footer-version {
    color: var(--text-dim);
    font-size: 11px;
    letter-spacing: 0.02em;
}

/* ----- Responsive ----- */
@media (max-width: 1100px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        z-index: 50;
        transform: translateX(-100%);
        animation: none;
        opacity: 0.96;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-panel {
        padding: 28px 18px 0;
    }
    .features-grid { grid-template-columns: 1fr; }
}
