@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* Color variables and theme definitions are on the root HTML element */
html {
    --bg-fallback: #000;
    --bg-gradient: linear-gradient(-45deg, #121212, #1a1a2e, #16213e, #0f3460);
    --card-bg: rgba(28, 28, 30, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --text-body: #EAEAEA;
    --button-bg: rgba(51, 51, 51, 0.8);
    --button-border: rgba(255, 255, 255, 0.1);
    --accent-color: #007BFF;
    --accent-glow: rgba(0, 123, 255, 0.5);
}

html.light-theme {
    --bg-fallback: #f2f2f2;
    --bg-gradient: linear-gradient(-45deg, #f2f2f2, #e0eafc, #cfdef3, #d7e2f5);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.1);
    --text-primary: #1E1E1E;
    --text-secondary: #555555;
    --text-body: #333333;
    --button-bg: rgba(230, 230, 230, 0.8);
    --button-border: rgba(0, 0, 0, 0.1);
    --accent-color: #0056b3;
    --accent-glow: rgba(0, 86, 179, 0.4);
}

/* This new rule explicitly tells the animated background to update for the light theme */
html.light-theme .animated-background {
    background: var(--bg-gradient);
}

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

html {
    background-color: var(--bg-fallback); /* Using the new variable */
    font-family: 'Inter', sans-serif;
    transition: background-color 0.5s ease;
}

body {
    color: var(--text-body);
    display: flex;
    justify-content: center;
    align-items: center;
}

.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    transition: background 0.5s ease;
}

.card {
    background-color: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    max-width: 400px;
    width: 100%;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--card-border);
    position: relative;
    margin: 20px;
}

.card > *:not(.theme-toggle-container) { animation: fadeInUp 0.8s ease-out forwards; opacity: 0; }
.theme-toggle-container { position: absolute; top: 20px; right: 20px; display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.theme-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #555; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(20px); }

.profile-picture { animation-delay: 0.1s; width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 3px solid var(--text-body); margin-bottom: 20px; }
.name { animation-delay: 0.2s; font-size: 2rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.bio { animation-delay: 0.3s; font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 30px; }
.main-links { animation-delay: 0.5s; display: flex; flex-direction: column; margin-bottom: 30px; }
.link-button { background-color: var(--button-bg); color: var(--text-body); text-decoration: none; padding: 15px; border-radius: 10px; font-size: 1rem; font-weight: 500; border: 1px solid var(--button-border); transition: all 0.3s ease; }
.link-button:hover { background-color: var(--accent-color); color: #FFFFFF; transform: translateY(-3px); box-shadow: 0 0 20px var(--accent-glow); }
.social-links { animation-delay: 0.7s; display: flex; justify-content: center; gap: 25px; }
.social-links a { color: var(--text-secondary); font-size: 1.5rem; text-decoration: none; transition: all 0.3s ease; }
.social-links a:hover { color: var(--accent-color); transform: translateY(-3px); }