/* Centered video showcase */
html {
    scroll-behavior: smooth;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    --frame-bg: #f17148;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--frame-bg);
    transition: background-color 600ms ease;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: "new-atten", sans-serif;
    font-weight: 500;
    font-style: normal;
    margin: 0;
}

body.theme-afternoon {
    --frame-bg: #e68e82;
}

body.theme-midnight {
    --frame-bg: #6c5d8a;
}

.page {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.experience-frame {
    padding: clamp(15px, 3vw, 30px);
    box-sizing: border-box;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(12px, 2vw, 24px);
    background-color: var(--frame-bg);
    transition: background-color 600ms ease;
    -webkit-text-stroke: 0.2px rgba(0, 0, 0, 0.05);
}

.frame-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.frame-footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    font-size: 16px;
    font-weight: 500;
    color: #000;
    text-transform: lowercase;
}

.frame-footer span {
    letter-spacing: 0.01em;
}

body.theme-midnight .frame-footer {
    color: #f6f0e8;
}

.frame-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

body.theme-midnight .frame-nav {
    color: #f6f0e8;
}

.frame-nav .separator {
    margin: 0;
}

.frame-nav .nav-item {
    text-transform: lowercase;
    position: relative;
    padding-bottom: 4px;
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.frame-nav .nav-line {
    display: inline;
}

.frame-nav .nav-line--mobile {
    display: inline;
}
.frame-footer .nav-item {
    position: relative;
    padding-bottom: 0;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
}

.frame-footer .nav-item::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    opacity: 1;
}

.frame-nav .nav-item.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
}

.frame-nav .nav-item.disabled {
    opacity: 0.4;
    cursor: default;
}

.frame-content {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.logo-stack {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(18px, 2.5vw, 32px);
    text-align: center;
    color: #f17148;
    z-index: 10;
}

.logo-stack .logo {
    width: clamp(200px, 20vw, 340px);
    aspect-ratio: 2000 / 696;
    background-color: var(--frame-bg);
    transition: background-color 600ms ease;
    -webkit-mask-image: url("images/logo.png");
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    mask-image: url("images/logo.png");
    mask-repeat: no-repeat;
    mask-size: contain;
    mask-position: center;
    pointer-events: none;
}

.logo-date {
    margin: 0;
    font-size: 28px;
    font-style: italic;
    letter-spacing: 0;
    font-weight: 800;
    text-transform: lowercase;
    -webkit-text-stroke: 0.3px rgba(0, 0, 0, 0.1);
}

.panel-copy-layer {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
    z-index: 9;
}

.panel-copy {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(100%, 720px);
    max-width: 720px;
    padding: clamp(20px, 4vw, 40px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    color: #faf7f2;
    font-size: clamp(16px, 1.6vw, 18px);
    line-height: 1.3;
    -webkit-text-stroke: 0.2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transition: opacity 300ms ease;
}

.panel-copy h2 {
    margin: 0;
    font-size: clamp(20px, 3vw, 32px);
    text-transform: lowercase;
    letter-spacing: 0;
    font-family: "new-atten", sans-serif;
    font-weight: 700;
    font-style: italic;
}

.panel-copy p {
    margin: 0;
}

.panel-copy--night {
    gap: 1rem;
}

.panel-copy--visible {
    opacity: 1;
}

.experience-frame.has-copy-overlay .intro-text,
.experience-frame.has-copy-overlay .story-content {
    opacity: 0;
    pointer-events: none;
}

.frame-track {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 600ms ease;
}

.frame-panel {
    position: relative;
    flex: 0 0 100%;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.frame-panel.is-active {
    pointer-events: auto;
}

.intro-wrapper,
.afternoon-wrapper,
.night-wrapper {
    position: relative;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    flex: 1 1 auto;
}

.intro-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0.25);
}

.intro-wrapper::before,
.afternoon-wrapper::before,
.night-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
    will-change: transform, filter;
    transform: translateZ(0);
    transform-origin: center center;
}

.intro-wrapper::before {
    background-image: url("images/chairs-responsive.jpg");
    -webkit-filter: url("#ripple-intro");
    filter: url("#ripple-intro");
    animation: bgDriftIntro 34s ease-in-out infinite alternate;
}

@media (min-width: 769px) {
    .intro-wrapper::before {
        background-image: url("images/chairs-desktop.jpg");
    }
}

