:root {
    /* Default (Morning) Theme */
    --color-soft-blue: #7495E2;
    --color-lavender: #DAD2EC;
    --color-bright-blue: #277CDE;
    --color-deep-blue: #2E38CB;
    --color-light-blue: #A3CFE3;
    --color-bg-gradient-start: #fdfbfd;
    --color-bg-gradient-end: #DAD2EC;
    --color-white: #ffffff;
    --color-card-bg: rgba(255, 255, 255, 0.7);
    --color-text-muted: #6c757d;
    
    --shadow-soft: 0 10px 30px -5px rgba(116, 149, 226, 0.15);
    --shadow-hover: 0 25px 50px -12px rgba(46, 56, 203, 0.25);
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    
    --blob-opacity: 0.6;
    --star-opacity: 0; /* Hidden by default */
    
    /* Fireplace Colors */
    --fire-brick: #8B5E3C;
    --fire-orange: #FF922C;
    --fire-yellow: #FFE45E;
    --fire-glow: rgba(255, 146, 44, 0.1);

    /* Animation Timing */
    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* NIGHT THEME */
[data-theme="night"] {
    --color-soft-blue: #6366f1;
    --color-lavender: #1e293b;
    --color-bright-blue: #818cf8;
    --color-deep-blue: #e2e8f0; 
    --color-light-blue: #334155;
    --color-bg-gradient-start: #0f172a;
    --color-bg-gradient-end: #1e293b;
    --color-white: #1e293b;
    --color-card-bg: rgba(30, 41, 59, 0.7);
    --color-text-muted: #94a3b8;
    
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    
    --blob-opacity: 0.3;
    --star-opacity: 1;
    
    --fire-glow: rgba(255, 146, 44, 0.5);
}

/* FOCUS THEME */
[data-theme="focus"] {
    --color-soft-blue: #71717a;
    --color-lavender: #f4f4f5;
    --color-bright-blue: #52525b;
    --color-deep-blue: #18181b;
    --color-light-blue: #e4e4e7;
    --color-bg-gradient-start: #ffffff;
    --color-bg-gradient-end: #f4f4f5;
    --color-white: #ffffff;
    --color-card-bg: #ffffff;
    --color-text-muted: #71717a;
    
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --glass-border: 1px solid #e4e4e7;
    
    --blob-opacity: 0; /* Hide blobs */
    --star-opacity: 0;
    --fire-glow: rgba(0,0,0,0);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, var(--color-bg-gradient-start) 0%, var(--color-bg-gradient-end) 100%);
    color: var(--color-deep-blue);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    transition: background 0.8s ease, color 0.8s ease;
}

/* GRAIN TEXTURE */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.5;
    mix-blend-mode: overlay;
}

/* NIGHT STARS OVERLAY */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    background-image: radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 3px),
    radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 2px),
    radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 3px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    opacity: var(--star-opacity);
    transition: opacity 1s ease;
}

/* NAVBAR */
.navbar {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: var(--glass-border);
    padding: 1rem 0;
    transition: all 0.5s var(--ease-smooth);
}

[data-theme="night"] .navbar {
    background: rgba(15, 23, 42, 0.7);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-soft);
    padding: 0.8rem 0;
}

[data-theme="night"] .navbar.scrolled {
    background: rgba(15, 23, 42, 0.95);
}

.navbar-brand {
    font-weight: 700;
    color: var(--color-deep-blue) !important;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    transition: color 0.5s ease;
}

.nav-link {
    color: var(--color-deep-blue) !important;
    font-weight: 600;
    margin: 0 10px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -5px;
    left: 50%;
    background-color: var(--color-bright-blue);
    transition: width 0.4s var(--ease-elastic), transform 0.4s var(--ease-elastic);
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-link:hover::after, .nav-link.active::after { width: 80%; }

/* THEME TOGGLE */
.theme-toggle-btn {
    background: transparent;
    border: var(--glass-border);
    color: var(--color-deep-blue);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}
.theme-toggle-btn:hover {
    background: var(--color-lavender);
}

/* HERO SECTION */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-bottom: 80px;
}

