/* Импорт шрифта */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --bocchi-pink: #ff69b4;
    --ryo-blue: #00bfff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* Запрещаем горизонтальный скролл на корневом уровне */
}

body {
    font-family: 'JetBrains Mono', monospace;
    background-color: #0d0e12;
    color: var(--text-main);
    min-height: 100vh;
    overflow-y: auto;
    position: relative;
}

/* Главная вертикальная обертка */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    padding: clamp(20px, 5vw, 60px) 15px; /* Оптимальные безопасные отступы по бокам */
    gap: clamp(30px, 6vw, 50px);
    overflow-x: hidden;
}

/* Задний фон со свечением */
body::before, body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
}
body::before {
    width: 450px;
    height: 450px;
    background: var(--bocchi-pink);
    opacity: 0.25;
    top: 5%;
    left: 10%;
    animation: float 8s ease-in-out infinite alternate;
}
body::after {
    width: 500px;
    height: 500px;
    background: var(--ryo-blue);
    opacity: 0.20;
    top: 35%;
    right: 10%;
    animation: float 10s ease-in-out infinite alternate-reverse;
}

/* --- ВЕРХНИЙ БЛОК (Профиль) --- */
.main-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: 850px;
    gap: 20px;
    flex-wrap: wrap;
}

.sidebar {
    width: 100%;
    min-width: 240px;
    flex: 1 1 240px;
    background-size: cover;
    background-position: center 15%; /* Смещаем картинку, чтобы лицо Хитори всегда было в кадре */
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    min-height: 200px;
    padding: 30px 20px;
    background: rgba(0, 0, 0, 0.45);
    gap: 20px;
}

.avatar-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--bocchi-pink);
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.4);
    transition: transform 0.3s ease;
}
.avatar-container:hover { transform: scale(1.08); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; }

.social-links { display: flex; gap: 18px; }
.social-icon { font-size: 1.4rem; color: var(--text-muted); text-decoration: none; transition: color 0.3s ease, transform 0.2s ease; position: relative; }
.social-icon:hover { color: #fff; transform: translateY(-2px); }

.profile-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: clamp(20px, 4vw, 35px);
    flex: 1 1 300px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    
    /* Флекс для вертикального распределения элементов */
    display: flex;
    flex-direction: column;
}

header h1 {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    margin-bottom: 6px;
    background: linear-gradient(45deg, var(--bocchi-pink), var(--ryo-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }

section { margin-bottom: 20px; }
section h2 { font-size: 1.1rem; margin-bottom: 10px; color: var(--bocchi-pink); border-bottom: 1px solid var(--glass-border); padding-bottom: 4px; display: inline-block; }
section p { color: #d1d5db; line-height: 1.5; font-size: 0.9rem; }

/* Стек технологий автоматически прижимается к низу карточки */
.tech-stack {
    margin-top: auto;
    padding-top: 15px;
}
.tech-stack ul { list-style: none; display: flex; gap: 10px; flex-wrap: wrap; }
.tech-stack li { display: flex; align-items: center; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-border); padding: 6px 14px; border-radius: 14px; font-size: 0.85rem; transition: all 0.2s ease; }
.tech-stack li:hover {
    background: rgba(255, 105, 180, 0.15);
    border-color: var(--bocchi-pink);
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.2);
}
.tech-icon { margin-right: 6px; }

/* --- НИЖНИЙ БЛОК: СЕТКА ПРОЕКТОВ --- */
.projects-section {
    width: 100%;
    max-width: 850px; 
}

.section-title {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    justify-content: flex-start;
}

.project-tile {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    
    flex: 1 1 250px;
    width: 100%;
    max-width: 270px;
    height: 420px;
    
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    margin-top: 0;
    margin-bottom: 8px;
    transition: margin 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.tile-header { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 15px;
    flex-shrink: 0;
}

.project-logo-wrapper {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-logo { 
    width: 100% !important; 
    height: 100% !important; 
    object-fit: cover !important; 
}

.tile-title h3 { font-size: 1.1rem; color: #fff; line-height: 1.2; }
.tile-title p { font-size: 0.75rem; color: var(--text-muted); }

.tile-desc {
    font-size: 0.8rem;
    color: #d1d5db;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
    overflow-y: auto; 
    padding-right: 5px; 
}

.tile-desc::-webkit-scrollbar { width: 4px; }
.tile-desc::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.01); }
.tile-desc::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }
.tile-desc::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

.tile-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 15px;
    flex-shrink: 0;
}

