/* ----------------- Base Variables and Settings ----------------- */
:root {
    /* Primary color palette */
    --primary-color: #3a6ea5;
    --primary-color-dark: #2c5584;
    --primary-color-light: #5a8ec5;

    /* Secondary color palette */
    --secondary-color: #ff6b6b;
    --secondary-color-dark: #e55656;
    --secondary-color-light: #ff8a8a;

    /* Accent colors */
    --accent-color: #ffe66d;
    --accent-color-dark: #f0d84f;
    --accent-color-light: #fff0a0;

    /* Text and background colors */
    --text-color: #333;
    --text-color-light: #666;
    --text-color-inverted: #fff;
    --light-bg: #f8f9fa;
    --light-bg-alt: #f1f3f5;
    --dark-bg: #2c3e50;
    --dark-bg-alt: #1a2530;

    /* Spacing variables */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-xxl: 3rem;

    /* Font sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.125rem;
    --text-lg: 1.25rem;
    --text-xl: 1.5rem;
    --text-2xl: 1.75rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3rem;
    --text-hero: clamp(2.5rem, 8vw, 4rem);

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transition speeds */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Layout constraints */
    --container-max: 1200px;
    --container-narrow: 900px;
}

/* ----------------- Base Reset and Typography ----------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
    font-size: 16px;
}

body {
    background-color: var(--light-bg);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: var(--space-xl) 0;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ----------------- Accessibility Enhancements ----------------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--text-color-inverted);
    padding: var(--space-sm) var(--space-md);
    z-index: 1001;
    transition: top var(--transition-normal);
    border-radius: 0 0 var(--radius-md) 0;
    text-decoration: none;
    font-weight: 500;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* ----------------- Layout & Container ----------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-xl);
    position: relative;
}

.container-narrow {
    max-width: var(--container-narrow);
}

section {
    padding: var(--space-xxl) 0;
    min-height: 50vh;
}

/* ----------------- Typography & Headings ----------------- */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: var(--space-md);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-color-dark);
}

h1 {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-lg);
}

h2 {
    font-size: var(--text-3xl);
    margin: var(--space-xl) 0 var(--space-lg);
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60%;
    height: 3px;
    background-color: var(--secondary-color);
}

h3 {
    font-size: var(--text-xl);
}

.subtitle {
    font-size: var(--text-md);
    margin-bottom: var(--space-md);
    font-weight: 300;
    color: var(--text-color-light);
}

p {
    margin-bottom: var(--space-md);
}

p:last-child {
    margin-bottom: 0;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition-normal);
}

a:hover, a:focus {
    color: var(--primary-color-dark);
    text-decoration: underline;
}

/* Logo */
.logo {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--primary-color);
    margin-right: auto;
    transition: color var(--transition-normal);
}

.logo:hover {
    color: var(--primary-color-dark);
}

/* ----------------- Hero Section ----------------- */
.hero-section {
    height: 100vh;
    height: 100 svh; /* for mobile */
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-color-inverted);
    overflow: hidden;
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.video-container video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            rgba(0, 0, 0, 0.6),
            rgba(0, 0, 0, 0.4),
            rgba(0, 0, 0, 0.6)
    );
    transition: opacity 1.5s ease;
}

.video-overlay.fade-out {
    opacity: 0;
}

