/**
 * Стили Nodeolite — hero, орбиты, демо нод, карточки, CTA.
 * Тема: theme.css. Базовые: base.css (section-dark, section-alt, block-title-calendar уже там).
 */

/* ——— Hero Nodeolite ——— */
.hero-nodeolite {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: radial-gradient(ellipse at 50% 50%, rgba(var(--vt-theme-rgb), 0.12) 0%, transparent 50%),
                radial-gradient(ellipse at 20% 80%, rgba(var(--vt-accent-rgb), 0.08) 0%, transparent 40%),
                var(--vt-darker);
    position: relative;
    overflow: hidden;
}

.hero-nodeolite .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: vt-fadeInUp 1s ease-out;
}

.hero-badge-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 40px;
}

.hero-nodeolite .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(var(--vt-accent-rgb), 0.2);
    border: 1px solid rgba(var(--vt-accent-rgb), 0.4);
    border-radius: 50px;
    backdrop-filter: blur(5px);
}

.hero-nodeolite .hero-badge span {
    color: var(--vt-accent);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-nodeolite .hero-title {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.1;
}

.hero-nodeolite .hero-title.gradient-text {
    background: linear-gradient(135deg, var(--vt-accent), var(--vt-theme));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-nodeolite .hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--vt-gray);
    max-width: 680px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.hero-nodeolite .hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Орбиты — тема */
.hero-nodeolite .orbit-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    pointer-events: none;
    opacity: 0.2;
}

.hero-nodeolite .orbit {
    position: absolute;
    border: 1px dashed rgba(var(--vt-theme-rgb), 0.3);
    border-radius: 50%;
}

.hero-nodeolite .orbit-1 { top: 0; left: 0; width: 500px; height: 500px; animation: vt-orbit-rotate 20s linear infinite; }
.hero-nodeolite .orbit-2 { top: 80px; left: 80px; width: 340px; height: 340px; border-color: rgba(var(--vt-accent-rgb), 0.2); animation: vt-orbit-reverse 25s linear infinite; }
.hero-nodeolite .orbit-3 { top: 160px; left: 160px; width: 180px; height: 180px; border-color: rgba(255,255,255,0.1); animation: vt-orbit-rotate 15s linear infinite; }

.hero-nodeolite .satellite {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--vt-theme-light);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(var(--vt-theme-rgb), 0.5);
    animation: vt-float 6s ease-in-out infinite;
}

.hero-nodeolite .satellite:nth-child(1) { top: 10%; left: 10%; }
.hero-nodeolite .satellite:nth-child(2) { top: 15%; right: 10%; animation-delay: 1s; background: var(--vt-accent); }
.hero-nodeolite .satellite:nth-child(3) { bottom: 20%; left: 15%; animation-delay: 2s; background: var(--vt-theme); }
.hero-nodeolite .satellite:nth-child(4) { bottom: 15%; right: 20%; animation-delay: 3s; }

/* Карточки возможностей — тема (base .feature-card) */
#features .feature-icon svg {
    color: var(--vt-theme);
    stroke: currentColor;
    fill: none;
}

/* Демо: канвас нод */
.node-demo {
    margin: 60px auto;
    max-width: 1000px;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #1a1a1b;
    position: relative;
}

.node-demo-header {
    background: #252527;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.node-demo-logo { font-size: 18px; font-weight: 700; color: white; }

.node-demo-toolbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.node-demo-lang {
    display: flex;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}

.node-demo-lang span {
    padding: 4px 10px;
    border-radius: 6px;
    cursor: default;
}

.node-demo-lang .active {
    background: rgba(var(--vt-theme-rgb), 0.2);
    color: var(--vt-theme-light);
}

.node-demo-lang .inactive {
    color: rgba(255,255,255,0.4);
}

.node-demo-add {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--vt-theme);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 300;
    cursor: default;
    box-shadow: 0 4px 16px rgba(var(--vt-theme-rgb), 0.4);
}

.node-demo-canvas {
    min-height: 420px;
    background: #1e1e20;
    position: relative;
    padding: 24px;
    overflow: hidden;
}

.node-demo-graph {
    position: relative;
    width: 100%;
    height: 360px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px dashed rgba(255,255,255,0.08);
    isolation: isolate;
}

