/* UPM EBS landing page.
 *
 * Served as a plain static file (not an Odoo asset bundle) on purpose: bundles are passed through
 * rtlcss for Arabic, which would mirror the physical positions below. The background artwork has
 * a fixed composition (logo top-left, "EBS" title top-right) in both languages, so the content
 * column is positioned physically under the baked-in title; text inside it is centred and works
 * in either direction.
 */

@font-face {
    font-family: "UPM DIN";
    src: url("../fonts/DINNextLTW23-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "UPM DIN";
    src: url("../fonts/DINNextLTW23-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

:root {
    --upm-blue: #004b72;
    --upm-gold: #fec35e;
    --upm-ink: #ffffff;
    --upm-ink-soft: rgba(255, 255, 255, 0.82);
    --upm-ink-faint: rgba(255, 255, 255, 0.64);
    --upm-tile-hover: rgba(255, 255, 255, 0.12);

    /* Scene geometry. The artwork is 1462 x 1073 and covers the viewport from its top-left
       corner, so its rendered size is the larger of the two fits. */
    --scene-w: max(100vw, 136.25vh);
    --scene-h: max(73.39vw, 100vh);
    /* Centre and bottom of the baked-in "EBS / Enterprise Business System" title, as shares of
       the artwork's width and height. */
    --title-x: 0.677;
    --title-bottom: 0.285;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body.upm-landing {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: var(--upm-blue);
    color: var(--upm-ink);
    font-family: "UPM DIN", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.upm-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Background artwork ------------------------------------------------------------------ */

.upm-landing__scene {
    position: fixed;
    inset: 0;
    background: var(--upm-blue) url("../img/ebs_scene.jpg") left top / cover no-repeat;
    background-image: image-set(
        url("../img/ebs_scene.webp") type("image/webp"),
        url("../img/ebs_scene.jpg") type("image/jpeg")
    );
}

/* ---- Content column, under the baked-in title ---------------------------------------------- */

.upm-landing__column {
    position: absolute;
    top: calc(var(--scene-h) * var(--title-bottom));
    left: calc(var(--scene-w) * var(--title-x));
    transform: translateX(-50%);
    width: min(640px, 46vw);
    min-height: calc(100vh - var(--scene-h) * var(--title-bottom));
    display: flex;
    flex-direction: column;
    padding: clamp(4px, 1.5vh, 20px) 0 clamp(12px, 2.5vh, 24px);
    text-align: center;
}

.upm-landing__main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upm-landing__rule {
    display: block;
    width: 36px;
    height: 3px;
    border-radius: 2px;
    background: var(--upm-gold);
    margin-bottom: clamp(12px, 2vh, 20px);
}

.upm-landing__title {
    margin: 0;
    font-size: clamp(24px, 2.2vw, 32px);
    font-weight: 500;
    line-height: 1.25;
}

.upm-landing__lead {
    max-width: 34em;
    margin: clamp(8px, 1.4vh, 14px) 0 0;
    font-size: clamp(15px, 1.15vw, 17px);
    color: var(--upm-ink-soft);
}

.upm-landing__signin {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin-top: clamp(16px, 2.6vh, 28px);
    padding: 0 30px;
    border-radius: 12px;
    background: #ffffff;
    color: var(--upm-blue);
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 12px 28px -12px rgba(0, 18, 36, 0.6);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.upm-landing__signin:hover {
    background: #eef6fb;
    transform: translateY(-1px);
    box-shadow: 0 16px 32px -12px rgba(0, 18, 36, 0.7);
}

.upm-landing__signin-arrow {
    flex: none;
}

[dir="rtl"] .upm-landing__signin-arrow {
    transform: scaleX(-1);
}

/* ---- Service shortcuts -------------------------------------------------------------------- */

.upm-landing__services {
    width: 100%;
    margin-top: clamp(20px, 3.6vh, 40px);
}

.upm-tiles {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.upm-tile__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 8px 2px 6px;
    border-radius: 14px;
    color: var(--upm-ink);
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.upm-tile__link:hover {
    background: var(--upm-tile-hover);
    transform: translateY(-2px);
}

.upm-tile__icon {
    display: grid;
    place-items: center;
    width: clamp(44px, 6.4vh, 54px);
    height: clamp(44px, 6.4vh, 54px);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 18px -8px rgba(0, 18, 36, 0.65);
}

.upm-tile__icon img {
    display: block;
    width: 58%;
    height: 58%;
}

.upm-tile__label {
    font-size: 12.5px;
    line-height: 1.25;
    color: var(--upm-ink-soft);
}

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

.upm-landing__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 20px;
    margin-top: auto;
    padding-top: 24px;
    font-size: 13px;
    color: var(--upm-ink-faint);
}

.upm-landing__footer a {
    color: var(--upm-ink-soft);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.upm-landing__footer a:hover {
    color: var(--upm-ink);
    border-bottom-color: currentColor;
}

/* ---- Focus and motion --------------------------------------------------------------------- */

.upm-landing a:focus-visible {
    outline: 3px solid var(--upm-gold);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .upm-landing__signin,
    .upm-tile__link {
        transition: none;
    }

    .upm-landing__signin:hover,
    .upm-tile__link:hover {
        transform: none;
    }
}

/* ---- Phones, tablets and portrait windows ------------------------------------------------
 * Under the title the artwork is too narrow to hold the content, so it becomes a banner at
 * the top and the content flows below it on the same blue.
 */

@media (max-width: 991.98px), (max-aspect-ratio: 6/5) {
    .upm-landing__scene {
        position: relative;
        inset: auto;
        width: 100%;
        aspect-ratio: 1462 / 1073;
        background-size: cover;
    }

    /* Fade the desk photograph into the page colour so the banner has no hard edge. */
    .upm-landing__scene::after {
        content: "";
        position: absolute;
        inset: auto 0 0 0;
        height: 38%;
        background: linear-gradient(to bottom, rgba(0, 75, 114, 0), var(--upm-blue) 92%);
    }

    .upm-landing__column {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: auto;
        max-width: 640px;
        min-height: 0;
        margin: -6vw auto 0;
        padding: 0 16px 24px;
    }

    .upm-landing__title {
        font-size: clamp(22px, 5.6vw, 30px);
    }

    .upm-landing__lead {
        font-size: 15px;
    }

    .upm-landing__signin {
        width: 100%;
        max-width: 360px;
        justify-content: center;
    }

    .upm-landing__services {
        margin-top: 28px;
    }

    .upm-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px 4px;
    }

    .upm-tile__icon {
        width: 52px;
        height: 52px;
    }

    .upm-landing__footer {
        margin-top: 32px;
    }
}
