@font-face {
    font-family: 'HIPPIE GROOVY';
    src: url('../fonts/HIPPIE GROOVY.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    display: swap;
}

/* Base Body Styles */
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #2e1065;
    color: #ffffff;
    font-family: 'HIPPIE GROOVY', sans-serif;
}

/* Layout Lock for Demos Page (iOS scroll handling) */
body.demos-page-body {
    height: 100dvh;
    overflow: visible;
    position: fixed;
    top: 0;
    left: 0;
}

.font-groovy {
    font-family: 'HIPPIE GROOVY', sans-serif;
}

/* Navigation Link Typography */
.groovy-nav {
    font-family: 'HIPPIE GROOVY', sans-serif;
    text-shadow: 
     -2px -2px 0 #000,  
      2px -2px 0 #000,
     -2px  2px 0 #000,
      2px  2px 0 #000,
      4px  4px 8px rgba(0, 0, 0, 0.95);
}

/* Title Typography */
.groovy-title {
    overflow: visible;
    font-family: 'HIPPIE GROOVY', sans-serif;
    text-shadow: 
     -2px -2px 0 #000,  
      2px -2px 0 #000,
     -2px  2px 0 #000,
      2px  2px 0 #000,
      4px  4px 10px rgba(0, 0, 0, 0.95);
}

/* Body Text Typography */
.groovy-text {
    font-family: 'HIPPIE GROOVY', sans-serif;
    -webkit-text-stroke: 0px transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* Swirl Background Canvas */
#swirl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: -1;
    pointer-events: none;
}

/* Notch / Safe Area Handling */
.safe-top {
    padding-top: max(0.5rem, env(safe-area-inset-top));
}
.safe-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Custom Scrollbars */
::-webkit-scrollbar,
#gallery-container::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-thumb,
#gallery-container::-webkit-scrollbar-thumb {
    background-color: rgba(168, 85, 247, 0.5);
    border-radius: 4px;
}

/* App Viewport Container (demos.html) */
#app-viewport {
    height: 100%;
    height: 100dvh;
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(10rem + env(safe-area-inset-bottom));
}

/* Fixed Audio Player Bar (demos.html) */
#player-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out;
    visibility: hidden;
    background-color: rgba(3, 7, 18, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(168, 85, 247, 0.4);
}

#player-bar.show-player {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* Photo Gallery Grid & Tiles (photos.html) */
.aspect-square {
    aspect-ratio: 1 / 1;
}
.aspect-wide {
    aspect-ratio: 2 / 1;
}
.aspect-tall {
    aspect-ratio: 1 / 2;
}

.photo-tile {
    position: relative;
    overflow: hidden;
    border-radius: 0.85rem;
    background-color: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: transform 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.photo-tile:hover {
    transform: scale(1.025);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4);
}
.photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-tile.photo-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(219, 39, 119, 0.3));
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Lightbox Overlay (photos.html) */
#lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 0, 20, 0.94);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 2rem;
}
#lightbox-overlay.open {
    display: flex;
}
#lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}
#lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: white;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    background: rgba(255,255,255,0.15);
    border-radius: 9999px;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}