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

:root {
    --primary-color: #ff6b00;
    --secondary-color: #ff8c42;
    --accent-color: #ffb380;
    --bg-dark: #2a2a2a;
    --bg-medium: #3a3a3a;
    --bg-light: #4a4a4a;
    --text-primary: #f0f0f0;
    --text-secondary: #cccccc;
    --mi-dark: #111;
    --mi-medium: #222;
    --mi-light: #333;
    --mi-orange: #ff6b00;
    --mi-silver: #e0e0e0;
    --mi-card: rgba(240, 240, 240, 0.9);
    --screen-bg: #e0e0e0;
    /* PowerShell colors */
    --ps-blue: #012456;
    --ps-dark-blue: #001f3f;
    --ps-light-blue: #0078d4;
    --ps-text: #cccccc;
    --ps-green: #16c60c;
    --ps-yellow: #f9f1a5;
    --ps-red: #e74856;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-dark);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    padding: 20px;
    color: var(--text-primary);
    position: relative;
    perspective: 1000px;
}

.pattern-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.08;
    pointer-events: none;
    overflow: hidden;
    background: transparent;
}

.pattern-text {
    position: absolute;
    font-size: 120px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.15);
    transform: rotate(-45deg);
    white-space: nowrap;
    animation: pattern-move 120s linear infinite;
    font-family: 'Courier New', monospace;
    letter-spacing: 10px;
}

@keyframes pattern-move {
    0% { transform: translateX(-100%) rotate(-45deg); }
    100% { transform: translateX(100%) rotate(-45deg); }
}

.avatar-container {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.5);
    z-index: 100;
    transition: transform 0.3s ease;
    animation: avatar-float 6s ease-in-out infinite;
}

.avatar-container:hover {
    transform: scale(1.1);
}

@keyframes avatar-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(2deg); }
    50% { transform: translateY(3px) rotate(-1deg); }
    75% { transform: translateY(-3px) rotate(1deg); }
}

.avatar {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--bg-medium), var(--bg-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 24px;
    font-weight: bold;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

/* Смартфон в стиле Xiaomi Mi11T */
.phone-container {
    position: relative;
    width: 360px;
    height: 780px;
    background: var(--mi-dark);
    border-radius: 40px;
    padding: 20px 15px;
    box-shadow: 
        0 0 0 4px #333,
        0 0 0 8px #222,
        0 20px 60px rgba(0, 0, 0, 0.8),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 40px;
    overflow: hidden;
    animation: phone-float 8s ease-in-out infinite;
    transform-style: preserve-3d;
}

@keyframes phone-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(1deg); }
    50% { transform: translateY(5px) rotate(-1deg); }
    75% { transform: translateY(-5px) rotate(0.5deg); }
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--screen-bg);
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 25px;
    background: var(--mi-dark);
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0 20px;
}

.phone-camera {
    width: 12px;
    height: 12px;
    background: #222;
    border-radius: 50%;
    border: 1px solid #333;
}

.phone-speaker {
    width: 60px;
    height: 6px;
    background: #222;
    border-radius: 3px;
    border: 1px solid #333;
}

.phone-content {
    width: 100%;
    height: 100%;
    padding: 30px 15px 15px;
    overflow-y: auto;
    position: relative;
    transform-style: preserve-3d;
}

.mobile-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px; /* Уменьшен промежуток между элементами */
    transform-style: preserve-3d;
    height: 100%;
    justify-content: space-between;
}

/* PowerShell Terminal */
.powershell-terminal {
    width: 100%;
    background: var(--ps-dark-blue);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(0, 120, 212, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--ps-light-blue);
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.5s ease;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    max-height: 58%; /* Немного уменьшена высота терминала */
    min-height: 250px;
}

.terminal-header {
    height: 30px;
    background: linear-gradient(135deg, var(--ps-blue), var(--ps-dark-blue));
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid var(--ps-light-blue);
    position: relative;
}

.terminal-controls {
    display: flex;
    gap: 6px;
}

