* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none;
}

:root[data-theme="light"] {
    --bg-color: #fbfbfd;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.06);
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --accent-color: #0071e3;
    --accent-gradient: linear-gradient(135deg, #0071e3, #41a5ff);
    --blur-strength: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] {
    --bg-color: #000000;
    --card-bg: rgba(22, 22, 23, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #6e6e73;
    --accent-color: #2997ff;
    --accent-gradient: linear-gradient(135deg, #2997ff, #0051a8);
    --blur-strength: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.7);
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: -1;
    pointer-events: none;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.5s cubic-bezier(0.28, 0.11, 0.32, 1),
        border-color 0.5s cubic-bezier(0.28, 0.11, 0.32, 1);
}

html {
    scroll-behavior: smooth;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: var(--bg-color);
    color: var(--text-primary);
}

body {
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 24px;
}

.floating-controls {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    gap: 12px;
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, background-color 0.3s;
}

.control-btn:hover {
    transform: scale(1.05);
    background: var(--text-primary);
    color: var(--bg-color);
}

#lang-toggle {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    user-select: none;
}

#back-to-top {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.tag {
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 32px;
    color: var(--text-primary);
}

.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-avatar-wrapper {
    position: relative;
    margin-bottom: 24px;
}

.hero-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--card-bg);
    box-shadow: var(--shadow-md);
}

.status-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background-color: #34c759;
    border: 2px solid var(--bg-color);
    border-radius: 50%;
}

.hero-name {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    background: var(--text-primary);
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-title {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.hero-bio {
    font-size: 15px;
    color: var(--text-tertiary);
    max-width: 500px;
    line-height: 1.6;
    margin-bottom: 32px;
}

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

.hero-link-icon {
    width: 18px;
    height: 18px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 500;
    background: var(--text-primary);
    color: var(--bg-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, opacity 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 500;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    transition: transform 0.2s ease, background-color 0.2s;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background: var(--card-border);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-tertiary);
    animation: bounce 2s infinite;
    cursor: pointer;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translate(-50%, 0);
    }

    40% {
        transform: translate(-50%, -10px);
    }

    60% {
        transform: translate(-50%, -5px);
    }
}

.section {
    padding: 100px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.about-text {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-text p {
    margin-bottom: 16px;
}

.skills-wrapper {
    margin-top: 32px;
}

.skills-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 220px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        box-shadow 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    color: var(--text-tertiary);
}

.project-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(0, 113, 227, 0.1);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card:nth-child(2) .project-icon-box {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
}

.project-card:nth-child(3) .project-icon-box {
    background: rgba(255, 149, 0, 0.1);
    color: #ff9500;
}

.project-link-icon {
    width: 16px;
}

.project-body {
    margin-top: 20px;
}

.project-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.project-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.contact-text {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid transparent;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

:root[data-theme="dark"] .contact-item {
    background: rgba(255, 255, 255, 0.02);
}

.contact-item:hover {
    border-color: var(--card-border);
    background: var(--bg-color);
    transform: translateY(-2px);
}

.contact-icon {
    color: var(--text-secondary);
}

.contact-info-text .label {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.contact-info-text .value {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 2px;
}

.qr-popover {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 12px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.qr-popover img {
    width: 140px;
    height: 140px;
    display: block;
    border-radius: 8px;
}

.contact-item:hover .qr-popover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

footer {
    padding: 40px 0;
    border-top: 1px solid var(--card-border);
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
}

.footer-meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.footer-link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1),
        transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-spinner {
    width: 30px;
    height: 30px;
    border: 2px solid var(--card-border);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@media (max-width: 1024px) {
    .container {
        padding: 0 32px;
    }

    .hero-name {
        font-size: 42px;
    }

    .section-title {
        font-size: 26px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .hero {
        height: 100vh;
        height: 100dvh;
        padding: 0 16px;
    }

    .hero-name {
        font-size: 34px;
    }

    .hero-title {
        font-size: 17px;
        padding: 0 12px;
    }

    .hero-bio {
        font-size: 14px;
        max-width: 100%;
        padding: 0 8px;
    }

    .hero-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .hero-avatar {
        width: 80px;
        height: 80px;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .about-text {
        font-size: 16px;
        line-height: 1.7;
    }

    .skills-container {
        gap: 8px;
    }

    .tag {
        font-size: 12px;
        padding: 5px 12px;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .project-card {
        height: auto;
        min-height: 180px;
        padding: 24px;
    }

    .project-name {
        font-size: 18px;
    }

    .project-desc {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }

    .contact-card {
        padding: 24px;
        gap: 24px;
    }

    .contact-methods {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .contact-item {
        padding: 14px;
    }

    .qr-popover {
        bottom: 110%;
    }

    .contact-item:active .qr-popover,
    .contact-item:focus-within .qr-popover {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    footer {
        padding: 32px 0;
    }

    .floating-controls {
        top: 16px;
        right: 16px;
        gap: 8px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }

    #lang-toggle {
        font-size: 12px;
    }

    .reveal {
        transition-duration: 0.5s;
        transform: translateY(20px);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-name {
        font-size: 28px;
    }

    .hero-title {
        font-size: 15px;
    }

    .hero-bio {
        font-size: 13px;
    }

    .btn-primary,
    .btn-secondary {
        max-width: 240px;
        padding: 10px 20px;
        font-size: 14px;
    }

    .hero-avatar {
        width: 70px;
        height: 70px;
    }

    .status-badge {
        width: 12px;
        height: 12px;
        bottom: 3px;
        right: 3px;
    }

    .section {
        padding: 44px 0;
    }

    .section-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .project-card {
        padding: 20px;
        border-radius: 16px;
    }

    .project-name {
        font-size: 17px;
    }

    .contact-card {
        padding: 20px;
        border-radius: 20px;
    }

    .floating-controls {
        top: 12px;
        right: 12px;
        gap: 6px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
    }

    #lang-toggle {
        font-size: 11px;
    }

    .scroll-indicator {
        bottom: 28px;
    }

    footer {
        padding: 24px 0;
        font-size: 12px;
    }
}

@media (max-height: 480px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 80px 16px 60px;
    }

    .hero-avatar-wrapper {
        margin-bottom: 12px;
    }

    .hero-avatar {
        width: 60px;
        height: 60px;
    }

    .hero-name {
        font-size: 26px;
        margin-bottom: 4px;
    }

    .hero-title {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .hero-bio {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .hero-links {
        flex-direction: row;
        gap: 10px;
    }

    .btn-primary,
    .btn-secondary {
        max-width: 180px;
        padding: 8px 16px;
        font-size: 13px;
    }

    .scroll-indicator {
        display: none;
    }
}

:root[data-theme="dark"] .qr-popover {
    background: rgba(30, 30, 32, 0.95);
}
