/* =========================================================
   Kissa Café — under-construction page
   Layout: body > header (h1, p) > .carousel > .slide (img, .page-number) > footer

   Desktop: page scrolls normally; menu shown full size (capped at 1000px wide).
   Mobile / touch: whole page fits one screen; only the carousel moves (sideways).
   ========================================================= */

/* ---------- Theme ---------- */

:root {
    color-scheme: light dark;
    --bg: #fafaf9;
    --fg: #1c1917;
    --muted: #78716c;
    --badge-bg: rgb(0 0 0 / 0.55);
    --badge-fg: #fff;
    --pad: 1.5rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1c1917;
        --fg: #f5f5f4;
        --muted: #a8a29e;
    }
}

/* ---------- Base (desktop) ---------- */

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

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--fg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    text-align: center;
}

/* ---------- Header ---------- */

header {
    flex: none;
    padding: 2rem var(--pad) 1.5rem;
}

header h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

header p {
    max-width: 42ch;
    margin: 0.5rem auto 0;
    color: var(--muted);
    font-size: 1.125rem;
}

/* ---------- Carousel ---------- */

.carousel {
    display: flex;
    align-items: flex-start;
    width: 100%;
    max-width: 1000px;
    margin-inline: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;              /* visible on desktop for mouse users */
}

.carousel .slide {
    position: relative;                 /* anchor for .page-number */
    flex: 0 0 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.carousel .slide img {
    display: block;
    width: 100%;
    height: auto;                       /* natural size; page scrolls to read it */
    aspect-ratio: auto 3 / 4;           /* reserves space while loading, then uses the real ratio */
}

.carousel span.page-number {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--badge-bg);
    color: var(--badge-fg);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;               /* never blocks a swipe */
}

/* ---------- Footer ---------- */

footer {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-top: auto;
    padding: 1.5rem var(--pad) 2rem;
    color: var(--muted);
}

footer .company {
    font-size: 1.125rem;
    letter-spacing: 0.1em;              /* tune so this line matches the credit line's width */
}

footer .credit {
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
}

footer a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

footer a:hover {
    color: var(--fg);
}

/* =========================================================
   Media queries — keep at the bottom so they win ties
   ========================================================= */

/* Mobile & touch: fit everything on one screen, no page scrolling */
@media (max-width: 768px), (pointer: coarse) {
    body {
        height: 100vh;                  /* fallback */
        height: 100dvh;                 /* exact visible height, incl. mobile Safari */
        min-height: 0;
        overflow: hidden;
    }

    .carousel {
        flex: 1 1 0;                    /* fill the height left over */
        min-height: 0;                  /* shrink instead of overflowing */
        scrollbar-width: none;
    }

    .carousel::-webkit-scrollbar {
        display: none;
    }

    .carousel .slide {
        height: 100%;
    }

    .carousel .slide img {
        max-height: 100%;               /* never taller than the space available */
        object-fit: contain;            /* no stretching */
        object-position: top;           /* image starts at the top, so the badge sits on it */
    }

    footer {
        margin-top: 0;
        padding-block: 1rem 1.25rem;
    }
}

/* Phones: smaller type, tighter spacing */
@media (max-width: 500px) {
    :root {
        --pad: 1rem;
    }

    header {
        padding-top: 1.25rem;
        padding-bottom: 1rem;
    }

    header h1 {
        font-size: 1.3rem;
        line-height: 1.2;
    }

    header p {
        font-size: 1rem;
    }

    .carousel span.page-number {
        top: 0.75rem;
        left: 1rem;
        font-size: 0.8125rem;
    }

    footer {
        padding-block: 0.75rem 1rem;
    }

    footer .company {
        font-size: 1rem;
    }

    footer .credit {
        font-size: 0.75rem;
    }
}

/* Respect reduced-motion settings */
@media (prefers-reduced-motion: reduce) {
    .carousel {
        scroll-behavior: auto;
    }
}