
/* Our enchanted forest colour palette */
:root {
    --forest: #294D35;
    --moss: #A8C66C;
    --fairy-pink: #D5309C;
    --wisteria: #C4A1E8;
    --sunlight: #FFD36E;
    --vanilla: #FFF1DF;
}

/* Reset browser defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--forest);
    color: var(--vanilla);
    font-family: Georgia, serif;
}

/* Enchanted forest environment */
#enchanted-forest {
    position: relative;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
}

/* Forest scenery */
#forest-background {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(
            to bottom,
            rgba(255, 241, 223, 0.10) 0%,
            rgba(255, 211, 110, 0.08) 20%,
            rgba(41, 77, 53, 0.18) 55%,
            rgba(11, 33, 24, 0.35) 100%
        ),
        url("assets/backgrounds/day-forest.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#forest-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 20%, rgba(255, 211, 110, 0.20), transparent 35%),
        radial-gradient(circle at 20% 75%, rgba(196, 161, 232, 0.12), transparent 25%),
        radial-gradient(circle at 80% 70%, rgba(213, 48, 156, 0.10), transparent 22%);
    pointer-events: none;
}

/* Welcome message */
#welcome {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 8vh 20px 20px;
    max-width: 900px;
    margin: 0 auto;
}

#welcome h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: normal;
    letter-spacing: 2px;
    color: var(--vanilla);
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.35),
        0 0 25px rgba(255, 211, 110, 0.25);
}

#welcome p {
    margin-top: 15px;
    font-size: 1.2rem;
    color: var(--sunlight);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Future magical animation layers */
#magical-particles,
#cursor-fairy {
    position: absolute;
    pointer-events: none;
}

#magical-particles {
    inset: 0;
}

/* Enchanted welcome typography */

#welcome {
    padding: 6vh 20px 50px;
    background: radial-gradient(
        ellipse at top,
        rgba(10, 25, 15, 0.65),
        transparent 75%
    );
}

.welcome-intro {
    display: block;
    color: var(--sunlight);
    font-size: 0.85rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

#welcome h1 {
    color: var(--vanilla);
    text-shadow:
        0 3px 12px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(255, 211, 110, 0.3);
}

#welcome p {
    color: var(--vanilla);
    font-style: italic;
    text-shadow: 0 2px 8px #000;
}

/* Magical fairy dust */

.fairy-dust {
    position: fixed;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--sunlight);
    box-shadow:
        0 0 6px #FFD36E,
        0 0 12px #FFD36E,
        0 0 18px #FFF1DF;
    pointer-events: none;
    z-index: 1000;
    animation: dust-fade 1.2s ease-out forwards;
}

@keyframes dust-fade {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--drift), 25px) scale(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fairy-dust {
        display: none;
    }
}

/* Flying socials fairy */

#forest-creatures {
    position: relative;
    z-index: 20;
}

#social-fairy {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    z-index: 25;
    will-change: transform;
}

.fairy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    font-size: 1.9rem;
    border-radius: 50%;
    background: rgba(255, 241, 223, 0.14);
    backdrop-filter: blur(4px);
    box-shadow:
        0 0 18px rgba(255, 211, 110, 0.35),
        0 0 28px rgba(196, 161, 232, 0.2);
    animation: fairy-flutter 1s ease-in-out infinite alternate;
}

.fairy-sign {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 241, 223, 0.92);
    color: var(--forest);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
}

@keyframes fairy-flutter {
    from {
        transform: translateY(0px) scale(1);
    }
    to {
        transform: translateY(-5px) scale(1.04);
    }
}

