/* ============================================ */
/* GLOBAL STYLES: HYBRID THEME (AUTOSCALE)     */
/* Источник: mainpage_v3_refined.html v3.5     */
/* Последнее обновление: 2026-01-19            */
/* ============================================ */

/* --- CSS VARIABLES --- */
:root {
    /* Colors */
    --h-bg: #050505;
    --h-accent: #00ff88;
    --h-accent-secondary: #0088ff;
    --h-accent-glow: rgba(0, 255, 136, 0.4);
    --h-text: #e0e0e0;
    --h-text-muted: #888;
    --h-glass: rgba(20, 20, 20, 0.6);
    --h-glass-border: rgba(0, 255, 136, 0.15);

    /* Fluid Typography (Autoscale) */
    --h-font-main: 'IBM Plex Sans', sans-serif;
    --h-font-mono: 'IBM Plex Mono', monospace;

    --h-text-sm: clamp(14px, 0.8vw, 16px);
    --h-text-base: clamp(16px, 1vw, 20px);
    --h-text-lg: clamp(18px, 1.2vw, 24px);
    --h-text-xl: clamp(24px, 2vw, 40px);
    --h-text-hero: clamp(40px, 6vw, 120px);

    /* Fluid Spacing (Autoscale) */
    --h-space-xs: clamp(8px, 0.5vw, 12px);
    --h-space-sm: clamp(12px, 1vw, 20px);
    --h-space-md: clamp(20px, 2vw, 40px);
    --h-space-lg: clamp(60px, 5vw, 120px);

    /* Container */
    --h-width: clamp(320px, 92vw, 1600px);

    /* Borders & Rounding */
    --h-radius-sm: 4px;
    --h-radius-md: 12px;
    --h-radius-lg: 20px;

    /* Transitions */
    --h-transition-fast: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    --h-transition-smooth: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    --h-transition-elastic: 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- BASE LAYOUT --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--h-bg);
    margin: 0;
    padding: 0;
    color: var(--h-text);
    font-family: var(--h-font-main);
    font-size: var(--h-text-base);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom cursor only when h-cursor exists */
body:has(.h-cursor) {
    cursor: none;
}

#v3-hybrid-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

.h-container {
    width: 100%;
    max-width: var(--h-width);
    margin: 0 auto;
    padding: 0 var(--h-space-md);
}

a {
    text-decoration: none;
    color: inherit !important;
    transition: color var(--h-transition-fast);
}

/* Custom cursor for links only when h-cursor exists */
body:has(.h-cursor) a {
    cursor: none;
}

a:hover {
    color: var(--h-accent) !important;
}

/* Tilda overrides - force link colors */
#v3-hybrid-wrapper a,
.h-section a,
.h-container a {
    color: inherit !important;
}

#v3-hybrid-wrapper a:hover,
.h-section a:hover,
.h-container a:hover {
    color: var(--h-accent) !important;
}

/* --- BACKGROUND LAYERS --- */
.bg-layer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.matrix-layer {
    opacity: 0.15;
}

#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.blobs-layer {
    filter: blur(80px);
    opacity: 0.3;
}

.h-blob {
    position: absolute;
    border-radius: 50%;
    background: var(--h-accent);
}

.h-blob-1 {
    width: 30vw;
    height: 30vw;
    top: -10%;
    left: -10%;
    animation: floatBlob 20s infinite alternate;
}

.h-blob-2 {
    width: 25vw;
    height: 25vw;
    bottom: -10%;
    right: -10%;
    background: var(--h-accent-secondary);
    animation: floatBlob 25s infinite alternate-reverse;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: radial-gradient(circle at center, transparent 0%, var(--h-bg) 90%);
    pointer-events: none;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 100px); }
}

/* --- CUSTOM CURSOR --- */
.h-cursor {
    width: 8px;
    height: 8px;
    background: var(--h-accent);
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
}

.h-cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid var(--h-accent);
    position: fixed;
    top: -16px;
    left: -16px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.5;
    transition: transform 0.1s;
}