.blob-bg {
    position: absolute;
    filter: blur(80px);
    opacity: var(--blob-opacity);
    z-index: -1;
    border-radius: 50%;
    animation: blobFloat 20s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
    transition: opacity 1s ease;
}
.blob-1 { width: 500px; height: 500px; top: -100px; right: -100px; background: var(--color-lavender); }
.blob-2 { width: 400px; height: 400px; bottom: 0px; left: -100px; background: var(--color-light-blue); animation-delay: -5s; }

/* Hero Image Floating */
.hero-img-container {
    position: relative;
    z-index: 1;
    display: inline-block;
    animation: floatImage 6s ease-in-out infinite;
}

.hero-img-container::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100%;
    height: 100%;
    background-color: var(--color-soft-blue);
    border-radius: 30px;
    z-index: -1;
    opacity: 0.3;
    transition: transform 0.5s var(--ease-elastic), background-color 0.8s ease;
}

.hero-img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 30px;
    box-shadow: var(--shadow-soft);
    border: var(--glass-border);
    transition: transform 0.5s var(--ease-elastic);
}

.hero-img-container:hover .hero-img { transform: translate(-8px, -8px) scale(1.02); }
.hero-img-container:hover::before { transform: translate(12px, 12px); opacity: 0.6; }

/* TYPING EFFECT */
.typing-container {
    display: inline-block;
}
.typing-text {
    border-right: 3px solid var(--color-bright-blue);
    white-space: nowrap;
    overflow: hidden;
    animation: blink 0.75s step-end infinite;
}

/* BUTTONS */
.btn-custom {
    background: linear-gradient(135deg, var(--color-bright-blue), var(--color-soft-blue));
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease-elastic);
    box-shadow: 0 5px 15px rgba(39, 124, 222, 0.3);
    z-index: 1;
}

[data-theme="night"] .btn-custom {
    color: #fff;
}

.btn-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-deep-blue), var(--color-bright-blue));
    z-index: -1;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.btn-custom:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(39, 124, 222, 0.5);
    color: white;
}

.btn-custom:hover::before { opacity: 1; }

.btn-outline-custom {
    background: transparent;
    border: 2px solid var(--color-deep-blue);
    color: var(--color-deep-blue);
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.4s var(--ease-elastic);
}

.btn-outline-custom:hover {
    background-color: var(--color-deep-blue);
    box-shadow: 0 10px 25px rgba(46, 56, 203, 0.25);
    color: white; /* Works for night mode too since deep-blue is light there */
    transform: translateY(-5px);
}

[data-theme="night"] .btn-outline-custom:hover {
        color: #0f172a; 
}


/* SECTIONS & DIVIDERS */
.section-title {
    color: var(--color-deep-blue);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    transition: color 0.8s ease;
}

.section-title::before {
    content: '';
    position: absolute;
    width: 0%; 
    height: 6px;
    bottom: -12px;
    left: 0;
    background: var(--color-soft-blue);
    border-radius: 6px;
    opacity: 0.6;
    transition: width 1s var(--ease-smooth), background 0.8s ease;
}

.reveal.active .section-title::before { width: 60%; }

.wave-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
    z-index: 1;
}
.wave-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
}

.wave-divider .shape-fill { 
    fill: var(--color-white); 
    transition: fill 0.8s ease;
}
.wave-divider-top { transform: rotate(0deg); top: 0; bottom: auto;}

/* CARDS (Used for About & GitHub Widget) */
.cozy-card {
    background: var(--color-card-bg);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    transition: all 0.5s var(--ease-elastic), background 0.8s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform-origin: center bottom;
}

.cozy-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: var(--shadow-hover);
    background: var(--color-white);
    z-index: 2;
}

