:root {
    --bg-color: #ffffff;
    --text-color: #14161a;
    --accent-glow: rgba(0, 0, 0, 0.14);
    --border-color: rgba(0, 0, 0, 0.1);
    --tile-surface: rgba(0, 0, 0, 0.04);
    --placeholder-bg: #eceef1;
}

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

html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

body {
    font-family: 'Hanken Grotesk', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

body.splash-active,
body.nav-menu-open {
    overflow: hidden !important;
    height: 100vh !important;
    touch-action: none !important;
}

/* ── Splash Screen ─────────────────────────────── */
#splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: url('assets/images/background.webp') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
    touch-action: none;
}

#splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.splash-nav {
    flex-shrink: 0;
}

.splash-content {
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px 40px;
    max-width: 90vw;
    width: 460px;
    box-sizing: border-box;
    gap: 0;
}

.splash-entering {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-color);
    opacity: 0.6;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.splash-title {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: clamp(32px, 6vw, 52px);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-wrap: balance;
}

.splash-description {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.6;
    max-width: 380px;
    margin-bottom: 16px;
    text-wrap: balance;
}

.splash-device-note {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.75;
    font-style: italic;
    margin-bottom: 28px;
    letter-spacing: 0.01em;
    text-wrap: balance;
}

.splash-status {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-color);
    opacity: 0.45;
    letter-spacing: 0.01em;
}

.splash-enter {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 10px 28px;
    cursor: pointer;
    letter-spacing: 0.04em;
    border-radius: 2px;
    transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    animation: fadeInUp 0.5s ease forwards;
}

.splash-enter:hover {
    border-color: rgba(0, 0, 0, 0.6);
    transform: translateY(-1px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.main-content-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0 60px 40px 0;
}

.top-row {
    display: flex;
    width: 100%;
    height: 0;
    opacity: 0;
    overflow: hidden;
    gap: 40px;
    margin-bottom: 0;
    will-change: height, opacity;
    transition: height 1.6s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 1s ease 0.3s,
        margin-bottom 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-row.visible {
    height: 540px;
    opacity: 1;
    margin-bottom: 40px;
}

.canvas-container {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

#spectrogram-canvas {
    width: 100%;
    height: 540px;
    /* Fixed — never resizes during transition */
    display: block;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

#fullscreen-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.fullscreen-text {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#fullscreen-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.canvas-container:fullscreen {
    background-color: var(--bg-color);
    width: 100vw;
    height: 100vh;
}

.canvas-container:fullscreen #spectrogram-canvas {
    height: 100vh;
}

body.fullscreen-open {
    overflow: hidden !important;
    height: 100vh !important;
    touch-action: none !important;
}

/* Pseudo-Fullscreen Fallback for Mobile / iOS Safari */
.canvas-container.fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background-color: var(--bg-color) !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    touch-action: none !important;
}

.canvas-container.fullscreen-active #spectrogram-canvas {
    height: 100vh !important;
    width: 100vw !important;
    max-height: none !important;
}

.canvas-container.fullscreen-active #fullscreen-btn {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    z-index: 1000000 !important;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.currently-playing-container {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
}

.currently-playing-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
}

.scroll-hint {
    font-size: 13px;
    font-weight: 500;
    color: #b87333;
    margin-left: 6px;
    font-style: italic;
}

.view-more-blurb {
    font-size: 13px;
    font-style: italic;
    color: #888;
    margin-top: 15px;
}

#currently-playing-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 480px;
    padding-right: 10px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: rgba(184, 115, 51, 0.8) rgba(0, 0, 0, 0.05);
}

#currently-playing-info::-webkit-scrollbar {
    width: 8px;
    display: block;
}

#currently-playing-info::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

#currently-playing-info::-webkit-scrollbar-thumb {
    background-color: rgba(184, 115, 51, 0.75);
    border-radius: 10px;
}

#currently-playing-info::-webkit-scrollbar-thumb:hover {
    background-color: rgba(184, 115, 51, 1);
}

#currently-playing-info::-webkit-scrollbar {
    width: 6px;
}

#currently-playing-info::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
}

#currently-playing-info::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

#currently-playing-info::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

.playing-item {
    display: flex;
    gap: 20px;
}

