/* =========================================================================
   Homepage full-bleed hero
   ========================================================================= */
.hero-section {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;

    /* Full-bleed */
    width: 100%;
    min-height: clamp(560px, 88vh, 820px);

    /* Background image */
    background-color: var(--color-charcoal);            /* fallback colour */
    background-image: var(--hero-image, none);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;

    /* Text colour for contrast on image */
    color: var(--color-ivory);

    overflow: hidden;
    padding-block: clamp(4rem, 10vw, 8rem);
}

/* Overlay for legibility ------------------------------------------------ */
.hero-section__overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        115deg,
        rgba(23, 27, 29, 0.82) 0%,
        rgba(23, 27, 29, 0.62) 45%,
        rgba(59, 7, 11, 0.55) 100%
    );
}

.hero-section--dark .hero-section__overlay {
    background: linear-gradient(
        115deg,
        rgba(23, 27, 29, 0.92) 0%,
        rgba(23, 27, 29, 0.78) 55%,
        rgba(59, 7, 11, 0.72) 100%
    );
}

.hero-section--light .hero-section__overlay {
    background: linear-gradient(
        115deg,
        rgba(23, 27, 29, 0.55) 0%,
        rgba(23, 27, 29, 0.35) 55%,
        rgba(59, 7, 11, 0.35) 100%
    );
}

/* Content --------------------------------------------------------------- */
.hero-section__inner {
    position: relative;
    z-index: 1;
    width: 100%;
}

.hero-section__content {
    max-width: 46rem;
}

.hero-section__eyebrow {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--color-burgundy-soft);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero-section__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.08;
    letter-spacing: -0.01em;
    color: var(--color-white);
    margin-bottom: 1.5rem;
    text-wrap: balance;
}

.hero-section__text {
    font-family: var(--font-body);
    font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
    line-height: 1.65;
    color: rgba(250, 249, 246, 0.9);
    max-width: 38rem;
    margin-bottom: 2.5rem;
    text-wrap: pretty;
}

/* Actions --------------------------------------------------------------- */
.hero-section__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-section__actions .btn--primary {
    background: var(--color-burgundy);
    color: var(--color-white);
    border-color: var(--color-burgundy);
}
.hero-section__actions .btn--primary:hover {
    background: var(--color-burgundy-dark);
    border-color: var(--color-burgundy-dark);
}

.hero-section__actions .btn--outline-light {
    background: transparent;
    color: var(--color-ivory);
    border: 1px solid rgba(250, 249, 246, 0.55);
}
.hero-section__actions .btn--outline-light:hover {
    background: rgba(250, 249, 246, 0.08);
    border-color: var(--color-ivory);
}

/* Thin editorial rule at the bottom -------------------------------------- */
.hero-section__rule {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(250, 249, 246, 0.35) 20%,
        rgba(250, 249, 246, 0.35) 80%,
        transparent
    );
    z-index: 1;
}

/* =========================================================================
   Motion system
   -------------------------------------------------------------------------
   All animations gate on prefers-reduced-motion and (for JS-driven reveals)
   on the presence of .is-revealed.
   ========================================================================= */

/* --- Shared timing tokens ------------------------------------------------ */
:root {
    --motion-fast:   220ms;
    --motion-base:   420ms;
    --motion-slow:   640ms;
    --motion-ease:   cubic-bezier(0.22, 0.61, 0.36, 1);
    --motion-rise:   translateY(14px);
    --motion-rise-sm: translateY(8px);
}

/* -------------------------------------------------------------------------
   1. Scroll-reveal primitives
   ------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: var(--motion-rise);
    transition:
        opacity var(--motion-base) var(--motion-ease),
        transform var(--motion-base) var(--motion-ease);
    will-change: opacity, transform;
}

.reveal.is-revealed {
    opacity: 1;
    transform: none;
}

/* Stagger via inline custom property — no per-child CSS needed */
.reveal[style*="--reveal-delay"] {
    transition-delay: var(--reveal-delay, 0ms);
}

/* Variant: rise from left / right (for split sections) */
.reveal--left  { transform: translateX(-14px); }
.reveal--right { transform: translateX(14px); }
.reveal--scale { transform: scale(0.98); }
.reveal--left.is-revealed,
.reveal--right.is-revealed,
.reveal--scale.is-revealed { transform: none; }

/* -------------------------------------------------------------------------
   2. Hero text entry (homepage full-bleed hero)
   ------------------------------------------------------------------------- */
@keyframes heroRise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

.hero-section__eyebrow,
.hero-section__title,
.hero-section__text,
.hero-section__actions {
    opacity: 0;
    animation: heroRise var(--motion-slow) var(--motion-ease) forwards;
}
.hero-section__eyebrow { animation-delay: 120ms; }
.hero-section__title   { animation-delay: 220ms; }
.hero-section__text    { animation-delay: 340ms; }
.hero-section__actions { animation-delay: 460ms; }

