/* ==========================================================
   HOME PAGE
   Loaded only by Views/Home/Index.cshtml via ~/bundles/home-css.
   Site-wide components stay in style.css / mobile_style.css.
   ========================================================== */

/* ---- Hero ----
   Height follows the photo's ratio (ImagePreset.HomeHero: 1920x835, 4:5 crop on phones)
   so the angled corner and gradient baked into the photo's bottom edge are never cropped. */
.home-hero {
    position: relative;
    /* Explicit width: with width:auto, max-height is carried through aspect-ratio into a
       max-width, leaving a gap on the right on wide-but-short windows. */
    width: 100%;
    aspect-ratio: 1920 / 835;
    max-height: calc(100vh - var(--nav-h));
    overflow: hidden;
    background-color: #1c2125;
}

.home-hero picture {
    display: block;
    height: 100%;
}

.home-hero__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom; /* when max-height applies, trim the sky, keep the corner */
}

/* Old site's rotating badge (RotateIcon1 / 2): a broken ring spins over a soft glow;
   on hover the ring snaps back half a turn. Text size follows the badge (cqw). */
.home-hero__contact {
    position: absolute;
    right: 10%;
    bottom: 20%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: clamp(112px, 10%, 220px);
    aspect-ratio: 1;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    container-type: inline-size;
}

.home-hero__contact-ring,
.home-hero__contact-glow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.home-hero__contact-ring {
    animation: home-spin 3s linear infinite;
}

.home-hero__contact:hover .home-hero__contact-ring,
.home-hero__contact:focus-visible .home-hero__contact-ring {
    animation: home-spin-back 0.5s linear;
}

.home-hero__contact-text {
    position: relative;
    font-family: "Sui Generis", Arial, sans-serif;
    font-size: 9.5cqw;
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-align: center;
}

.home-hero__contact:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

@keyframes home-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes home-spin-back {
    from {
        transform: rotate(180deg);
    }

    to {
        transform: rotate(0deg);
    }
}

/* ---- Headquarter gallery ----
   Same ratio as the processed photos (ImagePreset.HomeHq: 5:2, 4:3 crop on phones). */
.home-hq {
    position: relative;
    width: 100%; /* see .home-hero */
    aspect-ratio: 5 / 2;
    max-height: 820px;
    background-color: #1c2125;
}

.home-hq picture {
    display: block;
    height: 100%;
}

/* Keeps the white title readable on bright photos. */
.home-hq::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    height: 50%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 100%);
    content: "";
    pointer-events: none;
}

.home-hq__title {
    position: absolute;
    bottom: 64px;
    left: clamp(24px, 15vw, 260px);
    z-index: 2;
    margin: 0;
    color: #fff;
    font-family: "Sui Generis", Arial, sans-serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 3px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

.home-hq .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background-color: #fff;
    opacity: 0.55;
}

.home-hq .swiper-pagination-bullet-active {
    background-color: #ffed00;
    opacity: 1;
}

/* ---- Profile ---- */
.home-profile__text p {
    margin-bottom: 24px;
    color: #222;
    font-size: 18px;
    line-height: 1.75;
}

.home-profile__text strong {
    color: #111;
    font-weight: 700;
}

.home-facts {
    margin: 0;
    border-top: 4px solid #ffed00;
    font-size: 15px;
}

.home-facts dt {
    color: #555;
    font-weight: 500;
}

.home-facts dd {
    color: #111;
    font-weight: 700;
}

.home-profile__more p {
    margin-bottom: 12px;
    color: #333;
    font-size: 15px;
    line-height: 1.8;
}

/* ---- Group company ---- */
/* Angled frame drawn in CSS: outer lines, then two thick slashes joined by a thin line. */
.home-frame {
    display: flex;
    align-items: flex-start;
    height: 34px;
}

.home-frame--top {
    margin-top: -8px; /* outer lines sit on the title baseline */
}

.home-frame--bottom {
    transform: scaleY(-1);
}

.home-frame__line {
    flex: 1 1 0%;
    height: 2px;
    background-color: #111;
}

.home-frame__notch {
    flex: 0 0 auto;
    width: clamp(280px, 54%, 600px);
    height: 100%;
    background-color: #111;
    clip-path: polygon(0 0, 12px 0, 40px calc(100% - 1.5px), calc(100% - 40px) calc(100% - 1.5px), calc(100% - 12px) 0, 100% 0, calc(100% - 28px) 100%, 28px 100%);
}

.home-brands {
    list-style: none;
}

/* Each row is a single artwork; the dark version cross-fades in on hover. */
.home-brand {
    display: grid;
}

.home-brand__img {
    grid-area: 1 / 1;
    width: 100%;
    height: auto;
    transition: opacity 200ms ease;
}