[data-theme="night"] .cozy-card:hover {
        background: rgba(30, 41, 59, 0.95);
}

.card-img-top {
    height: 220px;
    object-fit: cover;
    border-bottom: var(--glass-border);
    border-radius: 24px 24px 0 0;
    transition: transform 0.5s ease;
}

.cozy-card:hover .card-img-top { transform: scale(1.05); }

.tech-badge {
    background-color: var(--color-lavender);
    color: var(--color-deep-blue);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 6px;
    margin-bottom: 8px;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.5);
    transition: all 0.3s ease;
}

.tech-badge:hover { transform: scale(1.05); }

/* PROJECT CARDS */

.project-card {
    background: var(--color-card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 28px;
    padding: 12px; 
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

/* Hover State for the Card */
.project-card:hover {
    transform: translateY(-10px);
    background: var(--color-white);
    box-shadow: var(--shadow-hover);
    border-color: rgba(116, 149, 226, 0.3);
}

/* Night Mode Adjustments */
[data-theme="night"] .project-card:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(129, 140, 248, 0.3);
}

/* Image Wrapper - The "Window" */
.project-img-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 220px;
    width: 100%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

/* Zoom image on card hover */
.project-card:hover .project-img {
    transform: scale(1.1);
}

/* Overlay that appears on hover */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.4));
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 15px;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

/* Content Area */
.project-body {
    padding: 20px 10px 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    color: var(--color-deep-blue);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.project-desc {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Tech Stack Pills */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(116, 149, 226, 0.1); /* Soft Blue tint */
    color: var(--color-bright-blue);
    border: 1px solid rgba(116, 149, 226, 0.2);
    transition: all 0.3s ease;
}

[data-theme="night"] .tag-pill {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.2);
}

.project-card:hover .tag-pill {
    background: var(--color-bright-blue);
    color: white;
    transform: translateY(-2px);
}

/* Project Link Button */
.project-link {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
    color: var(--color-deep-blue);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

[data-theme="night"] .project-link {
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--color-white);
}

.link-arrow {
    width: 35px;
    height: 35px;
    background: var(--color-lavender);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s var(--ease-elastic);
    color: var(--color-deep-blue);
}

.project-card:hover .link-arrow {
    background: var(--color-bright-blue);
    color: white;
    transform: translateX(5px) rotate(-45deg);
}

/* SKILLS */
#skills {
    position: relative;
    overflow: hidden;
}

#skills-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.skill-item {
    background: var(--color-card-bg);
    backdrop-filter: blur(5px);
    border: var(--glass-border);
    padding: 25px 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: all 0.5s var(--ease-elastic), background 0.8s ease;
    cursor: default;
    z-index: 2; 
    position: relative;
}

.skill-item:hover {
    transform: translateY(-10px);
    background: var(--color-white);
    box-shadow: var(--shadow-hover);
}

/* NIGHT MODE SKILLS - STAR EFFECT */
[data-theme="night"] .skill-item {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

[data-theme="night"] .skill-item:hover {
    box-shadow: 0 0 20px rgba(130, 200, 255, 0.4);
    border-color: rgba(130, 200, 255, 0.5);
    background: rgba(40, 50, 80, 0.9);
}

.skill-icon {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--color-soft-blue), var(--color-bright-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    filter: drop-shadow(0 5px 5px rgba(116, 149, 226, 0.2));
    transition: transform 0.5s var(--ease-elastic);
}

.skill-item:hover .skill-icon { transform: scale(1.2) rotate(5deg); }

/* CONTACT FORM */
.contact-form {
    background: var(--color-card-bg);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    padding: 45px;
    border-radius: 30px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.5s ease, background 0.8s ease;
}

.contact-form:hover { transform: translateY(-5px); }

.form-control {
    border-radius: 15px;
    border: 2px solid var(--color-lavender);
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--color-deep-blue);
    transition: all 0.3s ease;
}

[data-theme="night"] .form-control {
        background: rgba(0, 0, 0, 0.2);
        border-color: #334155;
}