/* Hanging social links — wooden planks and gold lettering. */
#social-popup {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 11px;
    width: var(--plank-width, 92px);
    padding: 0;
    background: none;
    border: 0;
    pointer-events: none;
    will-change: transform;
}
#social-popup .social-plank {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--plank-height, 34px);
    padding: 5px 4px;
    border: 2px solid #bb792c;
    border-radius: 6px 8px 6px 8px;
    background:
        linear-gradient(
            180deg,
            #D88B3420 0%,
            #803A1015 35%,
            #35140755 100%
        ),
        url("assets/characters/social-fairy/socials-wood-grain.jpg") center / 100% 100%,
        #54280F;
    box-shadow: inset 0 0 0 1px #f5c978,
                inset 0 0 8px #321607b0,
                0 2px 4px #26120680;
    color: #ffd36e;
    font-family: 'Times New Roman', Georgia, serif;
    font-size: calc(var(--plank-font, 16px) * 1.15);
    line-height: 1.1;
    font-weight: 400;
    letter-spacing: -.3px;
    text-decoration: none;
    white-space: nowrap;
    pointer-events: auto;
    transition: box-shadow .2s ease, filter .2s ease;
}
/* Two twisted ropes connect each plaque to the one above. */
#social-popup .social-plank::before,
#social-popup .social-plank::after {
    content: "";
    position: absolute;
    top: -15px;
    width: 4px;
    height: 18px;
    border-radius: 3px;
    background: repeating-linear-gradient(145deg,
        #e9c187 0 2px, #ae7737 2px 3px, #71451f 3px 4px,
        #c69551 4px 5px);
    box-shadow: inset 1px 0 #fff0c05c, 1px 0 1px #2e190a88;
    pointer-events: none;
}
#social-popup .social-plank::before { left: 23%; }
#social-popup .social-plank::after { right: 23%; }
#social-popup .social-plank:first-child::before,
#social-popup .social-plank:first-child::after { top: -11px; height: 14px; }
#social-popup .social-plank span {
    background: linear-gradient(
        180deg,
        #FFF4C2 0%,
        #FFDA78 25%,
        #F5B63C 50%,
        #D88918 80%,
        #FFC65C 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: .15px #FFE5A0;
    filter:
        drop-shadow(0 1px 0 #713509)
        drop-shadow(0 1px 1px #321408);
}
#social-popup .social-plank:hover,
#social-popup .social-plank:focus-visible {
    box-shadow: inset 0 0 0 1px #ffe3a2,
                inset 0 0 8px #321607b0,
                0 0 10px #ffd36e80;
    filter: brightness(1.16);
}
#social-popup .social-plank:focus-visible { outline: 2px solid #fff1df; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
    #social-popup .social-plank { transition: none; }
}

/* Fix fairy positioning and popup visibility */

#forest-creatures {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#social-fairy {
    pointer-events: auto;
}

#social-popup[hidden] {
    display: none;
}

/* Illustrated woodland fairy */

.fairy-art {
    display: block;
    width: clamp(110px, 18vw, 170px);
    height: auto;
    user-select: none;
    pointer-events: none;
    filter: drop-shadow(
        0 0 12px rgba(255, 211, 110, 0.45)
    );
    transition: filter 0.3s ease;
}

#social-fairy:hover .fairy-art {
    filter: drop-shadow(
        0 0 22px rgba(255, 211, 110, 0.85)
    );
}

#social-fairy:focus-visible {
    outline: 2px solid var(--sunlight);
    border-radius: 15px;
}

/* Automatic day and night lighting */

#forest-background {
    transition: filter 3s ease;
}

.night-mode #welcome h1 {
    text-shadow:
        0 0 15px rgba(255, 211, 110, 0.6),
        0 0 35px rgba(196, 161, 232, 0.5);
}

.night-mode .fairy-art {
    filter: drop-shadow(
        0 0 18px rgba(255, 211, 110, 0.7)
    );
}

/* Enchanted forest fireflies */

#magical-particles {
    z-index: 1;
    opacity: 0.45;
    transition: opacity 3s ease;
    pointer-events: none;
}

.night-mode #magical-particles {
    opacity: 1;
}

.firefly {
    position: absolute;
    border-radius: 50%;
    background: #FFF7C7;

    box-shadow:
        0 0 5px #FFD36E,
        0 0 12px #FFD36E,
        0 0 22px #FFD36E;

    pointer-events: none;

    animation:
        firefly-float var(--duration) ease-in-out infinite alternate,
        firefly-glow var(--pulse) ease-in-out infinite;

    animation-delay: var(--delay);
}

/* Gentle independent movement */

@keyframes firefly-float {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(var(--drift-x), -25px);
    }

    100% {
        transform: translate(
            var(--drift-x2),
            var(--drift-y)
        );
    }
}

/* Natural glowing and fading */

@keyframes firefly-glow {
    0%, 100% {
        opacity: 0.1;
    }

    50% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .firefly {
        animation: none;
        opacity: 0.5;
    }
}

/* The Enchanted Shop entrance */