/* Sound toggle button */
.sound-toggle {
    position: absolute;
    bottom: var(--space-xl);
    right: var(--space-xl);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    font-size: var(--text-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    z-index: 100;
    opacity: 0.8;
    pointer-events: auto;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
    opacity: 1;
    transform: scale(1.05);
    background-color: rgba(58, 110, 165, 0.9);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.sound-toggle.sound-on {
    background-color: rgba(58, 110, 165, 0.9);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Direct unmute button */
.direct-unmute-btn {
    transition: all var(--transition-normal);
}

.direct-unmute-btn:hover,
.direct-unmute-btn:focus-visible {
    background-color: rgba(58, 110, 165, 0.9) !important;
    transform: scale(1.05);
}

/* Sound notification */
.sound-notification {
    position: absolute;
    bottom: calc(var(--space-xl) + 55px);
    right: var(--space-xl);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-normal);
    pointer-events: none;
    z-index: 10;
}

.sound-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Hero content fade effect */
.hero-content {
    max-width: 800px;
    padding: 0 var(--space-xl);
    z-index: 1;
    transition: opacity 1.5s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content.fade-out {
    opacity: 0;
}

.hero-section h1 {
    font-size: var(--text-hero);
    margin-bottom: var(--space-md);
    color: var(--text-color-inverted);
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    margin-bottom: var(--space-xl);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Enhanced scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: bounce 2s infinite;
    cursor: pointer;
    transition: opacity var(--transition-normal);
}

.scroll-indicator:hover {
    opacity: 0.8;
}

.scroll-indicator span {
    margin-bottom: var(--space-sm);
    font-size: var(--text-base);
}

.scroll-indicator i {
    font-size: var(--text-lg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-20px) translateX(-50%);
    }
    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* ----------------- Header styles ----------------- */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-bg));
    color: var(--text-color-inverted);
    text-align: center;
    padding: 4rem 0 2.5rem;
    position: relative;
    margin-bottom: 0;
    box-shadow: var(--shadow-lg);
}

header h1 {
    color: var(--text-color-inverted);
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100'%3E%3Cpath fill='%23f8f9fa' fill-opacity='1' d='M0,64L60,64C120,64,240,64,360,58.7C480,53,600,43,720,42.7C840,43,960,53,1080,58.7C1200,64,1320,64,1380,64L1440,64L1440,100L1380,100C1320,100,1200,100,1080,100C960,100,840,100,720,100C600,100,480,100,360,100C240,100,120,100,60,100L0,100Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
}

/* ----------------- Navigation ----------------- */
nav {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-normal);
    transform: translateY(-100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

nav.visible {
    transform: translateY(0);
}

nav.scrolled {
    padding: 0.5rem 0;
    background-color: white;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style-type: none;
    padding: var(--space-md) 0;
    margin: 0;
}

nav li {
    margin: 0 var(--space-lg);
}

/* nav links */
nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: var(--text-md);
    font-weight: 500;
    transition: all var(--transition-normal);
    position: relative;
    padding: var(--space-sm) 0;
    display: inline-block;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width var(--transition-normal);
}

nav a:hover,
nav a:focus {
    color: var(--secondary-color);
    outline: none;
    text-decoration: none;
}

nav a:hover::after,
nav a:focus::after {
    width: 100%;
}

nav a.active {
    color: var(--secondary-color);
}

nav a.active::after {
    width: 100%;
}

/* Hamburger menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-menu:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.hamburger-menu div {
    width: 2rem;
    height: 0.25rem;
    background: var(--primary-color);
    border-radius: var(--radius-sm);
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* ----------------- Filter controls ----------------- */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
    gap: var(--space-sm);
}

.filter-btn {
    background-color: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn:focus-visible,
.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    outline: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.filter-btn.active {
    background-color: var(--primary-color-dark);
}

/* ----------------- Memory gallery ----------------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-xl);
    margin: var(--space-xl) 0 var(--space-xxl);
}

.memory-card {
    background-color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    will-change: transform, box-shadow;
}

.memory-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.memory-img {
    width: 100%;
    height: 220px;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    position: relative;
    overflow: hidden;
}

.memory-img .img-placeholder {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.memory-img .img-placeholder.hidden {
    opacity: 0;
    z-index: -1;
}

.memory-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

/* Hover effects for non-touch devices */
@media (hover: hover) {
    .memory-card:hover .memory-img img {
        transform: scale(1.05);
    }

    .memory-img:hover .fullscreen-icon {
        opacity: 1;
    }
}

#fullscreenImage {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.fullscreen-icon {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal), background-color var(--transition-normal);
    cursor: pointer;
    z-index: 2;
}

