@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0e0e0e;
    --bg-secondary: #0a0a0a;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #aaa;
    --accent-color: #667eea;
    --accent-gradient: linear-gradient(135deg, #667eea, #764ba2);
    --border-color: rgba(255,255,255,0.08);
    --hero-gradient: radial-gradient(circle at 0% 0%, #0e0e0e, #1a1a2e, #2a1a3e);
    --gradient-start: #1a1a2e;
    --gradient-end: #0a0a0a;
    --stats-bg: rgba(255,255,255,0.05);
    --stats-border: rgba(255,255,255,0.08);
    --stats-hover: rgba(255,255,255,0.08);
}

[data-theme="light"] {
    --bg-primary: #f5f0eb;
    --bg-secondary: #efe8e0;
    --bg-card: #ffffff;
    --text-primary: #2c3e2f;
    --text-secondary: #5a6e5d;
    --accent-color: #2d5a2c;
    --accent-gradient: linear-gradient(135deg, #2d5a2c, #4a7c48);
    --border-color: rgba(0,0,0,0.06);
    --hero-gradient: radial-gradient(circle at 0% 0%, #f5f0eb, #e8dfd5, #f0ebe3);
    --gradient-start: #e8dfd5;
    --gradient-end: #dad0c4;
    --stats-bg: rgba(0,0,0,0.03);
    --stats-border: rgba(0,0,0,0.06);
    --stats-hover: rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    scroll-behavior: smooth;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

@media (min-width: 769px) {
    body {
        cursor: none;
    }
}

.custom-cursor {
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.2s, height 0.2s, background 0.2s, border-color 0.2s;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(2px);
}

.hero {
    padding: 60px 5%;
    background: var(--hero-gradient);
    animation: gradientShift 10s ease infinite;
    background-size: 200% 200%;
    border-bottom: 1px solid var(--border-color);
}

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

.header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 5%;
    z-index: 100;
    flex-wrap: wrap;
    gap: 12px;
}

[data-theme="light"] .header {
    background: rgba(245, 240, 235, 0.9);
}

.logo {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo-serif {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
}

.nav-link {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

.theme-switch {
    position: relative;
    width: 56px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}

.theme-switch-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--stats-bg);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    transition: all 0.3s;
}

.theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    transform: translateX(0);
}

.theme-switch-thumb i {
    font-size: 0.9rem;
    color: white;
    position: absolute;
    transition: opacity 0.2s;
}

.theme-switch-thumb .fa-moon {
    opacity: 1;
}

.theme-switch-thumb .fa-sun {
    opacity: 0;
}

[data-theme="light"] .theme-switch-thumb {
    transform: translateX(28px);
}

[data-theme="light"] .theme-switch-thumb .fa-moon {
    opacity: 0;
}

[data-theme="light"] .theme-switch-thumb .fa-sun {
    opacity: 1;
}

.theme-switch:hover .theme-switch-track {
    border-color: var(--accent-color);
    background: var(--stats-hover);
}

nav {
    display: flex;
    gap: 24px;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 60px;
    flex-wrap: wrap;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.futuristic-title {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: clamp(2rem, 6vw, 3.5rem);
    line-height: 1.2;
    margin-bottom: 20px;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

/* ===== ПЕРЕЛИВАЮЩИЕСЯ КНОПКИ ===== */
.btn-primary, .btn-secondary, .btn-submit, .btn-glass {
    padding: 10px 24px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    position: relative;
    overflow: hidden;
    display: inline-block;
    border: none;
    cursor: pointer;
    background-size: 200% auto;
}

.btn-primary, .btn-submit {
    background: linear-gradient(135deg, #667eea, #764ba2, #a5b4fc, #667eea);
    background-size: 300% 300%;
    color: white;
    animation: buttonShimmer 4s ease infinite;
}

.btn-primary::after, .btn-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-primary:hover::after, .btn-submit:hover::after {
    width: 200%;
    height: 200%;
}

.btn-primary:hover, .btn-submit:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    animation: buttonShimmer 1.5s ease infinite;
}

.btn-glass {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05), rgba(255,255,255,0.15));
    background-size: 200% 200%;
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: glassShimmer 4s ease infinite;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    animation: glassShimmer 1.5s ease infinite;
}

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

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

[data-theme="light"] .btn-primary, 
[data-theme="light"] .btn-submit {
    background: linear-gradient(135deg, #2d5a2c, #4a7c48, #6a9c68, #2d5a2c);
    background-size: 300% 300%;
    animation: buttonShimmer 4s ease infinite;
}

.hero-shape {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 280px;
}

.glowing-sphere {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sphere-core {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--accent-color) 0%, rgba(102,126,234,0.2) 70%);
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.7;
    animation: pulse 3s ease infinite;
}

.sphere-ring {
    position: absolute;
    width: 90%;
    height: 90%;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    animation: rotate 8s linear infinite;
}

.sphere-ring::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 12px var(--accent-color);
}

.sphere-particles {
    position: absolute;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(102,126,234,0.3) 1%, transparent 1%);
    background-size: 20px 20px;
    border-radius: 50%;
    animation: rotateReverse 12s linear infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateReverse {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

.cases {
    padding: 60px 5%;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-primary);
}

.cases h2 {
    margin-bottom: 16px;
    font-size: 1.8rem;
    text-align: center;
}

.cases-note {
    text-align: center;
    font-size: 0.85rem;
    margin-bottom: 40px;
    opacity: 1;
    font-weight: 500;
    background: linear-gradient(135deg, #667eea, #764ba2, #a5b4fc, #667eea);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gentleGlow 4s ease infinite;
}

[data-theme="light"] .cases-note {
    background: linear-gradient(135deg, #2d5a2c, #4a7c48, #6a9c68, #2d5a2c);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gentleGlowLight 4s ease infinite;
}

@keyframes gentleGlow {
    0% {
        background-position: 0% 50%;
        text-shadow: 0 0 2px rgba(102,126,234,0.2);
    }
    50% {
        background-position: 100% 50%;
        text-shadow: 0 0 8px rgba(102,126,234,0.3);
    }
    100% {
        background-position: 0% 50%;
        text-shadow: 0 0 2px rgba(102,126,234,0.2);
    }
}

@keyframes gentleGlowLight {
    0% {
        background-position: 0% 50%;
        text-shadow: 0 0 2px rgba(45,90,44,0.15);
    }
    50% {
        background-position: 100% 50%;
        text-shadow: 0 0 8px rgba(45,90,44,0.25);
    }
    100% {
        background-position: 0% 50%;
        text-shadow: 0 0 2px rgba(45,90,44,0.15);
    }
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.case {
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s forwards;
    border: 1px solid var(--border-color);
    break-inside: avoid;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.case:hover {
    transform: translateY(-8px) rotateX(3deg) rotateY(3deg) scale(1.02);
    box-shadow: 0 25px 35px rgba(0,0,0,0.3);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.size-small {
    grid-row: span 1;
    opacity: 0.9;
    transform: translateY(10px);
}
.size-small:hover {
    transform: translateY(4px) rotateX(2deg) rotateY(2deg) scale(1.02);
}

.size-normal {
    grid-row: span 1;
}

.size-large {
    grid-row: span 2;
}

.size-wide {
    grid-column: span 2;
    grid-row: span 1;
}

.margin-top-20 {
    margin-top: 1.25rem;
}
.margin-top-40 {
    margin-top: 2.5rem;
}
.margin-top--20 {
    margin-top: -1.25rem;
}
.margin-top--40 {
    margin-top: -2.5rem;
}

.case-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.case-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.case:hover .case-image img {
    transform: scale(1.08);
}

.case-info {
    padding: 20px;
}

.case-info h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.case-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.tag {
    display: inline-block;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    margin-top: 0.5rem;
}

.case-featured {
    position: relative;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
    transform: scale(1.02);
}

.case-featured:hover {
    transform: translateY(-8px) rotateX(3deg) rotateY(3deg) scale(1.03);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
}

.case-featured:hover .case-image img {
    transform: scale(1.08);
}

.featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 10;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

[data-theme="light"] .case-featured {
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(45, 90, 44, 0.3);
}

[data-theme="light"] .case-featured:hover {
    box-shadow: 0 0 30px rgba(45, 90, 44, 0.5);
}

.stack {
    padding: 60px 5%;
    background: var(--bg-secondary);
    text-align: center;
}

.stack h2 {
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.stack-item {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 1.5rem;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.stack-item:hover {
    transform: translateY(-4px);
}

.stack-item i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.stack-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.stack-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.contact {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 20px 120px;
}

.contact h2 {
    margin-bottom: 16px;
    font-size: 1.8rem;
}

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

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.contact-form input,
.contact-form textarea {
    padding: 12px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: var(--stats-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--stats-hover);
}

.contact-form button {
    align-self: center;
    margin-top: 0.5rem;
}

.contact-socials {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--stats-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.social-link i {
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.social-link:hover {
    background: var(--stats-hover);
    color: var(--accent-color);
    transform: translateY(-3px) scale(1.05);
}

[data-theme="light"] .social-link .fa-telegram-plane,
[data-theme="light"] .social-link .fa-behance {
    color: var(--accent-color) !important;
    transition: color 0.2s ease;
}

[data-theme="light"] .social-link:hover .fa-telegram-plane,
[data-theme="light"] .social-link:hover .fa-behance {
    color: white !important;
}

.footer {
    text-align: center;
    padding: 30px 20px 40px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-roles {
    font-size: 0.85rem;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.role-design,
.role-frontend {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
}

.divider {
    margin: 0 10px;
    color: var(--accent-color);
    font-size: 0.7rem;
}

.family-sign {
    font-size: 0.75rem;
    background: linear-gradient(135deg, #888, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: all 0.3s;
}

.family-sign:hover {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.heart {
    display: inline-block;
    transition: transform 0.2s;
    color: #ff6b6b;
}

.family-sign:hover .heart {
    transform: scale(1.2);
}

/* ===== СТРАНИЦА "ОБО МНЕ" ===== */
.about-hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 5% 40px;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 60px;
    align-items: center;
    flex-wrap: wrap;
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-image img {
    max-width: 100%;
    width: 320px;
    border-radius: 40% 60% 60% 40%;
    box-shadow: 0 25px 40px rgba(0,0,0,0.4);
    border: 2px solid var(--accent-color);
}

.about-text {
    flex: 1.5;
}

.about-text h1 {
    font-size: 2.5rem;
    margin-bottom: 24px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.about-text p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.values {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.value-item {
    flex: 1;
    background: var(--bg-card);
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.value-item:hover {
    transform: translateY(-5px);
}

.value-item i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 12px;
}

.value-item h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.value-item p {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.about-button-wrapper {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
    }
    .hero-buttons {
        justify-content: center;
    }
    .glowing-sphere {
        width: 220px;
        height: 220px;
    }
}

@media (max-width: 768px) {
    .custom-cursor {
        display: none;
    }
    .header {
        justify-content: center;
        flex-wrap: wrap;
    }
    nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    .theme-switch {
        order: 2;
    }
    .logo {
        order: 1;
    }
    .cases-grid {
        display: flex;
        flex-direction: column;
    }
    .size-wide, .size-large {
        grid-column: span 1;
        grid-row: span 1;
    }
    .case-featured {
        transform: scale(1);
    }
    .case-featured:hover {
        transform: translateY(-4px) scale(1);
    }
    .featured-badge {
        top: 8px;
        right: 8px;
        font-size: 0.6rem;
        padding: 3px 8px;
        white-space: nowrap;
    }
    .margin-top-20, .margin-top-40, .margin-top--20, .margin-top--40 {
        margin-top: 0;
    }
    .contact {
        padding: 40px 20px 100px;
    }
    .contact-socials {
        gap: 20px;
    }
    .social-link {
        width: 44px;
        height: 44px;
    }
    .social-link i {
        font-size: 1.3rem;
    }
    .footer-roles {
        font-size: 0.7rem;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .divider {
        display: none;
    }
    .stack-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .about-container {
        flex-direction: column;
        text-align: center;
    }
    .about-image img {
        width: 240px;
    }
    .about-text h1 {
        font-size: 2rem;
    }
    .about-button-wrapper {
        margin-top: 30px;
        margin-bottom: 30px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 20px;
    }
    .hero-text h1 {
        font-size: 1.5rem;
    }
    .btn-primary, .btn-secondary, .btn-submit, .btn-glass {
        padding: 8px 18px;
        font-size: 0.85rem;
    }
    .contact {
        padding: 40px 20px 80px;
    }
    .featured-badge {
        font-size: 0.55rem;
        padding: 3px 6px;
        top: 6px;
        right: 6px;
    }
    .glowing-sphere {
        width: 180px;
        height: 180px;
    }
    .about-button-wrapper {
        margin-top: 20px;
        margin-bottom: 20px;
    }
}
