/* browser compatibility and reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

/* ------------------------- Scaling System by Osmo [https://osmo.supply/] -------------------------  */

/* Desktop */
:root {
    --size-unit: 16;
    /* body font-size in design - no px */
    --size-container-ideal: 1440;
    /* screen-size in design - no px */
    --size-container-min: 992px;
    --size-container-max: 1920px;
    --size-container: clamp(var(--size-container-min), 100vw, var(--size-container-max));
    --size-font: calc(var(--size-container) / (var(--size-container-ideal) / var(--size-unit)));
}

/* Tablet */
@media screen and (max-width: 991px) {
    :root {
        --size-container-ideal: 834;
        /* screen-size in design - no px */
        --size-container-min: 768px;
        --size-container-max: 991px;
    }
}

/* Mobile Landscape */
@media screen and (max-width: 767px) {
    :root {
        --size-container-ideal: 550;
        /* screen-size in design - no px */
        --size-container-min: 480px;
        --size-container-max: 767px;
    }
}

/* Mobile Portrait */
@media screen and (max-width: 479px) {
    :root {
        --size-container-ideal: 390;
        /* screen-size in design - no px */
        --size-container-min: 320px;
        --size-container-max: 479px;
    }
}

/* normalize cross-browser defaults */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ensure consistent baseline across browsers */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-font-feature-settings: "kern";
    -moz-font-feature-settings: "kern";
    font-feature-settings: "kern";
}

/* cross-browser flex support */
.container {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
}

/* ensure consistent rendering */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
    display: block;
}

