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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --text-primary: #0a0a0a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --border: #e5e5e5;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --gradient-opacity: 0.08;
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: #1e3a8a;
    --border: #2a2a2a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.7);
    --gradient-opacity: 0.15;
}

*, html {
    scroll-behavior: smooth !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border-radius: 6px;
    border: 3px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: #000000;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #2a2a2a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #1a1a1a var(--bg-primary);
}

[data-theme="dark"] * {
    scrollbar-color: #2a2a2a var(--bg-primary);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Grain texture */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 100;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Gradient background */
.gradient-bg {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, var(--gradient-opacity)) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.3s ease;
}

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

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    animation: slideDown 0.6s ease-out;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .nav {
    background: rgba(10, 10, 10, 0.8);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo-img {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease;
}

.logo:hover .logo-img {
    transform: scale(1.1) rotate(5deg);
}

/* Dark theme logo color adjustment */
[data-theme="dark"] .logo-img {
    filter: invert(1);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

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

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

.nav-links a:hover::after {
    width: 100%;
}

/* Language Toggle */
.lang-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.lang-toggle:hover {
    border-color: var(--accent);
    transform: scale(1.05);
    color: var(--accent);
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.theme-toggle svg {
    position: absolute;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: var(--text-primary);
}

.moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
    color: var(--text-primary);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #ffffff;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 0 80px;
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 32px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

[data-theme="dark"] .hero-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-title {
    font-size: clamp(40px, 7vw, 80px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}

.hero-title .line {
    display: block;
    animation: fadeInUp 0.8s ease-out both;
}

.hero-title .line:nth-child(1) {
    animation-delay: 0.3s;
}

.hero-title .line:nth-child(2) {
    animation-delay: 0.4s;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 80px;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.btn-primary svg {
    transition: transform 0.3s ease;
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 64px;
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

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

/* Animate-in class for scroll animations */
.section-header {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-header.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.project-showcase,
.about-grid,
.contact-grid,
.contact-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.project-showcase.animate-in,
.about-grid.animate-in,
.contact-grid.animate-in,
.contact-content.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeIn 1s ease-out 1s both;
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-tertiary);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 3px;
    height: 8px;
    background: var(--text-tertiary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 1.5s ease-in-out infinite;
}

@keyframes scroll {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Section styles */
section {
    padding: 120px 0;
    position: relative;
    z-index: 1;
}

.section-label {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

/* Work Section */
.work {
    background: var(--bg-secondary);
}

.project-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.project-visual {
    cursor: pointer;
    display: block;
}

.project-window {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.project-visual:hover .project-window {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), 0 0 0 2px var(--accent);
}

.window-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.window-dots {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.window-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
}

.window-dots span:nth-child(1) { background: #ff5f57; }
.window-dots span:nth-child(2) { background: #ffbd2e; }
.window-dots span:nth-child(3) { background: #28ca42; }

.window-title {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.window-content {
    padding: 40px;
}

.url-demo {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.demo-input,
.demo-output {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.demo-input {
    min-width: 0;
}

.demo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-icon {
    font-size: 20px;
}

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

.demo-arrow {
    font-size: 24px;
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
}

.demo-short {
    color: var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.mini-stat {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.mini-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mini-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.project-info {
    animation: fadeInRight 0.8s ease-out;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.project-name {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.project-desc {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.tech-tag {
    padding: 8px 16px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
}

.project-features {
    display: grid;
    gap: 12px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--text-secondary);
}

.feature svg {
    color: var(--accent);
    flex-shrink: 0;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-text {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

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

.skills {
    display: grid;
    gap: 24px;
}

.skill-category h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.skill-category p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.code-window {
    background: #1e1e1e;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: float 6s ease-in-out infinite;
    transition: box-shadow 0.3s ease;
}

[data-theme="dark"] .code-window {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.9);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.code-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #2d2d2d;
    border-bottom: 1px solid #3d3d3d;
}

.code-dots {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.code-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #ffbd2e; }
.code-dots span:nth-child(3) { background: #28ca42; }

.code-title {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

.code-content {
    padding: 24px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.8;
    overflow-x: auto;
}

.code-content code {
    color: #d4d4d4;
}

.code-keyword { color: #569cd6; }
.code-variable { color: #9cdcfe; }
.code-property { color: #9cdcfe; }
.code-string { color: #ce9178; }

/* Contact Section */
.contact {
    background: var(--bg-secondary);
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 64px;
    line-height: 1.7;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 16px;
    padding: 40px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    cursor: pointer;
    min-height: 160px;
    height: 100%;
}

.contact-card .contact-icon {
    margin-bottom: 8px;
}

.contact-card .contact-info {
    width: 100%;
}

.discord-card {
    width: 100%;
    text-align: left;
}

/* Global Copy Notification */
.copy-notification {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent);
    color: white;
    padding: 16px 32px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1000;
}

.copy-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.copy-notification svg {
    flex-shrink: 0;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.contact-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: var(--radius-md);
    color: var(--accent);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.contact-icon svg {
    width: 28px;
    height: 28px;
}

.contact-card:hover .contact-icon {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

.contact-info {
    text-align: left;
}

.contact-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.contact-info p {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

/* Footer */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

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

.footer-content p {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 968px) {
    .project-showcase,
    .about-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    
    .hero-stats {
        gap: 32px;
    }
    
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .nav-links {
        gap: 16px;
        font-size: 14px;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    section {
        padding: 60px 0;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 24px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat {
        min-width: 100px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .project-window,
    .code-window {
        animation: none;
    }
    
    .contact-card {
        padding: 32px 24px;
        min-height: 140px;
    }
    
    .contact-icon {
        width: 56px;
        height: 56px;
    }
    
    .contact-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .copy-notification {
        bottom: 20px;
        padding: 14px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        display: none;
    }
    
    .nav-controls {
        gap: 8px;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-description {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .project-name {
        font-size: 24px;
    }
    
    .contact-info p {
        font-size: 16px;
    }
    
    .url-demo {
        flex-direction: column;
        gap: 12px;
    }
    
    .demo-arrow {
        transform: rotate(90deg);
    }
}

::selection {
    background: var(--accent);
    color: white;
}