.node-box {
    position: absolute;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 120px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.node-box.api { background: rgba(var(--vt-theme-rgb), 0.2); color: var(--vt-theme-light); border-color: rgba(var(--vt-theme-rgb), 0.4); }
.node-box.js { background: rgba(138, 43, 226, 0.2); color: #b794f6; border-color: rgba(138,43,226,0.4); }
.node-box.cond { background: rgba(var(--vt-accent-rgb), 0.2); color: var(--vt-accent); border-color: rgba(var(--vt-accent-rgb), 0.4); }
.node-box.debug { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.2); }
.node-box small { display: block; font-size: 10px; font-weight: 400; opacity: 0.8; margin-top: 2px; }

.node-demo-nodes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.node-demo-nodes .node-box { pointer-events: auto; }

.node-demo-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

.node-demo-svg path {
    fill: none;
    stroke: rgba(160, 168, 175, 0.5);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s ease;
}

.node-demo-svg path.rubber {
    display: none;
    stroke: var(--vt-theme);
    stroke-width: 1;
    stroke-dasharray: none;
    opacity: 0.9;
}
.node-demo-svg path.rubber.visible {
    display: block;
}

.node-demo-svg path.flow {
    stroke: var(--vt-theme);
    stroke-width: 1;
    stroke-dasharray: 2 4;
    animation: edgeFlow 0.85s linear forwards;
}

@keyframes edgeFlow {
    from { stroke-dashoffset: 12; }
    to { stroke-dashoffset: -12; }
}

.node-demo-add.pulse {
    animation: addBtnPulse 0.5s ease;
}

@keyframes addBtnPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 16px rgba(var(--vt-theme-rgb), 0.4); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(var(--vt-theme-rgb), 0.3); }
}

.node-box .node-run {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--vt-theme);
    background: rgba(var(--vt-theme-rgb), 0.2);
    border: 1px solid rgba(var(--vt-theme-rgb), 0.4);
    border-radius: 6px;
    cursor: default;
}

.node-box .node-progress {
    margin-top: 6px;
    height: 4px;
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.node-box .node-progress.visible { display: block; }

.node-box .node-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--vt-theme), var(--vt-accent));
    border-radius: 2px;
    transition: width 0.2s linear;
}

.node-box.processing .node-progress { display: block; }
.node-box.processing .node-progress-bar { transition: width 0.5s linear; }
.node-box.processing {
    box-shadow: 0 0 0 2px var(--vt-accent), 0 0 16px rgba(var(--vt-accent-rgb), 0.3);
}

.node-port {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(var(--vt-theme-rgb), 0.6);
    border: 1px solid rgba(var(--vt-theme-rgb), 0.8);
    top: 50%;
    margin-top: -4px;
    pointer-events: none;
}

.node-port.right { right: -4px; }
.node-port.left { left: -4px; }

.node-picker {
    position: absolute;
    z-index: 50;
    right: 0;
    top: 100%;
    margin-top: 10px;
    transform: translateY(0);
    background: #252527;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 8px;
    min-width: 160px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.node-picker.visible {
    opacity: 1;
    visibility: visible;
}

.node-picker-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    background: transparent;
    border: none;
    border-radius: 6px;
    text-align: left;
    cursor: default;
    transition: background 0.2s;
}

.node-picker-item:hover,
.node-picker-item.selected {
    background: rgba(var(--vt-theme-rgb), 0.15);
    color: var(--vt-theme-light);
}

.node-picker-item small { display: block; font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 2px; }

.node-box.removing { animation: nodeRemove 0.4s ease forwards; }

@keyframes nodeRemove {
    to { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

.node-ghost {
    position: fixed;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 110px;
    text-align: center;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    transition: none;
}

.node-ghost.dragging {
    transition: left 0.5s ease-out, top 0.5s ease-out;
}

/* CTA — тема */
.cta-section {
    background: linear-gradient(135deg, rgba(var(--vt-theme-rgb), 0.1), rgba(var(--vt-theme-rgb), 0.06));
    border-radius: 30px;
    padding: 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin: 100px auto;
    border: 1px solid rgba(var(--vt-theme-rgb), 0.2);
}

.cta-title { font-size: 48px; font-weight: 700; margin-bottom: 20px; color: white; }
.cta-subtitle { font-size: 18px; color: var(--vt-gray); max-width: 600px; margin: 0 auto 40px; }

/* Download/instruction — тема (base даёт сетку и карточки) */
.download-card h3 { color: var(--vt-theme); }
.download-card:hover { border-color: var(--vt-theme); box-shadow: 0 12px 32px rgba(var(--vt-theme-rgb), 0.25); }
.instruction-card:hover { border-color: rgba(var(--vt-theme-rgb), 0.4); }

.download-card__checklist {
    margin-top: auto;
    padding-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--vt-theme);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .hero-nodeolite .hero-title { font-size: 40px; }
    .hero-nodeolite .hero-subtitle { font-size: 17px; }
    .node-demo-canvas { min-height: 320px; }
    .node-demo-graph { height: 280px; }
    .node-box { min-width: 90px; font-size: 11px; padding: 8px 10px; }
    .cta-section { padding: 40px 20px; }
    .cta-title { font-size: 36px; }
}
