.hero {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: var(--hero-pad);
    overflow: clip;
    isolation: isolate;
    /* Background comes from body now so hero and playground are visually continuous */
    background: transparent;
}
/* noise overlay moved to body so hero and playground share the same texture */

.hero-inner { position: relative; width: min(100%, var(--hero-maxw)); text-align:center; }
.hero-title {
    font-size: clamp(50px, 6vw, 80px);
    line-height: 1.05; letter-spacing: -0.02em;
    margin: 0 0 16px;
    animation: fadeInUp 0.8s ease-out;
}
.hero-title span { color: rgb(var(--hero-key-glow)); filter: saturate(120%); }
.hero-name {
    font-weight: 700;
    color: rgb(var(--hero-key-glow));
    position: relative;
    cursor: default;
    display: inline-block;
    
    /* Medium glass-like shine with glow */
    text-shadow: 
        0 0 20px rgba(var(--hero-key-glow), 0.4),
        0 0 35px rgba(var(--hero-key-glow), 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1),
        0 -1px 1px rgba(255, 255, 255, 0.4);
    
    filter: saturate(135%) brightness(1.08);
    
    /* 3D perspective for tilt effect */
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, text-shadow 0.15s ease-out;
}

.hero-name:hover {
    text-shadow: 
        0 0 25px rgba(var(--hero-key-glow), 0.5),
        0 0 40px rgba(var(--hero-key-glow), 0.25),
        0 1px 2px rgba(0, 0, 0, 0.1),
        0 -1px 1px rgba(255, 255, 255, 0.5);
}

/* Dark theme adjustments */
:root[data-theme="dark"] .hero-name {
    text-shadow: 
        0 0 22px rgba(var(--hero-key-glow), 0.5),
        0 0 38px rgba(var(--hero-key-glow), 0.25),
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 -1px 1px rgba(255, 255, 255, 0.25);
}

:root[data-theme="dark"] .hero-name:hover {
    text-shadow: 
        0 0 28px rgba(var(--hero-key-glow), 0.6),
        0 0 45px rgba(var(--hero-key-glow), 0.3),
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 -1px 1px rgba(255, 255, 255, 0.35);
}

/* Sparkle effect */
.sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    pointer-events: none;
    animation: sparkleFloat 0.8s ease-out forwards;
    z-index: 10;
}

.sparkle svg {
    width: 100%;
    height: 100%;
    fill: rgb(var(--hero-key-glow));
}

@keyframes sparkleFloat {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(1) rotate(180deg);
    }
}

/* Gallery - Floating stacked squares */
.hero-gallery {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: -30px;
    height: 200px;
    margin: 0 0 20px;
    perspective: 1200px;
}

