/* Завел переменные для цветов, чтобы не бегать постоянно по коду */
:root {
    --primary: #e53935;      /* Основной красный как в японском флаге */
    --primary-dark: #b71c1c; /* Темнее красный для ховеров */
    --secondary: #1a1a1a;    /* Почти черный для фонов */
    --accent: #ffab00;       /* Желтый для акцентов */
    --text: #f5f5f5;         /* Белый текст */
    --text-secondary: #b0b0b0; /* Серый для второстепенного */
    --bg: #0d0d0d;           /* Основной фон */
    --card-bg: #1a1a1a;      /* Фон карточек */
    --border: #333;          /* Границы */
}

/* Обнуляю стандартные отступы и подключаю border-box */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Плавный скролл по якорям */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Raleway', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden; /* На всякий случай убираю горизонтальный скролл */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
}

h1, h2, h3, h4 {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 3.5rem;
    position: relative;
    display: inline-block;
}

/* Подчеркивание для заголовка с градиентом */
h1:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

/* Добавил японский символ самурая под заголовками секций */
h2:after {
    content: '侍'; /* Самурайский символ */
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--primary);
    opacity: 0.7;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Хиро секция - первый экран */
header {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    /* Темный градиент поверх фоновой фотки */
    background: linear-gradient(rgba(13, 13, 13, 0.9), rgba(13, 13, 13, 0.7)), 
                url('photo.png');
    background-size: cover;
    background-position: center;
}

.header-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.header-content h1 {
    margin-bottom: 1rem;
    font-size: 4rem;
    /* Градиентный текст - выглядит круто */
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: glow 2s ease-in-out infinite alternate;
}

/* Анимация свечения для имени */
@keyframes glow {
    from {
        text-shadow: 0 0 5px var(--primary);
    }
    to {
        text-shadow: 0 0 20px var(--primary), 0 0 30px var(--primary-dark);
    }
}

.header-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.contacts {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: var(--primary);
    transform: translateY(-5px);
}

.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

/* Анимация стрелочки вниз */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-20px) translateX(-50%);
    }
    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* Секция "О себе" */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text {
    padding-right: 20px;
}

.about-image {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    /* 3D эффект наклона */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform 0.5s ease;
}

.about-image:hover {
    transform: perspective(1000px) rotateY(0deg);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Секция навыков */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-category {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.skill-category h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
    padding-left: 25px;
}

.skill-list li:before {
    content: '►';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.8rem;
}

.skill-list li:last-child {
    border-bottom: none;
}

/* Таймлайн для опыта работы */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* Вертикальная линия по центру */
.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: var(--primary);
    transform: translateX(-50%);
}

.timeline-item {
    padding: 20px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-content {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Треугольные хвостики у карточек таймлайна */
.timeline-content:after {
    content: '';
    position: absolute;
    top: 20px;
    width: 20px;
    height: 20px;
    background: var(--card-bg);
    transform: rotate(45deg);
}

.timeline-item:nth-child(odd) .timeline-content:after {
    right: -10px;
}

.timeline-item:nth-child(even) .timeline-content:after {
    left: -10px;
}

.timeline-date {
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 10px;
    display: block;
}

.timeline-marker {
    position: absolute;
    top: 30px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-marker {
    right: -10px;
}

.timeline-item:nth-child(even) .timeline-marker {
    left: -10px;
}

/* Секция проектов - специально сделал побольше и красивее */
.projects-section {
    background: linear-gradient(to bottom, var(--bg), var(--secondary));
    position: relative;
    overflow: hidden;
}

/* Большой японский текст как декоративный элемент */
.projects-section:before {
    content: 'プロジェクト'; /* "Проекты" по-японски */
    position: absolute;
    top: 50px;
    right: 50px;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.03); /* Еле заметный */
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    z-index: 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    position: relative;
    z-index: 1;
}

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: all 0.4s ease;
    position: relative;
    height: 650px; /* Фиксированная высота чтобы все карточки были одинаковые */
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.project-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-tech {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tech-tag {
    background: var(--primary);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.project-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.project-description {
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.project-link:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* Секция образования */
.education-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.education-content:before {
    content: '学び'; /* "Учеба" по-японски */
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.03);
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
}

/* Дополнительная информация */
.additional-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.additional-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.additional-card:hover {
    transform: translateY(-10px);
}

.additional-card h3 {
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-level {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

.qualities-list {
    list-style: none;
}

.qualities-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
    padding-left: 25px;
}

.qualities-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.qualities-list li:last-child {
    border-bottom: none;
}

/* Подвал */
footer {
    background: var(--secondary);
    padding: 50px 0 30px;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 30px;
}

/* Адаптив под планшеты */
@media (max-width: 992px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-text {
        padding-right: 0;
    }
    
    /* На мобилках таймлайн слева */
    .timeline:before {
        left: 30px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 20px;
    }
    
    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    .timeline-item:nth-child(odd) .timeline-marker,
    .timeline-item:nth-child(even) .timeline-marker {
        left: 20px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content:after,
    .timeline-item:nth-child(even) .timeline-content:after {
        left: -10px;
        right: auto;
    }
}

/* Адаптив под мобилки */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .header-content h1 {
        font-size: 3rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Классы для анимаций появления */
[data-aos] {
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
}

[data-aos].aos-animate {
    opacity: 1;
}

/* Разные направления появления */
.fade-up {
    transform: translateY(30px);
}

.fade-down {
    transform: translateY(-30px);
}

.fade-left {
    transform: translateX(-30px);
}

.fade-right {
    transform: translateX(30px);
}

.zoom-in {
    transform: scale(0.9);
}

/* 3D повороты для карточек проектов */
.flip-left {
    transform: perspective(1000px) rotateY(-90deg);
}

.flip-right {
    transform: perspective(1000px) rotateY(90deg);
}

/* Дополнительная анимация с поворотом */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.rotate-in {
    animation: rotateIn 0.8s ease-out;
}
