/*
 * Homepage-only styles (reference implementation).
 * Shared tokens: design-tokens.css | Primitives: arpm-components.css | Layout: arpm-layout.css
 * Docs: ai_rough_work/DESIGN_SYSTEM.md | Edit map: Components/Home/README.md
 */

.home-page {
    --home-section-gap: calc(var(--space-section-gap) / 2);
    background: var(--color-bg);
    color: var(--color-text-heading);
    max-width: 100%;
}

/* -- Home intro hero - full-bleed background band + foreground copy -- */
.home-hero-intro {
    position: relative;
    overflow: hidden;
    padding-top: var(--home-hero-intro-offset-top);
    padding-bottom: clamp(1.5rem, 4vw, var(--space-block-gap));
}

.home-hero-intro__shell {
    position: relative;
    z-index: 1;
}

/* Portrait / narrow screens: make the hero (and its glass band) span the full
 * screen height so the canvas fills the entire viewport instead of a short strip. */
@media (orientation: portrait) {
    .home-hero-intro {
        min-height: 100dvh;
    }
}

/*
 * Fills the entire hero section (full width + full height) so the glass canvas
 * covers the whole screen, including on narrow/portrait viewports. Full viewport
 * width from inside .site-main; counteract .site-main { zoom: 0.8 } below 2560px
 * so the band still touches screen edges (zoom otherwise shrinks 100vw).
 */
.home-hero-intro__band {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    max-width: 100vw;
    transform: translateX(-50%);
    transform-origin: center;
    zoom: calc(1 / var(--site-main-zoom, 1));
    z-index: 0;
    pointer-events: none;
    line-height: 0;
    /* Fallback (shown if the WebGL glass renderer cannot start). */
    background:
        radial-gradient(58% 70% at 82% 34%, rgba(246, 99, 62, 0.18), transparent 70%),
        radial-gradient(52% 52% at 74% 78%, rgba(213, 231, 76, 0.20), transparent 70%),
        radial-gradient(46% 46% at 22% 86%, rgba(48, 83, 227, 0.13), transparent 70%),
        #ffffff;
}

.home-hero-intro__band img,
.home-hero-intro__glass {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Scroll cue - tiny chevron, bottom-centre, gently bobbing to invite scroll. */
.home-hero-intro__scroll-cue {
    position: absolute;
    bottom: clamp(0.75rem, 2.5vh, 1.5rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: var(--color-text-heading);
    pointer-events: none;
    line-height: 0;
}

.home-hero-intro__chevron {
    display: block;
    width: 1.5rem;
    height: auto;
    opacity: 0.55;
    animation: home-hero-scroll-cue 1.8s ease-in-out infinite;
}

@keyframes home-hero-scroll-cue {
    0%, 100% { transform: translateY(0); opacity: 0.45; }
    50% { transform: translateY(0.35rem); opacity: 0.85; }
}

@media (orientation: portrait), (max-width: 768px) {
    .home-hero-intro__scroll-cue {
        bottom: clamp(2.5rem, 9vh, 5rem);
    }

    .home-hero-intro__chevron {
        width: 2.25rem;
        opacity: 0.7;
    }
}

.home-hero-intro__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    max-width: min(100%, 75%);
}

.home-hero-intro__lead {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
}

.home-hero-intro__logo {
    display: block;
    width: clamp(8rem, 20%, 100%);
    margin-bottom: var(--home-hero-intro-logo-title-gap);
    flex-shrink: 0;
    line-height: 0;
    text-decoration: none;
}

.home-hero-intro__logo img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: var(--arpm-logo-aspect);
}

.home-hero-intro__headline.arpm-serif-title {
    margin: 0 0 var(--home-hero-intro-gap);
    max-width: none;
    font-size: var(--text-home-hero-headline);
    line-height: 1.2;
    font-weight: var(--font-weight-regular);
    color: var(--color-text-heading);
}

.home-hero-intro__ctas {
    display: flex;
    align-items: stretch;
    width: clamp(12rem, 50%, 100%);
    gap: 5%;
}

.home-hero-intro__ctas .home-hero-intro__cta {
    flex: 1 1 0;
    min-width: 0;
    min-height: 2.75rem;
    padding-inline: clamp(0.75rem, 2vw, 1.25rem);
    font-size: var(--text-home-hero-cta);
}

.home-hero-intro__cta--contact.arpm-btn {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    font-weight: 700;
    border-color: var(--color-footer-bg);
}