.gallery-item {
    width: clamp(100px, 18vw, 140px);
    height: clamp(100px, 18vw, 140px);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: var(--bg);
    flex-shrink: 0;
    transition: all 0.3s ease;
    margin: 0 -30px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Staggered positioning with shadows to create floating effect */
.gallery-item-1 {
    z-index: 1;
    transform: translateY(20px) translateX(-40px) rotate(-8deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.gallery-item-2 {
    z-index: 3;
    transform: translateY(-10px) translateX(-15px) rotate(4deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2), 0 12px 24px rgba(0, 0, 0, 0.15);
}

.gallery-item-3 {
    z-index: 2;
    transform: translateY(10px) translateX(15px) rotate(-6deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.18), 0 10px 20px rgba(0, 0, 0, 0.12);
}

.gallery-item-4 {
    z-index: 1;
    transform: translateY(0px) translateX(40px) rotate(8deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.gallery-item-1:hover {
    transform: translateY(12px) translateX(-40px) rotate(-8deg) scale(1.05);
}

.gallery-item-2:hover {
    transform: translateY(-18px) translateX(-15px) rotate(4deg) scale(1.05);
}

.gallery-item-3:hover {
    transform: translateY(2px) translateX(15px) rotate(-6deg) scale(1.05);
}

.gallery-item-4:hover {
    transform: translateY(-8px) translateX(40px) rotate(8deg) scale(1.05);
}

/* Floating Notecard with Arrow */
.hero-notecard {
    position: absolute;
    right: 0%;
    top: 30%;
    transform: translateY(-50%) rotate(12deg);
    padding: 24px;
    max-width: 200px;
    font-family: 'Segoe Print', 'Comic Sans MS', cursive;
    z-index: 10;
    animation: fadeIn 0.8s ease-in 2s both;
}

.notecard-text {
    font-size: 15px;
    color: var(--fg);
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Animated Arrow SVG pointing to gallery */
.notecard-arrow {
    position: absolute;
    bottom: -100px;
    left: 20%;
    transform: translateX(-50%) rotate(50deg);
    width: 40px;
    height: 100px;
    color: var(--fg);
    animation: arrowFloat 2s ease-in-out infinite;
}

@keyframes arrowFloat {
    0%, 100% {
        transform: translateX(-50%) translateY(0) rotate(50deg);
        opacity: 0.7;
    }
    50% {
        transform: translateX(-50%) translateY(8px) rotate(50deg);
        opacity: 1;
    }
}

/* Responsive - hide on small screens */
@media (max-width: 768px) {
    .hero-notecard {
        display: none;
    }
}

.hero-sub { font-size: clamp(16px, 2.5vw, 22px); opacity: .75; margin: 0 0 28px; }

.hero-cta { display: flex; gap: 14px; justify-content:center; flex-wrap: wrap; }

/* (btn-glass and btn-ghost removed — social buttons use only .social-btn now) */

/* Accessible helper for screen reader-only text */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Square neumorphic social buttons (icon-only) - using rp-action-btn styling */
.social-btn {
    appearance: none;
    border: 1px solid var(--bg);
    background: var(--bg);
    width: clamp(2.75rem, 5.5vw, 3.5rem);
    height: clamp(2.75rem, 5.5vw, 3.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: clamp(0.5rem, 1vw, 0.75rem);
    color: var(--fg);
    flex-shrink: 0;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.15), -6px -6px 12px rgba(255, 255, 255, 0.8);
}

:root[data-theme="dark"] .social-btn {
    box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.5), -6px -6px 12px rgba(255, 255, 255, 0.1);
}

.social-btn svg { 
    width: 60%; 
    height: 60%; 
    display: block;
    fill: var(--fg);
    transition: all 0.3s ease;
}

.social-btn:hover svg {
    fill: rgb(var(--hero-key-glow));
    filter: drop-shadow(0 0 8px rgb(var(--hero-key-glow))) drop-shadow(0 0 16px rgba(140, 180, 255, 0.6));
}

.social-btn:active {
    transform: scale(0.98);
}

/* Dark theme variant - same rules, colors adjusted only */
:root[data-theme="dark"] .social-btn {
    color: var(--fg);
    background: var(--bg);
    transition: all 0.3s;
    border: none;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.6),
        0 -4px 8px rgba(100, 100, 100, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.3)) drop-shadow(-10px -10px 20px rgba(100, 100, 100, 0.1));
}

:root[data-theme="dark"] .social-btn:active {
    color: var(--fg);
    box-shadow: 
        inset 0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 -2px 4px rgba(255, 255, 255, 0.05);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

@media (prefers-reduced-motion: reduce) {
    .social-btn { transition: none; }
}

/* Scroll cue */
.scroll-cue { position: absolute; left: 50%; transform: translateX(-50%); bottom: 2rem; opacity: .9; font-size: .95rem; z-index: 20; color: var(--fg); }

/* Gallery Modal */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.gallery-modal[aria-hidden="false"] {
    display: flex;
}

.gallery-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

:root[data-theme="dark"] .gallery-modal-backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.gallery-modal-content {
    position: relative;
    z-index: 1001;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border);
}

#galleryModalImage {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    object-fit: contain;
    margin-bottom: 16px;
}

.gallery-modal-caption {
    text-align: center;
    font-size: 1rem;
    opacity: 0.8;
    margin: 0;
    max-width: 500px;
}

.gallery-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--fg);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    z-index: 1002;
}

.gallery-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInItem1 {
    from {
        opacity: 0;
        transform: translateY(70px) translateX(-40px) rotate(-8deg);
    }
    to {
        opacity: 1;
        transform: translateY(20px) translateX(-40px) rotate(-8deg);
    }
}

@keyframes slideInItem2 {
    from {
        opacity: 0;
        transform: translateY(70px) translateX(-15px) rotate(4deg);
    }
    to {
        opacity: 1;
        transform: translateY(-10px) translateX(-15px) rotate(4deg);
    }
}

@keyframes slideInItem3 {
    from {
        opacity: 0;
        transform: translateY(70px) translateX(15px) rotate(-6deg);
    }
    to {
        opacity: 1;
        transform: translateY(10px) translateX(15px) rotate(-6deg);
    }
}

@keyframes slideInItem4 {
    from {
        opacity: 0;
        transform: translateY(70px) translateX(40px) rotate(8deg);
    }
    to {
        opacity: 1;
        transform: translateY(0px) translateX(40px) rotate(8deg);
    }
}


