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

:root {
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    --secondary-color: #c084fc;
    --accent-color: #f472b6;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    
    /* Retro dark theme colors */
    --bg-color: #0a1526;
    --bg-gradient-start: #0a1526;
    --bg-gradient-end: #1a2a3a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --card-bg: #ffffff;
    --card-bg-hover: #f5f5f5;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --border-color: #000000;
    --border-hover: #333333;
    --window-border: #000000;
    --close-button: #ff0000;
    --close-button-hover: #cc0000;
}

body {
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    overflow-y: hidden;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Particles Background */
.particles-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particles-canvas {
    width: 100%;
    height: 100%;
}

/* Отключаем частицы на очень маленьких экранах для производительности */
@media (max-width: 480px) {
    .particles-background {
        display: none;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: transparent;
    border-bottom: 3px solid var(--window-border);
    color: white;
    padding: 1.5rem 0;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.header-main {
    flex: 1;
    min-width: 300px;
}

.logo {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 3rem;
    font-weight: normal;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    color: #ffffff;
    text-shadow: 
        2px 2px 0px #000000,
        4px 4px 0px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tagline {
    font-size: 1rem;
    font-weight: normal;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.7;
    font-weight: 300;
    color: var(--text-secondary);
    font-style: italic;
}

.header-badge {
    display: flex;
    align-items: center;
}

.badge-text {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(129, 140, 248, 0.15);
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary-light);
    backdrop-filter: blur(10px);
    font-weight: 500;
}

/* Animated Gradient Text - Retro style */
.animated-gradient-text {
    color: #ffffff;
    text-shadow: 
        2px 2px 0px #000000,
        4px 4px 0px rgba(0, 0, 0, 0.5);
}

/* Main */
.main {
    flex: 1;
    padding: 2rem 0;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    min-height: 0;
}

.intro-section {
    max-width: 700px;
    margin: 0 auto 3rem;
    text-align: center;
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    font-weight: 300;
}

.section-title {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: normal;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #ffffff;
    text-shadow: 
        2px 2px 0px #000000,
        4px 4px 0px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Projects Grid */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 0;
    justify-content: center;
    align-items: start;
}

@media (min-width: 1024px) {
    .projects-grid {
        justify-content: center;
    }
}

/* Retro Window Card - Minimalist */
.bento-card {
    position: relative;
    border-radius: 0;
    overflow: visible;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background: var(--card-bg);
    border: 3px solid var(--window-border);
    box-shadow: 
        4px 4px 0px rgba(0, 0, 0, 0.3),
        8px 8px 0px rgba(0, 0, 0, 0.2);
    transform: translateZ(0);
    transition: all 0.2s ease;
    width: 100%;
    max-width: 400px;
    font-family: 'Courier New', monospace;
}

.bento-card[data-project-url]:not([data-project-url="#"]) {
    cursor: pointer;
}


.bento-card:hover {
    transform: translateY(-2px) translateX(-2px);
    box-shadow: 
        6px 6px 0px rgba(0, 0, 0, 0.4),
        12px 12px 0px rgba(0, 0, 0, 0.3);
}

/* Icon Wrapper */
.bento-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 1rem;
}


/* Project Card with Magic Card effect */
.project-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    --mouse-x: -200px;
    --mouse-y: -200px;
}

/* Bento Background - removed for retro style */
.bento-background {
    display: none;
}

.bento-gradient {
    display: none;
}

.bento-hover-overlay {
    display: none;
}

/* Bento Content */
.bento-content {
    position: relative;
    z-index: 2;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
}

/* Bento Header */
.bento-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.bento-icon {
    font-size: 2.5rem;
    line-height: 1;
    text-align: center;
    display: inline-block;
    width: auto;
    height: auto;
    color: #000000;
    user-select: none;
    font-style: normal;
    font-weight: normal;
    margin-bottom: 1rem;
}

/* Bento Body */
.bento-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.bento-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Courier New', monospace;
}

.bento-stage {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.bento-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* Bento Tech */
.bento-tech {
    padding: 0.5rem 0.75rem;
    background: #f0f0f0;
    border: 2px solid var(--window-border);
    border-radius: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Bento Footer */
.bento-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 2px solid var(--window-border);
    margin-top: auto;
}

.bento-link {
    color: #0000ff;
    font-weight: bold;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    text-decoration: underline;
    text-decoration-color: #0000ff;
}

.bento-card:hover .bento-link {
    color: #0000cc;
}

.bento-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    border: 2px solid var(--window-border);
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
}

