:root {
    /* Color Palette */
    --bg-color: #020408;
    --text-primary: #e6e6e6;
    --text-secondary: #a0a0b0;
    --accent-color: #ff91c2;
    /* Yozakura Pink */
    --accent-glow: rgba(255, 145, 194, 0.5);

    /* Glassmorphism */
    --glass-bg: rgba(5, 10, 18, 0.75);
    /* Dark Navy Glass */
    --glass-border: 1px solid rgba(200, 220, 255, 0.1);
    --glass-blur: blur(12px);

    /* Typography */
    --font-heading: 'M PLUS Rounded 1c', sans-serif;
    /* Pop Style for Logo/Headings - Wait, user asked to change 'About Me' text font which is body/pop. Let's change the pop font variable. */
    --font-heading-script: 'Courgette', cursive;
    --font-script-hero: 'Great Vibes', cursive;

    --font-pop: 'Zen Maru Gothic', sans-serif;
    /* New Stylish Pop Font */
    --font-body: 'Zen Maru Gothic', sans-serif;
    /* Use it for body too */

    /* Spacing */
    --container-width: 1100px;
    --header-height: 70px;
}

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

body {
    font-family: var(--font-body);
    background: radial-gradient(circle at 50% 120%, #0a1020, #020408);
    /* Midnight Blue glow */
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Cursor from s0iru.com */
.cursor-glow {
    position: fixed;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: screen;
    filter: blur(5px);
    transition: width 0.3s, height 0.3s, background 0.1s;
    background: radial-gradient(circle, rgba(255, 155, 240, 0.5) 0%, rgba(255, 155, 240, 0) 70%);
}

.particle {
    position: fixed;
    border-radius: 100% 0 100% 0;
    /* Petal shape */
    pointer-events: none;
    z-index: 9999;
    animation: particle-fade 1s ease-out forwards;
    transform-origin: center;
}

@keyframes particle-fade {
    0% {
        opacity: 0.8;
        transform: translate(0, 0) scale(1) rotate(0deg);
        /* Start */
    }

    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(var(--rot));
        /* End with rotation */
    }
}

.cursor-glow.active {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 88, 166, 0.6) 0%, rgba(255, 88, 166, 0) 70%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #1f242d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Background Effects */
.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

canvas#bg-particles {
    display: block;
    width: 100%;
    height: 100%;
}



/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-reveal {
    /* Visible by default for safety (progressive enhancement) */
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.scroll-reveal.hidden {
    opacity: 0;
    transform: translateY(50px);
    filter: blur(10px);
}

/* Stagger Delays */
.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

.delay-500 {
    transition-delay: 0.5s;
}

/* Typography Defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #fff;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Components */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-family: var(--font-pop);
    /* Pop style for buttons */
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn-primary {
    background: var(--accent-color);
    color: #0d1117;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent-color);
    box-shadow: 0 0 30px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(240, 246, 252, 0.1);
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.glass-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    padding: 2rem;
}

.section-title {
    font-family: 'Courgette', cursive;
    /* Readable Script for titles */
    font-size: 3rem;
    font-weight: 400;
    text-align: center;
    margin: 0 auto 4rem;
    /* Center with margin */
    position: relative;
    display: table;
    /* Allows centering with margin auto while fitting content */
    /* Removed left and transform to avoid conflict with scroll animation */
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    height: var(--header-height);
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(240, 246, 252, 0.05);
}

.navbar .container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Courgette', cursive;
    font-size: 1.8rem;
    font-weight: 400;
    color: #fff;
    letter-spacing: 1px;
}

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

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-family: var(--font-body);
    /* Match body text (Pop) */
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 700;
    /* Bold for pop look */
    position: relative;
    letter-spacing: 0.5px;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    position: relative;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-family: 'Great Vibes', cursive;
    font-size: 5rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    /* Reduced margin slightly due to line-height */
    line-height: 1.1;
}

.highlight {
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-glow);
}

