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

html,
body {
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.viewport {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    overflow: hidden;
}

.stage {
    position: relative;
    width: 1920px;
    height: 1080px;
    flex: none;
    transform-origin: center center;
    background-color: #000;
    overflow: hidden;
    box-shadow: 0 0 120px rgba(0, 0, 0, 0.8);
    will-change: transform;
    opacity: 0;
}

body.is-first-visit.is-loader-done .stage {
    animation: stageFadeIn 1.4s ease-out both;
}

body.is-loader-done:not(.is-first-visit) .stage {
    opacity: 1;
    animation: none;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.9s ease, visibility 0.9s ease;
}

.page-loader.is-hiding {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

html.skip-loader .page-loader {
    display: none;
}

body.is-loading .viewport {
    opacity: 0;
    visibility: hidden;
}

body.is-loader-done .viewport {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease 0.15s, visibility 0.6s ease 0.15s;
}

.page-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    width: min(420px, 78vw);
    text-align: center;
    animation: loaderFadeIn 1s ease-out both;
}

.page-loader-brand {
    color: #fff;
    font-family: 'Abhaya Libre', 'Times New Roman', serif;
    font-weight: 800;
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: 0.02em;
}

.page-loader-brand p {
    margin: 0;
}

.page-loader-book {
    margin: 0;
    color: #f3eee9;
    font-family: 'Abhaya Libre', 'Times New Roman', serif;
    font-size: 24px;
    line-height: 1.4;
    letter-spacing: 0.06em;
    opacity: 0.72;
    animation: hintPulse 1.6s ease-in-out infinite;
}

.page-loader-track {
    position: relative;
    width: 100%;
    height: 1px;
    background: rgba(243, 238, 233, 0.18);
    overflow: hidden;
}

.page-loader-bar {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(243, 238, 233, 0.35) 0%, #f3eee9 50%, rgba(243, 238, 233, 0.35) 100%);
    box-shadow: 0 0 18px rgba(243, 238, 233, 0.45);
    transition: width 0.35s ease;
}

@keyframes loaderFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dive-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    background: #000;
}

.dive-overlay.is-active {
    pointer-events: auto;
}

.viewport.is-diving {
    filter: brightness(0.92) contrast(1.05);
}

.viewport.is-diving .stage {
    filter: blur(calc(var(--dive-blur, 0) * 1px));
}

body.is-transitioning {
    cursor: wait;
    overflow: hidden;
}

body.is-transitioning .weifeng-hitarea,
body.is-transitioning .dafeng-hitarea,
body.is-transitioning .bird-hitarea {
    pointer-events: none !important;
}

body.is-enter-ready {
    cursor: pointer;
}

body.is-enter-ready.is-transitioning {
    cursor: wait;
}

body.is-returning .stage {
    animation: none !important;
    opacity: 1;
    will-change: auto;
}

body.is-returning .author-name,
body.is-returning .title-darwins,
body.is-returning .title-lock,
body.is-returning .home-subtitle {
    animation: none !important;
    opacity: 0;
}

html.skip-loader body.is-loader-done .viewport {
    opacity: 1;
    visibility: visible;
    transition: none;
}

body.is-returning {
    cursor: wait;
}

body.is-returning .parallax-layer {
    will-change: auto;
}

body.is-returning .weifeng-canvas,
body.is-returning .dafeng-canvas {
    will-change: auto;
}

body.is-returning .bird-sequence {
    visibility: hidden;
}

.flora-freeze-img {
    pointer-events: none;
}

body.is-returning .dive-overlay {
    pointer-events: auto;
}

body.is-returning .viewport.is-diving {
    filter: none;
}

body.is-returning .viewport.is-diving .stage {
    filter: none;
}

@keyframes stageFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.layer {
    position: absolute;
    pointer-events: none;
}

.parallax-layer {
    position: absolute;
    inset: 0;
    width: 1920px;
    height: 1080px;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    pointer-events: none;
}

.parallax-layer--far {
    z-index: 1;
}

.parallax-layer--flora {
    z-index: 3;
}

.parallax-layer--mid {
    z-index: 6;
    pointer-events: none;
}