.form-control:focus {
    background: var(--color-white);
    border-color: var(--color-soft-blue);
    box-shadow: 0 0 0 4px rgba(116, 149, 226, 0.1);
    transform: scale(1.01);
    color: var(--color-deep-blue);
}

[data-theme="night"] .form-control:focus {
        background: #0f172a;
}

.form-label {
        color: var(--color-deep-blue);
}

/* SPOTIFY WIDGET */
.spotify-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    padding: 10px 15px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s var(--ease-elastic);
    max-width: 320px;
    width: auto;
    min-width: 240px;
    overflow: hidden; /* Contains the glow inside */
}

/* Ambilight Glow Effect */
.spotify-widget::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: var(--album-art-bg);
    background-size: cover;
    background-position: center;
    filter: blur(20px) saturate(180%);
    opacity: 0.4; /* Subtle tint */
    z-index: -1; 
    transition: background-image 0.5s ease;
}

/* Vinyl Spin Animation */
@keyframes spin-record {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

[data-theme="night"] .spotify-widget {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255,255,255,0.1);
}

.spotify-widget:hover {
    transform: translateY(-5px) scale(1.02);
    background: var(--color-white);
    box-shadow: var(--shadow-hover);
}

[data-theme="night"] .spotify-widget:hover {
    background: rgba(15, 23, 42, 0.9);
}

.spotify-album-art {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1DB954;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--color-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.spotify-album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    /* Smooth transition for stopping */
    transition: transform 1s ease; 
}

/* Spin ONLY when playing */
.spotify-widget.playing .spotify-album-art img {
    animation: spin-record 6s linear infinite;
}

.spotify-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    font-size: 0.85rem;
    overflow: hidden;
    flex-grow: 1;
    font-weight: 700;
    position: relative; 
    z-index: 2;
}

.spotify-song {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-deep-blue);
    max-width: 180px;
}

.spotify-artist {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.spotify-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 15px;
    margin-left: 5px;
    position: relative;
    z-index: 2;
}

.bar {
    width: 3px;
    background: #1DB954;
    border-radius: 2px;
    height: 3px; 
}

/* Only animate if class 'playing' is added */
.spotify-widget.playing .bar {
    animation: visualize 0.8s infinite ease-in-out alternate;
}

.spotify-widget.playing .bar:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.spotify-widget.playing .bar:nth-child(2) { height: 90%; animation-delay: 0.2s; }
.spotify-widget.playing .bar:nth-child(3) { height: 50%; animation-delay: 0.3s; }
.spotify-widget.playing .bar:nth-child(4) { height: 70%; animation-delay: 0.15s; }

@keyframes visualize {
    0% { height: 20%; }
    100% { height: 100%; }
}

/* POMODORO WIDGET */
.pomodoro-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    
    /* Styles for Focus Mode */
    background: var(--color-card-bg);
    border: var(--glass-border);
    box-shadow: var(--shadow-soft);
    color: var(--color-deep-blue);

    padding: 10px 15px;
    border-radius: 20px; /* Rounded like a pill */
    display: none; /* Hidden by default */
    align-items: center;
    gap: 15px;
    transition: all 0.4s var(--ease-elastic);
    width: auto;
}

.pomodoro-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    padding-left: 5px;
}

.pomodoro-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.pomodoro-time {
    font-size: 1.5rem; /* Larger time display */
    font-weight: 700;
    color: var(--color-deep-blue);
    letter-spacing: -0.5px;
}

.pomodoro-controls {
    display: flex;
    gap: 8px;
    padding-left: 10px;
    border-left: 1px solid var(--color-light-blue);
}