/* --- SECTIONS --- */
.h-section {
    padding: var(--h-space-lg) 0;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.h-section-title {
    font-family: var(--h-font-mono);
    font-size: var(--h-text-xl);
    color: var(--h-accent);
    margin-bottom: 60px;
    border-bottom: 1px solid var(--h-glass-border);
    padding-bottom: 20px;
    width: 100%;
}

/* --- STATUS POD --- */
.h-status-pod {
    font-family: var(--h-font-mono);
    font-size: var(--h-text-sm);
    color: var(--h-accent);
    border: 1px solid var(--h-accent);
    padding: 5px 12px;
    border-radius: var(--h-radius-lg);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--h-accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* --- HERO TYPOGRAPHY --- */
.h-title {
    font-family: var(--h-font-main);
    font-weight: 800;
    font-size: var(--h-text-hero);
    line-height: 0.95;
    margin: 0;
    letter-spacing: -0.02em;
}

.h-word.accent {
    color: transparent;
    -webkit-text-stroke: 1px var(--h-accent);
    position: relative;
}

.h-subtitle {
    font-family: var(--h-font-mono);
    color: var(--h-text-muted);
    margin-top: 30px;
    font-size: var(--h-text-base);
}

/* --- CHIPS & BADGES --- */
.h-chip {
    font-family: var(--h-font-mono);
    font-size: var(--h-text-sm);
    color: #fff;
    border: 1px solid var(--h-glass-border);
    padding: 12px 24px;
    border-radius: var(--h-radius-sm);
    background: rgba(255, 255, 255, 0.03);
    transition: all var(--h-transition-smooth);
    display: inline-block;
}

.h-chip:hover {
    background: var(--h-accent-glow);
    border-color: var(--h-accent);
    color: #000;
    box-shadow: 0 0 20px var(--h-accent-glow);
}

.h-badge {
    font-family: var(--h-font-mono);
    font-size: 0.7rem;
    border: 1px solid #666;
    padding: 4px 8px;
    border-radius: var(--h-radius-sm);
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.h-badge.highlight {
    border-color: var(--h-accent);
    color: var(--h-accent);
}

/* --- NAV CLUSTER --- */
.h-nav-cluster {
    display: flex;
    gap: 15px;
    margin-top: 50px;
    flex-wrap: wrap;
}

/* --- CARDS --- */
.h-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--h-glass-border);
    padding: 30px;
    border-radius: var(--h-radius-md);
    transition: all var(--h-transition-smooth);
    height: 100%;
    display: flex;
    flex-direction: column;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transform-style: preserve-3d;
}

.h-card:hover {
    border-color: var(--h-accent);
    background: rgba(0, 255, 136, 0.05);
}

.h-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.h-card h3 {
    margin: 0;
    font-size: clamp(1.1rem, 1.5vw, 1.4rem);
    color: #fff;
    line-height: 1.2;
}

.h-card p {
    color: var(--h-text);
    font-size: var(--h-text-sm);
    line-height: 1.6;
    opacity: 0.8;
}

/* --- TAGS --- */
.h-tags {
    margin-top: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 20px;
}

.h-tags span {
    font-family: var(--h-font-mono);
    font-size: 0.75rem;
    color: #666;
}

/* --- LINK BUTTON --- */
.h-link-btn {
    display: inline-block;
    margin-top: 20px;
    font-family: var(--h-font-mono);
    font-size: 0.85rem;
    color: var(--h-accent);
    border: 1px solid var(--h-accent);
    padding: 8px 16px;
    border-radius: var(--h-radius-sm);
    transition: all var(--h-transition-smooth);
    align-self: flex-start;
}

.h-link-btn:hover {
    background: var(--h-accent);
    color: #000;
}

/* --- PROJECT GRID --- */
.h-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    perspective: 1000px;
}

/* --- LAB GRID --- */
.h-lab-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.h-lab-item {
    flex: 1;
    min-width: 200px;
    background: #0f0f12;
    border: 1px dashed #333;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: var(--h-radius-md);
    transition: all var(--h-transition-smooth);
}

.h-lab-item:hover {
    border-color: var(--h-accent);
    border-style: solid;
    background: #15151a;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.1);
}

.h-lab-item:hover .h-pixel-icon {
    filter: drop-shadow(0 0 10px var(--h-accent));
}

.h-lab-info h4 {
    margin: 0;
    color: #fff;
    font-family: var(--h-font-mono);
}

.h-lab-info p {
    margin: 5px 0 0 0;
    font-size: 0.8rem;
    color: #666;
}

/* --- BLOG GRID --- */
.h-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    perspective: 1000px;
}

.h-post-card {
    background: var(--h-glass);
    border: 1px solid var(--h-glass-border);
    padding: 30px;
    border-radius: var(--h-radius-sm);
    display: block;
    transition: transform var(--h-transition-smooth), border-color var(--h-transition-smooth);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transform-style: preserve-3d;
}