.home-brand__img--hover,
.home-brand:hover .home-brand__img,
.home-brand:focus-visible .home-brand__img {
    opacity: 0;
}

.home-brand:hover .home-brand__img--hover,
.home-brand:focus-visible .home-brand__img--hover {
    opacity: 1;
}

.home-brand:focus-visible {
    outline: 3px solid #ffed00;
    outline-offset: 4px;
}

/* ---- Since & key figures ---- */
.home-since__track {
    padding-top: 8px;
    border-top: 1px solid #111;
}

.home-since__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    padding: 0 2px;
    background: linear-gradient(90deg, #000 0%, #4a4a4a 30%, #d6d6d6 72%, #fff 100%);
}

.home-since__year {
    font-family: "Sui Generis", Arial, sans-serif;
    font-size: 32px;
    line-height: 1;
}

.home-since__year--start {
    color: #fff;
}

.home-since__year--end {
    color: #111;
}

.home-since__marker {
    position: relative;
    height: 22px;
    border-bottom: 1px solid #111;
}

/* Arrow starts under the first year; when the block scrolls into view
   (fun.js adds .is-visible via data-reveal) it slides under the current year over 1.5s.
   --since-from / --since-to are the year centres, set by the script in Index.cshtml. */
.home-since__marker::after {
    position: absolute;
    top: 6px;
    left: calc(var(--since-from, 40px) - 8px);
    border-top: 9px solid #111;
    border-right: 8px solid transparent;
    border-left: 8px solid transparent;
    content: "";
    transition: left 1.5s ease-out;
}

.home-since__marker.is-visible::after {
    left: calc(var(--since-to, calc(100% - 55px)) - 8px);
}

.home-stat__num {
    display: block;
    color: #dcbc6e;
    font-family: "Sui Generis", Arial, sans-serif;
    /* Fluid so the widest figure (e.g. 6,913,500) always fits its grid column. */
    font-size: clamp(24px, 4.8vw, 60px);
    font-weight: 400;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.home-stat__label {
    margin: 4px 0 0;
    color: #212529;
    font-family: "Sui Generis", Arial, sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
    text-transform: uppercase;
}

/* ---- Certificate ---- */
.home-divider {
    margin: 0;
    border: 0;
    border-top: 1px solid #555;
    opacity: 1;
}

.home-cert__eyebrow {
    color: #b79332;
}

.home-cert__subtitle {
    color: #111;
    font-family: "Sui Generis", Arial, sans-serif;
    font-size: 30px;
    line-height: 1.2;
}

.home-cert__list {
    list-style: none;
}

.home-cert__list li {
    position: relative;
    padding-left: 18px;
    color: #333;
    font-size: 14px;
    line-height: 2;
}

.home-cert__list li::before {
    position: absolute;
    top: 0.85em;
    left: 0;
    width: 8px;
    height: 4px;
    background-color: #ffed00;
    content: "";
}

/* ---- Patent ---- */
/* Faint "Patents approved 195" script behind the text; scaled to the block width, never stretched.
   --patent-bg is set inline by Index.cshtml so the URL carries the ?v= date parameter. */
.home-patent {
    background-image: var(--patent-bg, url("/Images/home/patent/patents-approved.png"));
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% auto;
}

/* ==========================================================
   Home page: responsive
   ========================================================== */
@media (max-width: 991.98px) {
    .home-stat__label {
        font-size: 20px;
    }
}

@media (max-width: 767.98px) {
    /* Phones get the 4:5 crop, which loses the photo's angled corner, so redraw it here. */
    .home-hero {
        aspect-ratio: 4 / 5;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 30% 100%, 26% calc(100% - 18px), 0 calc(100% - 18px));
    }

    /* The old site hides the badge on phones; we keep a smaller one. */
    .home-hero__contact {
        right: 6%;
        bottom: 14%;
        width: 96px;
    }

    .home-hq {
        aspect-ratio: 4 / 3;
    }

    .home-hq__title {
        bottom: 44px;
        left: 20px;
        font-size: 24px;
        letter-spacing: 2px;
    }

    .home-profile__text p {
        font-size: 16px;
    }

    .home-since__year {
        font-size: 26px;
    }

    .home-stat__label {
        font-size: 16px;
    }

    .home-cert__subtitle {
        font-size: 24px;
    }
}

@media (max-width: 575.98px) {
    /* The title is wider than the notch here, so drop the frame below it. */
    .home-frame--top {
        margin-top: 8px;
    }

    .home-stat__label {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-brand__img,
    .home-since__marker::after {
        transition: none;
    }

    .home-hero__contact-ring,
    .home-hero__contact:hover .home-hero__contact-ring,
    .home-hero__contact:focus-visible .home-hero__contact-ring {
        animation: none;
    }
}