.layer--home-bg {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.layer--overlay {
    left: 0;
    top: 0;
    width: 2015px;
    height: 1186px;
    background-color: #000;
    opacity: 0.6;
    z-index: 2;
}

.layer--botanical {
    top: -191px;
    left: 0;
    right: 0;
    bottom: 191px;
    height: 1080px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.botanical-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform: rotate(180deg) scaleX(-1);
    overflow: hidden;
}

.botanical-img {
    position: absolute;
    top: 0;
    left: -4.49%;
    width: 108.94%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.weifeng-flower {
    z-index: 4;
    pointer-events: none;
    overflow: visible;
}

.weifeng-flower--left {
    left: -80px;
    top: 380px;
    width: 640px;
    height: 640px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.weifeng-flower--left .weifeng-flower-inner {
    position: relative;
    width: 560px;
    height: 560px;
    transform: rotate(15.73deg) scale(0.75);
    transform-origin: center center;
    flex: none;
    overflow: visible;
}

.weifeng-flower--left .weifeng-canvas {
    display: block;
    width: 560px;
    height: 560px;
    pointer-events: none;
}

.weifeng-flower--center {
    left: 410px;
    top: 585px;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.weifeng-flower--center .weifeng-flower-inner {
    position: relative;
    width: 280px;
    height: 280px;
    transform: scale(0.75);
    transform-origin: center center;
    flex: none;
    overflow: visible;
}

.weifeng-flower--center .weifeng-canvas {
    display: block;
    width: 280px;
    height: 280px;
    pointer-events: none;
}

.weifeng-flower--top-right {
    left: 1060px;
    top: -45px;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.weifeng-flower--top-right .weifeng-flower-inner {
    position: relative;
    width: 300px;
    height: 300px;
    transform: rotate(180deg) scale(1.25);
    transform-origin: center center;
    flex: none;
    overflow: visible;
}

.weifeng-flower--top-right .weifeng-canvas {
    display: block;
    width: 300px;
    height: 300px;
    pointer-events: none;
}

.weifeng-flower--right {
    left: 1520px;
    top: 700px;
    width: 480px;
    height: 480px;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weifeng-flower--right .weifeng-flower-inner {
    position: relative;
    width: 480px;
    height: 480px;
    flex: none;
    overflow: visible;
}

.weifeng-flower--right .weifeng-canvas {
    display: block;
    width: 480px;
    height: 480px;
    pointer-events: none;
}

.weifeng-hitarea {
    position: absolute;
    inset: 18%;
    cursor: inherit;
    pointer-events: none;
}

.weifeng-hitarea.is-locked,
.dafeng-hitarea.is-locked {
    pointer-events: none;
    cursor: default;
}

.dafeng-flower {
    left: 1040px;
    top: 620px;
    width: 420px;
    height: 420px;
    z-index: 5;
    pointer-events: none;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dafeng-flower-inner {
    position: relative;
    width: 420px;
    height: 420px;
    transform: rotate(10.19deg);
    transform-origin: center center;
    flex: none;
    overflow: visible;
}

.dafeng-canvas {
    display: block;
    width: 420px;
    height: 420px;
    pointer-events: none;
}

.dafeng-hitarea {
    position: absolute;
    inset: 12%;
    cursor: pointer;
    pointer-events: auto;
}

.dafeng-hitarea.is-locked {
    pointer-events: none;
    cursor: default;
}

.author-name {
    left: 484px;
    top: 153px;
    width: 953px;
    text-align: center;
    color: #fff;
    font-family: 'Abhaya Libre', 'Times New Roman', serif;
    font-weight: 800;
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: 0.02em;
    z-index: 10;
    opacity: 0;
}

body.is-first-visit.is-loader-done .author-name {
    animation: fadeInDown 1.2s ease-out 0.3s both;
}

body.is-loader-done:not(.is-first-visit) .author-name,
body.is-loader-done:not(.is-first-visit) .title-darwins,
body.is-loader-done:not(.is-first-visit) .title-lock,
body.is-loader-done:not(.is-first-visit) .home-subtitle {
    opacity: 1;
    animation: none;
}

.author-name p {
    margin: 0;
}

.title-darwins {
    left: 519px;
    top: 316px;
    width: 883px;
    height: 166px;
    object-fit: contain;
    z-index: 6;
    opacity: 0;
}

body.is-first-visit.is-loader-done .title-darwins {
    animation: fadeInUp 1.4s ease-out 0.5s both;
}

.bird-sequence {
    inset: 0;
    width: 1920px;
    height: 1080px;
    z-index: 7;
    pointer-events: none;
    transform:
        translate3d(var(--bird-x, 0px), var(--bird-y, 0px), 0)
        scaleX(var(--bird-flip, 1));
    transform-origin: 50% 50%;
    will-change: transform;
    opacity: 0;
}

.bird-sequence.is-entering,
.bird-sequence.is-landed {
    opacity: 1;
    transition: opacity 0.35s ease;
}

.bird-canvas {
    position: absolute;
    inset: 0;
    width: 1920px;
    height: 1080px;
    display: block;
    pointer-events: none;
    transform: scale(calc(2 / 3));
    transform-origin: 50% 50%;
}

.bird-hitarea {
    position: absolute;
    left: 800px;
    top: 410px;
    width: 320px;
    height: 280px;
    cursor: inherit;
    pointer-events: none;
    z-index: 1;
    background: transparent;
}

@keyframes birdFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.title-lock {
    left: 721px;
    top: 541px;
    width: 479px;
    height: 165px;
    object-fit: contain;
    z-index: 8;
    opacity: 0;
}

body.is-first-visit.is-loader-done .title-lock {
    animation: fadeInUp 1.4s ease-out 0.6s both;
}

.home-subtitle {
    left: 0;
    right: 0;
    top: 760px;
    text-align: center;
    color: #f3eee9;
    font-family: "Abhaya Libre ExtraBold",'Abhaya Libre', 'Times New Roman', serif;
    letter-spacing: 0.02em;
    z-index: 9;
    pointer-events: none;
    font-size: 48px;
    opacity: 0;
    width: 100%;
    display: flex;
    justify-content: center;
}
.home-subtitle p{
    width: 562px;
    font-weight: 800;
}

body.is-first-visit.is-loader-done .home-subtitle {
    animation: fadeInUp 1.4s ease-out 0.75s both;
}

.home-subtitle-tip {
    letter-spacing: 0.08em;
    color: #fff;
    text-shadow: 0 0 22px rgba(255, 255, 255, 0.35);
    animation: hintPulse 1.6s ease-in-out infinite;
    margin-top: 1em;
    display: none;
}

@keyframes hintPulse {
    0%,
    100% {
        opacity: 0.55;
    }
    50% {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

@media screen and (max-width: 768px) {
    .stage {
        box-shadow: none;
    }

    .layer--botanical {
        top: -120px;
        bottom: 120px;
    }

    .weifeng-flower--left {
        left: -120px;
        top: 520px;
        transform: scale(0.85);
        transform-origin: center center;
    }

    .weifeng-flower--center {
        left: 320px;
        top: 680px;
        transform: scale(0.8);
        transform-origin: center center;
    }

    .weifeng-flower--top-right {
        left: 900px;
        top: -20px;
        transform: scale(0.85);
        transform-origin: center center;
    }

    .weifeng-flower--right {
        left: 1380px;
        top: 780px;
        transform: scale(0.75);
        transform-origin: center center;
    }

    .dafeng-flower {
        left: 900px;
        top: 700px;
        transform: scale(0.85);
        transform-origin: center center;
    }

    .author-name {
        left: 0;
        right: 0;
        width: auto;
        top: 110px;
        font-size: 28px;
        line-height: 1.2;
        letter-spacing: 0.04em;
    }

    .title-darwins {
        left: 50%;
        margin-left: -210px;
        top: 250px;
        width: 420px;
        height: auto;
    }

    .title-lock {
        left: 50%;
        margin-left: -130px;
        top: 500px;
        width: 260px;
        height: auto;
    }

    .home-subtitle {
        top: 650px;
        padding: 0 120px;
        font-size: 22px;
    }
    .home-subtitle p{
        width: 80vw;
    }

    .home-subtitle-tip {
        font-size: 26px;
        letter-spacing: 0.06em;
    }

    .bird-hitarea {
        left: 760px;
        top: 380px;
        width: 400px;
        height: 340px;
    }

    .dafeng-hitarea {
        inset: 8%;
        min-width: 44px;
        min-height: 44px;
    }

    .weifeng-hitarea {
        inset: 12%;
        min-width: 44px;
        min-height: 44px;
    }
}