.pomodoro-btn {
    background: var(--color-lavender);
    border: 1px solid var(--color-light-blue);
    color: var(--color-bright-blue);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pomodoro-btn:hover {
    background: var(--color-light-blue);
    transform: scale(1.1);
}

/* Widget Visibility Rules */

/* By default, Spotify is visible and Pomodoro is hidden */
.pomodoro-widget {
    display: none;
}
.spotify-widget {
    display: flex;
}

/* In Focus Mode, hide Spotify and show Pomodoro */
[data-theme="focus"] .pomodoro-widget {
    display: flex;
}
[data-theme="focus"] .spotify-widget {
    display: none;
}


/* FOOTER */
footer {
    background: var(--color-deep-blue);
    color: var(--color-lavender);
    padding: 60px 0 40px;
    text-align: center;
    transition: background 0.8s ease, padding 0.8s ease;
}

/* Add space for the fireplace only in Night Mode */
[data-theme="night"] footer {
    padding-bottom: 240px;
}

.social-link {
    background: rgba(255,255,255,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: var(--color-light-blue);
    font-size: 1.5rem;
    margin: 0 8px;
    transition: all 0.4s var(--ease-elastic);
}

.social-link:hover {
    background: var(--color-soft-blue);
    color: white;
    transform: translateY(-8px) scale(1.1);
}

/* ANIMATIONS */

.reveal-hidden {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 { transition-delay: 100ms; }
.stagger-2 { transition-delay: 200ms; }
.stagger-3 { transition-delay: 300ms; }
.stagger-4 { transition-delay: 400ms; }

@keyframes floatImage {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -40px) scale(1.1); }
}

@keyframes blink {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--color-bright-blue); }
}

/* Initial Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg-gradient-start);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader-content { font-size: 2rem; font-weight: bold; color: var(--color-soft-blue); }
.loader-hidden { opacity: 0; visibility: hidden; }

/* GitHub widget responsive card */
.gh-widget-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-sizing: border-box;

  /* smooth hover transition */
  transition: transform .28s cubic-bezier(.2,.9,.2,1), box-shadow .28s cubic-bezier(.2,.9,.2,1);
}

/* Hover effects only for devices that support hover (desktop) */
@media (hover: hover) and (pointer: fine) {
  .gh-widget-card:hover,
  .gh-widget-card:focus-within {
    transform: translateY(-8px);
    box-shadow: 0 18px 40px rgba(24,39,75,0.12), 0 6px 12px rgba(24,39,75,0.06);
  }

  /* Subtle image lift/saturate on hover */
  .gh-streak-img,
  .gh-contrib-img {
    transition: transform .28s ease, filter .28s ease;
  }
  .gh-widget-card:hover .gh-streak-img,
  .gh-widget-card:hover .gh-contrib-img {
    transform: translateY(-4px) scale(1.01);
    filter: saturate(1.03);
  }
}

/* Disable heavy transforms on small/touch devices to avoid jank */
@media (max-width: 767.98px) {
  .gh-widget-card { transition: none; }
  .gh-widget-card:hover,
  .gh-widget-card:focus-within {
    transform: none;
    box-shadow: var(--shadow-soft);
  }
}

/* keep cozy-card existing hover/transition but avoid large transforms for this widget */
.gh-widget-card.cozy-card:hover { /* fallback: small shadow if other rules not applied */
  transform: none;
  box-shadow: var(--shadow-soft);
}

/* GitHub language pills */
.gh-language-pills { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; align-items:center; }
.lang-pill {
    display:inline-flex;
    align-items:center;
    gap:8px;
    background: rgba(0,0,0,0.04);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.85rem;
    color: var(--color-deep-blue);
    box-shadow: var(--shadow-soft);
    transition: transform .15s ease, box-shadow .15s ease;
}
.lang-pill:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.lang-color {
    width:12px;
    height:12px;
    border-radius:50%;
    flex:0 0 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15) inset;
}

.lang-name { font-weight:600; text-transform:capitalize; }

.lang-percent { margin-left:6px; opacity:0.85; font-weight:700; font-size:0.8rem; color:var(--color-text-muted); }

