/* Keep these rules scoped to the homepage; inner pages retain their layout. */
.page-homepage {
    color: #fff;
    background: #063343;
}
.page-homepage [hidden] { display: none !important; }
.page-homepage #preloader { display: none; }
.page-homepage a { color: #fff; }
.page-homepage a:focus-visible,
.page-homepage button:focus-visible,
.page-homepage video:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 5px;
    box-shadow: 0 0 0 7px #063343;
}
.skip-link {
    position: fixed;
    top: 8px;
    left: 16px;
    z-index: 2000;
    padding: 12px 20px;
    background: #063343;
    transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
.page-homepage #main-menu {
    position: fixed;
    top: 0;
    z-index: 100;
    min-height: 88px;
    margin: 0;
    background: rgba(3, 39, 52, .94);
}
.page-homepage #main-menu .navbar-brand img { max-width: 180px !important; }
.page-homepage .navbar-header { height: 84px; }
.page-homepage .navbar-links { padding-top: 14px; }
.page-homepage .navbar-nav > li > a { font-weight: 600; }
.page-homepage .section { background: #063343; }
.page-homepage .section-1 {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 120px 24px 64px !important;
    background: linear-gradient(rgba(3, 30, 42, .26), rgba(3, 30, 42, .26)),
        #063343 url('../img/Elman-1r.jpg') center bottom / cover no-repeat;
}
.page-homepage .section-1 .section-wrapper { margin: 0 auto; }
.page-homepage h1 {
    max-width: 1050px;
    margin: 0 auto;
    font-size: clamp(30px, 4.2vw, 60px);
    line-height: 1.2;
    font-weight: 400;
    text-shadow: 0 2px 12px #032938;
}
.page-homepage .section-1 .btn-down {
    width: 58px !important;
    height: 58px !important;
    margin: 36px auto 12px !important;
    background: rgba(3, 39, 52, .65);
    border-color: #fff;
    text-indent: 0;
}
.page-homepage .btn-down::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 17px;
    left: 20px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}
.page-homepage .section-2 { scroll-margin-top: 88px; }
.page-homepage .competence-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}
.page-homepage .competence-artwork { height: 100%; }
.page-homepage .section-3 {
    scroll-margin-top: 88px;
    background: linear-gradient(105deg, #023040 25%, #54737d 75%, #dde4e6);
}
.video-section-content {
    padding: 108px 24px 46px;
    text-align: center;
}
.company-player {
    position: relative;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(255, 255, 255, .25);
    background: #0b131b;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .22);
}
.company-player video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.video-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    min-height: 56px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 4px;
    color: #fff;
    background: rgba(3, 39, 52, .95);
    font: 600 16px/1.4 'Raleway', sans-serif;
    white-space: nowrap;
}
.video-play:hover { background: #a91320; }
.video-play-icon {
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #fff;
}
.page-homepage .competence-label,
#azienda-page.page-homepage .process-label {
    position: relative;
    margin: 18px auto 0;
    color: #fff;
    font-size: clamp(18px, 1.6vw, 26px);
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 1px 5px #063343;
}
/* Display only the original emblem and grid, excluding the rasterized text.
   Use the reduced artwork; the original remains in img/Elman-3.jpg. */