.home-hero-intro__cta--contact.arpm-btn:hover {
    filter: brightness(1.08);
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    border-color: var(--color-footer-bg);
}

.home-hero-intro__overview {
    display: flex;
    flex-direction: column;
    width: clamp(16rem, 75%, 100%);
    margin-top: calc(2 * var(--home-hero-intro-gap));
}

.home-hero-intro__overview-row {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-home-hero-overview);
    font-weight: var(--font-weight-regular);
    line-height: 1.7;
    color: #000;
}

.home-hero-intro__overview-row--ruled {
    padding-bottom: var(--home-hero-intro-overview-pad-bottom);
    border-bottom: 1px solid var(--color-border-strong);
}

.home-hero-intro__overview-row:not(:first-child) {
    padding-top: var(--home-hero-intro-overview-pad-top);
}

/* Scrollable page body - tighter vertical rhythm than global section gap */
.home-page__body {
    display: flex;
    flex-direction: column;
    gap: var(--home-section-gap);
    padding-block: var(--home-section-gap);
    overflow-x: clip;
}

.home-page__body-inner {
    display: flex;
    flex-direction: column;
    gap: var(--home-section-gap);
}

.home-page__body-inner,
.home-page__body > .arpm-container,
.home-page__body > .home-network {
    overflow-x: visible;
}

/* Verticals - equal-height cards, buttons aligned */
.home-verticals__cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(2rem, 5.5vw, 6.375rem);
    align-items: stretch;
}

.home-service-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: var(--space-block-gap);
}

.home-service-card__media {
    width: 100%;
    aspect-ratio: 452 / 491;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #e8e8e8;
}

.home-service-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-service-card__content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2.5rem;
    min-height: 0;
}

.home-service-card__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1.375rem;
}

.home-service-card__title {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-service-title);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-ui);
    color: var(--color-text-service);
}

.home-service-card__content .arpm-btn {
    margin-top: auto;
    flex-shrink: 0;
    align-self: flex-start;
}

/* Header above the practices list - title + "VIEW ALL SERVICES" link aligned */
.home-practice__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: clamp(1rem, 2vw, 2.5rem);
    flex-wrap: wrap;
}

.home-practice__header .arpm-headline-col {
    flex: 1 1 32rem;
    max-width: var(--width-serif-column);
}

/* Narrow full-width row cards for each practice */
.home-practice__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #cbc2b7;
}

.home-practice__list > li {
    margin: 0;
    border-bottom: 1px solid #cbc2b7;
    transition: background-color var(--transition-fast);
}

.home-practice__list > li.home-practice__item--green:hover,
.home-practice__list > li.home-practice__item--green:focus-within {
    background: rgba(213, 231, 76, 0.22);
}

.home-practice__list > li.home-practice__item--blue:hover,
.home-practice__list > li.home-practice__item--blue:focus-within {
    background: rgba(48, 83, 227, 0.08);
}

.home-practice__list > li.home-practice__item--orange:hover,
.home-practice__list > li.home-practice__item--orange:focus-within {
    background: rgba(246, 99, 62, 0.06);
}

.home-practice__list > li.home-practice__item--outline:hover,
.home-practice__list > li.home-practice__item--outline:focus-within {
    background: rgba(47, 43, 38, 0.04);
}

.home-practice-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: clamp(1rem, 2.2vw, 1.75rem) clamp(1rem, 2vw, 1.75rem);
    text-decoration: none;
    color: var(--color-text-heading);
    transition: color var(--transition-fast);
}

.home-practice-row:hover,
.home-practice-row:focus-visible {
    outline: none;
}

.home-practice-row__title {
    font-family: var(--font-sans);
    font-size: clamp(1.25rem, 2.2vw, 2.25rem);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-ui);
}

.home-practice-row__arrow {
    flex-shrink: 0;
    font-family: var(--font-sans);
    font-size: clamp(1.25rem, 2vw, 2rem);
    line-height: 1;
    transition:
        transform var(--transition-fast),
        color var(--transition-fast);
}

.home-practice-row--green .home-practice-row__arrow {
    color: var(--accent-green-text);
}

.home-practice-row--blue .home-practice-row__arrow {
    color: var(--accent-blue);
}

.home-practice-row--orange .home-practice-row__arrow {
    color: var(--accent-orange);
}

.home-practice-row--outline .home-practice-row__arrow {
    color: var(--color-text-muted);
}