.playing-item img {
    width: 80px;
    height: auto;
    object-fit: contain;
    align-self: flex-start;
}

.info-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    line-height: 1.4;
}

.info-details p {
    margin: 0;
}

.info-details a.learn-more {
    margin-top: 10px;
    font-weight: 900;
    font-style: italic;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
}

.bottom-row {
    width: 100%;
    padding-left: 60px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.inventory-title {
    font-size: clamp(12px, 1.5vw, 20px);
    font-weight: 900;
    text-align: center;
}

#instrument-categories {
    display: flex;
    flex-wrap: nowrap;
    gap: clamp(5px, 2vw, 60px);
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

/* Global Navbar */
.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #C5C5C5;
    height: 110px;
}

.mobile-nav-header {
    display: none;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 26px;
    height: 18px;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1002;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-menu-wrapper {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 40px;
    flex: 1;
}

.nav-links.left {
    justify-content: flex-start;
}

.nav-links.right {
    justify-content: flex-end;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 17px;
    font-weight: 500;
    text-transform: none;
    /* Raleway looks better without forced case here */
    letter-spacing: 0.2px;
    transition: opacity 0.2s ease;
}

.nav-links a:hover {
    opacity: 0.6;
}

.nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-item>a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 20px 0;
}

.nav-item:has(.dropdown)>a::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
    margin-left: 2px;
}

.dropdown {
    display: none;
    position: absolute;
    top: calc(100% - 10px);
    left: -20px;
    background-color: #ffffff;
    min-width: 240px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    border-radius: 0px;
    padding: 16px 0;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.nav-links.right .dropdown {
    left: auto;
    right: -20px;
}

.dropdown::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
}

.nav-item:hover .dropdown {
    display: flex;
    flex-direction: column;
}

.dropdown a {
    padding: 10px 24px;
    font-size: 15px !important;
    text-align: left;
    white-space: normal;
    color: var(--text-color);
    transition: background-color 0.2s ease, opacity 0.2s ease;
    line-height: 1.4;
}

.dropdown a:hover {
    background-color: #f7f7f7;
    opacity: 1 !important;
}

.nav-logo {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    padding-top: 10px;
    padding-bottom: 10px;
}

.nav-logo img {
    height: 95px;
    width: auto;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Global Header */
.site-header {
    text-align: center;
    background: url('assets/images/smallerslice.webp') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    margin-bottom: 60px;
}

.site-header-content {
    background-color: var(--bg-color);
    padding: 40px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.site-header h1 {
    font-size: clamp(32px, 6vw, 52px);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    line-height: 1.1;
}

.site-header p {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.category-section {
    margin-bottom: 30px;
    width: 100%;
    max-width: 384px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 90px), 1fr));
    column-gap: clamp(5px, 1vw, 20px);
    row-gap: clamp(5px, 1vw, 20px);
    margin-top: 15px;
    width: 100%;
}



/* Pre-allocate container heights removed for compact packing */

.tile-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    break-inside: avoid;
    margin-bottom: 40px;
}

.instrument-tile {
    position: relative;
    width: 100%;
    border-radius: 0px;
    overflow: visible;
    /* Prevent glow clipping */
    cursor: pointer;
    background: transparent;
    border: none;
    backdrop-filter: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateZ(0);
    /* Hardware accel for smooth transition */
}

#grid-tonals-rods,
#grid-tonals-tops,
.layout-row {
    align-items: flex-end;
}

#grid-gongs,
#grid-singing-bars,
#grid-combinations {
    align-items: flex-start;
}

.tile-wrapper[data-category="tonals-rods"] .instrument-tile,
.tile-wrapper[data-category="tonals-tops"] .instrument-tile {
    align-items: flex-end;
    min-height: 200px;
}

.tile-wrapper[data-category="gongs"] .instrument-tile,
.tile-wrapper[data-category="singing-bars"] .instrument-tile,
.tile-wrapper[data-category="combinations"] .instrument-tile {
    align-items: flex-start;
}


.mini-progress {
    width: 100%;
    height: 4px;
    margin: 5px 0 10px 0;
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--placeholder-bg);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.mini-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0;
    height: 4px;
    box-shadow: -1000px 0 0 1000px #b87333;
}

