/* Custom font from /fonts – Regular standard, Medium for bold */
@font-face {
    font-family: 'Modern Era';
    src: url('fonts/Modern Era Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Modern Era';
    src: url('fonts/Modern Era Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Hide scrollbar, keep scroll */
html {
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar {
    display: none;
}

body {
    display: flex;
    margin: 0;
    min-height: 100vh;
    font-family: 'Modern Era', sans-serif;
    position: relative;
    overflow-x: hidden;
    color: #2D1810;
}

/* index page styles*/

.index-text {
    position: fixed;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    background-color: transparent;
    pointer-events: none;
}

.index-text p,
.index-text a {
    pointer-events: auto;
}

.index-text p {
    text-align: center;
    font-size: 20px;
    line-height: 1.5;
    width: 60%;
    font-weight: 300;
}

.index-text .dim-text {
    transition: opacity 0.3s ease;
}

.index-text.text-dimmed .dim-text {
    opacity: 0.1;
}

/* Andrea Albiac + graphic designer: use Medium weight */
.index-text p .name-highlight,
.index-text p .name-highlight-static {
    font-weight: 500;
    display: inline-block;
    white-space: nowrap;
}

.index-text p .name-highlight span {
    display: inline-block;
    transition: transform 0.2s ease;
}

.index-text p:hover .name-highlight span {
    animation: letterJump 0.5s ease;
}

.index-text p a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    transition: color 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
    position: relative;
}

.index-text p a[target="_blank"] {
    border-bottom: none;
}

.index-text p a.category-link[data-category="branding"] {
    --category-color: #BD9EFF;
    white-space: nowrap;
}

.index-text p a.category-link[data-category="web"] {
    --category-color: #FF9D47;
}

.index-text p a.category-link[data-category="motion"] {
    --category-color: #FB7CA6;
}

.index-text p a.category-link[data-category="mixedmedia"] {
    --category-color: #7EB5E8;
}

.index-text p a.category-link[data-category="pottery"] {
    --category-color: #A4754C;
}

.index-text p a.category-link:hover {
    color: var(--category-color);
}

.index-text p a.category-link.highlighted {
    color: var(--category-color);
}

.bottom-bar {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    z-index: 2;
}

.portfolio-note {
    font-family: 'Modern Era', sans-serif;
    font-size: 16px;
    font-weight: 300;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.7s ease, max-width 0.7s ease, margin 0.7s ease;
    margin-right: 0;
}

@media (hover: hover) {
    .bottom-bar:hover .portfolio-note {
        opacity: 1;
        max-width: 300px;
        margin-right: 1.25rem;
    }
}

/* Mobile: portfolio note expands via JS (tap Contact first, then Email opens mail) */
@media screen and (max-width: 768px) {
    .bottom-bar.mobile-expanded .portfolio-note {
        opacity: 1;
        max-width: 300px;
        margin-right: 1rem;
    }
}

.get-in-touch-btn {
    padding: 8px 20px;
    font-family: 'Modern Era', sans-serif;
    font-size: 15px;
    font-weight: 300;
    color: #2D1810;
    white-space: nowrap;
    touch-action: manipulation;
    background-color: transparent;
    border: 1px solid #2D1810;
    border-radius: 999px;
    text-decoration: none;
    z-index: 2;
    cursor: pointer;
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}

.get-in-touch-btn:hover {
    color: #F9F2E4;
    background-color: #2D1810;
    transform: scale(1.05);
}

/* Name hover image */
.name-hover-image {
    position: fixed;
    width: 80px;
    height: auto;
    pointer-events: none;
    opacity: 0;
    z-index: 100;
    transition: opacity 0.15s ease;
}

.name-hover-image.visible {
    opacity: 1;
}

/* Gallery Modal */
.gallery-close-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1011;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: #2D1810;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.gallery-close-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.25s ease;
}

@media (hover: hover) {
    .gallery-close-btn:hover svg {
        transform: rotate(90deg);
    }
}

.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    flex-direction: column;
    opacity: 0;
    pointer-events: auto;
    background: transparent;
}

.gallery-header {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1010;
    max-width: 40%;
}

.gallery-title {
    margin: 0;
    font-family: 'Modern Era', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: #2D1810;
}

.gallery-description {
    margin: 8px 0 0;
    font-family: 'Modern Era', sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: #2D1810;
    line-height: 1.4;
}

.gallery-body {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 80px 24px 24px;
    min-height: 0;
}

.gallery-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.gallery-center-image {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 70vh;
}

.gallery-center-image img,
.gallery-thumb img {
    -webkit-user-drag: none;
    user-drag: none;
}

.gallery-center-image img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    align-items: flex-end;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.gallery-thumb {
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.35s ease, transform 0.25s ease;
    max-width: 100px;
}

.gallery-thumb img {
    width: auto;
    height: auto;
    max-width: 100px;
    max-height: 80px;
    object-fit: contain;
    display: block;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    .gallery-thumb:hover {
        transform: translateX(-4px);
    }
}

.gallery-modal.motion .gallery-center-image img,
.gallery-modal.motion .gallery-thumb img {
    max-height: 50vh;
}

.visit-site-btn {
    position: relative;
    display: inline-flex;
    margin-top: 12px;
    z-index: 1010;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: auto;
    height: auto;
    padding: 8px 20px;
    border-radius: 999px;
    font-family: 'Modern Era', sans-serif;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.2;
    color: #2D1810;
    background: transparent;
    border: 1px solid #2D1810;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.visit-site-btn:hover {
    color: #F9F2E4;
    background-color: #2D1810;
    transform: scale(1.05);
}


#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    background-color: #F9F2E4;
}

