:root {
    --primary-color: #502580;
    --primary-hover: #6f3399;
    --text-color: #e6e6f2;
    --glow-color: #b766ff;
    --font-main: 'Arial', sans-serif;
    --font-special: 'Orbitron', sans-serif;
    --footer-height: 55px;
}

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

html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    padding-bottom: var(--footer-height);
    border: none;
    outline: none;
    font-family: var(--font-main);
    background-color: #020004;
    color: var(--text-color);
    text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color);
    position: relative;
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: rgba(183, 102, 255, 0.2);
}

/* CSS-based space background */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(ellipse at 30% 40%, rgba(80, 37, 128, 0.25) 0%, rgba(0, 0, 0, 0) 70%),
        radial-gradient(ellipse at 80% 40%, rgba(111, 51, 153, 0.25) 0%, rgba(0, 0, 0, 0) 70%),
        radial-gradient(ellipse at 50% 70%, rgba(173, 78, 188, 0.15) 0%, rgba(0, 0, 0, 0) 75%),
        radial-gradient(ellipse at 15% 60%, rgba(68, 14, 132, 0.2) 0%, rgba(0, 0, 0, 0) 60%);
    z-index: -3;
    pointer-events: none;
    border: none;
    outline: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

/* Stars effect - First layer (small stars) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(1px 1px at 17px 41px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 53px 76px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 85px 112px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 119px 163px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 142px 203px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 176px 267px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 211px 321px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 237px 298px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 269px 247px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 293px 188px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 318px 143px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 342px 205px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 367px 264px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 389px 307px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 418px 371px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 437px 432px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 461px 488px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 482px 537px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 513px 583px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 546px 561px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 573px 512px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 594px 464px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 623px 423px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 651px 391px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 678px 342px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 703px 312px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 731px 356px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 763px 419px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 792px 463px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 824px 412px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 857px 367px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 889px 337px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 915px 403px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 943px 467px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 973px 517px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 998px 553px, #fff, rgba(0, 0, 0, 0));
    background-size: 1000px 600px;
    background-repeat: repeat;
    z-index: -1;
    opacity: 0.8;
    animation: twinkle 8s ease-in-out infinite alternate;
    pointer-events: none;
    border: none;
    outline: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

/* Second layer of stars (medium stars) */
.stars-medium {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(1.5px 1.5px at 39px 47px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 87px 94px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 132px 158px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 183px 219px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 227px 173px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 271px 129px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 317px 203px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 361px 257px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 408px 309px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 453px 363px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 496px 312px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 543px 264px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 587px 318px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 631px 371px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 679px 427px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 723px 489px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 776px 537px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 823px 479px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 872px 417px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 916px 357px, #fff, rgba(0, 0, 0, 0));
    background-size: 950px 650px;
    background-repeat: repeat;
    z-index: -1;
    opacity: 0;
    animation: twinkle-medium 6s ease-in-out infinite alternate;
    border: none;
    outline: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

/* Third layer of stars (large stars) */
.stars-large {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(2px 2px at 67px 83px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 132px 163px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 194px 237px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 263px 194px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 337px 283px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 413px 349px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 476px 417px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 524px 358px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 591px 293px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 657px 346px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 713px 413px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 773px 481px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 827px 423px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 895px 371px, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0));
    background-size: 900px 700px;
    background-repeat: repeat;
    z-index: -1;
    opacity: 0;
    animation: twinkle-large 10s ease-in-out infinite alternate;
    border: none;
    outline: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

/* Special bright stars - More randomly positioned */
.bright-star {
    position: fixed;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8), 0 0 20px 6px var(--glow-color);
    z-index: -1;
    pointer-events: none;
    animation: bright-twinkle 4s ease-in-out infinite;
    border: none;
    outline: none;
    margin: 0;
    padding: 0;
}
.bright-star-1 {
    top: 15%;
    left: 23%;
    animation-delay: 0s;
}

.bright-star-2 {
    top: 42%;
    left: 78%;
    animation-delay: 1s;
}

.bright-star-3 {
    top: 73%;
    left: 33%;
    animation-delay: 2s;
}

.bright-star-4 {
    top: 27%;
    left: 57%;
    animation-delay: 3s;
}

.bright-star-5 {
    top: 63%;
    left: 82%;
    animation-delay: 2.5s;
}

.bright-star-6 {
    top: 82%;
    left: 12%;
    animation-delay: 1.5s;
}

@keyframes twinkle {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0.7;
    }
}

@keyframes twinkle-medium {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 0.3;
    }
}

@keyframes twinkle-large {
    0% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 0.3;
    }
}