#forest-navigation {
    position: absolute;
    inset: 0;
    z-index: 15;
    pointer-events: none;
}

#shop-entrance {
    position: absolute;
    bottom: 12%;
    right: 6%;

    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 18px 26px;
    border: 2px solid #C5A05A;
    border-radius: 12px;

    background: linear-gradient(
        145deg,
        #604229,
        #302016
    );

    color: var(--vanilla);
    text-decoration: none;
    text-align: center;
    pointer-events: auto;

    box-shadow:
        0 0 15px rgba(255, 211, 110, 0.35),
        inset 0 0 15px rgba(0, 0, 0, 0.4);

    transform-origin: top center;

    transition:
        box-shadow 0.4s ease,
        transform 0.4s ease;
}

.shop-decoration {
    color: var(--sunlight);
    font-size: 1.1rem;
    letter-spacing: 5px;
    margin-bottom: 6px;
}

.shop-title {
    font-size: 1.35rem;
    color: var(--vanilla);
}

.shop-subtitle {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--sunlight);
    margin-top: 7px;
}

/* Magical hover interaction */

#shop-entrance:hover,
#shop-entrance:focus-visible {
    box-shadow:
        0 0 20px rgba(255, 211, 110, 0.7),
        0 0 45px rgba(255, 211, 110, 0.35);

    animation: shop-sway 2s ease-in-out infinite;
}

@keyframes shop-sway {
    0%, 100% {
        transform: rotate(-2deg);
    }

    50% {
        transform: rotate(2deg);
    }
}

/* Stronger magical glow at night */

.night-mode #shop-entrance {
    box-shadow:
        0 0 20px rgba(255, 211, 110, 0.5),
        0 0 35px rgba(255, 211, 110, 0.2);
}

@media (prefers-reduced-motion: reduce) {
    #shop-entrance {
        animation: none;
        transition: none;
    }
}


.owl-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.owl-trigger::-webkit-details-marker {
    display: none;
}

.owl-icon {
    font-size: 4rem;
    filter: drop-shadow(
        0 0 12px rgba(255, 211, 110, 0.5)
    );
    transition: filter 0.3s ease;
}

.owl-trigger:hover .owl-icon {
    filter: drop-shadow(
        0 0 25px rgba(255, 211, 110, 0.9)
    );
}

.owl-sign {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--vanilla);
    color: var(--forest);
    font-weight: bold;
    margin-top: 5px;
}

/* Magical parchment letter */

.contact-letter {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;

    width: min(280px, 80vw);
    padding: 24px;

    background: linear-gradient(
        135deg,
        #FFF1DF,
        #E8D5AE
    );

    color: var(--forest);
    border: 2px solid #C5A05A;
    border-radius: 12px;
    text-align: center;

    box-shadow:
        0 0 25px rgba(255, 211, 110, 0.35),
        0 8px 25px rgba(0, 0, 0, 0.3);
}

.letter-decoration {
    color: #A17A35;
    letter-spacing: 5px;
}

.contact-letter h2 {
    font-size: 1.4rem;
    margin: 12px 0;
}

.contact-letter p {
    font-size: 1rem;
    line-height: 1.6;
}

.contact-email {
    display: block;
    margin-top: 18px;
    padding: 12px;
    background: var(--forest);
    color: var(--vanilla);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.contact-email:hover {
    background: var(--fairy-pink);
    color: #111;
}

/* The Enchanted Gallery */

.gallery-page {
    min-height: 100svh;
    padding: 30px 20px 60px;
    text-align: center;

    background:
        linear-gradient(
            rgba(11, 33, 24, 0.65),
            rgba(11, 33, 24, 0.90)
        ),
       url("assets/backgrounds/day-forest-expanded.png");

    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.back-to-forest {
    display: inline-block;
    color: var(--sunlight);
    text-decoration: none;
    padding: 12px 20px;
    border: 1px solid var(--sunlight);
    border-radius: 25px;
}

.gallery-welcome {
    margin: 45px auto;
}

.gallery-welcome span {
    color: var(--sunlight);
    letter-spacing: 3px;
    font-size: 0.85rem;
}

.gallery-welcome h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: normal;
    margin: 15px 0;
}

.gallery-welcome p {
    font-style: italic;
    color: var(--wisteria);
}

.gallery-collection {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(min(250px, 100%), 1fr));

    gap: 35px;
    max-width: 850px;
    margin: 40px auto;
}

