/* ===========================================================================
   Mindspace - shared page hero

   One hero for /about-us, /services, /blog and /contact-us. Each page keeps
   its own words; the frame around them is identical everywhere.

   The four heroes used to be four separate builds of the same idea, each with
   a bordered panel on the right holding the logo mark. That panel is gone. A
   photograph now runs the full width and height of the section, and the copy
   sits on it behind a scrim that keeps the text readable.

   Loaded after the per-page sheet, so this file owns the hero outright.
   ========================================================================== */

body.about-page {
    --ms-hero-ground: #0f0f0f;
}

body.services-page,
body.contact-page {
    --ms-hero-ground: #080909;
}

body.blog-page {
    --ms-hero-ground: #070808;
}

.ms-hero {
    --ms-hero-gold: #a67c52;
    --ms-hero-line: rgba(166, 124, 82, 0.32);
    /* the page background the hero has to land on; set per page above */
    --ms-hero-ground: #080909;
    position: relative;
    z-index: 0;
    display: flex;
    align-items: flex-end;
    width: 100%;
    min-height: 620px;
    height: 92svh;
    max-height: 780px;
    margin: 0;
    padding: 136px 0 58px;
    overflow: hidden;
    isolation: isolate;
    color: #f5f2ea;
    background: #070808;
    font-family: "Satoshi", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- the photograph ------------------------------------------------ */

.ms-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

/* Oversized on purpose: the scroll parallax shifts it, and the overhang stops
   an empty edge sliding into view. */
.ms-hero__image {
    position: absolute;
    inset: -4%;
    display: block;
    width: 108%;
    height: 108%;
    object-fit: cover;
    object-position: 64% 46%;
    filter: grayscale(0.42) contrast(1.08) saturate(0.88) brightness(0.6);
}

.ms-hero__scrim,
.ms-hero__grid,
.ms-hero__glow,
.ms-hero__beam {
    position: absolute;
    display: block;
    pointer-events: none;
}

/* Reads dark under the copy on the left, opens up over the photograph on the
   right, then closes into the page colour along the bottom edge. */
.ms-hero__scrim {
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(90deg, rgba(6, 7, 7, 0.97) 0%, rgba(6, 7, 7, 0.9) 30%, rgba(6, 7, 7, 0.48) 62%, rgba(6, 7, 7, 0.76) 100%),
        linear-gradient(180deg, rgba(6, 7, 7, 0.92) 0%, rgba(6, 7, 7, 0.1) 26%, rgba(6, 7, 7, 0.08) 52%, var(--ms-hero-ground) 100%);
}

.ms-hero__glow {
    inset: 0;
    z-index: 1;
    background: radial-gradient(ellipse at 72% 42%, rgba(166, 124, 82, 0.3), transparent 38%);
    mix-blend-mode: screen;
}

.ms-hero__grid {
    inset: 0;
    z-index: 3;
    background-image:
        linear-gradient(rgba(166, 124, 82, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(166, 124, 82, 0.07) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(90deg, transparent, #000 36%, #000 80%, transparent);
    animation: msHeroGridDrift 14s linear infinite;
}

.ms-hero__beam {
    inset: 10% auto 8% 58%;
    z-index: 4;
    width: 11%;
    background: linear-gradient(90deg, transparent, rgba(245, 242, 234, 0.14), rgba(166, 124, 82, 0.3), transparent);
    filter: blur(20px);
    opacity: 0.4;
    mix-blend-mode: screen;
    transform: skewX(-18deg);
    animation: msHeroBeam 7s ease-in-out infinite alternate;
}

.ms-hero__beam--two {
    left: 76%;
    width: 7%;
    opacity: 0.24;
    transform: skewX(16deg);
    animation-duration: 8.6s;
}

@keyframes msHeroGridDrift {
    to {
        background-position: 52px 52px, 52px 52px;
    }
}

@keyframes msHeroBeam {
    from {
        filter: blur(20px);
    }

    to {
        filter: blur(27px);
    }
}

/* ---------- the copy ------------------------------------------------------ */

.ms-hero__inner {
    position: relative;
    z-index: 5;
    display: grid;
    gap: clamp(30px, 3vw, 46px);
    width: min(100% - 72px, 1490px);
    margin-inline: auto;
}

.ms-hero__content {
    max-width: 720px;
}

.ms-hero__content::before {
    display: block;
    width: min(100%, 420px);
    height: 1px;
    margin-bottom: 30px;
    background: linear-gradient(90deg, rgba(166, 124, 82, 0.75), transparent);
    content: "";
}

.ms-hero__kicker {
    margin: 0;
    color: var(--ms-hero-gold);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    line-height: 1.1;
    text-transform: uppercase;
}

.ms-hero__title {
    max-width: 100%;
    margin: 24px 0 0;
    color: #fffaf1;
    font-size: clamp(2.4rem, 3.6vw, 3.7rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.06;
}

/* One line per span - the reveal masks each line separately, so a line that
   wraps would break the effect. The type scale above keeps them on one line. */
.ms-hero__line {
    display: block;
    overflow: hidden;
}

.ms-hero__line > span {
    display: block;
}

.ms-hero__title em {
    color: var(--ms-hero-gold);
    font-style: italic;
    font-weight: 600;
}

.ms-hero__rule {
    display: block;
    width: 96px;
    height: 2px;
    margin: 28px 0 0;
    background: var(--ms-hero-gold);
    transform-origin: 0 50%;
}

.ms-hero__intro {
    max-width: 580px;
    margin: 30px 0 0;
    color: rgba(245, 242, 234, 0.74);
    font-size: 1rem;
    line-height: 1.76;
}

.ms-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.ms-hero__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 52px;
    padding: 0 26px;
    border: 1px solid rgba(166, 124, 82, 0.78);
    border-radius: 999px;
    color: #fff8ec;
    background: rgba(10, 11, 11, 0.44);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 220ms ease, background 220ms ease, border-color 220ms ease;
}

.ms-hero__button:hover {
    border-color: var(--ms-hero-gold);
    background: rgba(166, 124, 82, 0.16);
    transform: translateY(-2px);
}

.ms-hero__button--primary {
    border-color: transparent;
    color: #140e08;
    background: linear-gradient(135deg, #e2b77c, #a67c52);
}

.ms-hero__button--primary:hover {
    background: linear-gradient(135deg, #eec48c, #b98d5f);
}

.ms-hero__button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

/* ---------- optional stat rail (about) ------------------------------------ */

.ms-hero__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(100%, 720px);
    border-top: 1px solid var(--ms-hero-line);
    border-bottom: 1px solid rgba(166, 124, 82, 0.16);
}

.ms-hero__stat {
    display: grid;
    gap: 8px;
    min-height: 100px;
    padding: 20px 20px 16px 0;
    border-right: 1px solid rgba(166, 124, 82, 0.16);
}

.ms-hero__stat:last-child {
    border-right: 0;
}

.ms-hero__stat strong {
    color: #fffaf1;
    font-size: clamp(1.5rem, 1.8vw, 2.2rem);
    font-weight: 700;
    line-height: 1;
}

.ms-hero__stat span {
    color: rgba(245, 242, 234, 0.74);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-transform: uppercase;
}

/* ---------- responsive ---------------------------------------------------- */

@media (max-width: 1180px) {
    .ms-hero {
        padding-top: 126px;
    }

    .ms-hero__inner {
        width: min(100% - 44px, 1490px);
    }
}

@media (max-width: 860px) {
    .ms-hero {
        height: auto;
        max-height: none;
        min-height: 560px;
        padding: 112px 0 52px;
    }

    .ms-hero__inner {
        width: min(100% - 32px, 1490px);
    }

    .ms-hero__title {
        font-size: clamp(2rem, 7.6vw, 3.4rem);
    }

    .ms-hero__image {
        object-position: 58% 44%;
    }

    /* No room for a left-to-right scrim on a narrow screen - it has to read
       top to bottom instead, or the copy loses its ground. */
    .ms-hero__scrim {
        background: linear-gradient(180deg, rgba(6, 7, 7, 0.9) 0%, rgba(6, 7, 7, 0.58) 26%, rgba(6, 7, 7, 0.86) 62%, var(--ms-hero-ground) 100%);
    }

    .ms-hero__grid {
        mask-image: linear-gradient(180deg, transparent, #000 30%, #000 74%, transparent);
    }

    .ms-hero__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ms-hero__stat:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 560px) {
    .ms-hero {
        min-height: 520px;
    }

    .ms-hero__title {
        font-size: clamp(1.7rem, 7vw, 2.5rem);
    }

    .ms-hero__content::before {
        margin-bottom: 24px;
    }

    .ms-hero__actions {
        display: grid;
        gap: 12px;
    }

    .ms-hero__button {
        width: 100%;
    }

    .ms-hero__stat {
        min-height: 86px;
        padding-right: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ms-hero__grid,
    .ms-hero__beam {
        animation: none;
    }
}