/* custom font faces */
@font-face {
    font-family: 'Nexa Light';
    src: url('Nexa/Nexa_V1_2012/Nexa Light.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0020-007F;
}

@font-face {
    font-family: 'Asobi Memogaki';
    src: url('asobi2/AsobiMemogaki-Regular-1-01.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    unicode-range: U+3040-309F, U+30A0-30FF, U+4E00-9FAF;
}

/* body and html setup */
html,
body {
    font-family: 'Nexa Light', monospace, courier;
    font-size: calc(var(--size-font) * 1px);
    line-height: 1.1;
    background-color: #ffffff;
    color: #333;
    height: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    zoom: 1;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* prevent text selection for all elements */
* {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* main container - consistent layout */
.container {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -moz-box-orient: horizontal;
    -moz-box-direction: normal;
    -ms-flex-direction: row;
    -webkit-flex-direction: row;
    flex-direction: row;
    gap: 0px;
    -webkit-gap: 0px;
    -moz-gap: 0px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 0px 20px 20px;
    min-height: 100vh;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

/* left side - all text content */
.content {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 400px;
    max-width: 800px;
    position: relative;
}

/* fixed manga panel on the right - fixed width */
.sticky-image {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    background: #ffffff;
    z-index: 10;
    width: 625px;
    overflow: hidden;
}

.sticky-image img {
    height: 100vh;
    width: 100%;
    max-width: 625px;
    object-fit: cover;
    object-position: center;
    border: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    display: block;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.sticky-image img.loaded {
    opacity: 1 !important;
}

/* header styling */
header {
    margin-bottom: 20px;
    margin-left: -40px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-right: 5px;
}

header h1 {
    font-size: 3.22265625rem;
    font-weight: normal;
    margin: 10px 0 0 0;
    color: #000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

header h1.fade-in {
    opacity: 1;
}

/* keep header name always in english font */
.static-english {
    font-family: 'Nexa Light', monospace, courier !important;
}

/* button font styles */
.btn-hiragana {
    font-family: 'Asobi Memogaki', 'Noto Sans CJK JP', sans-serif;
}

.btn-english {
    font-family: 'Nexa Light', monospace, courier;
}

.language-toggle {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 4px 18px;
    font-size: 1.71875rem;
    color: #333;
    transition: opacity 0.3s ease;
    font-family: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    margin-left: 0px;
    position: relative;
}

.btn-hiragana,
.btn-english {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.language-toggle.fade-in {
    opacity: 1;
}

.language-toggle:hover {
    opacity: 0.7;
}

/* language-specific font styles */
body.lang-en {
    font-family: 'Nexa Light', monospace, courier;
}

body.lang-ja {
    font-family: 'Asobi Memogaki', 'Noto Sans CJK JP', sans-serif;
}

/* ensure connect buttons use language-appropriate fonts */
body.lang-ja .connect-button {
    font-family: 'Asobi Memogaki', 'Noto Sans CJK JP', sans-serif;
}

body.lang-en .connect-button {
    font-family: 'Nexa Light', monospace, courier;
}

/* section visibility */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* table of contents styling */
.toc-container {
    margin-top: 25px;
}

.toc-entry {
    display: block;
    margin-bottom: 30px;
    font-family: monospace, courier;
    font-size: 1.25rem;
}

.chapter-number {
    display: none;
    /* hide numbers for this style */
}

.chapter-title {
    color: #333;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
}

.toc-entry::before {
    content: "[>] ";
    color: #333;
    font-weight: normal;
}

/* fixed navigation */
.fixed-nav {
    position: fixed;
    bottom: 39px;
    left: 15px;
    display: flex;
    gap: -20px;
    z-index: 1000;

}

.fixed-nav-item {
    font-family: monospace, courier;
    font-size: 1.71875rem;
    color: #333;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.fixed-nav-item.fade-in {
    opacity: 1;
}

.fixed-nav-item:hover {
    opacity: 0.7;
}


/* table of contents shortcut button */
.toc-shortcut {
    position: absolute;
    bottom: 20px;
    right: 5px;
    font-family: monospace, courier;
    font-size: 1.71875rem;
    color: #333;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 6px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border: none;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    line-height: 1;
    opacity: 0;
}

.toc-shortcut.fade-in {
    opacity: 1;
}

.toc-shortcut:hover {
    opacity: 0.7;
}

/* connection links styling */
.connect-links {
    margin-top: 15px;
    margin-left: -40px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.connect-links.fade-in {
    opacity: 1;
}

/* connect links fade-in when navigating to section0 */
#section0.loaded .connect-links,
#section0 .connect-links.fade-in {
    opacity: 1;
}

.connect-button {
    font-family: monospace, courier;
    font-size: 1.71875rem;
    color: #333;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border: none;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connect-button:hover {
    opacity: 0.7;
}


/* simple fade-in for first page (section0) initial load only */
#section0.initial-load h2,
#section0.initial-load p {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#section0.initial-load.fade-in h2,
#section0.initial-load.fade-in p {
    opacity: 1;
}

/* language transition effects with fly-up animation for all sections including section0 navigation */
.content-section h2,
.content-section p,
.toc-container,
.content-section .image-grid {
    transition: opacity 0.6s cubic-bezier(.298, .007, .099, 1.001), transform 0.6s cubic-bezier(.298, .007, .099, 1.001);
    transform: translateY(10px);
    /* start 10px down */
    opacity: 0;
    /* start invisible */
}

/* music grid - no bounce up transition, only fade */
.content-section .music-grid {
    transition: opacity 0.6s cubic-bezier(.298, .007, .099, 1.001);
    opacity: 0;
}

/* override for initial load section0 */
#section0.initial-load h2,
#section0.initial-load p {
    transition: opacity 0.3s ease;
    transform: none;
}

.content-section.loaded h2,
.content-section.loaded p,
.content-section.loaded .toc-container,
.content-section.loaded .image-grid {
    transform: translateY(0px);
    /* fly up to original position */
    opacity: 1;
    /* fade in */
}

/* music grid loaded - only fade in, no transform */
.content-section.loaded .music-grid {
    opacity: 1;
}

.content-section.fade-out h2,
.content-section.fade-out p,
.content-section.fade-out .toc-container,
.content-section.fade-out .image-grid {
    opacity: 0;
    transform: translateY(10px);
    /* move down while fading out */
}

/* music grid fade out - only fade, no transform */
.content-section.fade-out .music-grid {
    opacity: 0;
}

/* connect links fade out during language switch */
.content-section.fade-out .connect-links {
    opacity: 0;
    transition: opacity 0.6s ease;
}


/* image grid styling */
.image-grid {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 15px 1fr 15px 1fr 15px 1fr;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    -webkit-gap: 15px;
    -moz-gap: 15px;
    margin-top: 60px;
    margin-left: 65px;
    max-width: 600px;
}

/* photos grid styling - 4x4 smaller squares */
.photos-grid {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 10px 1fr 10px 1fr 10px 1fr;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    -webkit-gap: 10px;
    -moz-gap: 10px;
    margin-top: 60px;
    margin-left: 65px;
    max-width: 480px;
    overflow: visible;
}

/* music grid styling - same as photos but for music covers */
.music-grid {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 10px 1fr 10px 1fr 10px 1fr;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    -webkit-gap: 10px;
    -moz-gap: 10px;
    margin-top: 60px;
    margin-left: 65px;
    max-width: 480px;
    overflow: visible;
}

.image-item {
    width: 100%;
    height: 220px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.image-item:hover {
    opacity: 0.8;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder {
    color: #999;
    font-size: 0.8rem;
    text-align: center;
}

/* photo item styling - smaller squares */
.photo-item {
    width: 100%;
    height: 110px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    overflow: visible;
}

.photo-item img {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.photo-item.photo-loaded img {
    opacity: 1;
}

.photo-item:hover {
    opacity: 0.8;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item .placeholder {
    font-size: 0.6rem;
}

/* music item styling - same size as photo items */
.music-item {
    width: 100%;
    height: 110px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    overflow: hidden;
    position: relative;
}

.music-item:hover {
    opacity: 0.8;
}

.music-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.music-item .placeholder {
    font-size: 0.6rem;
    color: #999;
    text-align: center;
}

.music-item img {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.music-item.music-loaded img {
    opacity: 1;
}

/* photo enlargement on hover */
.photo-item {
    position: relative;
}

/* Global enlarged photo - completely independent */
.enlarged-photo-global {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%) scale(0);
    z-index: 9999;
    border: 3px solid #333;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
    background: white;
}

.enlarged-photo-global img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1px;
}

/* ensure photos section can contain absolutely positioned button */
#section7 {
    position: relative;
}

/* refresh button styling for photos */
.refresh-button-photos {
    position: absolute;
    top: 325px;
    right: 200px;
    font-family: monospace, courier;
    font-size: 1.203125rem;
    /* 30% smaller: 1.71875 * 0.7 = 1.203125 */
    color: #333;
    background: transparent;
    border: none;
    transition: opacity 0.2s ease;
    padding: 0;
    margin: 0;
}

.refresh-button-photos:hover {
    opacity: 0.7;
}

/* navigation menu - horizontal */
nav ul {
    list-style: none;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    gap: 20px;
    -webkit-gap: 20px;
    -moz-gap: 20px;
}

nav a {
    text-decoration: none;
    color: #555;
    padding: 5px 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

nav a:hover {
    color: #000;
    border: 1px solid #ddd;
}

/* main sections */
section {
    margin-bottom: 60px;
}

section h2 {
    font-size: 2.3203125rem;
    font-weight: normal;
    margin-bottom: 10px;
    margin-left: -40px;
    color: #000;
}

section h3 {
    font-size: 2.234375rem;
    font-weight: normal;
    margin-bottom: 15px;
    color: #333;
}

/* paragraph styling */
p {
    margin-bottom: 5px;
    margin-left: -40px;
    max-width: 70ch;
    /* limit line length for readability */
}

/* date styling */
.date {
    font-size: 1.375rem;
    color: #777;
    margin-top: 20px;
    font-style: normal;
}

/* project styling */
.project {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border: 1px solid #eee;
    border-radius: 4px;
}

.project-link {
    display: inline-block;
    color: #0066cc;
    text-decoration: none;
    margin-top: 10px;
    padding: 5px 10px;
    border: 1px solid #0066cc;
    transition: all 0.2s ease;
}

.project-link:hover {
    background: #0066cc;
    color: white;
}

/* contact list */
.contact-list {
    list-style: none;
}

.contact-list li {
    margin-bottom: 10px;
}

.contact-list a {
    color: #0066cc;
    text-decoration: none;
}

.contact-list a:hover {
    text-decoration: underline;
}

/* footer */
footer {
    margin-top: 100px;
    padding-top: 40px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 1.71875rem;
}

/* mobile responsive design - enhanced for better user experience */
@media screen and (max-width: 768px) {

    html,
    body {
        /* Font size handled by Osmo scaling system */
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        text-size-adjust: 100%;
        /* Enable momentum scrolling on iOS */
        -webkit-overflow-scrolling: touch;
    }

    .container {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -moz-box-orient: vertical;
        -moz-box-direction: normal;
        -ms-flex-direction: column;
        -webkit-flex-direction: column;
        flex-direction: column;
        padding: 15px;
        /* Reduced padding for more content space */
        max-width: 100%;
        min-height: 100vh;
        /* Better mobile viewport handling */
        min-height: -webkit-fill-available;
    }

    .sticky-image {
        display: none !important;
    }

    .content {
        max-width: 100%;
        min-width: auto;
        padding: 0;
    }

    /* Larger, more readable header on mobile */
    header {
        margin-bottom: 25px;
        margin-left: 0;
        /* Remove negative margin on mobile */
    }

    header h1 {
        font-size: 2.8rem;
        /* Increased from 2.5rem */
        line-height: 1.1;
        margin: 0;
    }

    .header-top {
        padding-right: 0;
        margin-bottom: 15px;
    }

    /* Larger touch targets for mobile */
    .language-toggle {
        padding: 12px 20px;
        /* Increased from 8px 18px */
        font-size: 1.5rem;
        min-width: 60px;
        min-height: 48px;
        /* Minimum touch target size */
    }

    /* Better mobile navigation */
    .fixed-nav {
        bottom: 20px;
        left: 15px;
        right: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: rgba(255, 255, 255, 0.95);
        padding: 15px 20px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        max-width: none;
        width: auto;
    }

    .fixed-nav-item {
        font-size: 1.4rem;
        padding: 12px 16px;
        /* Larger touch targets */
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: rgba(51, 51, 51, 0.1);
        text-decoration: none;
        text-underline-offset: 0;
    }

    .fixed-nav-item:hover {
        background: rgba(51, 51, 51, 0.2);
        opacity: 1;
    }

    /* Table of contents shortcut - mobile optimized */
    .toc-shortcut {
        position: fixed;
        bottom: 100px;
        right: 20px;
        padding: 12px 16px;
        min-width: 48px;
        min-height: 48px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        font-size: 1.3rem;
    }

    /* Mobile-optimized image grids */
    .image-grid {
        -ms-grid-columns: 1fr;
        grid-template-columns: 1fr;
        /* Single column on mobile */
        gap: 20px;
        margin-top: 30px;
        margin-left: 0;
        /* Remove left margin on mobile */
        max-width: 100%;
    }

    .image-item {
        height: 200px;
        /* Increased from 160px */
        border-radius: 8px;
        overflow: hidden;
    }

    /* Mobile photos grid - 2x2 instead of 4x4 */
    .photos-grid {
        -ms-grid-columns: 1fr 15px 1fr;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-top: 30px;
        margin-left: 0;
        max-width: 100%;
    }

    /* Mobile music grid - 2x2 instead of 4x4 */
    .music-grid {
        -ms-grid-columns: 1fr 15px 1fr;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-top: 30px;
        margin-left: 0;
        max-width: 100%;
    }

    .photo-item {
        height: 150px;
        /* Larger photo items on mobile */
        border-radius: 8px;
        overflow: hidden;
    }

    .music-item {
        height: 150px;
        /* Larger music items on mobile */
        border-radius: 8px;
        overflow: hidden;
    }

    /* Adjust enlarged photo size for mobile */
    .enlarged-photo-global {
        width: 250px;
        height: 250px;
        border-radius: 12px;
    }

    /* Mobile-optimized refresh button */
    .refresh-button-photos {
        position: absolute;
        top: -40px;
        right: 0;
        font-size: 1.5rem;
        padding: 8px;
        min-width: 40px;
        min-height: 40px;
    }

    /* Better mobile typography */
    section h2 {
        font-size: 2rem;
        /* Reduced from 2.3203125rem */
        margin-left: 0;
        /* Remove negative margin */
        margin-bottom: 15px;
        line-height: 1.2;
    }

    p {
        margin-left: 0;
        /* Remove negative margin */
        margin-bottom: 8px;
        line-height: 1.4;
        /* Better mobile line spacing */
        max-width: 100%;
    }

    /* Mobile-friendly connect links */
    .connect-links {
        margin-left: 0;
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
    }

    .connect-button {
        padding: 12px 16px;
        min-width: 48px;
        min-height: 48px;
        font-size: 1.3rem;
        border-radius: 8px;
        width: 100%;
        max-width: 200px;
    }


    /* Disable hover effects on mobile */
    .image-item:hover,
    .photo-item:hover,
    .connect-button:hover,
    .language-toggle:hover,
    .toc-shortcut:hover {
        opacity: 1;
    }

    /* Better mobile table of contents */
    .toc-entry {
        font-size: 1.4rem;
        margin-bottom: 20px;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }

    .chapter-title {
        text-underline-offset: 6px;
    }
}

/* small mobile devices - phones in portrait */
@media screen and (max-width: 480px) {

    html,
    body {
        /* Font size handled by Osmo scaling system */
    }

    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2.4rem;
    }

    .photos-grid {
        grid-template-columns: 1fr;
        /* Single column on very small screens */
        gap: 10px;
    }

    .music-grid {
        grid-template-columns: 1fr;
        /* Single column on very small screens */
        gap: 10px;
    }

    .photo-item {
        height: 180px;
    }

    .music-item {
        height: 180px;
    }

    .fixed-nav {
        padding: 12px 15px;
        left: 10px;
        right: 10px;
    }

    .fixed-nav-item {
        font-size: 1.2rem;
        padding: 10px 12px;
        min-width: 44px;
        min-height: 44px;
    }
}

/* tablet responsive design */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 20px;
    }

    .sticky-image {
        width: 400px;
    }

    .sticky-image img {
        width: 400px;
    }

    /* Better tablet photo grid - 3 columns */
    .photos-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin-left: 20px;
    }

    .photo-item {
        height: 130px;
    }

    /* Better tablet music grid - 3 columns */
    .music-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin-left: 20px;
    }

    .music-item {
        height: 130px;
    }

    /* Tablet navigation improvements */
    .fixed-nav {
        bottom: 25px;
        left: 20px;
    }

    .toc-shortcut {
        bottom: 80px;
        right: 25px;
    }
}

/* desktop consistent sizing */
@media screen and (min-width: 1025px) {
    .container {
        max-width: 1400px;
    }
}

/* Brave browser specific fixes */
@supports (-webkit-appearance: none) {
    .sticky-image {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .content {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .container {
        min-height: 100vh;
        min-height: -moz-available;
    }
}

/* Safari specific fixes */
@supports (-webkit-appearance: -apple-pay-button) {
    .container {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}

/* IE/Edge specific fixes */
@supports (-ms-ime-align: auto) {

    .image-grid,
    .photos-grid {
        display: -ms-grid;
    }

    .content {
        -ms-flex: 1 1 auto;
    }
}

/* Velocity-based custom cursor */
.cursor {
    z-index: 99999;
    pointer-events: none;
    position: fixed;
    inset: 0% auto auto 0%;
    transform: translate(-50%, -50%);
}

.cursor-inner {
    width: 1.6em;
}

/* Hide browser default cursor */
html {
    cursor: none !important;
}

/* Ensure no browser cursor appears on any interactive elements */
*,
*:hover,
*:focus,
*:active,
a,
a:hover,
a:focus,
a:active,
button,
button:hover,
button:focus,
button:active,
[data-cursor],
[data-cursor]:hover,
[data-cursor]:focus,
[data-cursor]:active,
.connect-button,
.connect-button:hover,
.connect-button:focus,
.connect-button:active,
.language-toggle,
.language-toggle:hover,
.language-toggle:focus,
.language-toggle:active,
.toc-entry,
.toc-entry:hover,
.toc-entry:focus,
.toc-entry:active,
.fixed-nav-item,
.fixed-nav-item:hover,
.fixed-nav-item:focus,
.fixed-nav-item:active,
.toc-shortcut,
.toc-shortcut:hover,
.toc-shortcut:focus,
.toc-shortcut:active,
.refresh-button-photos,
.refresh-button-photos:hover,
.refresh-button-photos:focus,
.refresh-button-photos:active,
svg,
svg:hover,
svg:focus,
svg:active,
path,
path:hover,
path:focus,
path:active,
#site-title-clickable,
#site-title-clickable:hover,
#site-title-clickable:focus,
#site-title-clickable:active,
h1,
h1:hover,
h1:focus,
h1:active {
    cursor: none !important;
}

/* Hide custom cursor initially */
.cursor {
    display: none;
}

/* Show custom cursor only when user is on the site */
html:hover .cursor {
    display: block;
}

/* Hide custom cursor on touch screens */
@media (hover: none) and (pointer: coarse) {
    .cursor {
        display: none !important;
    }
}

/* Media tooltip for hover effects */
.media-tooltip {
    position: fixed;
    min-width: 24px;
    padding: 6px 8px;
    background: black;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    white-space: nowrap;
    pointer-events: none;
    z-index: 9999;
    display: none;
    border-radius: 2px;
    transform: translate(10px, 10px);
}

/* Hide media tooltip on touch screens */
@media (hover: none) and (pointer: coarse) {
    .media-tooltip {
        display: none !important;
    }
}