.home-practice-row:hover .home-practice-row__arrow,
.home-practice-row:focus-visible .home-practice-row__arrow {
    transform: translateX(0.35rem);
}

/* Sector tags - wider gaps + Ellipse.svg separators.
 * Labels use a contained size (not the big section-label) so 10 sectors fit
 * 1–2 lines on desktop and the row never strands a lone item. justify-center
 * also keeps any partial last line visually balanced. */
.home-sector-tags.arpm-sector-tags {
    column-gap: clamp(1.25rem, 3vw, 2.5rem);
    row-gap: clamp(0.75rem, 1.6vw, 1.5rem);
    justify-content: center;
}

.home-sector-tags .home-sector-tags__label {
    font-size: clamp(1rem, 1.5vw, 1.625rem);
    line-height: var(--line-height-ui);
}

.home-sector-tags__sep {
    display: inline-block;
    flex-shrink: 0;
    color: var(--accent-green);
}

.home-sector-tags__sep--blue {
    color: var(--accent-blue);
}

.home-sector-tags__sep--orange {
    color: var(--accent-orange);
}

/* Network - intro in page grid; marquee band is true viewport width (4K included) */
.home-page__body > .home-network {
    display: flex;
    flex-direction: column;
    gap: var(--space-block-gap);
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-inline: 0;
}

.home-network__intro {
    display: flex;
    flex-direction: column;
    gap: var(--space-block-gap);
}

.home-network__subtitle {
    margin: 0;
    /* Wider than the default headline column so the line breaks once, not three times */
    max-width: 64rem;
}

.home-network__marquee {
    --home-network-logo-height: clamp(3.5rem, 6vw, 5.5rem);
    width: 100%;
    max-width: none;
    height: 200px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--color-bg);
    box-sizing: border-box;
}

.home-network__track {
    display: flex;
    align-items: center;
    width: max-content;
    height: var(--home-network-logo-height);
    animation: home-marquee-scroll 55s linear infinite;
}

.home-network__track:hover {
    animation-play-state: paused;
}

.home-network__group {
    display: flex;
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
    padding-inline: clamp(1rem, 3vw, 2rem);
    flex-shrink: 0;
    height: 100%;
}

.home-network__logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.home-network__logo a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.home-network__logo img {
    display: block;
    height: 100%;
    width: auto;
    max-height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center;
    transition: opacity var(--transition-ui);
}

.home-network__logo a:hover img,
.home-network__logo img:hover {
    opacity: 0.85;
}

@keyframes home-marquee-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Closing CTA - sans title (Figma 40px / 120% lh) */
.home-cta__title {
    margin: 0;
    font-family: var(--font-sans);
    font-size: clamp(1.5rem, calc(40 / 1728 * 100vw), 2.5rem);
    font-weight: var(--font-weight-regular);
    line-height: 1.2;
    color: var(--color-text-heading);
    max-width: 42rem;
}

/* Projects */
.home-projects--spacious {
    gap: clamp(2rem, 4.375vw, 4.375rem);
}

.home-projects__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(3rem, 7vw, 7.5rem);
    padding-inline: clamp(0, 2.5vw, 2.5rem);
}

.home-project-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-decoration: none;
    color: inherit;
}

.home-project-card__media {
    width: 100%;
    aspect-ratio: 640 / 480;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #e8e8e8;
}

.home-project-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.home-project-card:hover .home-project-card__media img {
    transform: scale(1.02);
}

.home-project-card__title {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-project-title);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-ui);
    color: var(--color-text-heading);
    transition: color var(--transition-fast);
}

.home-project-card__meta {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-body);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-body);
    color: var(--color-text-body);
}

/* -- Responsive -- */

@media (max-width: 1100px) {
    .home-hero-intro__content {
        max-width: 100%;
    }

    .home-verticals__cards {
        grid-template-columns: 1fr;
        max-width: 32rem;
    }

}

@media (max-width: 768px) {
    .home-hero-intro__ctas {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .home-hero-intro__ctas .home-hero-intro__cta {
        flex: none;
        width: 100%;
        max-width: 16rem;
    }

    .home-projects__grid {
        grid-template-columns: 1fr;
        padding-inline: 0;
    }

    .home-page__body {
        gap: var(--home-section-gap);
        padding-block: var(--home-section-gap);
    }

    .home-page__body-inner {
        gap: var(--home-section-gap);
    }

}
