:root {
    --bg-color: #f4f4f5;
    --text-color: #18181b;
    --text-muted: #71717a;
    --card-bg: rgba(255, 255, 255, 0.4);
    --card-border: rgba(255, 255, 255, 0.6);
    --card-shadow: rgba(228, 228, 231, 0.5);
    --accent-color: #6366f1;
    --spotify-color: #1DB954;
    --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
    --font-display: "Outfit", ui-sans-serif, system-ui, sans-serif;
}

.dark {
    --bg-color: #09090b;
    --text-color: #fafafa;
    --text-muted: #a1a1aa;
    --card-bg: rgba(24, 24, 27, 0.4);
    --card-border: rgba(39, 39, 42, 0.6);
    --card-shadow: rgba(0, 0, 0, 0.5);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    transition: background-color 0.7s ease, color 0.7s ease;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

.noise-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: -1;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.dark .noise-bg {
    opacity: 0.06;
}

.background-gradients {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: -2;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
}

.dark .background-gradients {
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.12) 0%, transparent 40%);
}

/* Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    z-index: 10;
}

@media (min-width: 640px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .hero-card { grid-column: span 2; }
    .projects-card { grid-column: span 2; }
}

@media (min-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: minmax(180px, auto);
        padding: 0 2rem 2rem;
    }
    .hero-card { grid-column: span 2; grid-row: span 2; }
    .spotify-card { grid-column: span 1; grid-row: span 1; }
    .skills-card { grid-column: span 1; grid-row: span 1; }
    .projects-card { grid-column: span 3; grid-row: span 1; }
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: calc(64rem - 2rem);
    margin: 2rem auto 2rem;
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 4px 20px var(--card-shadow);
    width: calc(100% - 2rem);
    position: relative;
    z-index: 10;
}

@media (min-width: 1024px) {
    .site-header {
        width: calc(100% - 4rem);
        max-width: calc(64rem - 4rem);
    }
}

.header-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.header-theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.header-theme-toggle:hover {
    color: var(--text-color);
    background: rgba(113, 113, 122, 0.1);
}

.header-theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Cards Base */
.bento-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 2rem;
    box-shadow: 0 20px 25px -5px var(--card-shadow), 0 8px 10px -6px var(--card-shadow);
    overflow: hidden;
    position: relative;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.hoverable {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.hoverable:hover {
    transform: scale(0.98);
}

/* Landing Animation */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: var(--delay, 0s);
}

/* Hero Card */
.hero-card {
    padding: 2rem;
    justify-content: space-between;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.profile-wrapper {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--card-border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

@media (min-width: 640px) {
    .profile-wrapper {
        width: 6rem;
        height: 6rem;
    }
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-content {
    margin-top: 2rem;
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
    background: linear-gradient(to bottom right, var(--text-color), var(--text-muted));
    -webkit-background-clip: text;
    color: transparent;
}

@media (min-width: 640px) {
    .hero-content h1 { font-size: 3rem; }
}

.hero-content p {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    max-width: 28rem;
    line-height: 1.5;
}

@media (min-width: 640px) {
    .hero-content p { font-size: 1.125rem; }
}

/* Hero Socials */
.hero-socials {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.hero-social-link {
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(113, 113, 122, 0.05);
}

.hero-social-link:hover {
    color: var(--text-color);
    background: rgba(113, 113, 122, 0.15);
    transform: translateY(-4px);
}

/* Spotify Card */
.spotify-card {
    min-height: 160px;
}

.spotify-loading, .spotify-disconnected {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

.spotify-loading svg, .spotify-disconnected svg {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.spotify-loading p, .spotify-disconnected p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.spotify-btn {
    padding: 0.625rem 1.25rem;
    background-color: var(--spotify-color);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 10px 15px -3px rgba(29, 185, 84, 0.2);
    transition: background-color 0.2s;
}

.spotify-btn:hover {
    background-color: #1ed760;
}

.spotify-playing {
    display: block;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.spotify-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.spotify-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(24px);
    opacity: 0.4;
    transform: scale(1.5);
}

.dark .spotify-bg img {
    opacity: 0.3;
}

.spotify-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.8), transparent);
}

.dark .spotify-bg-overlay {
    background: linear-gradient(to top, rgba(24,24,27,0.8), transparent);
}

.spotify-content {
    position: relative;
    z-index: 10;
    height: 100%;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.spotify-art {
    width: 5rem;
    height: 5rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .spotify-art {
        width: 6rem;
        height: 6rem;
    }
}

.spotify-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.spotify-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.spotify-header svg {
    color: var(--spotify-color);
}

.spotify-header span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--spotify-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.spotify-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 640px) {
    .spotify-title { font-size: 1.25rem; }
}

.spotify-artist {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 640px) {
    .spotify-artist { font-size: 1rem; }
}

.equalizer {
    display: flex;
    gap: 0.25rem;
    align-items: flex-end;
    height: 1rem;
    margin-top: 0.75rem;
}

.eq-bar {
    width: 4px;
    background-color: var(--spotify-color);
    border-radius: 9999px;
    animation: eq-bounce ease-in-out infinite;
}

.eq-bar:nth-child(1) { animation-duration: 1s; }
.eq-bar:nth-child(2) { animation-duration: 1.2s; animation-delay: 0.1s; }
.eq-bar:nth-child(3) { animation-duration: 0.8s; animation-delay: 0.2s; }
.eq-bar:nth-child(4) { animation-duration: 1.1s; animation-delay: 0.3s; }

@keyframes eq-bounce {
    0%, 100% { height: 4px; }
    50% { height: 16px; }
}

.spotify-paused {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 1.5rem;
    gap: 1.25rem;
}

.paused-icon {
    width: 5rem;
    height: 5rem;
    border-radius: 0.75rem;
    background: rgba(113, 113, 122, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

@media (min-width: 640px) {
    .paused-icon {
        width: 6rem;
        height: 6rem;
    }
}

.paused-info h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
}

.paused-info p {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Skills & Projects Cards */
.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.25rem;
}

.skills-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: rgba(113, 113, 122, 0.1);
    color: var(--text-color);
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(113, 113, 122, 0.2);
    transition: all 0.2s ease;
}

.skill-tag:hover {
    background: rgba(113, 113, 122, 0.2);
    transform: translateY(-2px);
}

.projects-card {
    padding: 1.5rem;
}

@media (min-width: 640px) {
    .projects-card {
        padding: 2rem;
    }
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.projects-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .projects-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

.project-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(113, 113, 122, 0.05);
    border-radius: 1rem;
    border: 1px solid rgba(113, 113, 122, 0.1);
    text-decoration: none;
    transition: all 0.2s ease;
}

.project-item:hover {
    background: rgba(113, 113, 122, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.project-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease;
}

.project-item:hover .project-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--accent-color);
    color: white;
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-arrow {
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.project-item:hover .project-arrow {
    transform: translateX(4px);
    color: var(--text-color);
}