.mini-progress::-moz-range-thumb {
    width: 0;
    height: 4px;
    border: none;
    box-shadow: -1000px 0 0 1000px #b87333;
}

.playing-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.3;
    transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.control-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.control-btn.loop-btn.active {
    opacity: 1;
    color: #b87333;
    filter: drop-shadow(0 0 5px rgba(184, 115, 51, 0.4));
}

.instrument-tile.placeholder {
    cursor: default;
    border: none;
    background: transparent !important;
}

.instrument-tile.placeholder:hover {
    transform: none;
    box-shadow: none;
    border: none;
}

.instrument-tile img {
    width: 100%;
    max-width: 90px;
    height: auto;
    max-height: 200px;
    display: block;
    opacity: 1;
    /* Fully colored by default */
    transition: transform 0.6s ease, opacity 0.4s ease, filter 0.4s ease;
}

.tile-wrapper[data-category="tonals-rods"] .instrument-tile img,
.tile-wrapper[data-category="tonals-tops"] .instrument-tile img {
    height: 170px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: bottom center;
}

.instrument-tile:not(.placeholder):hover {
    transform: translateY(-4px);
    /* Removed box-shadow and border to eliminate the "hover box" */
}

.instrument-tile:hover img {
    transform: scale(1.01);
    /* Reduced scaling on hover */
}

/* Universal Glowing outline for active instruments */
.instrument-tile.active img {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 15px rgba(184, 115, 51, 0.8)) drop-shadow(0 0 25px rgba(184, 115, 51, 0.5));
    transition: filter 0.3s ease, opacity 0.3s ease;
}



/* Removed lower-image styles */

@media (max-width: 1024px) {
    .site-nav {
        padding: 15px 30px;
    }

    .main-content-container {
        padding: 0 30px 40px 0;
    }

    .bottom-row {
        padding-left: 30px;
    }

    .top-row {
        height: 0;
    }

    .top-row.visible {
        height: 600px;
    }

    #grave-gong-section {
        width: calc(100% + 60px);
        margin-left: -30px;
    }
}

@media (max-width: 768px) {
    .site-nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: 75px;
        padding: 10px 20px;
        position: relative;
        z-index: 1000;
    }

    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .mobile-logo img {
        height: 52px;
        width: auto;
        display: block;
    }

    .hamburger-btn {
        display: flex;
    }

    .site-nav.nav-open .hamburger-btn span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .site-nav.nav-open .hamburger-btn span:nth-child(2) {
        opacity: 0;
    }

    .site-nav.nav-open .hamburger-btn span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .desktop-only-logo {
        display: none !important;
    }

    .nav-menu-wrapper {
        position: fixed;
        top: 75px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ffffff;
        display: none;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 24px 30px;
        gap: 20px;
        overflow-y: auto;
        z-index: 1001;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
        animation: navFadeIn 0.25s ease forwards;
    }

    .site-nav.nav-open .nav-menu-wrapper {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 15px;
        flex: none;
    }

    .nav-item {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .nav-item>a {
        font-size: 18px;
        font-weight: 700;
        padding: 10px 0;
        width: 100%;
        justify-content: space-between;
    }

    .dropdown {
        position: relative;
        top: 0;
        left: 0 !important;
        right: 0 !important;
        box-shadow: none;
        border: none;
        background-color: transparent;
        min-width: 100%;
        padding: 6px 0 6px 16px;
        margin-top: 0;
        display: none;
        flex-direction: column;
        border-left: 2px solid rgba(0, 0, 0, 0.1);
    }

    .nav-item.active .dropdown {
        display: flex;
    }

    .dropdown a {
        text-align: left;
        padding: 8px 0;
        font-size: 15px !important;
    }

    @keyframes navFadeIn {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }

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

    .splash-content {
        padding: 32px 20px;
        width: 88vw;
        max-width: 360px;
    }

    .splash-title {
        font-size: 28px;
        margin-bottom: 14px;
    }

    .splash-description {
        font-size: 13.5px;
        line-height: 1.5;
    }

    .splash-device-note {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .site-header {
        height: auto;
        padding: 24px 15px;
        margin-bottom: 0;
    }

    .site-header-content {
        padding: 24px 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .site-header h1 {
        font-size: clamp(20px, 6vw, 28px);
        white-space: nowrap;
        margin-bottom: 10px;
    }

    .site-header p {
        font-size: 15px;
        text-wrap: balance;
    }

    .main-content-container {
        padding: 0 0 40px 0;
    }

    .bottom-row {
        padding: 0 20px;
    }

    .top-row {
        flex-direction: column;
        height: 0;
        gap: 10px;
    }

    .top-row.visible {
        height: 560px;
        opacity: 1;
        margin-bottom: 25px;
    }

    .canvas-container {
        width: 100%;
        height: 220px;
        flex: none;
        overflow: hidden;
    }

    #spectrogram-canvas {
        height: 220px;
        width: 100%;
        display: block;
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
        mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
    }

    .currently-playing-container {
        padding: 10px 20px 0 20px;
        width: 100%;
        flex: none;
    }

    #currently-playing-info {
        max-height: 320px;
    }

    #grave-gong-section {
        width: 100%;
        margin-left: 0;
    }

    .control-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 6px;
    }
}