.afternoon-wrapper::before {
    background-image: url("images/afternoon-responsive.jpg");
    -webkit-filter: url("#ripple-intro");
    filter: url("#ripple-intro");
    animation: bgDriftIntro 34s ease-in-out infinite alternate;
}

.night-wrapper::before {
    background-image: url("images/midnight-responsive.jpg");
    -webkit-filter: url("#ripple-intro");
    filter: url("#ripple-intro");
    animation: bgDriftIntro 34s ease-in-out infinite alternate;
}

@media (min-width: 769px) {
    .afternoon-wrapper::before {
        background-image: url("images/afternoon.jpg");
    }
    .night-wrapper::before {
        background-image: url("images/midnight.jpg");
    }
}

/* When WebGL is active, hide CSS pseudo background to avoid double layers */
.intro-wrapper.has-webgl::before,
.afternoon-wrapper.has-webgl::before,
.night-wrapper.has-webgl::before {
    display: none;
}

/* Pause animations on inactive panels to save resources */
.frame-panel:not(.is-active) .intro-wrapper::before,
.frame-panel:not(.is-active) .afternoon-wrapper::before,
.frame-panel:not(.is-active) .night-wrapper::before {
    animation-play-state: paused;
}

@keyframes bgDriftIntro {
    0% {
        transform: translate3d(-3%, -2.5%, 0) rotate(-0.45deg) scale(1.06);
    }
    100% {
        transform: translate3d(3%, 2.5%, 0) rotate(0.45deg) scale(1.1);
    }
}

/* Subtle drift (transform-only) to avoid jitter from background-position */
@keyframes bgDriftAfternoon {
    0% {
        transform: translate3d(-3%, -2%, 0) rotate(-0.35deg) scale(1.06);
    }
    100% {
        transform: translate3d(3%, 2%, 0) rotate(0.35deg) scale(1.1);
    }
}

@keyframes bgDriftNight {
    0% {
        transform: translate3d(3%, -2%, 0) rotate(0.4deg) scale(1.08);
    }
    100% {
        transform: translate3d(-3%, 2%, 0) rotate(-0.4deg) scale(1.12);
    }
}

@media (prefers-reduced-motion: reduce) {
    .intro-wrapper::before,
    .afternoon-wrapper::before,
    .night-wrapper::before {
        filter: none;
        -webkit-filter: none;
        animation: none !important;
    }
}

.intro-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vw, 40px);
    width: min(100%, 720px);
    z-index: 2;
    color: #faf7f2;
    font-size: clamp(16px, 1.6vw, 18px);
    line-height: 1.3;
    text-align: center;
    gap: 0.75rem;
    box-sizing: border-box;
    -webkit-text-stroke: 0.3px rgba(0, 0, 0, 0.1);
}

.bella-accent {
    font-family: "new-atten", sans-serif;
    font-weight: 700;
    font-style: italic;
}

.intro-text h2 {
    margin: 0;
    font-size: clamp(20px, 3vw, 32px);
    text-transform: lowercase;
    letter-spacing: 0;
    font-family: "new-atten", sans-serif;
    font-weight: 700;
    font-style: italic;
}

.intro-text p {
    margin: 0;
}

.story-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: #faf7f2;
    text-align: center;
    max-width: 720px;
    width: min(100%, 720px);
    padding: clamp(20px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-sizing: border-box;
}

.night-content {
    gap: 1rem;
}

.story-content h2 {
    margin: 0;
    font-size: clamp(20px, 3vw, 32px);
    text-transform: lowercase;
    letter-spacing: 0;
    font-family: "new-atten", sans-serif;
    font-weight: 700;
    font-style: italic;
}

.story-content p {
    margin: 0;
    font-size: clamp(16px, 1.6vw, 18px);
    line-height: 1.3;
    -webkit-text-stroke: 0.2px rgba(0, 0, 0, 0.05);
}

@media (max-width: 600px) {
    .experience-frame {
        padding-bottom: clamp(15px, 3vw, 30px);
    }

    .frame-nav,
    .frame-footer {
        font-size: 11.5px;
    }

    .frame-nav {
        width: 100%;
        justify-content: space-between;
        gap: 0.25rem;
    }

    .frame-nav .nav-item {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.1rem;
        text-align: center;
    }

    .frame-nav .separator {
        margin: 0 0.25rem;
    }

    .frame-footer {
        justify-content: flex-start;
        flex-direction: column;
        gap: 0.15rem;
        text-align: left;
        align-items: flex-start;
    }

    .frame-nav .nav-line--mobile {
        display: block;
    }
}