.fullscreen-icon:hover,
.fullscreen-icon:focus {
    background-color: var(--primary-color);
}

/* Fullscreen modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.fullscreen-modal.active {
    display: flex;
    opacity: 1;
}

.fullscreen-content {
    max-width: 95%;
    max-height: 90%;
    position: relative;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fullscreen-caption {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: var(--space-md);
    text-align: center;
    font-size: var(--text-base);
    width: 100%;
    margin-top: var(--space-md);
    border-radius: var(--radius-md);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fullscreen-nav {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.fullscreen-nav button {
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-normal);
    margin: 0 var(--space-md);
    pointer-events: auto;
}

.fullscreen-nav button:hover,
.fullscreen-nav button:focus-visible {
    background-color: rgba(255, 255, 255, 0.2);
}

.close-fullscreen {
    position: absolute;
    top: var(--space-xl);
    right: var(--space-xl);
    color: white;
    font-size: var(--text-3xl);
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-normal);
}

.close-fullscreen:hover,
.close-fullscreen:focus-visible {
    background-color: rgba(255, 255, 255, 0.2);
}

.memory-img span {
    z-index: 1;
    background-color: rgba(0, 0, 0, 0.5);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    color: white;
    font-size: var(--text-sm);
}

.memory-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.memory-card:hover .memory-img::before {
    opacity: 1;
}

.memory-content {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.memory-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-sm);
    color: var(--primary-color);
    font-weight: 600;
}

.memory-date {
    font-size: var(--text-sm);
    color: #7f8c8d;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
}

.memory-date i {
    margin-right: var(--space-sm);
    color: var(--secondary-color);
}

.memory-description {
    font-size: var(--text-base);
    color: var(--text-color-light);
    line-height: 1.6;
    flex-grow: 1;
}

.memory-tags {
    margin-top: var(--space-sm);
}

.memory-tag {
    display: inline-block;
    background-color: var(--light-bg);
    color: var(--primary-color);
    padding: calc(var(--space-xs) / 2) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    margin-right: var(--space-sm);
    margin-top: var(--space-sm);
    transition: all var(--transition-normal);
}

.memory-tag:hover {
    background-color: var(--primary-color-light);
    color: white;
    transform: translateY(-2px);
}

/* ----------------- About section ----------------- */
#about {
    background-color: var(--light-bg-alt);
    border-radius: var(--radius-lg);
    padding: var(--space-xxl);
    margin: var(--space-xxl) 0;
    box-shadow: var(--shadow-md);
}

/* ----------------- Search box ----------------- */
.search-container {
    margin-bottom: var(--space-xl);
    position: relative;
}

.search-box {
    width: 100%;
    padding: var(--space-sm) var(--space-md) var(--space-sm) 3rem;
    border: 1px solid #ddd;
    border-radius: var(--radius-full);
    font-size: var(--text-base);
    transition: all var(--transition-normal);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.2);
}

.search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}

/* ----------------- Footer ----------------- */
footer {
    background-color: var(--dark-bg);
    color: white;
    text-align: center;
    padding: var(--space-xxl) 0 var(--space-lg);
    margin-top: var(--space-xxl);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    transform: translateY(-100%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100'%3E%3Cpath fill='%232c3e50' fill-opacity='1' d='M0,32L60,42.7C120,53,240,75,360,80C480,85,600,75,720,69.3C840,64,960,64,1080,69.3C1200,75,1320,85,1380,90.7L1440,96L1440,100L1380,100C1320,100,1200,100,1080,100C960,100,840,100,720,100C600,100,480,100,360,100C240,100,120,100,60,100L0,100Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
}

.social-icons {
    margin: var(--space-lg) 0;
}

.social-icons a {
    color: white;
    font-size: var(--text-xl);
    margin: 0 var(--space-sm);
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.1);
}

