/* -------------------------------------------------------------
   1. Smooth Page-Wide Theme Transition
------------------------------------------------------------- */
body,
header,
main,
footer,
article,
button {
    transition:
        background-color 0.6s ease,
        color 0.6s ease,
        border-color 0.6s ease;
}

/* -------------------------------------------------------------
   2. Hero Section & Crossfading Backgrounds
------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    width: 100%;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    /* Start flush with the edges */
    clip-path: inset(0px round 0px);

    /* Smooth spring-like transition when cropping triggers */
    transition: clip-path 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: clip-path;
}

/* Applied via JavaScript as soon as the user starts scrolling down */
.hero.is-scrolled {
    /* Inset 1.25rem (~20px) from each edge, with 24px rounded corners */
    clip-path: inset(1.25rem round 24px);
}

/* Base style for both image layers */
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}

/* Bottom layer: Dark Mode Image (Always sitting underneath) */
.hero::before {
    z-index: 0;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.7)),
        url("assets/fishing-night.png"); /* Replace with your night image */
    opacity: 1;
}

/* Top layer: Light Mode Image (Fades in and out over the night image) */
.hero::after {
    z-index: 1;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.5)),
        url("assets/fishing-day.png"); /* Replace with your day image */
    opacity: 0; /* Hidden by default because dark mode is default */
}

/* When Light mode is active, smoothly reveal the day image */
[data-theme="light"] .hero::after {
    opacity: 1;
}

/* Lift text above the image layers so it remains visible and selectable */
.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1,
.hero-content p {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* -------------------------------------------------------------
   3. Floating Toggle Button
------------------------------------------------------------- */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;

    width: auto;
    padding: 0.5rem 0.85rem;
    border-radius: 50px;
    cursor: pointer;

    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transition:
        background-color 0.3s ease,
        transform 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

@font-face {
    font-family: "MinecraftSeven";
    src: url("fonts/Minecraft-Seven_v2.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --pico-font-family: "MinecraftSeven", monospace, sans-serif;
}

body {
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}

/* Floating Corner Logo */
.corner-logo {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    display: inline-block;
    line-height: 0; /* Prevents unwanted bottom spacing on anchor tags */
    transition: transform 0.2s ease;
}

.corner-logo img {
    width: 64px;
    height: 64px;
    display: block;

    /* Keeps Minecraft pixel art razor-sharp with no blurry smoothing */
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;

    /* Subtle shadow so it stands out against both day and night backgrounds */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Fun hover 'pop' effect */
.corner-logo:hover {
    transform: scale(1.1);
}