.terminal-control {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.terminal-control-close { 
    background: #ff5f57; 
}
.terminal-control-minimize { 
    background: #ffbd2e; 
}
.terminal-control-maximize { 
    background: #28ca42; 
}

.terminal-title {
    color: var(--ps-text);
    font-size: 12px;
    margin-left: 10px;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    flex-grow: 1;
    text-align: center;
}

.terminal-content {
    padding: 12px;
    flex-grow: 1;
    overflow-y: auto;
    position: relative;
    color: var(--ps-text);
    font-size: 11px;
    line-height: 1.3;
    background: var(--ps-dark-blue);
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
}

.terminal-output {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.command-line {
    display: flex;
    margin-bottom: 5px;
}

.prompt {
    color: var(--ps-green);
    margin-right: 8px;
    white-space: nowrap;
    font-size: 11px;
}

.command {
    color: var(--ps-text);
    font-size: 11px;
}

.output-line {
    margin-bottom: 4px;
    color: var(--ps-text);
    font-size: 11px;
    line-height: 1.3;
}

.output-line.header {
    color: var(--ps-yellow);
    font-weight: bold;
    margin-top: 8px;
    margin-bottom: 4px;
}

.output-line.subheader {
    color: var(--ps-yellow);
    font-style: italic;
    margin-bottom: 6px;
}

.output-line.intro {
    color: var(--ps-green);
    margin-bottom: 6px;
}

.output-line.text {
    margin-bottom: 6px;
    line-height: 1.3;
}

.output-line.list {
    margin-left: 15px;
    margin-bottom: 4px;
    position: relative;
}

.output-line.list:before {
    content: "• ";
    color: var(--ps-green);
    position: absolute;
    left: -12px;
}

.output-line.button {
    color: var(--ps-light-blue);
    margin: 8px 0;
    cursor: pointer;
    display: inline-block;
}

.output-line.button:hover {
    text-decoration: underline;
}

.typing-cursor {
    display: inline-block;
    width: 6px;
    height: 12px;
    background: var(--ps-green);
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

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

/* Стили для иконок мессенджеров */
.messengers {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 5px 0; /* Уменьшен отступ сверху и снизу */
    flex-shrink: 0;
}

.messenger-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
    flex-shrink: 0;
}

.messenger-icon:hover {
    transform: scale(1.1) translateZ(5px);
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.5);
}

.messenger-icon img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

/* Мобильные баннеры */
.mobile-banners {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Уменьшен промежуток */
    width: 100%;
    flex-shrink: 0;
    justify-content: flex-end;
    margin-top: 5px; /* Добавлен отступ сверху для поднятия блока */
}

.mobile-banner {
    background: rgba(240, 240, 245, 0.9);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    border: 1px solid #000000;
    transition: all 0.3s ease;
    animation: banner-float 8s ease-in-out infinite;
    transform-style: preserve-3d;
    text-decoration: none;
    display: block;
    flex-shrink: 0;
    max-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes banner-float {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-3px); }
    50% { transform: translateY(2px); }
    75% { transform: translateY(-1px); }
}

.mobile-banner:hover {
    transform: translateY(-3px) translateZ(5px);
    background: rgba(230, 230, 235, 0.9);
}

.banner-icon {
    font-size: 20px;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.banner-title {
    font-size: 12px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 4px;
}

.banner-description {
    font-size: 9px;
    color: #000000;
    line-height: 1.2;
}

/* Эффекты частиц для мобильной версии */
.mobile-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.mobile-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 107, 0, 0.4);
    border-radius: 50%;
    animation: float-particle 15s infinite linear;
}

@keyframes float-particle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(20px);
        opacity: 0;
    }
}

/* Кнопки смартфона */
.phone-buttons {
    position: absolute;
    right: -5px;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.phone-button {
    width: 3px;
    height: 40px;
    background: #333;
    border-radius: 2px;
}

.phone-button:nth-child(2) {
    height: 60px;
}

/* Терминальный футер в стиле Windows Terminal */
.terminal-footer {
    width: 100%;
    max-width: 500px;
    margin-top: 40px;
    background: #0c0c0c;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(1, 122, 204, 0.3);
    position: relative;
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
}

.terminal-footer-header {
    height: 25px;
    background: linear-gradient(to right, #1e1e1e, #2d2d30);
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid rgba(1, 122, 204, 0.3);
}

.terminal-footer-controls {
    display: flex;
    gap: 5px;
}

.terminal-footer-control {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.terminal-footer-control-close { background: #ff5f57; }
.terminal-footer-control-minimize { background: #ffbd2e; }
.terminal-footer-control-maximize { background: #28ca42; }

.terminal-footer-title {
    color: rgba(200, 220, 255, 0.8);
    font-size: 10px;
    margin-left: 8px;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.terminal-footer-content {
    padding: 15px;
    color: #cccccc;
    min-height: 20px;
    position: relative;
    font-size: 13px;
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    text-align: center;
}

/* Десктоп версия */
@media (min-width: 769px) {
    .phone-container {
        transform: scale(1.1);
        margin-bottom: 60px;
    }
}

/* Мобильная адаптация для самого смартфона */
@media (max-width: 400px) {
    .phone-container {
        transform: scale(0.9);
    }
}

@media (max-width: 350px) {
    .phone-container {
        transform: scale(0.8);
    }
}

/* Стили для скроллбара терминала */
.terminal-content::-webkit-scrollbar {
    width: 6px;
}

.terminal-content::-webkit-scrollbar-track {
    background: var(--ps-blue);
    border-radius: 4px;
}

.terminal-content::-webkit-scrollbar-thumb {
    background: var(--ps-light-blue);
    border-radius: 4px;
}

.terminal-content::-webkit-scrollbar-thumb:hover {
    background: var(--ps-green);
}