.gallery-frame {
    padding: 12px;
    border: 3px double #C5A05A;
    border-radius: 15px;

    background: #30291D;

    box-shadow:
        0 0 20px rgba(255, 211, 110, 0.2),
        0 10px 30px rgba(0, 0, 0, 0.4);

    transition:
        transform 0.5s ease,
        box-shadow 0.5s ease;
}

.gallery-frame img {
    width: 100%;
    height: 320px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.gallery-frame figcaption {
    color: var(--sunlight);
    padding: 15px;
    font-size: 1.1rem;
}

.gallery-frame:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 35px rgba(255, 211, 110, 0.5);
}

.gallery-shop-link {
    display: inline-block;
    color: var(--sunlight);
    text-decoration: none;
    margin-top: 20px;
    padding: 12px 24px;
    border: 1px solid var(--sunlight);
    border-radius: 25px;
}

/* Magical treasure chest entrance */

#gallery-entrance {
    position: absolute;
    bottom: 5%;
    left: 50%;

    transform: translateX(-50%);

    display: flex;
    flex-direction: column;
    align-items: center;

    text-decoration: none;
    text-align: center;
    pointer-events: auto;

    color: var(--vanilla);
}

.treasure-icon {
    font-size: 4rem;

    filter: drop-shadow(
        0 0 12px rgba(255, 211, 110, 0.5)
    );

    transition:
        filter 0.4s ease,
        transform 0.4s ease;
}

.treasure-sign {
    padding: 8px 16px;
    border: 1px solid #C5A05A;
    border-radius: 20px;

    background: #30291D;
    color: var(--vanilla);

    font-weight: bold;
}

.treasure-subtitle {
    margin-top: 7px;
    color: var(--sunlight);
    font-size: 0.85rem;
    font-style: italic;
    text-shadow: 0 2px 8px #000;
}

#gallery-entrance:hover .treasure-icon,
#gallery-entrance:focus-visible .treasure-icon {
    transform: translateY(-8px) scale(1.08);

    filter: drop-shadow(
        0 0 25px rgba(255, 211, 110, 0.95)
    );
}

@media (prefers-reduced-motion: reduce) {
    .treasure-icon {
        transition: none;
    }

    #gallery-entrance:hover .treasure-icon,
    #gallery-entrance:focus-visible .treasure-icon {
        transform: none;
    }
}

/* Our enchanted storybook */

.storybook {
    max-width: 650px;
    margin: 30px auto;
    padding: clamp(25px, 5vw, 50px);

    background: linear-gradient(
        135deg,
        #FFF1DF,
        #E8D5AE
    );

    color: var(--forest);
    border: 4px double #C5A05A;
    border-radius: 12px;

    box-shadow:
        0 0 30px rgba(255, 211, 110, 0.25),
        0 15px 40px rgba(0, 0, 0, 0.4);
}

.storybook h2 {
    font-weight: normal;
    font-size: 1.8rem;
    margin-bottom: 25px;
}

.storybook p {
    font-size: 1.1rem;
    line-height: 1.9;
    margin-bottom: 20px;
}

.story-decoration {
    color: #A17A35;
    font-size: 1.5rem;
}

.our-story-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--sunlight);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 2px;
    transition: text-shadow 0.3s ease;
}

.our-story-link:hover {
    text-shadow: 0 0 15px #FFD36E;
    text-decoration: underline;
}

/* Cinematic day and night environments */

#forest-background {
    background-image:
        url("assets/backgrounds/day-forest.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    filter: none;
}

/* Matching nighttime environment */

#forest-background::before {
    content: "";
    position: absolute;
    inset: 0;

    background-image:
        url("assets/backgrounds/night-forest.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    opacity: 0;
    transition: opacity 5s ease-in-out;

    pointer-events: none;
}

/* Reveal the nighttime forest */

.night-mode #forest-background::before {
    opacity: 1;
}

/* Remove our old artificial lighting overlay */

#forest-background::after {
    background: none;
}

@media (prefers-reduced-motion: reduce) {
    #forest-background::before {
        transition: none;
    }
}

/* Luxurious enchanted typography */

#welcome {
    padding-top: 3vh;
    padding-bottom: 45px;

    background: radial-gradient(
        ellipse at top,
        rgba(5, 18, 12, 0.80),
        transparent 78%
    );
}