/* Custom Cursor */
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-deep-blue);
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-soft-blue);
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9998;
    pointer-events: none;
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Hover Effect */
body:has(a:hover, button:hover, .btn:hover) .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(116, 149, 226, 0.1);
    border-color: transparent;
}


/* DAYDREAM / IDLE MODE */

/* Fade out main content */
body.daydream-mode nav,
body.daydream-mode section .container,
body.daydream-mode footer,
body.daydream-mode .spotify-widget,
body.daydream-mode .pomodoro-widget, /* Also fade out pomodoro */
body.daydream-mode .cursor-dot,
body.daydream-mode .cursor-outline {
    opacity: 0.1;
    filter: blur(4px);
    transition: opacity 3s ease, filter 3s ease;
    pointer-events: none; /* Disable clicks on faded elements */
}

/* Hide cursor entirely to complete the screensaver feel */
body.daydream-mode {
    cursor: none;
}

/* Make Blobs more intense */
body.daydream-mode .blob-bg {
    opacity: 1; 
    filter: blur(60px);
    animation-duration: 10s; 
}

/* Make Stars twinkle faster in Night Mode */
body[data-theme="night"].daydream-mode .stars-bg {
    opacity: 1;
    animation: starPulse 3s infinite alternate;
}

@keyframes starPulse {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.1); }
}

/* --- CODE FIREPLACE (NIGHT MODE) --- */
.code-fireplace-container {
    position: absolute;
    bottom: 0; 
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    opacity: 0; 
    pointer-events: none;
    transition: opacity 1s ease;
    filter: drop-shadow(0 0 15px var(--fire-glow));
}

/* Show only in Night Mode */
[data-theme="night"] .code-fireplace-container {
    opacity: 1;
    pointer-events: auto;
}

.fireplace-structure {
    width: 250px; 
    height: 200px; 
    position: relative;
    /* Pixel Art Brick Wall style using CSS gradients */
    background-color: #3a2e2e;
    background-image: 
        linear-gradient(335deg, rgba(0,0,0,0.3) 23px, transparent 23px),
        linear-gradient(155deg, rgba(0,0,0,0.3) 23px, transparent 23px),
        linear-gradient(335deg, rgba(0,0,0,0.3) 23px, transparent 23px),
        linear-gradient(155deg, rgba(0,0,0,0.3) 23px, transparent 23px);
    background-size: 28px 28px;
    background-position: 0px 2px, 4px 15px, 14px 2px, 18px 15px;
    border: 4px solid #2a1e1e;
    border-radius: 4px 4px 0 0;
    box-shadow: inset 0 0 20px #000;
}

.fireplace-mantle {
    position: absolute;
    top: -12px;
    left: -25px;
    width: 300px; 
    height: 16px;
    background: #5a4033;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.fireplace-hearth {
    width: 80%;
    height: 70%;
    background: #111;
    margin: 25% auto 0;
    border-radius: 10px 10px 0 0;
    position: relative;
    overflow: hidden;
}

/* The Logs */
.log {
    position: absolute;
    bottom: 5px;
    height: 8px;
    background: #5D4037;
    border-radius: 4px;
    z-index: 2;
}
.log-1 { width: 80%; left: 10%; transform: rotate(-5deg); }
.log-2 { width: 80%; left: 10%; bottom: 10px; transform: rotate(5deg); }