/* Particle hover overlays container */
#particle-overlays-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* Particle hover overlay for animated GIFs */
.particle-hover-overlay {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: center center;
}

.particle-hover-image {
    -webkit-user-drag: none;
    user-drag: none;
    max-width: 225px;
    max-height: 225px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
}

.particle-hover-image[src*="brand-15"] {
    max-width: 163px;
    max-height: 163px;
}

.particle-hover-label {
    margin-top: 8px;
    font-family: 'Modern Era', sans-serif;
    font-size: 10px;
    font-weight: 400;
    color: #2D1810;
    text-align: center;
    min-height: 14px;
}

.background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
}

#scrollable-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
}

.auto-scroll-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1000;
    padding: 10px;
    pointer-events: auto;
}

.sun-icon {
    width: 52px;
    height: 52px;
    transform-origin: center;
    will-change: transform;
}

@keyframes letterJump {
    0%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
    50% {
        transform: translateY(0);
    }
    70% {
        transform: translateY(-4px);
    }
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .index-text {
        padding: 0 28px;
        box-sizing: border-box;
    }

    .index-text p {
        width: 85%;
        font-size: 19px;
        line-height: 1.6;
        padding: 0 56px;
    }

    .bottom-bar {
        bottom: 30px;
        gap: 1rem;
    }

    .get-in-touch-btn {
        font-size: 14px;
    }

    .portfolio-note {
        font-size: 15px;
    }

    .auto-scroll-btn {
        top: 15px;
        right: 15px;
        padding: 8px;
    }

    .sun-icon {
        width: 44px;
        height: 44px;
    }

    .gallery-body {
        flex-direction: column;
        padding: calc(70px + 10vh) 16px 16px;
        justify-content: flex-start;
    }

    .gallery-center-image,
    .gallery-center-image img {
        max-height: 56vh;
    }

    .gallery-modal.motion .gallery-center-image img,
    .gallery-modal.motion .gallery-thumb img {
        max-height: 40vh;
    }

    .gallery-thumbs {
        flex-direction: row;
        flex-wrap: nowrap;
        max-height: 120px;
        overflow-x: auto;
        overflow-y: hidden;
        width: 100%;
        justify-content: center;
        align-self: center;
        align-items: flex-end;
        align-content: flex-end;
        margin-top: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .gallery-thumb {
        max-width: 70px;
    }

    .gallery-thumb img {
        max-width: 70px;
        max-height: 60px;
    }

    .particle-hover-image {
        max-width: 180px;
        max-height: 180px;
    }

    .particle-hover-image[src*="brand-15"] {
        max-width: 130px;
        max-height: 130px;
    }

    .gallery-header {
        max-width: 70%;
    }

    .gallery-title {
        font-size: 24px;
    }

    .gallery-description {
        font-size: 18px;
        margin-top: 8px;
    }
}

/* When gallery is open: hide text, block scroll/click on content below */
body.gallery-open #background-container,
body.gallery-open #particle-overlays-container {
    pointer-events: none;
}

body.gallery-open .index-text,
body.gallery-open .bottom-bar,
body.gallery-open .auto-scroll-btn {
    opacity: 0.1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@media screen and (max-width: 480px) {
    .index-text {
        padding: 0 24px;
        box-sizing: border-box;
    }

    .index-text p {
        width: 90%;
        font-size: 18px;
        padding: 0 48px;
    }

    .bottom-bar {
        bottom: 25px;
        gap: 0.75rem;
    }

    .get-in-touch-btn {
        font-size: 13px;
    }

    .portfolio-note {
        font-size: 14px;
    }

    .auto-scroll-btn {
        top: 12px;
        right: 12px;
        padding: 6px;
    }

    .sun-icon {
        width: 36px;
        height: 36px;
    }

    .gallery-thumb img {
        max-width: 60px;
        max-height: 50px;
    }

    .particle-hover-image {
        max-width: 158px;
        max-height: 158px;
    }

    .particle-hover-image[src*="brand-15"] {
        max-width: 114px;
        max-height: 114px;
    }

    .gallery-header {
        max-width: 85%;
    }

    .gallery-title {
        font-size: 22px;
    }

    .gallery-description {
        font-size: 17px;
    }
}