/* Golden cube and decorative flourishes */

.royal-ornament {
    width: clamp(180px, 30vw, 320px);
    margin: 0 auto 12px;
}

.royal-ornament svg {
    display: block;
    width: 100%;
    fill: none;
    stroke: #FFD36E;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    filter: drop-shadow(
        0 0 6px rgba(255, 211, 110, 0.8)
    );
}

/* Metallic gold lettering */

#welcome h1,
.night-mode #welcome h1 {

    font-size: clamp(2.5rem, 6.5vw, 5.5rem);
    font-weight: normal;
    letter-spacing: 1px;
    line-height: 1.15;

    background: linear-gradient(
        to bottom,
        #FFF8DB 0%,
        #FFE6A3 35%,
        #D89B37 75%,
        #FFE8AF 100%
    );

    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;

    text-shadow: none;

    filter:
        drop-shadow(0 2px 2px #382008)
        drop-shadow(0 0 10px #D99A3655);
}

/* Elegant introductory text */

.welcome-intro {
    color: #FFE3A0;
    letter-spacing: 4px;
    margin-bottom: 12px;

    text-shadow: 0 0 10px #FFD36E66;
}

#welcome p {
    color: var(--vanilla);
    font-size: clamp(1rem, 2vw, 1.35rem);
    margin-top: 12px;
}

/* Magical story link */

.our-story-link {
    font-size: 1.05rem;
    font-style: italic;
    letter-spacing: 0.5px;
    color: #FFD36E;
    margin-top: 18px;
}

.our-story-link::after {
    content: "";
    display: block;
    width: 85%;
    height: 1px;
    margin: 12px auto 0;

    background: linear-gradient(
        to right,
        transparent,
        #FFD36E,
        transparent
    );

    box-shadow: 0 0 8px #FFD36E;
}

.night-mode .royal-ornament svg {
    filter: drop-shadow(
        0 0 9px rgba(255, 211, 110, 0.95)
    );
}

/* Living daytime forest background */

#day-forest-video {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    z-index: 1;
    pointer-events: none;

    filter: brightness(0.95);
}

/* Keep nighttime artwork above daytime video */

#forest-background::before {
    z-index: 2;
}

/* Static background for reduced motion */

@media (prefers-reduced-motion: reduce) {
    #day-forest-video {
        display: none;
    }
}

.night-mode #forest-background::before {
    opacity: 0;
}


/* =================================
   VIDEO-ONLY FOREST ENVIRONMENT
   ================================= */

#forest-background,
.night-mode #forest-background {
    background: #10291D;
    filter: none;
}

/* Disable previous PNG background layers */

#forest-background::before,
#forest-background::after {
    display: none;
}

/* Full-screen animated backgrounds */

#day-forest-video,
#night-forest-video {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    pointer-events: none;
    filter: none;
    display: block;
}

/* Daytime video */

#day-forest-video {
    z-index: 1;
    opacity: 1;
}

/* Nighttime video */

#night-forest-video {
    z-index: 2;
    opacity: 0;
    transition: opacity 5s ease-in-out;
}

/* Automatic nighttime crossfade */

.night-mode #night-forest-video {
    opacity: 1;
}

/* Disable crossfade for reduced motion */

@media (prefers-reduced-motion: reduce) {
    #night-forest-video {
        transition: none;
    }
}
/* Accessible hidden page title */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =================================
   EXPLORABLE ENCHANTED FOREST
   ================================= */

/* Visitor's viewing window */

#forest-viewport {
    position: relative;
    width: 100%;
    height: 100svh;

    overflow: auto;
    overscroll-behavior: contain;

    cursor: grab;
    touch-action: pan-x pan-y pinch-zoom;
}

/* The complete enchanted world */

#enchanted-forest {
    position: relative;

    width: max(600px, 104vw, 138.667svh);
    height: auto;
    min-height: 0;

    aspect-ratio: 4 / 3;

    overflow: hidden;
    flex-shrink: 0;
}

/* While dragging the forest */

#forest-viewport.is-dragging,
#forest-viewport.is-dragging * {
    cursor: grabbing !important;
    user-select: none;
}

/* Preserve clickable interactive objects */

#forest-viewport a,
#forest-viewport summary,
#forest-viewport button,
#social-fairy {
    cursor: pointer;
}

