:root {
    /* Light Mode (Default) */
    --bg-body: #EFEBE9;
    --bg-body-gradient-start: #EFEBE9;
    --bg-body-gradient-end: #E8E4E0;
    --bg-card: #FFF8E7;
    --bg-form: #FFFFFF;
    --bg-input: #FAFAFA;
    --text-primary: #5D4037;
    --text-secondary: #6D4C41;
    --text-light: #FFF8E7;
    --accent-primary: #8D6E63;
    --accent-hover: #6D4C41;
    --shadow-color: rgba(62, 39, 35, 0.08);
    --hero-gradient-start: #6D4C41;
    --hero-gradient-end: #A1887F;
    --footer-bg: #3E2723;
    --nav-bg: #EFEBE9;
    --border-color: #D7CCC8;
    --border-avatar: rgba(255, 248, 231, 0.4);
}

[data-theme="dark"] {
    /* Dark Mode */
    --bg-body: #121212;
    --bg-body-gradient-start: #121212;
    --bg-body-gradient-end: #1E1E1E;
    --bg-card: #1E1E1E;
    --bg-form: #252525;
    --bg-input: #2D2D2D;
    --text-primary: #E0E0E0;
    --text-secondary: #B0B0B0;
    --text-light: #E0E0E0;
    --accent-primary: #A1887F;
    --accent-hover: #D7CCC8;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hero-gradient-start: #3E2723;
    --hero-gradient-end: #5D4037;
    --footer-bg: #000000;
    --nav-bg: #121212;
    --border-color: #424242;
    --border-avatar: rgba(255, 255, 255, 0.2);
}

/* Basic reset and box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', 'DM Sans', system-ui, sans-serif;
    background: var(--bg-body);
    background-image:
        repeating-conic-gradient(rgba(93, 64, 55, 0.02) 0deg, transparent 1deg, transparent 20deg),
        linear-gradient(var(--bg-body-gradient-start) 0%, var(--bg-body-gradient-end) 100%);
    color: var(--text-primary);
    font-size: 1.05rem;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Header & Navigation */
header {
    background: var(--nav-bg);
    padding: 1.5rem 0;
    box-shadow: 0 2px 12px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

nav {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin-left: auto;
}

nav li {
    position: relative;
}

nav ul a {
    text-decoration: none;
    color: #5D4037;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.95rem;
    transition: color 0.3s ease, background 0.3s ease, transform 0.2s ease;
    position: relative;
}

nav ul a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease, left 0.3s ease;
}

nav ul a:hover {
    color: var(--accent-primary);
    background: rgba(141, 110, 99, 0.1);
}

nav ul a:hover::after {
    width: 60%;
    left: 20%;
}

nav ul a.active {
    color: var(--accent-primary);
    background: rgba(141, 110, 99, 0.15);
}

nav ul a.active::after {
    width: 60%;
    left: 20%;
}

/* Theme Toggle */
#theme-toggle {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.35rem;
    color: var(--text-primary);
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-left: 2rem;
    outline: none;
    position: relative;
    overflow: hidden;
}

#theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 8px 24px var(--shadow-color);
}

#theme-toggle:active {
    transform: scale(0.95);
}

[data-theme="dark"] #theme-toggle {
    background: var(--bg-input);
}

/* Tabs */
.tab-panel {
    display: none;
    min-height: 60vh;
}

.tab-panel.active {
    display: block;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    color: var(--text-light);
    padding: 2rem 1.5rem;
    text-align: center;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(255, 248, 231, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 10%;
    left: 15%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 248, 231, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-with-image {
    flex-direction: row;
    gap: 2rem;
    text-align: left;
}

.hero-headshot {
    width: 180px;
    height: 180px;
    min-width: 180px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid var(--border-avatar);
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.hero-headshot:hover {
    transform: scale(1.1);
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--border-avatar);
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.hero-content p {
    margin: 0;
}

.hero p {
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 4rem 2rem;
}

/* Animations */
.section-title {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-primary);
    opacity: 0;
    animation: fadeSlideUp 0.6s ease forwards;
}

.professional-section .section-title {
    animation-delay: 0s;
}

.personal-section .section-title {
    animation-delay: 0.2s;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) rotate(var(--card-rotate, 0deg));
    }

    to {
        opacity: 1;
        transform: translateY(0) rotate(var(--card-rotate, 0deg));
    }
}

.link-card:nth-child(odd) {
    --card-rotate: -1deg;
}

.link-card:nth-child(even) {
    --card-rotate: 1deg;
}

/* Grid & Cards */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
    perspective: 1000px;
}

.link-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 14px;
    box-shadow: 0 4px 16px var(--shadow-color), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid transparent;
    opacity: 0;
    animation: fadeSlideUp 0.5s ease forwards;
    transform-style: preserve-3d;
}

/* Animation Delays */
.professional-section .links-grid .link-card:nth-child(1) {
    animation-delay: 0.1s;
}