/* Pixel Fire Flames */
.fire-effects {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.pixel-flame {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 10px;
    background: var(--fire-orange);
    box-shadow: 0 0 10px var(--fire-orange);
    opacity: 0.8;
}

.f-1 { left: 30%; animation: flicker 0.5s infinite alternate; height: 20px; background: var(--fire-yellow); }
.f-2 { left: 50%; animation: flicker 0.7s infinite alternate-reverse; height: 30px; width: 12px; background: var(--fire-orange); }
.f-3 { left: 70%; animation: flicker 0.6s infinite alternate; height: 15px; background: var(--fire-brick); }

@keyframes flicker {
    0% { transform: scaleY(1); opacity: 0.8; }
    100% { transform: scaleY(1.4) translateY(-5px); opacity: 1; }
}

/* Burning Code Snippets */
.burning-code-pit {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.code-cinder {
    position: absolute;
    font-family: 'Press Start 2P', monospace; 
    font-size: 8px; 
    color: #aaa;
    white-space: nowrap;
    bottom: 50px;
    left: 120%; 
    opacity: 0;
    font-size: 11px; 
    animation: burnCodeAnim 4s linear forwards;
}

/* Animation: Slide In -> Fall into fire -> Burn/Rise -> Fade */
@keyframes burnCodeAnim {
    0% { left: 100%; opacity: 0; transform: translateY(0) rotate(0deg); }
    10% { left: 50%; opacity: 1; transform: translateY(0) rotate(0deg); color: #fff; }
    20% { left: 20%; opacity: 1; transform: translateY(20px) rotate(-5deg); color: var(--fire-yellow); }
    
    /* Ignite */
    40% { left: 30%; opacity: 1; transform: translateY(20px) scale(1.1); color: var(--fire-orange); text-shadow: 0 0 5px red; }
    
    /* Turn to ash/sparks - Rise higher for bigger fireplace */
    80% { left: 35%; opacity: 0.5; transform: translateY(-80px) rotate(10deg) scale(0.5); color: #333; filter: blur(2px); }
    100% { left: 40%; opacity: 0; transform: translateY(-150px); }
}

/* Sparks */
.spark {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--fire-yellow);
    bottom: 20px;
    left: 50%;
    border-radius: 50%;
    pointer-events: none;
    animation: flyUp 2s linear forwards;
    z-index: 4;
}

@keyframes flyUp {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), -180px) scale(0); opacity: 0; }
}

/* Tooltip */
.fireplace-tooltip {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    font-family: 'Quicksand', sans-serif;
}

.code-fireplace-container:hover .fireplace-tooltip {
    opacity: 1;
}

/* --- VENT --- */
#vent-input {
    position: absolute;
    top: -40px; /* Positioned above the fireplace by default */
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    background: transparent;
    border: none;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.3);
    color: #fff;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.8rem;
    text-align: center;
    padding: 5px;
    z-index: 10;
    opacity: 0;
    pointer-events: none; /* Prevent clicking when hidden */
    transition: all 0.4s var(--ease-elastic);
}

#vent-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

#vent-input:focus {
    outline: none;
    border-bottom: 2px solid var(--fire-orange);
    width: 200px; /* Expands when typing */
    opacity: 1;
    top: 10px; /* Moves down into view */
    pointer-events: auto;
}

/* Show input when hovering over the fireplace container */
.code-fireplace-container:hover #vent-input {
    opacity: 1;
    top: 10px;
    pointer-events: auto;
}

/* When the user input burns, give it a distinct color */
.code-cinder.user-vent {
    color: #ffcccc !important;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
    font-weight: bold;
    font-size: 12px; 
}

/* LIVE VISITOR COUNTER */
#visitor-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--color-card-bg);
    backdrop-filter: blur(5px);
    border: var(--glass-border);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--color-deep-blue);
    opacity: 0; /* Hidden by default */
    transition: opacity 0.5s ease;
    will-change: opacity;
}

#visitor-counter.visible {
    opacity: 1;
}

#visitor-count-number {
    font-weight: 700;
}

/* MULTIPLAYER CURSORS */
.cursor-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through */
    z-index: 9990; /* Below your custom cursor/loader */
    overflow: hidden;
}

.remote-cursor {
    position: absolute;
    top: 0;
    left: 0;
    width: 15px; /* slightly smaller than main cursor */
    height: 15px;
    background-color: var(--color-bright-blue); 
    border-radius: 50%;
    opacity: 0.6;
    transition: transform 0.15s linear; /* Smooths the network lag */
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remote-cursor::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}