/* Background: very slow, barely perceptible zoom-out */
@keyframes heroZoom {
    from { transform: scale(1.04); }
    to   { transform: scale(1); }
}
.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    background-size: cover;
    background-position: center;
    z-index: -1;
    animation: heroZoom 6s var(--motion-ease) forwards;
    will-change: transform;
}

/* -------------------------------------------------------------------------
   3. Underline sweep on nav + inline links
   ------------------------------------------------------------------------- */
.primary-nav__link::after {
    transition: transform var(--motion-base) var(--motion-ease);
}

/* For text links inside prose, use a subtle background-size sweep */
.link-sweep {
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size var(--motion-base) var(--motion-ease);
}
.link-sweep:hover,
.link-sweep:focus-visible {
    background-size: 100% 1px;
}

/* -------------------------------------------------------------------------
   4. Button micro-interactions
   ------------------------------------------------------------------------- */
.btn {
    transition:
        background var(--motion-fast) var(--motion-ease),
        color var(--motion-fast) var(--motion-ease),
        border-color var(--motion-fast) var(--motion-ease),
        transform var(--motion-fast) var(--motion-ease),
        box-shadow var(--motion-fast) var(--motion-ease);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -18px rgba(23, 27, 29, 0.45);
}
.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Arrow icon nudges right on hover (used inside "Learn more" links) */
.btn .icon--sm,
.service-card__more .icon {
    transition: transform var(--motion-fast) var(--motion-ease);
}
.btn:hover .icon--sm,
.service-card:hover .service-card__more .icon {
    transform: translateX(3px);
}

/* -------------------------------------------------------------------------
   5. Card hover lift (service, team, office, feature)
   ------------------------------------------------------------------------- */
.service-card,
.team-card,
.office-card,
.feature,
.trust-card,
.vm-card {
    transition:
        transform var(--motion-base) var(--motion-ease),
        box-shadow var(--motion-base) var(--motion-ease),
        border-color var(--motion-base) var(--motion-ease);
}

.service-card:hover,
.team-card:hover,
.office-card:hover,
.feature:hover,
.trust-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 44px -30px rgba(23, 27, 29, 0.4);
}

/* Subtle border tint on hover — burgundy hairline */
.service-card:hover { border-color: rgba(122, 17, 24, 0.35); }
.team-card:hover    { border-color: rgba(122, 17, 24, 0.25); }
.office-card:hover  { border-color: rgba(122, 17, 24, 0.25); }

/* Media zoom inside cards (very restrained: 1.03) */
.service-card img,
.team-card img,
.office-card img,
.vm-card img {
    transition: transform var(--motion-slow) var(--motion-ease);
    will-change: transform;
}
.team-card:hover img,
.office-card:hover img {
    transform: scale(1.03);
}

/* -------------------------------------------------------------------------
   6. Section headings — soft fade for eyebrow + underline accent
   ------------------------------------------------------------------------- */
.section-heading .eyebrow {
    position: relative;
    display: inline-block;
}

.section-heading--center .eyebrow::after {
    content: "";
    display: block;
    width: 32px;
    height: 1px;
    background: var(--color-burgundy);
    margin: 0.6rem auto 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--motion-slow) var(--motion-ease) 120ms;
}
.section-heading--center.reveal.is-revealed .eyebrow::after {
    transform: scaleX(1);
}

/* -------------------------------------------------------------------------
   7. Process steps — number dot pulse on reveal
   ------------------------------------------------------------------------- */
@keyframes stepPulse {
    0%   { box-shadow: 0 0 0 0 rgba(122, 17, 24, 0.35); }
    70%  { box-shadow: 0 0 0 12px rgba(122, 17, 24, 0); }
    100% { box-shadow: 0 0 0 0 rgba(122, 17, 24, 0); }
}
.process-step.reveal.is-revealed .process-step__number {
    animation: stepPulse 900ms var(--motion-ease) 200ms 1;
}

/* -------------------------------------------------------------------------
   8. Client logos — gentle fade-in on load
   ------------------------------------------------------------------------- */
.logo-grid__item {
    transition: border-color var(--motion-base) var(--motion-ease),
                background var(--motion-base) var(--motion-ease);
}
.logo-grid__item:hover {
    border-color: rgba(122, 17, 24, 0.25);
    background: #fff;
}

/* -------------------------------------------------------------------------
   9. Focus ring soft pulse (accessibility-safe, never hidden)
   ------------------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--color-burgundy);
    outline-offset: 3px;
    transition: outline-offset var(--motion-fast) var(--motion-ease);
}
:focus-visible:active {
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   10. Reduced motion — collapse everything
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .hero-section__eyebrow,
    .hero-section__title,
    .hero-section__text,
    .hero-section__actions {
        opacity: 1;
        animation: none;
    }

    .hero-section::before {
        animation: none;
        transform: none;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .btn:hover,
    .service-card:hover,
    .team-card:hover,
    .office-card:hover,
    .feature:hover,
    .trust-card:hover {
        transform: none;
        box-shadow: none;
    }

    .team-card:hover img,
    .office-card:hover img {
        transform: none;
    }

    .process-step.reveal.is-revealed .process-step__number {
        animation: none;
    }
}