/* --- Root Variables & Base Setup --- */
:root {
    --font-main: 'Inter', sans-serif;
    
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --card-border-radius: 24px;
    --control-border-radius: 12px;
}

[data-theme="dark"] {
    --bg-color: #0d0d1a;
    --text-primary: #f0f2f5;
    --text-secondary: #a8b2c2;
    --highlight-color: #4c82f7;
    --glass-bg: rgba(30, 30, 50, 0.3);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.2);
    --orb-1: #b339ff;
    --orb-2: #4c82f7;
    --orb-3: #ff3b30;
}

[data-theme="light"] {
    --bg-color: #f0f2f5;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --highlight-color: #007aff;
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.1);
    --orb-1: #ff9500;
    --orb-2: #34c759;
    --orb-3: #5856d6;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* --- Dynamic Background Orbs --- */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
}
.orb:nth-child(1) {
    width: 400px;
    height: 400px;
    background: var(--orb-1);
    animation: move-orb-1 25s infinite alternate;
}
.orb:nth-child(2) {
    width: 350px;
    height: 350px;
    background: var(--orb-2);
    animation: move-orb-2 30s infinite alternate;
}
.orb:nth-child(3) {
    width: 300px;
    height: 300px;
    background: var(--orb-3);
    animation: move-orb-3 20s infinite alternate;
}

@keyframes move-orb-1 {
    from { transform: translate(10vw, -10vh) rotate(0deg); }
    to { transform: translate(60vw, 40vh) rotate(360deg); }
}
@keyframes move-orb-2 {
    from { transform: translate(80vw, 20vh) rotate(0deg); }
    to { transform: translate(20vw, 70vh) rotate(-360deg); }
}
@keyframes move-orb-3 {
    from { transform: translate(30vw, 90vh) rotate(0deg); }
    to { transform: translate(70vw, -20vh) rotate(180deg); }
}

/* --- Layout & Header --- */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 1rem 5%;
    background: rgba(0,0,0,0);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.3s ease;
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.portfolio-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 20px;
    display: grid;
    gap: 2rem;
}

/* --- Motion Design: On-Load Animation --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.glass-card {
    animation: fadeInUp 0.8s var(--ease-out-quart) both;
}
.profile-card { animation-delay: 0.1s; }
.grid-layout .glass-card:nth-child(1) { animation-delay: 0.2s; }
.grid-layout .glass-card:nth-child(2) { animation-delay: 0.3s; }
#backend-projects { animation-delay: 0.4s; }
#contact { animation-delay: 0.5s; }


/* --- The "Liquid Glass" Card Style --- */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-border-radius);
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px 0 var(--glass-shadow);
    transition: transform 0.3s var(--ease-out-quart), box-shadow 0.3s var(--ease-out-quart);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 var(--glass-shadow);
}

.glass-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.75rem;
}

/* --- Component Styles --- */
.profile-card {
    text-align: center;
}
.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--glass-border);
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}
.profile-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.profile-bio {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 1.5rem auto;
}
.highlight {
    color: var(--highlight-color);
    font-weight: 500;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}
.skill-item {
    background: rgba(0,0,0,0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--control-border-radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: background 0.3s ease;
}
.skill-item:hover {
    background: rgba(0,0,0,0.2);
}
.skill-item i {
    color: var(--highlight-color);
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.hobby-card {
    height: 150px;
    border-radius: var(--control-border-radius);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}
.hobby-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.hobby-content i {
    font-size: 2rem;
}

.projects-list li {
    list-style: none;
    margin-bottom: 0.75rem;
}
.projects-list a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    background: rgba(0,0,0,0.1);
    border-radius: var(--control-border-radius);
    transition: background 0.3s ease, transform 0.3s ease;
}
.projects-list a:hover {
    background: rgba(0,0,0,0.2);
    transform: translateX(5px);
}
.projects-list .icon {
    margin-right: 1rem;
    color: var(--text-secondary);
    width: 20px;
}
.projects-list span {
    flex-grow: 1;
    font-weight: 500;
}
.projects-list .link-icon {
    color: var(--text-secondary);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}
.projects-list a:hover .link-icon {
    opacity: 1;
}

.disclaimer {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.backend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}
.backend-item {
    background: rgba(0,0,0,0.1);
    border-radius: var(--control-border-radius);
    padding: 1.5rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    transition: background 0.3s ease, transform 0.3s ease;
}
.backend-item:hover {
    background: rgba(0,0,0,0.2);
    transform: translateY(-5px);
}
.backend-item i {
    font-size: 1.75rem;
    color: var(--highlight-color);
}
.backend-item span {
    font-weight: 500;
}
.backend-item .download-icon {
    font-size: 1rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--control-border-radius);
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.1);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
}
.contact-form input::placeholder, .contact-form textarea::placeholder {
    color: var(--text-secondary);
}
.contact-form textarea {
    resize: vertical;
}
.contact-form button {
    padding: 0.8rem 1rem;
    border: none;
    border-radius: var(--control-border-radius);
    background-color: var(--highlight-color);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.contact-form button:hover {
    background-color: color-mix(in srgb, var(--highlight-color) 90%, black);
    transform: scale(1.02);
}

/* --- Footer & Theme Toggle --- */
.site-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.social-links {
    margin-bottom: 1rem;
}
.social-links a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    margin: 0 0.75rem;
    transition: color 0.3s ease;
}
.social-links a:hover {
    color: var(--highlight-color);
}
.last-updated {
    font-size: 0.8rem;
    opacity: 0.7;
}
.theme-button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}
.theme-button:hover {
    background-color: var(--glass-bg);
}
[data-theme="dark"] .fa-sun { display: block; }
[data-theme="dark"] .fa-moon { display: none; }
[data-theme="light"] .fa-sun { display: none; }
[data-theme="light"] .fa-moon { display: block; }


/* --- Responsive Design --- */
@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    .portfolio-container {
        margin-top: 1rem;
        gap: 1.5rem;
    }
    .glass-card {
        padding: 1.5rem;
    }
    .profile-name {
        font-size: 1.75rem;
    }
    .profile-img {
        width: 100px;
        height: 100px;
    }
}