.process-illustration {
    width: 100%;
    max-width: 920px;
    margin: 6px auto 0;
    aspect-ratio: 64 / 7;
    background: url('../img/Elman-3r.jpg') center 72.4138% / 100% auto no-repeat;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 28%, rgba(0, 0, 0, .7) 55%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, #000 28%, rgba(0, 0, 0, .7) 55%, transparent 75%);
}
.page-homepage .process-label { margin-top: 6px; }
.page-homepage .video-error { color: #fff; font-size: 16px; }
.video-error a { text-decoration: underline; }
.page-homepage #nav-footer { z-index: 90; pointer-events: none; }
.page-homepage #nav-footer a { pointer-events: auto; }
.page-homepage #fp-nav a { width: 28px; height: 28px; }
.page-homepage #fp-nav li { width: 28px; height: 28px; }
.page-homepage #fp-nav span { border-color: #fff; }
.page-homepage #fp-nav .fp-tooltip { background: #063343; padding: 3px 8px; }
.page-homepage #cookie-alert .bottom-last { padding: 10px 16px; }
.page-homepage #cookie-alert p { line-height: 1.5; font-size: 14px; }
.page-homepage #cookie-alert a { display: inline-block; padding: 12px; }
.page-homepage #cookie-alert .accetta-cookie { margin: 4px 8px; }

.competence-mobile-copy {
    display: block;
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    max-width: 680px;
    padding: 24px;
    margin: auto;
    text-align: center;
}
.competence-mobile-copy h2 { line-height: 1.3; }
.competence-mobile-copy ul {
    display: block;
    padding: 0;
    margin: 20px 0;
    list-style: none;
    font-size: 16px;
    line-height: 1.7;
}
.competence-mobile-copy li { display: inline; white-space: nowrap; }
.competence-mobile-copy li + li::before { content: "·"; margin: 0 .5em; }
.page-homepage .competence-mobile-copy p { color: #fff; font-size: 16px; line-height: 1.6; }

@media (min-width: 1024px) and (min-height: 700px) {
    .homepage-paged .section-2 {
        display: flex;
        flex-direction: column;
        padding: 88px 24px calc(100px + var(--cookie-height, 0px));
    }
    .homepage-paged .competence-artwork {
        flex: 1 1 0;
        min-height: 0;
        height: auto;
    }
    .homepage-paged .competence-image { height: 100%; }
    .homepage-paged .competence-mobile-copy {
        flex: 0 0 auto;
        width: 100%;
        max-width: 1100px;
        margin: 0 auto;
        padding: 12px 16px 0;
    }
    .homepage-paged .competence-mobile-copy h2 { margin: 8px 0 12px; }
    .homepage-paged .competence-mobile-copy ul { margin: 0; font-size: 14px; line-height: 1.6; }
    .homepage-paged .company-player {
        max-width: min(920px, calc((100vh - 360px - var(--cookie-height, 0px)) * 16 / 9));
    }
}
@media (max-width: 1023px), (max-height: 699px) {
    .page-homepage .competence-artwork { height: auto; }
    .page-homepage .section { height: auto; overflow: visible; }
    .page-homepage .section-2 { padding: 32px 0; }
    .page-homepage .section-2::before { display: none; }
    .page-homepage .section-3 { overflow: hidden; }
    .video-section-content { padding-top: 40px; padding-bottom: 48px; }
    .page-homepage #nav-footer { display: none; }
    .page-homepage #cookie-alert { position: sticky; bottom: 0; }
}
@media (max-width: 767px) {
    /* Resizing the hero after consent must not move the viewport down the page. */
    .page-homepage { overflow-anchor: none; }
    .page-homepage #main-menu { min-height: 72px; background: #032734; }
    .page-homepage .navbar-header { height: 72px; z-index: 8; }
    .page-homepage .navbar-brand { padding: 16px; width: auto; height: auto; z-index: 9; }
    .page-homepage #main-menu .navbar-brand img { max-width: 140px !important; margin: 0; }
    .page-homepage .navbar-toggle { width: 48px; height: 44px; margin: 14px 16px 14px 0; }
    .page-homepage .navbar-toggle .icon-bar { background: #fff; }
    .page-homepage .navbar-links { padding-top: 0; max-height: calc(100svh - 72px); overflow-y: auto; }
    .page-homepage .navbar-nav > li > a { padding: 14px 16px; min-height: 48px; }
    .page-homepage .section-1 {
        min-height: calc(100vh - var(--cookie-height, 0px));
        min-height: calc(100svh - var(--cookie-height, 0px));
        min-height: calc(100dvh - var(--cookie-height, 0px));
        align-items: flex-start;
        padding: 152px 20px 48px !important;
        /* Keep the facade logo in view when the wide photograph is cropped. */
        background-position: center, 26% bottom;
    }
    .page-homepage .section-1 h1 { font-size: clamp(26px, 7vw, 30px); }
    .page-homepage .section-1 .btn-down { margin-top: 24px !important; }
    .page-homepage .section-1 .container { width: 100%; padding: 0; }
    .page-homepage .competence-artwork {
        position: relative;
        height: auto;
        aspect-ratio: 1.85;
        overflow: hidden;
    }
    .page-homepage .competence-artwork .competence-image {
        position: absolute;
        width: 140%;
        max-width: none;
        height: auto;
        left: -20%;
        top: -26%;
    }
    .page-homepage .competence-mobile-copy { padding: 20px 20px 16px; }
    #azienda-page.page-homepage .competence-mobile-copy h2 { font-size: 21px !important; }
    .page-homepage .competence-mobile-copy ul { font-size: 11px; margin: 16px 0; }
    #azienda-page.page-homepage .competence-mobile-copy p { font-size: 12px; line-height: 1.5; }
    .page-homepage .section-2, .page-homepage .section-3 { scroll-margin-top: 72px; }
    .video-section-content { padding-left: 16px; padding-right: 16px; }
    .page-homepage .competence-label { margin-top: 48px; }
    .process-illustration {
        width: calc(100% + 32px);
        margin-left: -16px;
        margin-right: -16px;
        height: 92px;
        aspect-ratio: auto;
        background-size: 840px auto;
    }
    .page-homepage #cookie-alert p { font-size: 13px; }
    .page-homepage #cookie-alert .bottom-last { padding: 6px 12px; }
}
@media (max-width: 767px) and (max-height: 500px) {
    .page-homepage .section-1 { padding: 88px 20px 12px !important; }
    .page-homepage .section-1 h1 { font-size: 22px; }
    .page-homepage .section-1 .btn-down { margin-top: 12px !important; }
}
@media (prefers-reduced-motion: reduce) {
    .page-homepage *, .page-homepage *::before, .page-homepage *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
@media (min-width: 600px) and (max-height: 500px) {
    .company-player { max-width: calc((100svh - 144px) * 16 / 9); }
}
/* Natural-scroll layouts above the mobile-menu breakpoint still need a
   language switch: the fixed desktop footer is hidden in these layouts. */
@media (min-width: 768px) and (max-width: 1023px),
       (min-width: 768px) and (max-height: 699px) {
    .page-homepage #main-menu { min-height: 132px; }
    .page-homepage .navbar-links { position: static; }
    .page-homepage .navbar-lang {
        display: flex !important;
        justify-content: center;
        position: absolute;
        top: 88px;
        left: 0;
        width: 100%;
        height: 44px;
        margin: 0;
        padding: 0 !important;
        background: #032734;
    }
    .page-homepage .navbar-lang > li { float: none; width: auto; }
    .page-homepage .navbar-lang > li > a { min-width: 56px; padding: 12px; }
    .page-homepage .section-1 { padding-top: 156px !important; }
    .page-homepage .section-2,
    .page-homepage .section-3 { scroll-margin-top: 132px; }
}
@media (min-width: 768px) and (max-height: 500px) {
    .company-player { max-width: calc((100svh - 188px) * 16 / 9); }
}