.subtitle {
    font-family: var(--font-pop);
    /* Use Zen Maru Gothic */
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    letter-spacing: 1px;
    font-weight: 500;
    /* Zen Maru looks good with slight weight */
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-image {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 50;
    /* Ensure avatar sits above petals (z-index 10) */
    /* For speech bubble positioning */
}

.avatar-img {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 155, 240, 0.3);
    box-shadow: 0 0 50px rgba(255, 155, 240, 0.1);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 20;
    /* Keep above petals */
    cursor: pointer;
}

.avatar-img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 70px rgba(255, 155, 240, 0.2);
    border-color: var(--accent-color);
}

/* Easter Egg Animations */
@keyframes avatarBounce {

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

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

@keyframes avatarSpin {
    0% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.2) rotate(180deg);
    }

    100% {
        transform: scale(1) rotate(360deg);
    }
}

@keyframes avatarSpinRare {
    0% {
        transform: scale(1) rotate(0deg);
    }

    15% {
        transform: scale(0.8) rotate(-20deg);
        /* Crouch/Wind-up */
    }

    30% {
        transform: scale(1.4) rotate(400deg);
        /* POP! Big expansion */
    }

    50% {
        transform: scale(1.1) rotate(720deg);
        /* Bounce down */
    }

    70% {
        transform: scale(1.3) rotate(1080deg);
        /* Bounce up */
    }

    85% {
        transform: scale(1.1) rotate(1260deg);
        /* Small bounce */
    }

    100% {
        transform: scale(1) rotate(1440deg);
        /* Land */
    }
}

@keyframes petalBurst {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 0;
    }

    30% {
        opacity: 0.5;
        /* Transparent near center */
        transform: translate(calc(var(--endX) * 0.3), calc(var(--endY) * 0.3)) scale(0.6) rotate(30deg);
    }

    60% {
        opacity: 0.9;
        /* More visible outwards */
        transform: translate(calc(var(--endX) * 0.6), calc(var(--endY) * 0.6)) scale(1) rotate(60deg);
    }

    100% {
        transform: translate(var(--endX), var(--endY)) scale(1) rotate(var(--rot));
        opacity: 0;
    }
}

.easter-petal {
    box-shadow: 0 0 10px rgba(255, 145, 194, 0.5);
}

.easter-heart {
    text-shadow: 0 0 10px rgba(255, 145, 194, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 100%;
    /* Will be controlled by inline style */
    line-height: 1;
}

.secret-message {
    position: absolute;
    bottom: 110%;
    /* Above the avatar */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    /* Restored to fix vertical stacking issue */
    padding: 1.2rem 2rem;
    border-radius: 50px;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 3px solid var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 20px var(--accent-glow);
    animation: bubblePop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.secret-message::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 18px 15px 0;
    border-style: solid;
    border-color: var(--accent-color) transparent transparent transparent;
}

/* Inner triangle for border effect (optional, implies white body) 
   Simpler approach: just use the white bg. To match border we need a pseudo hack or just use filter drop-shadow or SVG.
   Let's stick to simple solid triangle for now matching border color. 
   Actually, to look correct with a border, we usually need two triangles or clip-path. 
   Let's keep it simple: The triangle will be the border color. 
   Wait, if the triangle is solid border color, it looks like a solid arrow. 
   Let's try to make it look seamless.
*/
.secret-message::before {
    content: '';
    position: absolute;
    bottom: -13px;
    /* Slightly less to overlap */
    left: 50%;
    transform: translateX(-50%);
    border-width: 15px 12px 0;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
    z-index: 1;
}


.secret-text {
    font-family: var(--font-pop);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-color);
    /* Pink text */
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 #fff;
}

.secret-emoji {
    font-size: 1.5rem;
    opacity: 0;
    animation: emojiReveal 0.4s ease forwards;
}

.secret-emoji:first-child {
    animation-delay: 0.3s;
}

.secret-emoji:last-child {
    animation-delay: 0.5s;
}

@keyframes bubblePop {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.5) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

@keyframes emojiReveal {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.secret-message.fade-out {
    animation: messageFadeOut 0.5s ease-in forwards;
}

@keyframes messageFadeOut {
    0% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8) translateY(-20px);
    }
}

.floating-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10002;
}

@keyframes particleFade {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--endX), var(--endY)) scale(0);
        opacity: 0;
    }
}