@keyframes bright-twinkle {
    0% {
        opacity: 0.4;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

/* Star nebula effect */
.nebula {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
    opacity: 0.15;
    animation: nebula-movement 90s ease-in-out infinite alternate;
    border: none;
    outline: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

.nebula-1 {
    background: radial-gradient(ellipse at 30% 40%, rgba(183, 102, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
}

.nebula-2 {
    background: radial-gradient(ellipse at 70% 60%, rgba(132, 61, 198, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    animation-delay: 30s;
}

.nebula-3 {
    background: radial-gradient(ellipse at 50% 20%, rgba(168, 99, 230, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    animation-delay: 60s;
}

@keyframes nebula-movement {
    0% {
        transform: translate(-3%, -3%) scale(1.05);
        opacity: 0.15;
    }
    50% {
        transform: translate(3%, 3%) scale(1);
        opacity: 0.18;
    }
    100% {
        transform: translate(-3%, 3%) scale(1.05);
        opacity: 0.15;
    }
}

header {
    font-family: var(--font-special);
    font-size: 3rem;
    text-align: center;
    padding: 15px 0;
    margin: 20px 0 10px;
    text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color);
    flex-shrink: 0;
}

.navbar {
    text-align: center;
    margin-bottom: 15px;
    padding: 0 10px;
    flex-shrink: 0;
}

.navbar a {
    display: inline-block;
    padding: 10px 20px;
    margin: 0 10px;
    background-color: var(--primary-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.15s, transform 0.15s;
    text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color);
}

/* Nav icons are for the mobile bottom bar only; hidden on desktop */
.navbar a i {
    display: none;
}

.navbar a:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

footer {
    text-align: center;
    padding: 6px 0;
    background-color: rgba(80, 37, 128, 0.8);
    color: var(--text-color);
    text-shadow: 0 0 5px var(--glow-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-top: 1px solid rgba(183, 102, 255, 0.5);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 100;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 30px;
    box-sizing: border-box;
}

.footer-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-section:last-child {
    align-items: flex-end;
}

#audio-controls {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copyright {
    font-family: var(--font-special);
    font-size: 0.8rem;
    margin-bottom: 1px;
    text-align: left;
}

.footer-tagline {
    font-size: 0.7rem;
    opacity: 0.8;
    text-align: left;
}

.social-links-footer {
    display: flex;
    gap: 10px;
    margin-bottom: 1px;
    justify-content: flex-end;
}

.social-links-footer a {
    color: var(--text-color);
    font-size: 1.1rem;
    transition: color 0.3s, transform 0.3s;
}

.social-links-footer a:hover {
    color: var(--glow-color);
    transform: translateY(-2px);
    text-shadow: 0 0 10px var(--glow-color);
}

.footer-credit {
    font-size: 0.7rem;
    opacity: 0.8;
    text-align: right;
}

.footer-credit i {
    color: var(--glow-color);
    margin: 0 3px;
}

footer a, footer a:hover {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: #e0e0e0;
    text-shadow: 0 0 10px #e0e0e0, 0 0 15px #e0e0e0;
}

.home-container {
    position: relative;
    min-height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: visible;
    padding: 15px 10px 25px;
}

.home-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 680px;
    width: 100%;
    z-index: 2;
    gap: 20px;
}

.home-top-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    width: 100%;
}

.home-photo {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.home-photo .profile-frame {
    width: 220px;
    border: 2px solid var(--glow-color);
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 0 15px var(--glow-color);
    background-color: rgba(0, 0, 0, 0.3);
}

#home-profile-pic {
    width: 100%;
    display: block;
    border-radius: 5px;
}

@media screen and (max-width: 700px) {
    .home-layout {
        gap: 15px;
    }

    .home-top-row {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .home-photo .profile-frame {
        width: 140px;
    }

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

    .home-content {
        text-align: center;
        font-size: 1rem;
    }

    .home-highlights {
        flex-direction: column;
        align-items: center;
    }

    .highlight-item {
        width: 100%;
        max-width: 320px;
        flex-direction: row;
        gap: 12px;
        justify-content: center;
    }

    .highlight-icon {
        margin-bottom: 0;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .cta-button {
        width: 100%;
        max-width: 320px;
    }
}

.home-content-wrapper {
    position: relative;
    z-index: 2;
    max-width: 800px;
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-text-box {
    background: rgba(80, 37, 128, 0.25);
    border: 1px solid rgba(183, 102, 255, 0.3);
    border-radius: 10px;
    padding: 20px 25px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(183, 102, 255, 0.1);
    flex: 1;
}

.home-content {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.2rem;
    color: var(--text-color);
    text-align: left;
    text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color);
    white-space: pre-wrap;
    overflow: visible;
    min-height: 80px;
    max-width: 800px;
    position: relative;
    padding-bottom: 10px;
    line-height: 1.5;
}

.home-content::after {
    content: '_';
    position: absolute;
    display: inline-block;
    animation: blink-caret 0.75s step-end infinite;
}

/* Cursor blinking animation - modified to not affect layout */
@keyframes blink-caret {
    from, to { opacity: 0; }
    50% { opacity: 1; }
}

.home-highlights {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.highlight-item {
    background-color: rgba(80, 37, 128, 0.3);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(183, 102, 255, 0.2);
    flex: 1;
    max-width: 200px;
}

.highlight-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(183, 102, 255, 0.3);
}

.highlight-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--glow-color);
    text-shadow: 0 0 10px var(--glow-color);
}

.highlight-text {
    font-family: var(--font-special);
    font-size: 0.9rem;
    text-align: center;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.cta-button {
    font-family: var(--font-special);
    font-size: 1rem;
    padding: 10px 20px;
    min-width: 170px;
    background-color: var(--primary-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
    text-align: center;
    border: 1px solid rgba(183, 102, 255, 0.5);
}

.cta-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(183, 102, 255, 0.3);
}

.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.shape {
    position: absolute;
    background: rgba(183, 102, 255, 0.1);
    border: 1px solid rgba(183, 102, 255, 0.3);
    border-radius: 50%;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.shape1 {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation: float 8s ease-in-out infinite;
}

.shape2 {
    width: 60px;
    height: 60px;
    top: 20%;
    right: 15%;
    animation: float 6s ease-in-out infinite 1s;
}

.shape3 {
    width: 40px;
    height: 40px;
    bottom: 15%;
    left: 20%;
    animation: float 7s ease-in-out infinite 2s;
}

.shape4 {
    width: 100px;
    height: 100px;
    bottom: 10%;
    right: 10%;
    animation: float 9s ease-in-out infinite 0.5s;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

/* Media Queries for Responsive Design */

@media screen and (max-width: 900px) {
    header {
        font-size: 2.5rem;
        margin: 15px 0 8px;
        padding: 10px 0;
    }

    .navbar a {
        padding: 8px 16px;
        margin: 3px 5px;
        font-size: 0.9rem;
    }

    .home-content {
        font-size: 1.2rem;
        min-height: 100px;
    }

    .home-highlights {
        gap: 12px;
    }

    .highlight-item {
        padding: 12px;
        max-width: 180px;
    }

    .highlight-text {
        font-size: 0.8rem;
    }

    .highlight-icon {
        font-size: 1.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .profile-container {
        margin-bottom: 10px;
    }

    .profile-frame {
        max-width: 200px;
    }

    .about-info {
        max-height: none;
    }

    .contact-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .timeline::before {
        left: 31px;
    }

    .container {
        width: 100%;
        padding-left: 55px;
        padding-right: 15px;
    }

    .right, .left {
        left: 0;
    }

    .right::after, .left::after {
        left: 17px;
    }

    .company {
        font-size: 1.2rem;
    }

    .position {
        font-size: 0.95rem;
    }

    .description {
        font-size: 0.9rem;
    }

    .content {
        padding: 15px;
    }

    .container {
        margin-bottom: 40px;
    }
}

@media screen and (max-width: 600px) {
    :root {
        --footer-height: 80px;
    }

    header {
        font-size: 1.8rem;
        margin: 8px 0 4px;
        padding: 6px 0;
    }

    .navbar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0;
        margin-bottom: 8px;
        padding: 0 5px;
    }

    .navbar a {
        padding: 10px 14px;
        margin: 3px 3px;
        font-size: 0.8rem;
        border-radius: 4px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #contentFrame {
        min-height: 250px;
    }

    .home-container {
        padding: 10px 8px;
    }

    .home-content {
        font-size: 0.95rem;
        min-height: 70px;
        margin-bottom: 15px;
    }

    .home-content-wrapper {
        padding: 8px;
    }

    .home-highlights {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .highlight-item {
        width: 100%;
        max-width: 280px;
        padding: 12px;
        flex-direction: row;
        gap: 12px;
    }

    .highlight-icon {
        font-size: 1.3rem;
        margin-bottom: 0;
    }

    .highlight-text {
        font-size: 0.8rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        max-width: 280px;
    }

    .cta-button {
        font-size: 0.85rem;
        padding: 12px 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .about-container {
        padding: 10px 8px;
    }

    .about-heading {
        font-size: 1.6rem;
        margin-bottom: 8px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .profile-container {
        margin-bottom: 5px;
    }

    .profile-frame {
        max-width: 180px;
    }

    .about-info {
        padding: 14px;
        max-height: none;
        overflow-y: visible;
    }

    .about-text {
        font-size: 0.9rem;
        min-height: auto;
        line-height: 1.5;
    }

    .social-links a {
        font-size: 1.3rem;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .skills-heading {
        font-size: 1.1rem;
    }

    .skills-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .skill-item {
        padding: 10px;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .contact-container {
        padding: 8px 12px;
    }

    .contact-heading {
        font-size: 1.6rem;
    }

    .contact-intro {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .contact-card {
        padding: 14px 12px;
        min-height: 44px;
        flex-direction: row;
        gap: 12px;
    }

    .contact-icon {
        font-size: 1.6rem;
        margin-bottom: 0;
    }

    .contact-label {
        font-size: 0.95rem;
    }

    .contact-description {
        font-size: 0.8rem;
    }

    .footer-content {
        flex-direction: row;
        gap: 8px;
        padding: 0 10px;
    }

    .copyright {
        font-size: 0.6rem;
    }

    .footer-tagline {
        font-size: 0.55rem;
    }

    .social-links-footer {
        gap: 10px;
    }

    .social-links-footer a {
        font-size: 1rem;
    }

    .footer-credit {
        font-size: 0.55rem;
    }

    .project-card {
        padding: 14px 12px;
    }

    .project-title {
        font-size: 1.05rem;
    }

    .project-description {
        font-size: 0.85rem;
    }

    .project-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 8px 16px;
    }

    .projects-container {
        padding: 10px;
    }

    footer {
        padding: 4px 8px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .footer-content {
        padding: 0 10px;
    }

    #audio-toggle {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .experience-container {
        padding: 6px 4px;
    }

    .timeline {
        padding-top: 10px;
    }

    .timeline::before {
        display: none;
    }

    .left::after, .right::after {
        display: none;
    }

    .container {
        width: 100%;
        padding: 0;
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 14px;
    }

    .right, .left {
        left: 0;
    }

    .content {
        padding: 14px 12px;
        border-left: 3px solid var(--glow-color);
    }

    .company {
        font-size: 1.1rem;
    }

    .position {
        font-size: 0.92rem;
    }

    .period {
        font-size: 0.82rem;
    }

    .description {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .shape {
        display: none;
    }

    .nebula {
        opacity: 0.08;
    }

    .shooting-star {
        display: none;
    }

    .star-cluster {
        display: none;
    }
}

@media screen and (max-width: 380px) {
    :root {
        --footer-height: 80px;
    }

    header {
        font-size: 1.5rem;
        margin: 6px 0 3px;
        padding: 4px 0;
    }

    .navbar a {
        padding: 8px 10px;
        margin: 2px 2px;
        font-size: 0.7rem;
        min-height: 44px;
    }

    .home-content {
        font-size: 0.85rem;
        min-height: 60px;
    }

    .home-content-wrapper {
        padding: 5px;
    }

    .highlight-item {
        max-width: 100%;
        padding: 10px;
    }

    .highlight-text {
        font-size: 0.75rem;
    }

    .highlight-icon {
        font-size: 1.1rem;
    }

    .cta-button {
        font-size: 0.8rem;
        padding: 10px 14px;
    }

    .about-heading {
        font-size: 1.4rem;
    }

    .about-text {
        font-size: 0.84rem;
        min-height: auto;
        line-height: 1.45;
    }

    .profile-frame {
        max-width: 140px;
    }

    .skills-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .skill-item {
        font-size: 0.78rem;
        padding: 8px;
    }

    .contact-heading {
        font-size: 1.4rem;
    }

    .contact-intro {
        font-size: 0.82rem;
    }

    .contact-card {
        padding: 12px 10px;
    }

    .contact-icon {
        font-size: 1.4rem;
    }

    .contact-label {
        font-size: 0.88rem;
    }

    .footer-content {
        padding: 3px 6px;
    }

    .copyright {
        font-size: 0.58rem;
    }

    .footer-tagline {
        font-size: 0.52rem;
    }

    .social-links-footer a {
        font-size: 1rem;
    }

    .footer-credit {
        font-size: 0.52rem;
    }

    .experience-container {
        padding: 4px 2px;
    }

    .container {
        padding: 0;
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 10px;
    }

    .content {
        padding: 12px 10px;
    }

    .company {
        font-size: 1rem;
    }

    .position {
        font-size: 0.85rem;
    }

    .period {
        font-size: 0.75rem;
    }

    .description {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .project-title {
        font-size: 0.95rem;
    }

    .project-description {
        font-size: 0.8rem;
    }

    .project-card {
        padding: 12px 10px;
        margin-bottom: 12px;
    }
}

.x-icon {
    font-size: 1.1rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.about-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
}

.about-content {
    max-width: 1000px;
    width: 100%;
}

.about-heading {
    font-family: var(--font-special);
    font-size: 2.5rem;
    margin-bottom: 5px;
    text-align: center;
    text-shadow: 0 0 10px var(--glow-color), 0 0 15px var(--glow-color);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: start;
}

.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-frame {
    border: 2px solid var(--glow-color);
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 0 15px var(--glow-color);
    background-color: rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 210px;
}

#profile-pic {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    display: block;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.fade-in {
    opacity: 1 !important;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    transition: color 0.3s, transform 0.3s;
}

.social-links a:hover {
    color: var(--glow-color);
    transform: translateY(-3px);
    text-shadow: 0 0 10px var(--glow-color);
}

.about-info {
    background-color: rgba(80, 37, 128, 0.2);
    border-radius: 10px;
    padding: 15px;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(183, 102, 255, 0.2);
}

/* Inner scroll box only on desktop; phones/tablets scroll the whole page in the iframe */
@media screen and (min-width: 901px) {
    .about-info {
        max-height: 400px;
        overflow-y: auto;
    }
}

/* Custom scrollbar for webkit browsers */
.about-info::-webkit-scrollbar {
    width: 8px;
}
.about-info::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
.about-info::-webkit-scrollbar-thumb {
    background: rgba(183, 102, 255, 0.5);
    border-radius: 4px;
}

.about-text {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1rem;
    color: var(--text-color);
    text-shadow: 0 0 5px var(--glow-color);
    white-space: pre-wrap;
    line-height: 1.5;
    margin-bottom: 15px;
    min-height: 200px;
}

.skills-section {
    margin-top: 15px;
}

.skills-heading {
    font-family: var(--font-special);
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-shadow: 0 0 5px var(--glow-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.skill-item {
    background-color: rgba(80, 37, 128, 0.4);
    border-radius: 5px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.skill-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(183, 102, 255, 0.3);
}

.skill-item i {
    color: var(--glow-color);
    font-size: 1.2rem;
}

.contact-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
}

.contact-heading {
    font-family: var(--font-special);
    font-size: 2.5rem;
    margin-bottom: 0px;
    text-align: center;
    text-shadow: 0 0 10px var(--glow-color), 0 0 15px var(--glow-color);
}

.contact-intro {
    font-size: 1.1rem;
    text-align: center;
    max-width: 600px;
    margin-bottom: 5px;
    line-height: 1.45;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
    margin-top: 5px;
}

.contact-card {
    background-color: rgba(80, 37, 128, 0.4);
    border-radius: 8px;
    padding: 15px 15px;
    text-decoration: none;
    color: var(--text-color);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(183, 102, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(183, 102, 255, 0.5);
    background-color: rgba(111, 51, 153, 0.5);
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--glow-color);
    text-shadow: 0 0 10px var(--glow-color);
}

.contact-label {
    font-family: var(--font-special);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.contact-description {
    font-size: 0.9rem;
    opacity: 0.8;
}

.contact-form-container {
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
}

.form-heading {
    font-family: var(--font-special);
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 0 5px var(--glow-color);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    width: 100%;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glow-color);
    border-radius: 5px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

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

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--glow-color);
    box-shadow: 0 0 8px var(--glow-color);
}

.submit-button {
    font-family: var(--font-special);
    font-size: 1.1rem;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    align-self: center;
    margin-top: 10px;
    text-shadow: 0 0 5px var(--glow-color);
}

.submit-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

/* Keep the existing contact button styles for backward compatibility */
.contact-row {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.contact-button {
    font-family: var(--font-special);
    font-size: 1.3rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 150px;
    height: 50px;
    margin: 5px 15px;
    padding: 15px;
    background-color: var(--primary-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.15s, transform 0.15s;
    text-align: center;
}

.contact-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

@media screen and (max-width: 600px) {
    .about-container {
        padding: 10px 8px;
    }

    .about-heading {
        font-size: 1.6rem;
        margin-bottom: 8px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .profile-container {
        margin-bottom: 5px;
    }

    .profile-frame {
        max-width: 180px;
    }

    .about-info {
        padding: 14px;
        max-height: none;
        overflow-y: visible;
    }

    .about-text {
        font-size: 0.9rem;
        min-height: auto;
        line-height: 1.5;
    }

    .skills-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .skill-item {
        padding: 10px;
        font-size: 0.85rem;
        min-height: 44px;
    }
}

@media screen and (max-width: 380px) {
    .about-heading {
        font-size: 1.4rem;
    }

    .about-text {
        font-size: 0.84rem;
        min-height: auto;
        line-height: 1.45;
    }

    .profile-frame {
        max-width: 140px;
    }

    .skills-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .skill-item {
        font-size: 0.78rem;
        padding: 8px;
    }
}

/* Experience Page Styles */
.experience-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* The actual timeline (the vertical ruler) */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 20px;
}

/* The vertical ruler */
.timeline::before {
    content: '';
    position: absolute;
    width: 4px;
    background: var(--glow-color);
    box-shadow: 0 0 8px var(--glow-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    z-index: 1;
}

/* Container around content */
.container {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    margin-bottom: 60px;
}

/* Place containers to the left */
.left {
    left: 0;
}

/* Place containers to the right */
.right {
    left: 50%;
}

/* Add circles on the timeline */
.left::after, .right::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: var(--primary-color);
    border: 3px solid var(--glow-color);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--glow-color);
    top: 20px;
    z-index: 2;
}

/* Add circle positions to the left container */
.left::after {
    right: -15px;
}

/* Add circle positions to the right container */
.right::after {
    left: -15px;
}

/* The actual content */
.content {
    position: relative;
    background-color: rgba(80, 37, 128, 0.4);
    border-radius: 8px;
    padding: 20px;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(183, 102, 255, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.content:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(183, 102, 255, 0.3);
}

.company {
    font-family: var(--font-special);
    font-size: 1.4rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.position {
    font-family: var(--font-special);
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.period {
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 10px;
    opacity: 0.8;
}

.description {
    line-height: 1.55;
    margin: 0;
    padding-left: 1.2em;
    list-style-type: disc;
}

.description li {
    margin-bottom: 10px;
}

.description li:last-child {
    margin-bottom: 0;
}

.description li::marker {
    color: var(--glow-color);
}

.description-lead {
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Expandable experience cards (reuse the .expand-btn styling from Projects) */
.content.expandable {
    cursor: pointer;
}

.exp-details {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.content.expanded .exp-details {
    grid-template-rows: 1fr;
}

.exp-details-inner {
    overflow: hidden;
    min-height: 0;
    padding-top: 14px;
}

.content.expanded .expand-chevron {
    transform: rotate(180deg);
}

.content.expanded .expand-more {
    display: none;
}

.content.expanded .expand-less {
    display: inline;
}

@media screen and (max-width: 900px) {
    .timeline::before {
        left: 31px;
    }

    .container {
        width: 100%;
        padding-left: 55px;
        padding-right: 15px;
        margin-bottom: 40px;
    }

    .right, .left {
        left: 0;
    }

    .right::after, .left::after {
        left: 17px;
    }

    .company {
        font-size: 1.2rem;
    }

    .position {
        font-size: 0.95rem;
    }

    .description {
        font-size: 0.9rem;
    }

    .content {
        padding: 15px;
    }
}

@media screen and (max-width: 600px) {
    .experience-container {
        padding: 6px 4px;
    }

    .timeline {
        padding-top: 10px;
    }

    .timeline::before {
        display: none;
    }

    .left::after, .right::after {
        display: none;
    }

    .container {
        width: 100%;
        padding: 0;
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 14px;
    }

    .right, .left {
        left: 0;
    }

    .content {
        padding: 14px 12px;
        border-left: 3px solid var(--glow-color);
    }

    .company {
        font-size: 1.1rem;
    }

    .position {
        font-size: 0.92rem;
    }

    .period {
        font-size: 0.82rem;
    }

    .description {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

@media screen and (max-width: 380px) {
    .experience-container {
        padding: 4px 2px;
    }

    .container {
        padding: 0;
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 10px;
    }

    .content {
        padding: 12px 10px;
    }

    .company {
        font-size: 1rem;
    }

    .position {
        font-size: 0.85rem;
    }

    .period {
        font-size: 0.75rem;
    }

    .description {
        font-size: 0.8rem;
        line-height: 1.4;
    }
}

/* Hidden audio player */
#audioPlayer {
    position: fixed;
    top: -100px;
    left: -100px;
    z-index: -1;
    opacity: 0.01;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

/* Content iframe */
#contentFrame {
    width: 100%;
    flex: 1;
    min-height: 0;
    border: none;
    display: block;
    overflow-y: auto;
    background: transparent;
}

/* Transparent background for embedded pages */
body.transparent-bg {
    background: transparent !important;
    padding-bottom: 0;
    display: block;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

body.transparent-bg::before,
body.transparent-bg::after,
body.transparent-bg .nebula,
body.transparent-bg .shooting-star,
body.transparent-bg .stars-medium,
body.transparent-bg .stars-large,
body.transparent-bg .bright-star,
body.transparent-bg .galaxy-spiral,
body.transparent-bg .cosmic-dust,
body.transparent-bg .color-overlay,
body.transparent-bg .star-cluster,
body.transparent-bg .far-stars {
    display: none;
}

/* Projects Page Styles */
.projects-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background-color: rgba(80, 37, 128, 0.4);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 800px;
    transition: transform 0.3s, box-shadow 0.3s;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(183, 102, 255, 0.3);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(183, 102, 255, 0.3);
}

.project-title {
    font-family: var(--font-special);
    color: var(--text-color);
    margin-top: 0;
}

.project-description {
    line-height: 1.6;
}

.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.project-link:hover {
    background-color: var(--primary-hover);
}

/* ---- Projects: section headings + expandable cards ---- */
.projects-section-title {
    font-family: var(--font-special);
    font-size: 1.6rem;
    color: var(--text-color);
    text-shadow: 0 0 10px var(--glow-color);
    width: 100%;
    max-width: 800px;
    margin: 10px 0 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(183, 102, 255, 0.25);
}

.projects-section-title:not(:first-child) {
    margin-top: 30px;
}

.projects-section-subtitle {
    width: 100%;
    max-width: 800px;
    font-size: 0.9rem;
    opacity: 0.75;
    margin-bottom: 16px;
}

.project-card.expandable {
    cursor: pointer;
}

.project-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-card-head .project-title {
    margin: 0;
    font-size: 1.25rem;
}

/* Clear "View details" button so it's obvious the card expands */
.expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    padding: 7px 14px;
    background-color: rgba(183, 102, 255, 0.15);
    border: 1px solid rgba(183, 102, 255, 0.45);
    border-radius: 6px;
    color: var(--text-color);
    font-family: var(--font-special);
    font-size: 0.72rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.expand-btn:hover {
    background-color: rgba(183, 102, 255, 0.28);
    box-shadow: 0 0 12px rgba(183, 102, 255, 0.3);
}

.expand-chevron {
    font-size: 0.9em;
    line-height: 1;
    color: var(--glow-color);
    transition: transform 0.3s ease;
    text-shadow: 0 0 8px var(--glow-color);
}

.project-card.expanded .expand-chevron {
    transform: rotate(180deg);
}

/* Swap the button label based on state */
.expand-less {
    display: none;
}

.project-card.expanded .expand-more {
    display: none;
}

.project-card.expanded .expand-less {
    display: inline;
}

.project-summary {
    margin: 8px 0 0;
    line-height: 1.5;
    opacity: 0.9;
}

.project-details {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.project-card.expanded .project-details {
    grid-template-rows: 1fr;
}

.project-details-inner {
    overflow: hidden;
    min-height: 0;
    padding-top: 14px;
}

.project-points {
    margin: 0;
    padding-left: 18px;
    line-height: 1.6;
}

.project-points li {
    margin-bottom: 6px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.project-tags span {
    font-size: 0.72rem;
    font-family: var(--font-special);
    padding: 4px 10px;
    border-radius: 999px;
    background-color: rgba(183, 102, 255, 0.12);
    border: 1px solid rgba(183, 102, 255, 0.3);
    color: var(--text-color);
    white-space: nowrap;
}

/* Muted, non-interactive tag for private/unavailable repos (not a button) */
.project-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-color);
    opacity: 0.6;
}

/* Audio controls */
#audio-toggle {
    background-color: rgba(80, 37, 128, 0.7);
    border: 1px solid rgba(183, 102, 255, 0.3);
    border-radius: 30px;
    padding: 8px 12px;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

#audio-toggle:hover {
    background-color: rgba(80, 37, 128, 0.9);
    box-shadow: 0 0 15px var(--glow-color);
    transform: translateY(-2px);
}

#audio-toggle i {
    text-shadow: 0 0 5px var(--glow-color);
}

#music-icon {
    margin-left: 5px;
    font-size: 0.8em;
    opacity: 0.8;
}

@media screen and (max-width: 600px) {
    #audio-controls {
        display: flex;
        justify-content: center;
        margin-bottom: 2px;
    }

    #audio-toggle {
        padding: 5px 12px;
        font-size: 0.8rem;
        min-height: 44px;
        min-width: 44px;
    }
}

.audio-label {
    font-family: var(--font-special);
    font-size: 0.7rem;
    color: var(--text-color);
    text-shadow: 0 0 5px var(--glow-color);
}

/* Shooting stars */
.shooting-star {
    position: fixed;
    width: 2px;
    height: 80px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0) 100%);
    border-radius: 0;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    transform-origin: top;
}

.shooting-star-1 {
    top: 20%;
    left: 25%;
    box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.6);
    animation: shooting-star-1 20s linear infinite;
    animation-delay: 4s;
}

.shooting-star-2 {
    top: 40%;
    left: 67%;
    box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.6);
    animation: shooting-star-2 25s linear infinite;
    animation-delay: 8s;
}

.shooting-star-3 {
    top: 70%;
    left: 45%;
    box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.6);
    animation: shooting-star-3 22s linear infinite;
    animation-delay: 15s;
}

.shooting-star-4 {
    top: 60%;
    left: 82%;
    box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.6);
    animation: shooting-star-4 30s linear infinite;
    animation-delay: 18s;
}

.shooting-star-5 {
    top: 35%;
    left: 15%;
    box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.6);
    animation: shooting-star-1 28s linear infinite;
    animation-delay: 12s;
}

.shooting-star-6 {
    top: 80%;
    left: 70%;
    box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.7);
    animation: shooting-star-3 18s linear infinite;
    animation-delay: 6s;
}

@keyframes shooting-star-1 {
    0% {
        opacity: 0;
        height: 0;
        transform: translateY(0) rotate(15deg);
    }
    0.5% {
        opacity: 1;
        height: 80px;
    }
    2% {
        opacity: 1;
        transform: translateY(150px) rotate(15deg);
    }
    2.5% {
        opacity: 0;
        height: 0;
    }
    100% {
        opacity: 0;
        transform: translateY(150px) rotate(15deg);
    }
}

@keyframes shooting-star-2 {
    0% {
        opacity: 0;
        height: 0;
        transform: translateY(0) rotate(10deg);
    }
    0.5% {
        opacity: 1;
        height: 90px;
    }
    2% {
        opacity: 1;
        transform: translateY(180px) rotate(10deg);
    }
    2.5% {
        opacity: 0;
        height: 0;
    }
    100% {
        opacity: 0;
        transform: translateY(180px) rotate(10deg);
    }
}

@keyframes shooting-star-3 {
    0% {
        opacity: 0;
        height: 0;
        transform: translateY(0) rotate(-8deg);
    }
    0.5% {
        opacity: 1;
        height: 70px;
    }
    2% {
        opacity: 1;
        transform: translateY(140px) rotate(-8deg);
    }
    2.5% {
        opacity: 0;
        height: 0;
    }
    100% {
        opacity: 0;
        transform: translateY(140px) rotate(-8deg);
    }
}

@keyframes shooting-star-4 {
    0% {
        opacity: 0;
        height: 0;
        transform: translateY(0) rotate(-12deg);
    }
    0.5% {
        opacity: 1;
        height: 100px;
    }
    2% {
        opacity: 1;
        transform: translateY(200px) rotate(-12deg);
    }
    2.5% {
        opacity: 0;
        height: 0;
    }
    100% {
        opacity: 0;
        transform: translateY(200px) rotate(-12deg);
    }
}

/* Galaxy spiral effect */
.galaxy-spiral {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-image: conic-gradient(
        rgba(0, 0, 0, 0) 0deg,
        rgba(80, 37, 128, 0.03) 60deg,
        rgba(111, 51, 153, 0.05) 120deg,
        rgba(143, 59, 186, 0.05) 180deg,
        rgba(173, 78, 188, 0.03) 240deg,
        rgba(68, 14, 132, 0.05) 300deg,
        rgba(0, 0, 0, 0) 360deg
    );
    opacity: 0.2;
    z-index: -2;
    transform-origin: center center;
    transform: scale(4);
    filter: blur(60px);
    animation: spiral-rotate 240s linear infinite;
    pointer-events: none;
    overflow: hidden;
    border: none;
    outline: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

@keyframes spiral-rotate {
    from {
        transform: scale(4) rotate(0deg);
    }
    to {
        transform: scale(4) rotate(360deg);
    }
}

/* Cosmic dust particles */
.cosmic-dust {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(1px 1px at 25px 150px, rgba(255, 163, 253, 0.2), rgba(0, 0, 0, 0) 20px),
        radial-gradient(1px 1px at 150px 350px, rgba(200, 147, 248, 0.2), rgba(0, 0, 0, 0) 25px),
        radial-gradient(1px 1px at 300px 250px, rgba(168, 127, 255, 0.2), rgba(0, 0, 0, 0) 30px),
        radial-gradient(1px 1px at 450px 550px, rgba(147, 107, 240, 0.2), rgba(0, 0, 0, 0) 20px),
        radial-gradient(1px 1px at 600px 350px, rgba(201, 135, 255, 0.2), rgba(0, 0, 0, 0) 25px),
        radial-gradient(1px 1px at 750px 550px, rgba(163, 108, 247, 0.2), rgba(0, 0, 0, 0) 30px),
        radial-gradient(1px 1px at 950px 350px, rgba(146, 80, 255, 0.2), rgba(0, 0, 0, 0) 25px);
    filter: blur(5px);
    z-index: -2;
    opacity: 0.15;
    animation: dust-drift 180s ease-in-out infinite alternate;
    pointer-events: none;
    overflow: hidden;
    border: none;
    outline: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

@keyframes dust-drift {
    0% {
        transform: translateX(-10px) translateY(-5px);
    }
    100% {
        transform: translateX(10px) translateY(5px);
    }
}

/* Color overlay */
.color-overlay {
    display: none; /* Hide this element as it's causing the box effect */
}

/* Star clusters */
.star-cluster {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 10%, rgba(0, 0, 0, 0) 70%);
    opacity: 0.2;
    z-index: -2;
    filter: blur(5px);
    pointer-events: none;
    overflow: hidden;
    border: none;
    outline: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

.star-cluster-1 {
    top: 25%;
    left: 20%;
    width: 300px;
    height: 300px;
}

.star-cluster-2 {
    top: 60%;
    left: 75%;
    width: 250px;
    height: 250px;
}

.star-cluster-3 {
    top: 70%;
    left: 30%;
    width: 200px;
    height: 200px;
}

.star-cluster-4 {
    top: 15%;
    left: 65%;
    width: 350px;
    height: 350px;
    opacity: 0.3;
}

/* Far away stars (tiny dots) */
.far-stars {
    display: none; /* Hide this element as it's causing the line of dots */
}

@media (hover: none) and (pointer: coarse) {
    .navbar a:hover {
        transform: none;
    }

    .highlight-item:hover {
        transform: none;
        box-shadow: none;
    }

    .cta-button:hover {
        transform: none;
        box-shadow: none;
    }

    .contact-card:hover {
        transform: none;
        box-shadow: none;
    }

    .content:hover {
        transform: none;
        box-shadow: none;
    }

    .skill-item:hover {
        transform: none;
        box-shadow: none;
    }

    .project-card:hover {
        transform: none;
        box-shadow: none;
    }

    #audio-toggle:hover {
        transform: none;
        box-shadow: none;
    }

    .navbar a:active {
        background-color: var(--primary-hover);
        transform: scale(0.95);
    }

    .cta-button:active,
    .contact-card:active,
    a.project-link:active {
        background-color: var(--primary-hover);
        transform: scale(0.97);
    }

    #audio-toggle:active {
        background-color: rgba(80, 37, 128, 0.9);
        transform: scale(0.95);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .shooting-star,
    .galaxy-spiral,
    .cosmic-dust,
    .nebula {
        display: none;
    }
}


/* ============================================================
   Mobile optimization pass (placed last so these win the
   cascade over the earlier, source-order-losing mobile rules)
   ============================================================ */
@media screen and (max-width: 600px) {
    /* Center the home hero vertically so tall phones don't leave a void below the CTAs */
    .home-container {
        align-items: center;
    }

    /* Section headings were rendering at full desktop size on mobile (dead 1.1rem override) */
    .skills-heading {
        font-size: 1.15rem;
    }

    /* Skills read better as a single column on phones (no cramped 2-col wrapping) */
    .skills-grid {
        grid-template-columns: 1fr;
    }

    /* Experience dates: drop the compounding italic + heavy glow, lift opacity */
    .period {
        font-style: normal;
        opacity: 0.9;
        text-shadow: none;
    }

    /* Footer text was ~8-10px; nudge to a more legible floor */
    .copyright {
        font-size: 0.68rem;
    }
    .footer-tagline,
    .footer-credit {
        font-size: 0.6rem;
    }

    /* Footer social icons: give them a 44px-tall tap target */
    .social-links-footer {
        gap: 6px;
    }
    .social-links-footer a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0 4px;
    }

    /* Project links span the card width for an easy tap target */
    .project-link {
        display: flex;
        width: 100%;
        box-sizing: border-box;
    }

    /* Keep all 5 nav links on one row on mainstream phones (390-393px) */
    .navbar a {
        padding: 8px 9px;
        margin: 2px;
        font-size: 0.72rem;
    }

    /* Stop the heavy decorative background animations on phones (battery) */
    .galaxy-spiral,
    .cosmic-dust {
        display: none;
    }
    .bright-star {
        animation: none;
    }
}

@media screen and (max-width: 380px) {
    /* Tighten nav further so it stays one row down to ~320px */
    .navbar a {
        padding: 8px 7px;
        margin: 2px 1px;
        font-size: 0.66rem;
    }

    /* Declutter the crammed footer on the narrowest phones */
    .footer-tagline,
    .footer-credit {
        display: none;
    }

    /* Keep the smallest text legible */
    .period {
        font-size: 0.8rem;
    }
    .skill-item {
        font-size: 0.85rem;
    }
}

/* ============================================================
   Mobile: bottom tab bar navigation + floating audio button
   (replaces the top navbar and footer bar on phones; desktop
   keeps the top nav + footer unchanged)
   ============================================================ */
@media screen and (max-width: 600px) {
    /* Reserve space for the fixed bottom tab bar instead of the footer */
    :root {
        --footer-height: 62px;
    }

    /* More breathing room at the top now that nav has moved down */
    header {
        font-size: 2rem;
        margin: 16px 0 12px;
        padding: 4px 0;
    }

    /* Turn the navbar into a fixed bottom tab bar */
    .navbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        margin: 0;
        padding: 4px 0;
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-around;
        background: rgba(80, 37, 128, 0.92);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(183, 102, 255, 0.5);
        z-index: 200;
    }

    .navbar a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 54px;
        padding: 4px 2px;
        margin: 0;
        background: transparent;
        border-radius: 0;
        font-size: 0.58rem;
        text-shadow: none;
    }

    .navbar a i {
        display: block;
        font-size: 1.15rem;
        color: var(--glow-color);
        text-shadow: 0 0 8px var(--glow-color);
    }

    .navbar a span {
        letter-spacing: 0.2px;
        opacity: 0.9;
    }

    /* Strip the footer down to just the audio button, floating above the tab bar */
    footer {
        bottom: 68px;
        right: 10px;
        left: auto;
        width: auto;
        padding: 0;
        background: transparent;
        border-top: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        z-index: 201;
    }

    .footer-content {
        display: block;
        width: auto;
        padding: 0;
    }

    /* Copyright + social icons are rehomed (socials live on About/Contact) */
    .footer-section {
        display: none;
    }

    #audio-controls {
        display: flex;
    }

    #audio-toggle {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    }
}