/* Text Page Styles (History, Sonambient Barn, etc) */
.text-page-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 20px;
}

.text-page-title {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    color: var(--text-color);
    margin-bottom: 60px;
}

.text-page-content p {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 24px;
}

/* Loading state for instrument tiles */
.instrument-tile.loading img {
    animation: tilePulse 1.2s infinite ease-in-out;
    opacity: 0.6;
}

@keyframes tilePulse {
    0% {
        opacity: 0.4;
        transform: scale(0.98);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }

    100% {
        opacity: 0.4;
        transform: scale(0.98);
    }
}

/* Grave Gong Footer Section */
#grave-gong-section {
    margin-top: 20px;
    padding-top: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(100% + 120px);
    margin-left: -60px;
    margin-bottom: -40px;
}

.grave-gong-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 24px;
    text-align: center;
}

#grave-gong-footer {
    width: 100%;
    display: flex;
    justify-content: center;
}

#grave-gong-footer .tile-wrapper {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
}

#grave-gong-footer .instrument-tile {
    max-height: none;
    height: auto;
    width: 100%;
    max-width: none;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

#grave-gong-footer .instrument-tile img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    display: block;
    object-fit: cover;
    padding: 0;
}

/* Grave Gong Text Hint Above Footer */
.grave-gong-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    color: #000000;
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
}

.grave-gong-hint .hint-arrow {
    display: inline-block;
}

@media (max-width: 768px) {
    .grave-gong-hint {
        font-size: 12px;
        margin-bottom: 8px;
    }
}

/* Layout Toggle */
.layout-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.layout-toggle-label {
    font-size: 16px;
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: #b87333;
}

input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Dynamic Row Layout */
.layout-row {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(5px, 1.5vw, 20px);
    width: 100%;
}

.layout-row .tile-wrapper {
    flex: 1 1 0;
    min-width: 0;
    max-width: 180px;
}

/* Mobile & Tablet Responsive Layout Rows */
@media (max-width: 900px) {
    .layout-row {
        flex-wrap: wrap;
        gap: 18px 12px;
    }

    .layout-row .tile-wrapper {
        flex: 0 1 calc(25% - 10px);
        min-width: 85px;
        max-width: 140px;
        margin-bottom: 24px;
    }
}

@media (max-width: 600px) {
    .layout-row {
        flex-wrap: wrap;
        gap: 15px 10px;
    }

    .layout-row .tile-wrapper {
        flex: 0 1 calc(33.333% - 8px);
        min-width: 80px;
        max-width: 120px;
        margin-bottom: 20px;
    }

    .tile-wrapper[data-category="tonals-rods"] .instrument-tile img,
    .tile-wrapper[data-category="tonals-tops"] .instrument-tile img {
        height: 125px;
    }

    .instrument-tile img {
        max-height: 130px;
    }
}

@media (max-width: 380px) {
    .layout-row .tile-wrapper {
        flex: 0 1 calc(50% - 8px);
        max-width: 140px;
    }

    .tile-wrapper[data-category="tonals-rods"] .instrument-tile img,
    .tile-wrapper[data-category="tonals-tops"] .instrument-tile img {
        height: 135px;
    }

    .instrument-tile img {
        max-height: 140px;
    }
}