.status-badge.active {
    background: #00ff00;
    color: #000000;
    border-color: var(--window-border);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.status-badge.testing {
    background: #ffff00;
    color: #000000;
    border-color: var(--window-border);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.status-badge.inactive {
    background: #cccccc;
    color: #000000;
    border-color: var(--window-border);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.status-badge::before {
    content: '■';
    margin-right: 0.4rem;
    display: inline-block;
    font-size: 0.6rem;
}

.status-badge.active::before {
    color: #000000;
}

.status-badge.testing::before {
    color: #000000;
}

.status-badge.inactive::before {
    color: #000000;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* Card Description */
.card-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 1rem;
}

/* Card Tech Stack */
.card-tech {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: rgba(129, 140, 248, 0.05);
    border: 1px solid rgba(129, 140, 248, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tech-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    gap: 1rem;
}

.card-link {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
}

.card-link::after {
    content: '→';
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.card-link:hover::after {
    transform: translateX(6px);
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background: transparent;
    padding: 1.5rem 0;
    margin-top: auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-top: 3px solid var(--window-border);
    flex-shrink: 0;
}

.footer-decorative-line {
    width: 100%;
    height: 3px;
    background: var(--window-border);
    margin-bottom: 2.5rem;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-logo {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 1rem;
    font-weight: normal;
    letter-spacing: 0.1em;
    color: #ffffff;
    text-shadow: 
        2px 2px 0px #000000,
        4px 4px 0px rgba(0, 0, 0, 0.5);
}

.footer-year {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 1rem;
    font-weight: normal;
    color: #ffffff;
    letter-spacing: 0.1em;
}

.footer-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.footer-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.6;
    animation: dot-pulse 2s ease-in-out infinite;
}

.footer-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.footer-dots .dot:nth-child(2) {
    animation-delay: 0.3s;
}

.footer-dots .dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes dot-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* Meteors */
.meteors-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.meteor {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: meteor-fall linear infinite;
}

.meteor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 50px;
    height: 1px;
    background: linear-gradient(to right, white, transparent);
    transform: translateY(-50%);
}

@keyframes meteor-fall {
    from {
        transform: translateY(-100vh) translateX(0);
        opacity: 1;
    }
    to {
        transform: translateY(100vh) translateX(-300px);
        opacity: 0;
    }
}

/* Responsive */
/* Tablet */
@media (max-width: 1024px) {
    .projects-grid {
        gap: 1.25rem;
    }
    
    .footer-content {
        gap: 1.75rem;
    }
}

/* Mobile Large */
@media (max-width: 768px) {
    .header {
        padding: 2.5rem 0;
    }

    .logo {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .main {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .projects-grid {
        gap: 1.25rem;
    }
    
    .bento-content {
        padding: 1.5rem;
    }
    
    .bento-icon {
        font-size: 2rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-badge {
        align-self: flex-start;
    }
    
    .tagline {
        font-size: 1.1rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .badge-text {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .intro-section {
        margin-bottom: 2rem;
    }
    
    .intro-text {
        font-size: 0.95rem;
    }
    
    .card-title-wrapper {
        gap: 0.4rem;
    }
    
    .project-stage {
        font-size: 0.7rem;
    }
    
    .card-tech {
        font-size: 0.8rem;
        padding: 0.625rem;
    }
    
    .footer {
        padding: 2.5rem 0;
    }
    
    .footer-content {
        gap: 1.5rem;
    }
    
    .footer-logo,
    .footer-year {
        font-size: 1.5rem;
    }
    
    .footer-dots {
        display: none;
    }
}

/* Mobile Small */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        padding: 2rem 0;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .header-content {
        gap: 1rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .badge-text {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
    }
    
    .intro-text {
        font-size: 0.9rem;
    }
    
    .card-title-wrapper {
        gap: 0.35rem;
    }
    
    .project-stage {
        font-size: 0.65rem;
    }
    
    .card-tech {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .main {
        padding: 1.5rem 0;
    }
    
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
    
    .projects-grid {
        gap: 1rem;
    }
    
    .bento-content {
        padding: 1.5rem;
    }
    
    .bento-icon {
        font-size: 1.75rem;
    }
    
    .bento-title {
        font-size: 1.25rem;
    }
    
    .bento-description {
        font-size: 0.85rem;
    }
    
    .bento-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }
    
    .footer {
        padding: 2rem 0;
    }
    
    .footer-content {
        gap: 1rem;
    }
    
    .footer-logo,
    .footer-year {
        font-size: 1.25rem;
    }
    
    .footer-decorative-line {
        margin-bottom: 2rem;
    }
}

/* Extra Small */
@media (max-width: 360px) {
    .logo {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-description {
        font-size: 0.85rem;
    }
    
    .footer {
        padding: 1.5rem 0;
    }
    
    .footer-logo,
    .footer-year {
        font-size: 1.1rem;
    }
    
    .footer-decorative-line {
        margin-bottom: 1.5rem;
    }
}

/* Touch devices optimization */
@media (hover: none) and (pointer: coarse) {
    .project-card:hover {
        transform: none;
    }
    
    .magic-card::before {
        display: none;
    }
    
    .border-beam {
        opacity: 0.5;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        padding: 2rem 0;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .main {
        padding: 1.5rem 0;
    }
}