/* Prevent native image dragging */

#forest-viewport img,
#forest-viewport video {
    -webkit-user-drag: none;
}

/* =================================
   FOREST ZOOM AND EXPLORATION
   ================================= */

#forest-viewport {
    touch-action: none;
}

/* Stationary zoom controls */

#forest-zoom-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;

    display: flex;
    gap: 8px;
}

/* Enchanted golden buttons */

#forest-zoom-controls button {
    width: 42px;
    height: 42px;

    background: rgba(48, 32, 22, 0.88);
    color: #FFD36E;

    border: 1px solid #C5A05A;
    border-radius: 10px;

    font-family: Georgia, serif;
    font-size: 1.5rem;

    cursor: pointer;

    box-shadow:
        0 0 12px rgba(255, 211, 110, 0.2);

    backdrop-filter: blur(5px);

    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
}

#forest-zoom-controls button:hover,
#forest-zoom-controls button:focus-visible {
    background: #604229;
    box-shadow:
        0 0 18px rgba(255, 211, 110, 0.6);
}

/* Smaller screens */

@media (max-width: 600px) {
    #forest-zoom-controls {
        top: 12px;
        right: 12px;
        gap: 6px;
    }
}

/* =================================
   FIT ENTIRE ENCHANTED FOREST
   ================================= */

/* Animated ambient background */

#forest-ambient {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    filter: blur(24px) brightness(0.65);
    transform: scale(1.15);

    pointer-events: none;
    z-index: 0;
}

#forest-ambient[hidden] {
    display: none;
}

/* Centre the forest when zoomed out */

#forest-viewport {
    display: flex;
    flex-direction: column;
    z-index: 1;

    scrollbar-width: none;
}

#forest-viewport::-webkit-scrollbar {
    display: none;
}

#enchanted-forest {
    margin: auto;
}

/* Living woodland fairy — layered alpha videos */
#social-fairy {
    width: clamp(190px, 25vw, 285px);
    aspect-ratio: 1 / 1;
    display: block;
    isolation: isolate;
    filter: drop-shadow(0 0 2px rgba(255, 222, 153, .50))
            drop-shadow(0 0 6px rgba(255, 211, 110, .26));
    transition: filter .35s ease;
}
#social-fairy .fairy-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    pointer-events: none;
    filter: none !important;
}
#social-fairy .fairy-video {
    opacity: 0;
    transition: opacity 560ms ease-in-out;
}
#social-fairy .fairy-video.is-visible { opacity: 1; }
#social-fairy-image { opacity: 1; transition: opacity 560ms ease-in-out; }
#social-fairy.video-ready #social-fairy-image { opacity: 0; }
#social-fairy:hover, #social-fairy:focus-visible {
    filter: drop-shadow(0 0 3px rgba(255, 226, 170, .65))
            drop-shadow(0 0 8px rgba(255, 211, 110, .33));
}
.night-mode #social-fairy {
    filter: brightness(.94) drop-shadow(0 0 3px rgba(255, 219, 150, .55))
            drop-shadow(0 0 8px rgba(255, 211, 110, .34));
}
@media (prefers-reduced-motion: reduce) {
    #social-fairy .fairy-video { display: none; transition: none; }
    #social-fairy #social-fairy-image { opacity: 1 !important; transition: none; }
}

/* =================================
   TEMPORARY EXPANDED FOREST TEST
   ================================= */

/* Hide original background videos */
#day-forest-video,
#night-forest-video {
    display: none !important;
}

/* Expanded daytime forest */
#forest-background,
.night-mode #forest-background {
    background-image: url("assets/backgrounds/day-forest-expanded.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: none;
}

/* Expanded nighttime forest */
#forest-background::before {
    content: "";
    display: block;
    position: absolute;
    inset: 0;

    background-image: url("assets/backgrounds/night-forest-expanded.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    opacity: 0;
    transition: opacity 5s ease-in-out;
    pointer-events: none;
}

/* Automatic nighttime transition */
.night-mode #forest-background::before {
    opacity: 1;
}

/* Disable blurry surrounding canvas */
#forest-ambient {
    display: none !important;
}

/* New forest aspect ratio */
#enchanted-forest {
    aspect-ratio: 16 / 9;
    width: max(600px, 104vw, 184.889svh);
}

/* =================================
   ENCHANTED MESSENGER OWL
   ================================= */