/* About Section */
.section {
    padding: 8rem 0;
}

.about-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    font-size: 1.25rem;
    /* Reduced size */
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
    line-height: 1.8;
}

.stats {
    display: flex;
    justify-content: space-around;
    padding-top: 2rem;
    border-top: 1px solid rgba(240, 246, 252, 0.1);
}

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

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--accent-color);
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Anchor scroll position: avoid fixed header covering section titles */
#gallery,
#worlds {
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

/* Gallery Section */
.gallery-grid {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.gallery-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0; /* Flexbox overflow fix */
}

.gallery-item {
    /* aspect-ratio removed for masonry */
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    z-index: 1;
    width: 100%;
}

.gallery-item .placeholder-img {
    transition: transform 0.5s ease;
}

.gallery-item:hover .placeholder-img {
    transform: scale(1.05);
}

.gallery-item:hover {
    border-color: var(--accent-color);
}

.gallery-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

/* Loading State - Skeleton Animation */
.gallery-item.loading {
    min-height: 200px;
    background: linear-gradient(
        90deg,
        var(--glass-bg) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        var(--glass-bg) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.gallery-item.loading .gallery-img {
    opacity: 0;
}

.gallery-item.loaded .gallery-img {
    opacity: 1;
    animation: fadeIn 0.4s ease;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    background: rgba(255, 255, 255, 0.02);
}

/* Worlds Section */
.worlds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.world-card {
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Smoother bezier */
    border-radius: 24px;
    background: var(--glass-bg);
    border: var(--glass-border);
}

.world-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    /* Softer, deeper shadow */
    border-color: rgba(255, 155, 240, 0.5);
}

.world-img-placeholder {
    width: 100%;
    height: 180px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.world-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.world-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.world-card p {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    backdrop-filter: blur(5px);
}

/* Contact Section Redesign */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.contact-card {
    position: relative;
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    backdrop-filter: var(--glass-blur);
}

.contact-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px var(--accent-glow);
}

/* Primary Cards (Twitter & VRChat) */
.contact-card.primary {
    grid-column: span 2;
    height: 160px;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.contact-card.primary .card-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 2;
}

.contact-card.primary i {
    font-size: 3.5rem;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.contact-card.primary:hover i {
    transform: scale(1.1) rotate(-10deg);
    color: #fff;
}

.contact-card .card-text h3 {
    font-size: 1.4rem;
    margin: 0;
    color: #fff;
    font-family: var(--font-heading);
}

.contact-card .card-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    font-family: var(--font-pop);
}

/* Secondary Cards (Discord, Note, etc) */
.contact-card.secondary {
    grid-column: span 1;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
}

.contact-card.secondary i {
    font-size: 2rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.contact-card.secondary span {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    font-family: var(--font-pop);
    transition: color 0.3s ease;
}

.contact-card.secondary:hover i {
    transform: translateY(-5px);
    color: #fff;
}

.contact-card.secondary:hover span {
    color: var(--accent-color);
}

/* Brand Colors on Hover */
.contact-card.twitter:hover i { color: #1DA1F2; text-shadow: 0 0 15px rgba(29, 161, 242, 0.4); }
.contact-card.vrchat:hover i { color: #17e0db; text-shadow: 0 0 15px rgba(23, 224, 219, 0.4); }
.contact-card.discord:hover i { color: #5865F2; text-shadow: 0 0 15px rgba(88, 101, 242, 0.4); }
.contact-card.note:hover i { color: #41C9B4; text-shadow: 0 0 15px rgba(65, 201, 180, 0.4); }
.contact-card.youtube:hover i { color: #FF0000; text-shadow: 0 0 15px rgba(255, 0, 0, 0.4); }
.contact-card.steam:hover i { color: #1b2838; text-shadow: 0 0 15px rgba(255, 255, 255, 0.2); } /* Steam is dark, maybe white glow */
.contact-card.steam:hover i { color: #ffffff; }

/* Responsive Contact Grid */
@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns on mobile */
    }

    .contact-card.primary {
        grid-column: span 2; /* Full width for primary */
        height: 120px;
        padding: 0 1.5rem;
    }

    .contact-card.primary i {
        font-size: 2.5rem;
    }

    .contact-card.secondary {
        height: 100px;
    }
}

/* Footer */
footer {
    padding: 3rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid rgba(240, 246, 252, 0.05);
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    max-height: min(85vh, 85dvh);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
}

.lightbox-close {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1;
    z-index: 100000;
}

.lightbox-close:hover {
    color: var(--accent-color);
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Lightbox loading spinner */
.lightbox-spinner {
    position: absolute;
    z-index: 100001;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.lightbox-spinner.active {
    opacity: 1;
}

.spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spinnerRotate 0.7s linear infinite;
}

@keyframes spinnerRotate {
    to {
        transform: rotate(360deg);
    }
}

/* Lightbox progressive image transition */
.lightbox-content {
    transition: filter 0.3s ease;
}

.lightbox-content.loading-hires {
    filter: blur(2px);
}

/* Reduce backdrop-filter cost on mobile */
@media (max-width: 768px) {
    .lightbox {
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        max-width: 90%;
    }

    .hero-text h1 {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 4rem 0;
        /* Reduce padding on mobile */
    }

    .container {
        padding: 0 1.5rem;
    }

    .hero {
        min-height: 100vh;
        height: auto;
        /* Allow content to grow */
        padding-top: calc(var(--header-height) + 2rem);
        padding-bottom: 2rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
        display: flex;
        flex-direction: column-reverse;
        /* Image on top */
    }

    .hero-text h1 {
        font-size: 2.8rem;
        line-height: 1.2;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

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

    .avatar-img {
        width: 200px;
        height: 200px;
        border-width: 2px;
    }

    /* Mobile Navigation */
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(2, 4, 8, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        padding: 2rem;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 1.4rem;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
    }

    .nav-links.active a {
        opacity: 1;
        transform: translateY(0);
    }

    /* Stagger animation for links */
    .nav-links.active li:nth-child(1) a {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) a {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(3) a {
        transition-delay: 0.3s;
    }

    .nav-links.active li:nth-child(4) a {
        transition-delay: 0.4s;
    }

    .nav-links.active li:nth-child(5) a {
        transition-delay: 0.5s;
    }

    .hamburger {
        display: block;
        z-index: 1000;
        position: relative;
    }

    .section-title {
        font-size: 2.2rem;
        margin-bottom: 2.5rem;
    }

    .section-title::after {
        width: 40px;
    }

    .about-content p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    /* Gallery: ensure enough vertical space on mobile so Favorite Worlds doesn't appear too soon */
    .section.gallery {
        min-height: 0;
        padding-bottom: 5rem;
    }

    .gallery-grid {
        flex-direction: column;
        /* Single column on mobile by stacking columns? 
           Ideally we want JS to handle 1 column, but as a fallback CSS stack is ok 
           though order will be LeftCol then RightCol. 
           We will implement JS resizing for proper ordering. */
        gap: 2rem;
    }

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

    .social-links-grid {
        gap: 1rem;
    }

    .link-btn {
        width: 50px;
        height: 50px;
    }

    .link-btn i {
        font-size: 1.2rem;
    }

    /* Secret Message Mobile Styles */
    /* Secret Message Mobile Styles */
    .secret-message {
        writing-mode: horizontal-tb;
        width: max-content;
        /* Force width to match text length (ignore parent width) */
        max-width: 95vw;
        /* Cap at screen width */
        height: auto;
        min-height: auto;
        max-height: none;
        white-space: normal;
        /* Allow wrap ONLY when hitting max-width */
        padding: 1rem 1.4rem;
        bottom: 120%;
        text-align: center;
        justify-content: center;
        gap: 0.5rem;
    }

    .secret-text {
        font-size: 1rem;
        /* Standard readable size */
    }

    .secret-text.rare-msg {
        font-size: 0.95rem;
        /* readable size */
        line-height: 1.4;
        /* breathing room */
    }

    .secret-emoji {
        font-size: 1.1rem;
    }
}

/* Fix for very small screens */
@media (max-width: 380px) {
    .hero-text h1 {
        font-size: 2.2rem;
    }

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