.project-socials { display: flex; gap: 14px; }
.project-socials a { color: var(--text-muted); font-size: 1.2rem; text-decoration: none; transition: color 0.2s ease, transform 0.2s ease; }
.project-socials a:hover { color: #fff; transform: translateY(-2px); }

.tile-btn {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease, color 0.2s ease;
}
.tile-btn i { font-size: 0.75rem; transition: transform 0.2s ease; }

/* --- ХОВЕРЫ ДЛЯ КАРТОЧЕК --- */
.tile-travevill:hover { margin-top: -8px; margin-bottom: 16px; border-color: var(--bocchi-pink); box-shadow: 0 15px 30px rgba(255, 105, 180, 0.25); }
.tile-travevill:hover .tile-btn { color: var(--bocchi-pink); }
.tile-travevill:hover .tile-btn i { transform: translateX(3px); }

.tile-polityevo:hover { margin-top: -8px; margin-bottom: 16px; border-color: var(--ryo-blue); box-shadow: 0 15px 30px rgba(0, 191, 255, 0.25); }
.tile-polityevo:hover .tile-btn { color: var(--ryo-blue); }
.tile-polityevo:hover .tile-btn i { transform: translateX(3px); }

.tile-discord-server:hover { margin-top: -8px; margin-bottom: 16px; border-color: #5865F2; box-shadow: 0 15px 30px rgba(88, 101, 242, 0.3); }
.tile-discord-server:hover .tile-btn { color: #5865F2; }
.tile-discord-server:hover .tile-btn i { transform: translateX(3px); }

.tile-blitzstats:hover { margin-top: -8px; margin-bottom: 16px; border-color: #2ecc71; box-shadow: 0 15px 30px rgba(46, 204, 113, 0.25); }
.tile-blitzstats:hover .tile-btn { color: #2ecc71; }
.tile-blitzstats:hover .tile-btn i { transform: translateX(3px); }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, 15px) scale(1.05); }
}

/* --- ВСПЛЫВАЮЩЕЕ УВЕДОМЛЕНИЕ (КЛИПБОРД ТУЛТИП) --- */
.clipboard-tooltip {
    position: absolute;
    background: rgba(88, 101, 242, 0.9); /* Серверный цвет Discord */
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: bold;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
    transform: translate(-50%, -100%);
    animation: tooltip-bounce 0.2s ease-out forwards;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.clipboard-tooltip.fade-out {
    opacity: 0;
    transform: translate(-50%, -130%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes tooltip-bounce {
    0% { transform: translate(-50%, -70%); opacity: 0; }
    100% { transform: translate(-50%, -100%); opacity: 1; }
}

/* ======================================================= */
/* МЕДИА-ЗАПРОС ДЛЯ ПК (Горизонтальные экраны)            */
/* ======================================================= */
@media (min-width: 750px) {
    .main-container {
        min-height: 440px; 
    }
    .sidebar { 
        max-width: 250px; 
    }
    .sidebar-content { 
        flex-direction: column; 
        padding: 35px 20px; 
    }
}

/* ======================================================= */
/* МЕДИА-ЗАПРОС ДЛЯ СМАРТФОНОВ                             */
/* ======================================================= */
@media screen and (max-width: 749px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }

    .sidebar {
        width: 100%;
        max-width: 550px; 
        height: auto; 
        background-image: none !important; 
        background: rgba(255, 255, 255, 0.03); 
    }

    .sidebar-content {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 30px 20px;
        gap: 15px; 
        background: transparent !important; 
    }

    .section-title {
        text-align: center;
    }

    .projects-grid {
        justify-content: center; 
    }

    .project-tile {
        flex: 1 1 100%;
        max-width: 550px; 
        height: auto; 
        min-height: 260px;
    }

    .tile-desc {
        overflow-y: visible; 
    }
}
