:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --shadow: rgba(0, 0, 0, 0.1);
    --border: #e9ecef;
    --overlay: rgba(0, 0, 0, 0.5);
    --glow-color: rgba(99, 102, 241, 0.4);
    --bg-pattern: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-primary: #818cf8;
    --accent-secondary: #a78bfa;
    --shadow: rgba(0, 0, 0, 0.3);
    --border: #2a2a2a;
    --overlay: rgba(0, 0, 0, 0.7);
    --glow-color: rgba(129, 140, 248, 0.6);
    --bg-pattern: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

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

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

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    box-shadow: 0 2px 10px var(--shadow);
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 400;
    font-family: "Dynalight", cursive;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

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

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
}

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

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

.theme-toggle {
    background: var(--bg-secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

main {
    margin-top: 70px;
}

.page {
    display: none;
    min-height: calc(100vh - 70px);
    position: absolute;
    width: 100%;
    top: 70px;
    left: 0;
}

.page.active {
    display: block;
    position: relative;
    top: 0;
}

#articles {
    background-image: var(--bg-pattern);
    background-color: var(--bg-primary);
    position: relative;
}

#articles::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    opacity: 0.7;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.article-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px var(--shadow), 0 0 30px var(--glow-color);
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .card-image img {
    transform: scale(1.1);
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.card-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.card-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-button:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

#portfolio {
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 70px);
    overflow: hidden;
}

#portfolio.page.active {
    display: flex;
    position: relative;
}

.animated-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary);
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    bottom: -100px;
    right: -100px;
    animation-delay: 7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-50px, 50px) scale(0.9);
    }
}

.portfolio-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
}

.portfolio-name {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease;
}

.portfolio-subtitle {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 3rem;
    font-weight: 400;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease 0.4s backwards;
}

.social-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid var(--border);
}

.social-icon:hover {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow);
}

.portfolio-footer {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-secondary);
    font-size: 0.75rem;
    animation: fadeIn 1s ease 0.6s backwards;
    text-align: center;
    max-width: 90%;
    line-height: 1.4;
}

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

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

@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .page-title {
        font-size: 2.2rem;
    }

    .page-subtitle {
        font-size: 1.15rem;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .card-description {
        font-size: 1.1rem;
    }

    .card-button {
        font-size: 1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .portfolio-name {
        font-size: 2.5rem;
    }

    .portfolio-subtitle {
        font-size: 1.25rem;
        padding: 0 1rem;
    }

    .social-icon {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
    }

    .portfolio-footer {
        position: fixed;
        bottom: 1.5rem;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        font-size: 0.95rem;
    }

    .gradient-orb {
        filter: blur(60px);
    }

    .orb-1 {
        width: 250px;
        height: 250px;
    }

    .orb-2 {
        width: 200px;
        height: 200px;
    }

    .orb-3 {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 480px) {
    .nav-logo {
        font-size: 1.1rem;
    }

    .page-title {
        font-size: 1.9rem;
    }

    .page-subtitle {
        font-size: 1.05rem;
    }

    .portfolio-name {
        font-size: 2rem;
    }

    .portfolio-subtitle {
        font-size: 1.1rem;
    }

    .social-links {
        gap: 1rem;
    }

    .social-icon {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .portfolio-footer {
        font-size: 0.9rem;
        bottom: 1rem;
    }
}