.h-post-card:hover {
    border-color: var(--h-accent);
}

.h-post-meta {
    font-family: var(--h-font-mono);
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 10px;
}

.h-post-card h3 {
    font-size: 1.2rem;
    color: #fff;
    margin: 0 0 20px 0;
    font-weight: 600;
}

.h-post-link {
    font-family: var(--h-font-mono);
    font-size: 0.8rem;
    color: var(--h-accent);
    font-weight: bold;
}

/* --- PIXEL ICONS --- */
.h-pixel-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    object-fit: contain;
    color: var(--h-accent);
    filter: drop-shadow(0 0 5px var(--h-accent));
}

/* --- CONSOLE COMPONENTS --- */
.h-console-unit {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 40px;
    align-items: stretch;
    min-height: 400px;
}

.h-shards-rack {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.h-shard {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--h-glass);
    border: 1px solid var(--h-glass-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: var(--h-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.3, 1, 0.3, 1);
    z-index: 10;
    overflow: hidden;
    cursor: pointer;
}

.h-shard:hover {
    border-color: var(--h-accent);
    transform: scale(1.1) translateX(10px);
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 15px var(--h-accent-glow);
}

.h-shard.active {
    background: var(--h-accent);
    color: #000;
    border-color: var(--h-accent);
    transform: scale(0.95);
}

.h-shard.active .shard-label,
.h-shard.active .h-pixel-icon {
    color: #000;
    filter: none;
}

.shard-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.shard-label {
    font-family: var(--h-font-mono);
    font-size: 0.7rem;
    color: var(--h-accent);
}

.h-reader-zone {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--h-glass-border);
    border-radius: var(--h-radius-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}

.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--h-accent);
    box-shadow: 0 0 15px var(--h-accent);
    opacity: 0;
    z-index: 5;
    pointer-events: none;
}

.h-screen-content {
    padding: 40px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    font-family: var(--h-font-mono);
    line-height: 1.6;
    color: #ccc;
}

.h-screen-content h3 {
    color: var(--h-accent);
    margin-top: 0;
    font-size: clamp(1.1rem, 1.5vw, 1.4rem);
    border-bottom: 1px dashed #444;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.h-screen-content p {
    margin-bottom: 15px;
    font-size: var(--h-text-sm);
}

.h-screen-content strong {
    color: var(--h-accent);
}

.h-metadata {
    color: #666;
    font-size: 0.8rem;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.h-placeholder {
    text-align: center;
    color: #555;
}

.blink-symbol {
    font-size: 3rem;
    animation: pulse 1s steps(2) infinite;
    color: var(--h-accent);
    margin-bottom: 20px;
}

/* --- ANIMATIONS --- */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* --- TILT CARD SUPPORT --- */
.tilt-card {
    transform-style: preserve-3d;
}

/* --- MOBILE RESPONSIVE (768px) --- */
@media (max-width: 768px) {
    .h-section {
        min-height: 0;
        padding: var(--h-space-md) 0;
    }

    .h-hero {
        min-height: 100vh;
    }

    .h-console-unit {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        gap: 20px;
    }

    .h-shards-rack {
        flex-direction: row;
        justify-content: center;
        overflow-x: auto;
        padding-bottom: 10px;
        gap: 10px;
    }

    .h-shard {
        width: 60px;
        height: 70px;
        flex-shrink: 0;
        aspect-ratio: auto;
    }

    .h-shard .shard-label {
        display: none;
    }

    .h-shard .h-pixel-icon {
        width: 24px;
        height: 24px;
    }

    .h-reader-zone {
        min-height: 300px;
    }

    .h-screen-content {
        padding: 20px;
    }

    .h-nav-cluster {
        gap: 10px;
    }

    .h-chip {
        padding: 10px 16px;
    }

    .h-project-grid,
    .h-blog-grid {
        grid-template-columns: 1fr;
    }

    .h-lab-grid {
        flex-direction: column;
    }

    .h-lab-item {
        min-width: auto;
    }

    /* Hide custom cursor on mobile */
    .h-cursor,
    .h-cursor-follower {
        display: none;
    }

    body {
        cursor: auto;
    }

    a {
        cursor: pointer;
    }
}

/* --- SMALL MOBILE (480px) --- */
@media (max-width: 480px) {
    .h-section-title {
        font-size: clamp(18px, 5vw, 24px);
        margin-bottom: 30px;
    }

    .h-card,
    .h-post-card {
        padding: 20px;
    }
}