.social-icons a:hover,
.social-icons a:focus-visible {
    color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* ----------------- Loading indicator ----------------- */
.loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.loader.active {
    display: flex;
}

.loader-spinner {
    border: 5px solid rgba(243, 243, 243, 0.5);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ----------------- Back to top button ----------------- */
.back-to-top {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    background-color: var(--primary-color);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 999;
    border: none;
    box-shadow: var(--shadow-md);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background-color: var(--primary-color-dark);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ----------------- Video play button ----------------- */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(58, 110, 165, 0.7);
    color: white;
    border: none;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    font-size: var(--text-3xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    z-index: 2;
}

.video-play-btn:hover,
.video-play-btn:focus-visible {
    background-color: var(--primary-color);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* ----------------- Media Queries ----------------- */

/* Large desktop screens */
@media (min-width: 1400px) {
    :root {
        --space-xxl: 4rem;
    }

    .container {
        max-width: 1320px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* Standard desktop */
@media (max-width: 1199px) {
    :root {
        --text-hero: clamp(2.2rem, 7vw, 3.5rem);
    }

    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }
}

/* Tablets and small desktops */
@media (max-width: 991px) {
    .container {
        padding: 0 var(--space-lg);
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: var(--space-lg);
    }

    #about {
        padding: var(--space-xl);
    }
}

/* Tablets and large phones */
@media (max-width: 768px) {
    :root {
        --text-hero: clamp(2rem, 6vw, 3rem);
    }

    .video-play-btn {
        width: 60px;
        height: 60px;
        font-size: var(--text-xl);
    }

    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.3rem);
    }

    h1 {
        font-size: var(--text-2xl);
    }

    h2 {
        font-size: var(--text-xl);
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    /* Mobile navigation */
    .hamburger-menu {
        display: flex;
    }

    nav ul {
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -300px;
        background-color: white;
        height: 100vh;
        width: 300px;
        padding: 4rem var(--space-xl);
        transition: right var(--transition-normal);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    nav ul.active {
        right: 0;
    }

    nav li {
        margin: var(--space-md) 0;
    }

    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .nav-overlay.active {
        display: block;
    }

    .memory-img {
        height: 180px;
    }

    .memory-content {
        padding: var(--space-md);
    }

    .sound-toggle,
    .back-to-top {
        bottom: var(--space-md);
        right: var(--space-md);
    }

    .sound-notification {
        bottom: calc(var(--space-md) + 55px);
        right: var(--space-md);
    }

    #fullscreenImage {
        max-height: 70vh;
    }

    .fullscreen-caption {
        font-size: var(--text-sm);
        padding: var(--space-sm);
    }

    .close-fullscreen {
        top: var(--space-md);
        right: var(--space-md);
    }
}

/* Small phones */
@media (max-width: 480px) {
    :root {
        --space-md: 0.75rem;
        --space-lg: 1.25rem;
        --space-xl: 1.5rem;
        --space-xxl: 2rem;
        --text-hero: clamp(1.8rem, 5vw, 2.5rem);
    }

    .container {
        padding: 0 var(--space-md);
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    #about {
        padding: var(--space-lg);
    }

    .filter-btn {
        padding: calc(var(--space-xs) / 2) var(--space-sm);
        font-size: var(--text-sm);
    }

    .social-icons a {
        margin: 0 var(--space-xs);
        font-size: var(--text-lg);
    }

    .fullscreen-nav button {
        width: 35px;
        height: 35px;
    }
}

/* Print styles */
@media print {
    .hero-section,
    nav,
    .back-to-top,
    .fullscreen-modal,
    .sound-toggle,
    .sound-notification,
    .scroll-indicator,
    .filter-controls,
    .search-container,
    footer,
    .social-icons {
        display: none !important;
    }

    body {
        background-color: white;
        color: black;
    }

    .container {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }

    .memory-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 1cm;
    }

    .memory-img {
        height: auto;
        max-height: 8cm;
    }

    .memory-img img {
        max-height: 8cm;
    }

    a {
        text-decoration: none;
        color: black;
    }
}