/* ROOT VARIABLES */
:root {
    --bg-dark: #0d1117;
    --bg-medium: #161b22;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-primary: #58a6ff;
    --accent-hover: #79c0ff;
    --font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition-speed: 0.3s;
}

/* GENERAL STYLES */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ANIMATED GRADIENT BACKGROUND */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(88, 166, 255, 0.1), transparent 30%),
                radial-gradient(circle at 80% 90%, rgba(88, 166, 255, 0.1), transparent 30%);
    animation: gradient-flow 15s ease-in-out infinite;
}

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


/* HEADER */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 100;
    background-color: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: top var(--transition-speed) ease-in-out;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
}

.main-nav a:hover {
    color: var(--text-primary);
}

.cta-button {
    background-color: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.cta-button:hover {
    background-color: var(--accent-primary);
    color: var(--bg-dark);
}

/* HERO SECTION */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
}

.hero-content {
    max-width: 700px;
    text-align: left;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.hero-links {
    display: flex;
    gap: 20px;
}

.social-icon {
    color: var(--text-secondary);
    transition: color var(--transition-speed);
}

.social-icon:hover {
    color: var(--accent-primary);
}


/* GENERAL SECTION STYLES */
section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    text-align: center;
    position: relative;
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-primary);
}

/* ABOUT SECTION */
.about-content {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 50px;
    align-items: center;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.skills-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.skills-list li {
    position: relative;
    padding-left: 25px;
}

.skills-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: 700;
}

.about-photo {
    position: relative;
}

.about-photo img {
    width: 100%;
    border-radius: 8px;
    filter: grayscale(100%);
    transition: filter var(--transition-speed);
}

.about-photo:hover img {
    filter: grayscale(0%);
}

/* PORTFOLIO SECTION */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.portfolio-card {
    background-color: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.3);
}

/* --- ИСПРАВЛЕННЫЙ БЛОК ДЛЯ КАРТИНОК --- */
.card-image {
    height: 200px;
    background-color: #0d1117; /* Фон для всех картинок */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px; /* Отступы для иконок */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Вписывает картинку, сохраняя пропорции */
}
/* --- КОНЕЦ ИСПРАВЛЕННОГО БЛОКА --- */

.card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.card-tags span {
    background-color: rgba(88, 166, 255, 0.1);
    color: var(--accent-primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.card-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    align-self: flex-start;
}

/* CONTACT SECTION */
.contact {
    text-align: center;
}

.contact .section-title {
    margin-bottom: 20px;
}

.contact .contact-subtitle {
    max-width: 600px;
    margin: 0 auto 40px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.contact-main-link-wrapper {
    margin-bottom: 40px;
}

.contact-main-link {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding-bottom: 5px;
    transition: color var(--transition-speed);
}

.contact-main-link:hover {
    color: var(--accent-hover);
}

.contact-main-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease-out;
}

.contact-main-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.contact-socials-footer {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.contact-socials-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
}

.contact-socials-footer a:hover {
    color: var(--accent-primary);
}


/* FOOTER */
.footer {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* MOBILE NAVIGATION */
.mobile-nav-toggle {
    display: none; /* Hidden by default */
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}
.mobile-nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 5px 0;
    transition: all var(--transition-speed);
}

.mobile-nav {
    display: none; /* Hidden by default */
}

/* FADE-IN ANIMATION FOR SECTIONS */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
