:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --secondary-text: #666666;
    --accent-color: #000000;
    --link-hover: #007aff;
    --skill-bg: #f8f8f8;
    --border-color: #f0f0f0;
    --avatar-border: #eee;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --secondary-text: #a0a0a0;
    --accent-color: #ffffff;
    --skill-bg: #2a2a2a;
    --border-color: #333333;
    --avatar-border: #333;
}

body.dark-mode .links-section img {
    filter: invert(1);
}

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

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-top: 80px;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 0 24px;
    text-align: center;
    flex: 1; /* Take up available space to push footer down */
}

/* Header */
.profile-header {
    margin-bottom: 48px;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 24px;
    object-fit: cover;
    border: 1px solid var(--avatar-border);
}

.name {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.05rem;
    margin-bottom: 8px;
}

.tagline-container {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 8px;
}

.tagline-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.univ-name {
    display: inline-block;
    width: 45px;
    text-align: left;
    font-size: 1.1rem;
    color: var(--secondary-text);
}

.tags {
    display: flex;
    align-items: center;
}

/* Sections General */
section {
    margin-bottom: 40px;
}

section h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--secondary-text);
    margin-bottom: 20px;
}

.about-container {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}

.work-row {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.work-label {
    width: 90px;
    text-align: left;
}

.work-company {
    display: inline-block;
    width: 140px;
    text-align: left;
}

.work-tags {
    display: flex;
    align-items: center;
}

.highlight {
    font-weight: 500;
    color: var(--accent-color);
    text-decoration: none;
}

.highlight:hover {
    text-decoration: underline;
}

.tag {
    padding: 2px 8px;
    background: var(--skill-bg);
    border-radius: 4px;
    font-size: 0.8rem;
    vertical-align: middle;
    margin-left: 4px;
    color: var(--secondary-text);
}

/* Skills */
.skills-section {
    margin-bottom: 32px;
}

.skills-list {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--secondary-text);
}

.skills-list span {
    padding: 2px 10px;
    background: var(--skill-bg);
    border-radius: 4px;
}

/* Stats */
.stats-grid {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--secondary-text);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    font-feature-settings: "tnum";
}

/* Links */
.links-section ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-bottom: 60px;
}

.links-section a {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%; /* Optional: Keep circular hover effect */
    transition: all 0.2s ease;
    border: none;
    padding: 0;
}

.links-section img {
    width: 32px;
    height: 32px;
    display: block;
    transition: transform 0.2s ease;
}

.links-section img[alt="GitHub"] {
    width: 28px;
    height: 28px;
}

.links-section img[alt="Blog"] {
    width: 30px;
    height: 30px;
}

.links-section a:hover {
    background-color: transparent;
    border-color: transparent;
    transform: translateY(-2px);
}

.links-section a:hover img {
    /* Optional: Slight scale or brightness change on hover */
    filter: brightness(0.8);
}

/* Footer */
.site-footer {
    padding-top: 32px;
    padding-bottom: 24px;
    font-size: 0.85rem;
    color: var(--secondary-text);
    text-align: center;
}

.site-footer a {
    color: var(--secondary-text);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .name {
        font-size: 2rem;
    }
    
    .stats-grid {
        gap: 20px;
    }
}

/* Theme Toggle Button */
#theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 0;
}

#theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

#theme-toggle svg {
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Default (Light Mode): Show Moon, Hide Sun */
.sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.moon-icon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Dark Mode: Show Sun, Hide Moon */
body.dark-mode .sun-icon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

body.dark-mode .moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}
