* {
    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;
    /* Ubuntu colors */
    --ubuntu-orange: #E95420;
    --ubuntu-light-orange: #FF7B00;
    --ubuntu-dark: #2C001E;
    --ubuntu-purple: #77216F;
    --ubuntu-gray: #333333;
    --ubuntu-light-gray: #F5F5F5;
    --ubuntu-terminal-bg: #300A24;
    --ubuntu-terminal-header: #2C001E;
}

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;
}

/* Обновленная подложка с белыми надписями DEV&STREL14 */
.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: 15px;
    transform-style: preserve-3d;
    height: 100%;
    justify-content: space-between;
}

/* Ubuntu терминал с 3D эффектом - уменьшенная высота */
.mobile-terminal {
    width: 100%;
    background: var(--ubuntu-terminal-bg);
    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(119, 33, 111, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--ubuntu-purple);
    animation: terminal-3d 6s ease-in-out infinite;
    font-family: 'Ubuntu Mono', 'Consolas', 'Courier New', monospace;
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.5s ease;
    flex-shrink: 0;
}

.mobile-terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 20%, 
        rgba(255, 255, 255, 0.5) 50%, 
        rgba(255, 255, 255, 0.3) 80%, 
        transparent 100%);
    z-index: 2;
}

.mobile-terminal::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(0, 0, 0, 0.4) 0%, 
        rgba(0, 0, 0, 0.2) 50%, 
        rgba(0, 0, 0, 0.4) 100%);
    border-radius: 0 0 12px 12px;
    z-index: 1;
}

@keyframes terminal-3d {
    0%, 100% { 
        transform: 
            perspective(1000px) 
            rotateX(1deg) 
            rotateY(-1deg) 
            translateZ(0);
        box-shadow: 
            0 10px 25px rgba(0, 0, 0, 0.4),
            0 5px 15px rgba(0, 0, 0, 0.3),
            0 0 0 1px rgba(119, 33, 111, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    25% { 
        transform: 
            perspective(1000px) 
            rotateX(2deg) 
            rotateY(1deg) 
            translateZ(5px);
        box-shadow: 
            0 15px 35px rgba(0, 0, 0, 0.6),
            0 8px 20px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(233, 84, 32, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
    50% { 
        transform: 
            perspective(1000px) 
            rotateX(-1deg) 
            rotateY(2deg) 
            translateZ(8px);
        box-shadow: 
            0 20px 40px rgba(0, 0, 0, 0.7),
            0 10px 25px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(119, 33, 111, 0.7),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    75% { 
        transform: 
            perspective(1000px) 
            rotateX(1deg) 
            rotateY(-2deg) 
            translateZ(5px);
        box-shadow: 
            0 15px 35px rgba(0, 0, 0, 0.6),
            0 8px 20px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(233, 84, 32, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

.terminal-header {
    height: 30px;
    background: linear-gradient(135deg, var(--ubuntu-terminal-header), var(--ubuntu-dark));
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid var(--ubuntu-purple);
    position: relative;
    transform-style: preserve-3d;
}

.terminal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 50%, 
        rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
}

.terminal-controls {
    display: flex;
    gap: 6px;
    transform: translateZ(5px);
}

.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-close:hover { 
    background: #ff3b30; 
    transform: scale(1.1);
}
.terminal-control-minimize { 
    background: #ffbd2e; 
}
.terminal-control-minimize:hover { 
    background: #ffa800; 
    transform: scale(1.1);
}
.terminal-control-maximize { 
    background: #28ca42; 
}
.terminal-control-maximize:hover { 
    background: #20b437; 
    transform: scale(1.1);
}

.terminal-title {
    color: var(--ubuntu-light-gray);
    font-size: 12px;
    margin-left: 10px;
    letter-spacing: 0.5px;
    font-family: 'Ubuntu', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    flex-grow: 1;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transform: translateZ(3px);
}

.terminal-content {
    padding: 12px;
    height: 150px; /* Уменьшенная высота */
    overflow-y: auto;
    position: relative;
    color: var(--ubuntu-light-gray);
    font-size: 12px; /* Уменьшенный шрифт */
    line-height: 1.3;
    background: 
        linear-gradient(135deg, 
            rgba(48, 10, 36, 0.9) 0%, 
            rgba(44, 0, 30, 0.95) 100%);
    transform-style: preserve-3d;
}

.terminal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, 
            rgba(233, 84, 32, 0.1) 0%, 
            transparent 50%),
        radial-gradient(circle at 80% 20%, 
            rgba(119, 33, 111, 0.1) 0%, 
            transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.terminal-code {
    color: var(--ubuntu-light-gray);
    font-size: 12px; /* Уменьшенный шрифт */
    line-height: 1.3;
    min-height: 100%;
    font-family: 'Ubuntu Mono', 'Consolas', 'Courier New', monospace;
    position: relative;
    z-index: 2;
    transform: translateZ(2px);
}

/* Ubuntu terminal specific styles */
.ubuntu-prompt {
    color: var(--ubuntu-orange);
    text-shadow: 0 0 5px rgba(233, 84, 32, 0.5);
}

.ubuntu-command {
    color: var(--ubuntu-light-gray);
}

.ubuntu-user {
    color: var(--ubuntu-light-orange);
}

.ubuntu-host {
    color: var(--ubuntu-orange);
}

.ubuntu-path {
    color: #4ec9b0;
}

.ubuntu-string {
    color: #ce9178;
}

.ubuntu-number {
    color: #b5cea8;
}

.ubuntu-comment {
    color: #6a9955;
    font-style: italic;
}

.ubuntu-keyword {
    color: #569cd6;
    font-weight: bold;
}

.ubuntu-type {
    color: #4ec9b0;
}

.ubuntu-success {
    color: #28ca42;
    text-shadow: 0 0 3px rgba(40, 202, 66, 0.3);
}

/* Стили для иконок мессенджеров */
.messengers {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
}

.messenger-icon {
    width: 45px;
    height: 45px;
    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;
}

.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: 12px;
    width: 100%;
    flex-grow: 1;
    justify-content: center;
}

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

.mobile-banner:nth-child(1) { --i: 1; }
.mobile-banner:nth-child(2) { --i: 2; }

@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: 24px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.banner-title {
    font-size: 14px;
    font-weight: bold;
    color: #000000; /* Черный цвет */
    margin-bottom: 6px;
}

.banner-description {
    font-size: 10px;
    color: #000000; /* Черный цвет */
    line-height: 1.2;
}

/* Ubuntu курсор */
.ubuntu-cursor {
    display: inline-block;
    width: 6px;
    height: 12px;
    background: var(--ubuntu-light-gray);
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: middle;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

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

.code-line {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Эффекты частиц для мобильной версии */
.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);
    }
}

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

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

.terminal-content::-webkit-scrollbar-thumb {
    background: var(--ubuntu-purple);
    border-radius: 4px;
}

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