.professional-section .links-grid .link-card:nth-child(2) {
    animation-delay: 0.2s;
}

.professional-section .links-grid .link-card:nth-child(3) {
    animation-delay: 0.3s;
}

.personal-section .links-grid .link-card:nth-child(1) {
    animation-delay: 0.15s;
}

.personal-section .links-grid .link-card:nth-child(2) {
    animation-delay: 0.25s;
}

.personal-section .links-grid .link-card:nth-child(3) {
    animation-delay: 0.35s;
}

.personal-section .links-grid .link-card:nth-child(4) {
    animation-delay: 0.45s;
}

.personal-section .links-grid .link-card:nth-child(5) {
    animation-delay: 0.55s;
}

.personal-section .links-grid .link-card:nth-child(6) {
    animation-delay: 0.65s;
}

.link-card:hover {
    box-shadow: 0 12px 32px var(--shadow-color), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: var(--border-color);
}

.link-card:hover i {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.link-card i {
    font-size: 3rem;
    transition: transform 0.2s ease;
}

/* Brand Colors */
.link-card .fa-file-pdf {
    color: #E74C3C;
}

.link-card .fa-linkedin {
    color: #0A66C2;
}

.link-card .fa-github {
    color: var(--text-primary);
}

.link-card .fa-instagram {
    color: #E4405F;
}

.link-card .fa-twitch {
    color: #9146FF;
}

.link-card .fa-discord {
    color: #5865F2;
}

.link-card .fa-youtube {
    color: #FF0000;
}

.link-card .fa-facebook {
    color: #1877F2;
}

.link-card .fa-spotify {
    color: #1DB954;
}

/* Contact Form */
.contact-section {
    background: var(--bg-card);
    /* Match professional section background */
    padding-top: 0;
}

.contact-form {
    background: var(--bg-form);
    padding: 2.5rem;
    border-radius: 14px;
    box-shadow: 0 4px 16px var(--shadow-color);
    /* Similar to link-card but softer */
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease forwards;
    animation-delay: 0.4s;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--nav-bg);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-input);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-form);
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.1);
}

textarea.form-input {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    background: var(--accent-primary);
    color: var(--text-light);
    border: none;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.submit-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(141, 110, 99, 0.2);
}

.submit-btn:active {
    transform: translateY(0);
}

.link-card h3 {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 1.5rem;
    margin: 0.5rem 0;
}

.link-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

.professional-section {
    background: var(--bg-card);
}

.personal-section {
    background: var(--bg-body);
}

.cta-button {
    display: inline-block;
    background: var(--accent-primary);
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
    font-weight: 600;
}

.cta-button:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.cta-button:active {
    transform: translateY(2px) scale(1.02);
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    font-size: 0.95rem;
    opacity: 0;
}

footer.visible {
    animation: fadeSlideUp 0.6s ease forwards;
}

/* Responsiveness */
@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .logo {
        width: 100%;
        text-align: center;
    }

    nav ul {
        gap: 0.5rem;
        font-size: 0.9rem;
        margin-left: 0;
        justify-content: center;
    }

    #theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.15rem;
        margin-left: 0.5rem;
        overflow: visible;
    }

    .hero-with-image {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        align-items: center;
    }

    .hero-headshot {
        width: 140px;
        height: 140px;
        min-width: 140px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }
}

/* Button States */
.submit-btn {
    position: relative;
    overflow: hidden;
}

.submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid #FFF8E7;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .btn-loader {
    opacity: 1;
}

@keyframes rotation {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.submit-btn.success {
    background-color: #2ECC71;
    pointer-events: none;
}

.submit-btn.error {
    background-color: #E74C3C;
    pointer-events: none;
}

/* ============================================
   PERSONAL TAB LAYOUT (Sidebar + Content)
   ============================================ */

.personal-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    /* Adjust based on header/footer */
    background: var(--bg-body);
}

/* Sidebar */
.personal-sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    /* Below header */
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.sidebar-profile {
    text-align: center;
    margin-bottom: 2rem;
}

.sidebar-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color, #1DB954);
    cursor: pointer;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.sidebar-avatar:hover {
    transform: scale(1.05);
}

.sidebar-profile h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.sidebar-bio {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

[data-theme="light"] .sidebar-link:hover,
[data-theme="light"] .sidebar-link.active {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-link.active {
    background: var(--primary-color, #1DB954);
    /* Default green, can override per link */
    color: white !important;
}

/* Specific Sidebar Colors (on hover/active) */
.sidebar-link[data-link="home"]:hover {
    color: var(--accent-primary);
}

.sidebar-link[data-link="spotify"]:hover {
    color: #1DB954;
}

.sidebar-link[data-link="youtube"]:hover {
    color: #FF0000;
}

.sidebar-link[data-link="socials"]:hover {
    color: #5865F2;
}

/* Content Area */
.personal-content {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
}

.content-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .personal-layout {
        flex-direction: column;
    }

    .personal-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .personal-content {
        padding: 1.5rem;
    }
}