/* Keep artwork aligned with world coordinates */
#forest-background,
#forest-background::before {
    background-size: 100% 100%;
}

/* Anchor owl to wooden signpost */
/* Anchor owl to wooden signpost */

#contact-owl {
    position: absolute;

    left: 17%;
    top: 48.7%;

    bottom: auto;
    right: auto;

    width: 6.5%;

    transform: translate(-50%, -98%);

    pointer-events: auto;
    z-index: 2;
}

/* Clickable owl */
.owl-trigger {
    display: block;
    width: 100%;
    cursor: pointer;
    list-style: none;
}

.owl-trigger::-webkit-details-marker {
    display: none;
}

/* Transparent owl artwork */
#messenger-owl {
    display: block;
    background: transparent;
    object-fit: contain;
    object-position: bottom center;
    width: 100%;
    height: auto;

    user-select: none;
    pointer-events: none;

    filter: drop-shadow(
        0 2px 3px rgba(0, 0, 0, 0.3)
    );

    transition: filter 0.4s ease;
}

/* Gentle glow on hover */
.owl-trigger:hover #messenger-owl {
    filter: drop-shadow(
        0 0 8px rgba(255, 211, 110, 0.65)
    );
}

/* Natural nighttime appearance */
.night-mode #messenger-owl {
    filter:
        brightness(0.85)
        saturate(0.90)
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Open contact letter beneath the owl */
#contact-owl .contact-letter {
    top: calc(100% + 12px);
    bottom: auto;
    left: 50%;

    transform: translateX(-50%);
}

/* =================================
   MESSENGER OWL ANIMATION LAYERS
   ================================= */

#messenger-owl {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    overflow: visible;
    background: transparent;
    pointer-events: none;
}

/* Overlay both animations */
.owl-animation {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: contain;
    object-position: bottom center;

    background: transparent;
    pointer-events: none;

    opacity: 0;
    transition: opacity 0.08s linear;
}

/* Display only the active animation */
.owl-animation.is-active {
    opacity: 1;
}

#owl-headturn,
#owl-full-headspin {
    transform: translateY(0.5%) scale(1.01);
    transform-origin: 50% 95.5%;
}

/* =================================
   LIVING ENCHANTED WATERFALL
   ================================= */

#forest-waterfalls {

    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    display: block;
    overflow: hidden;

    z-index: 0;

    pointer-events: none;
    user-select: none;

    opacity: 0.75;

    transition: opacity 5s ease-in-out;
}

/* Flowing water highlights */

.wf-cascade {

    opacity: 0.65;

    filter: blur(0.45px);

}

/* Soft mist above the water */

.wf-mist {

    opacity: 0.45;

    filter: blur(1.2px);

    animation: waterfallMist 3.5s
               ease-in-out infinite;

}

@keyframes waterfallMist {

    0%, 100% {
        opacity: 0.25;
    }

    50% {
        opacity: 0.6;
    }

}

/* Moonlit waterfall appearance */

.night-mode #forest-waterfalls {

    opacity: 0.60;

}

.night-mode .wf-cascade {

    opacity: 0.55;

}

.night-mode .wf-mist {

    opacity: 0.30;

}

/* Accessibility and reduced motion */

@media (prefers-reduced-motion: reduce) {

    #forest-waterfalls {
        display: none;
    }

}

/* =================================
   INTERACTIVE ENCHANTED POND
   ================================= */

#pond-ripples {

    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    display: block;
    overflow: hidden;

    z-index: 1;

    pointer-events: none;
    user-select: none;

}

/* Delicate water ripple highlights */

.pond-ripple-ring {

    fill: none;

    stroke: rgba(225, 250, 255, 0.85);
    stroke-width: 0.85;

    transform-box: fill-box;
    transform-origin: center;

    filter: drop-shadow(
        0 0.7px 0 rgba(10, 45, 55, 0.6)
    );

    animation: pondRipple
               1.3s ease-out both;

}

/* Secondary expanding ripple */

.pond-ripple-ring.secondary {

    stroke-width: 0.55;

    animation-delay: 0.14s;

}

/* Expand and dissolve naturally */

@keyframes pondRipple {

    0% {
        transform: scale(0.05);
        opacity: 0;
    }

    12% {
        opacity: 0.8;
    }

    40% {
        opacity: 0.55;
    }

    75% {
        opacity: 0.25;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }

}

