/* The home page (views/home.ejs): the painting "Dawn of the Heroic Path"
   fills the top of the page, with the title, the introduction and the way
   into the app on its calm left side; "What is RPG-IRL?" follows on a light
   band. Colours come from the painting: forest green and dawn gold.
   Headings: Big Shoulders Display (a tall, condensed game-title face);
   text: Figtree. Loaded by the home page only. */

:root {
    --home-forest-night: #0d2419;
    --home-forest: #15452f;
    --home-dawn-gold: #f3b545;
    --home-dawn-gold-hover: #ffc95e;
    --home-mist: #e9f1df;
    --home-moss: #9cc17a;

    --home-page-background: var(--home-forest-night);
    --home-text: var(--home-mist);
    --home-soft-text: color-mix(in srgb, var(--home-mist) 82%, transparent);
    --home-line: color-mix(in srgb, var(--home-mist) 22%, transparent);
    --home-button-background: var(--home-dawn-gold);
    --home-button-hover-background: var(--home-dawn-gold-hover);
    --home-button-text: var(--home-forest-night);
    --home-band-background: var(--home-mist);
    --home-band-text: var(--home-forest-night);
    --home-band-soft-text: color-mix(in srgb, var(--home-forest-night) 78%, transparent);
    --home-focus: var(--home-dawn-gold);
}

.home-page {
    background: var(--home-page-background);
    color: var(--home-text);
    font-family: 'Figtree', system-ui, sans-serif;
}

.home-page :focus-visible {
    outline: 2px solid var(--home-focus);
    outline-offset: 3px;
}

/* The navigation: over the painting, on a blurred dark strip. */
.home-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--home-forest-night) 62%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--home-line);
}

.home-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--home-text);
    font-family: 'Big Shoulders Display', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    text-decoration: none;
}

.home-brand:hover {
    color: var(--home-text);
}

.home-nav-link {
    padding: 8px 16px;
    border: 1px solid var(--home-line);
    border-radius: 999px;
    color: var(--home-text);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.home-nav-link:hover {
    border-color: var(--home-text);
    background: color-mix(in srgb, var(--home-mist) 10%, transparent);
    color: var(--home-text);
}

/* The hero: the painting fills the first screen, and on it the title and
   the way into the app. Phones: the hero and his shadow at the top, the
   text at the bottom, where the painting darkens into the forest green. */
.home-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: calc(100svh - 65px);
    overflow: hidden;
}

.home-hero-picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 74% top;
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, transparent 18%, color-mix(in srgb, var(--home-forest-night) 78%, transparent) 42%, var(--home-forest-night) 70%);
}

.home-hero-content {
    position: relative;
    z-index: 2;
    padding-top: 120px;
    padding-bottom: 32px;
}

.home-version {
    display: inline-block;
    margin-bottom: 18px;
    padding: 5px 14px;
    border: 1px solid var(--home-line);
    border-radius: 999px;
    color: var(--home-soft-text);
    font-size: 0.85rem;
    font-weight: 600;
}

.home-title {
    max-width: 14ch;
    margin: 0;
    color: var(--home-text);
    font-family: 'Big Shoulders Display', sans-serif;
    font-size: clamp(2.6rem, 11vw, 5.4rem);
    font-weight: 800;
    letter-spacing: -0.005em;
    line-height: 0.95;
}

.home-lead {
    max-width: 52ch;
    margin: 22px 0 0;
    color: var(--home-soft-text);
    font-size: 1.08rem;
    line-height: 1.6;
}

/* Early access: one panel with the heading and the "Open app" button. */
.home-start {
    max-width: 460px;
    margin-top: 32px;
    padding: 20px 22px 22px;
    border: 1px solid var(--home-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--home-forest-night) 55%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.home-start-title {
    margin: 0 0 14px;
    color: var(--home-text);
    font-family: 'Big Shoulders Display', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.home-open-app {
    display: block;
    padding: 15px 18px;
    border-radius: 10px;
    background: var(--home-button-background);
    color: var(--home-button-text);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.home-open-app:hover {
    background: var(--home-button-hover-background);
    color: var(--home-button-text);
    transform: translateY(-1px);
}

/* What is RPG-IRL?: the light band, the heading beside the text on
   larger screens. */
.home-about {
    padding: 64px 0 72px;
    background: var(--home-band-background);
    color: var(--home-band-text);
    scroll-margin-top: 70px;
}

.home-about-grid {
    display: grid;
    gap: 18px;
}

.home-about-title {
    margin: 0;
    color: var(--home-band-text);
    font-family: 'Big Shoulders Display', sans-serif;
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    font-weight: 800;
    line-height: 0.95;
}

.home-about-text p {
    max-width: 62ch;
    margin: 0;
    color: var(--home-band-soft-text);
    font-size: 1.08rem;
    line-height: 1.7;
}

.home-about-text p + p {
    margin-top: 16px;
}

/* The shared footer, on the forest green here. */
.home-page footer {
    background-color: var(--home-page-background) !important;
    border-color: var(--home-line) !important;
}

.home-page footer .muted,
.home-page footer .footer-link {
    color: var(--home-soft-text);
}

.home-page footer .footer-link:hover {
    color: var(--home-text);
}

/* Larger screens: the painting fills the first screen and the text lies on
   its darkened left, where the sky is calm. */
@media (min-width: 900px) {
    .home-hero {
        align-items: center;
        min-height: clamp(620px, calc(100svh - 70px), 900px);
    }

    .home-hero-picture {
        object-position: 68% center;
    }

    .home-hero::before {
        background:
            linear-gradient(90deg, color-mix(in srgb, var(--home-forest-night) 92%, transparent) 0%, color-mix(in srgb, var(--home-forest-night) 70%, transparent) 34%, transparent 64%),
            linear-gradient(0deg, color-mix(in srgb, var(--home-forest-night) 80%, transparent) 0%, transparent 30%);
    }

    .home-hero-content {
        width: 100%;
        padding-top: 40px;
        padding-bottom: 44px;
    }

    .home-title {
        max-width: 15ch;
        font-size: clamp(3.4rem, 5.6vw, 4.6rem);
    }

    .home-lead {
        margin-top: 18px;
    }

    /* The heading and the button side by side. */
    .home-start {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 0 24px;
        max-width: 520px;
        margin-top: 26px;
        padding: 18px 18px 18px 22px;
    }

    .home-start-title {
        margin: 0;
    }

    .home-about-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        gap: 48px;
    }
}

/* Phones: the painting only in the top part, so the hero and his shadow
   stay visible above the text, which is a little smaller, so the whole
   start fits the screen. */
@media (max-width: 599px) {
    .home-hero-picture {
        height: 58%;
        object-position: 70% center;
    }

    .home-hero::before {
        background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--home-forest-night) 85%, transparent) 50%, var(--home-forest-night) 58%);
    }

    .home-version {
        margin-bottom: 14px;
    }

    .home-lead {
        margin-top: 14px;
        font-size: 1rem;
        line-height: 1.55;
    }

    .home-start {
        margin-top: 22px;
        padding: 16px 16px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-nav-link,
    .home-open-app {
        transition: none;
    }
}