/* Softer moonlit ripples */

.night-mode .pond-ripple-ring {

    stroke: rgba(180, 225, 255, 0.75);

    filter: drop-shadow(
        0 0 1px rgba(130, 210, 255, 0.4)
    );

}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {

    #pond-ripples {
        display: none;
    }

}

/* =================================
   NATURAL DIMENSIONAL WATER RIPPLES
   ================================= */

#pond-ripples {
    --wave-highlight: rgba(89, 155, 135, 0.75);
    --wave-body: rgba(34, 120, 101, 0.55);
    --wave-shadow: rgba(5, 55, 48, 0.45);
}
}

/* Animate each complete water wave */

.pond-water-wave {

    transform-box: fill-box;
    transform-origin: center;

    animation: naturalWaterRipple
               1.5s cubic-bezier(0.15, 0.45, 0.3, 1)
               both;

}

/* Dark depression beneath the wave */

.pond-wave-trough {

    fill: none;
    stroke: var(--wave-shadow);
    stroke-width: 4.5;

    filter: blur(1.4px);

}

/* Thick translucent moving water */

.pond-wave-body {

    fill: none;
    stroke: var(--wave-body);
    stroke-width: 5.5;

    filter: blur(1.2px);

}

/* Light catching the raised water surface */

.pond-wave-crest {

    fill: none;
    stroke: var(--wave-highlight);
    stroke-width: 2.2;

    filter: blur(0.45px);

}

/* Natural expansion and dissipation */

@keyframes naturalWaterRipple {

    0% {
        transform: scale(0.08);
        opacity: 0;
    }

    10% {
        opacity: 0.95;
    }

    30% {
        opacity: 0.85;
    }

    60% {
        opacity: 0.48;
    }

    85% {
        opacity: 0.15;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }

}

/* Cool, luminous moonlit water */

.night-mode #pond-ripples {
    --wave-highlight: rgba(65, 125, 145, 0.70);
    --wave-body: rgba(25, 90, 115, 0.50);
    --wave-shadow: rgba(3, 30, 48, 0.50);
}

/* =================================
   SHIMMERING ENCHANTED WATER WAKE
   ================================= */

#pond-ripples {

    --trail-shadow: rgba(5, 47, 46, 0.45);
    --trail-body: rgba(55, 143, 123, 0.40);
    --trail-sheen: rgba(139, 211, 190, 0.45);
    --trail-glint: rgba(213, 248, 233, 0.72);

}

.pond-water-trail {

    pointer-events: none;

    animation: waterTrailDissolve
               1.6s ease-out forwards;

}

.pond-water-trail path {

    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;

}

/* Depth beneath the disturbed water */

.water-trail-shadow {

    stroke: var(--trail-shadow);
    stroke-width: 9;

    transform: translateY(1.4px);

}

/* Translucent turquoise water */

.water-trail-body {

    stroke: var(--trail-body);
    stroke-width: 8;

}

/* Glossy reflection along the wake */

.water-trail-sheen {

    stroke: var(--trail-sheen);
    stroke-width: 3.5;

}

/* Broken, dancing reflections */

.water-trail-glint {

    stroke: var(--trail-glint);
    stroke-width: 1.8;

    stroke-dasharray: 3 7 10 5 2 9;

    animation: waterGlintFlow
               1.3s linear infinite;

}

/* Gradual dissipation */

@keyframes waterTrailDissolve {

    0% {
        opacity: 0.9;
    }

    20% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 0;
    }

}

/* Light dancing along the water */

@keyframes waterGlintFlow {

    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: -36;
    }

}

/* Moonlit water reflections */

.night-mode #pond-ripples {

    --trail-shadow: rgba(3, 25, 45, 0.50);
    --trail-body: rgba(30, 100, 140, 0.40);
    --trail-sheen: rgba(100, 180, 210, 0.45);
    --trail-glint: rgba(190, 230, 255, 0.65);

}
.pond-lily {
  position: absolute;
  opacity: 1;
  mix-blend-mode: normal;
  filter: saturate(1.25) brightness(1.05) contrast(1.05);
  transform-origin: center center;
  will-change: transform, filter;
}

.pond-lily img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 1;
  mix-blend-mode: normal;
  filter: inherit;
  pointer-events: none;
}