/* ==============================================
   HOMEPAGE - home.css
   ============================================== */

/* ---- Hero ---- */
.hm-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100dvh;
}

.hm-hero__left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: var(--gutter-x);
    background: var(--color-bg);
}

.hm-hero__heading {
    font-size: var(--fs-h2);
    font-weight: 411.11;
    letter-spacing: -0.04em;
    line-height: 1.35;
    color: #4d4d4d;
    text-align: left;
}

.hm-hero__heading em {
    font-style: italic;
    font-family: serif;
    font-weight: 500;
    font-size: clamp(1.75rem, 3.5vw, 3rem);
}

.hm-hero__right {
    position: relative;
    background: #d0e0e0;
    overflow: hidden;
    min-height: 100dvh;
}

.hm-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* ---- Services - Sticky nav + scroll panels ---- */
.hm-services {
    background: var(--color-bg);
}

/* ---- Services header (matching testimonials style) ---- */
.hm-services__head {
    padding: var(--section-y) var(--gutter-x) 0;
}

.hm-services__label {
    font-size: var(--fs-label);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-brand-red);
    line-height: 1;
}

.hm-services__inner {
    display: block;
}

/* ---- Left: Sticky nav ---- */
.hm-services__nav {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(77, 77, 77, 0.18);
    padding: var(--section-y) 1.75rem;
    overflow: hidden;
}

.hm-services__nav-header {
    padding-bottom: 1.75rem;
    border-bottom: 1px solid rgba(77, 77, 77, 0.12);
}

/* ---- Nav list ---- */
.hm-services__list {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hm-service-nav-item {
    border-top: 1px solid rgba(77, 77, 77, 0.12);
    position: relative;
}

.hm-service-nav-item:last-child {
    border-bottom: 1px solid rgba(77, 77, 77, 0.12);
}

/* Animated left-bar indicator */
.hm-service-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 0;
    background: var(--service-color, var(--color-brand-red));
    transition: height 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.hm-service-nav-item.active::before {
    height: 100%;
}

.hm-service-nav-item[data-color="red"]    { --service-color: var(--color-brand-red); }
.hm-service-nav-item[data-color="blue"]   { --service-color: var(--color-brand-blue); }
.hm-service-nav-item[data-color="green"]  { --service-color: var(--color-brand-green); }
.hm-service-nav-item[data-color="purple"] { --service-color: var(--color-brand-purple); }

/* ---- Nav button ---- */
.hm-service-nav-item__btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 0 1.25rem 0.75rem;
    background: none;
    border: none;
    text-align: left;
    font-family: var(--font-primary);
    cursor: pointer;
    color: rgba(77, 77, 77, 0.22);
    transition: color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hm-service-nav-item.active .hm-service-nav-item__btn {
    color: #1a1a1a;
}

.hm-service-nav-item__icon-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.hm-service-nav-item__icon {
    width: 16px;
    height: 16px;
    display: block;
}

.hm-service-nav-item__name {
    font-size: var(--fs-label);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* ---- Services list (scroll-triggered accordion) ---- */
.hm-services__list {
    list-style: none;
    max-width: 50%;
    margin: 0 auto;
    padding: 0 var(--gutter-x) var(--section-y);
    text-align: center;
}

.hm-service-item {
    border-top: 1px solid var(--color-brand-green);
    padding: 0;
}

.hm-service-item:first-child {
    border-top: none;
}

.hm-service-item:last-child {
    border-bottom: 1px solid var(--color-brand-green);
}

.hm-services .accordion-item {
    border-bottom: none;
}

.hm-services .accordion-button {
    padding: 3rem 0 2rem;
    justify-content: center;
    text-align: center;
}

.hm-services .accordion-button::after {
    display: none;
}

.hm-services .accordion-button:hover {
    opacity: 1;
}

/* Keep current font treatment for service names (serif italic) */
.hm-service-item__name {
    display: block;
    font-size: var(--fs-h1);
    font-family: serif;
    font-style: italic;
    font-weight: 411.11;
    letter-spacing: -0.04em;
    line-height: 1.35;
    color: var(--color-nav-text);
}

.hm-services .accordion-panel {
    padding-bottom: 2rem;
    text-align: center;
}

.hm-service-item__desc {
    margin: 0 auto;
    max-width: 520px;
}

/* Smooth open/close for scroll-triggered accordion.
   Use grid-template-rows 0fr->1fr so the transition interpolates to the
   true content height (max-height 0->1000px otherwise finishes fast on
   short content and looks abrupt). */
.hm-services .accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    max-height: none;
    overflow: hidden;
    transition: grid-template-rows 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.45s ease;
    opacity: 0;
    will-change: grid-template-rows, opacity;
}

.hm-services .accordion-content.active {
    grid-template-rows: 1fr;
    max-height: none;
    opacity: 1;
}

.hm-services .accordion-content > .accordion-panel {
    min-height: 0;
    overflow: hidden;
}

.hm-service-panel__meta {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(77, 77, 77, 0.35);
    line-height: 1;
}

.hm-service-panel__bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
}

.hm-service-panel__name {
    font-size: var(--fs-h1);
    font-family: serif;
    font-style: italic;
    font-weight: 411.11;
    letter-spacing: -0.04em;
    line-height: 1.35;
    color: var(--color-nav-text);
}

.hm-service-panel__desc {
    max-width: 380px;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .hm-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hm-hero__left {
        min-height: 50dvh;
        justify-content: center;
    }

    .hm-hero__heading {
        text-align: center;
    }

    .hm-hero__right {
        min-height: 55dvh;
    }

    .hm-services__inner {
        grid-template-columns: 1fr;
    }

    .hm-services__nav {
        display: none;
    }

    .hm-services__list {
        max-width: 100%;
        padding: 0 2rem var(--section-y);
    }

    .hm-service-item__desc {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .hm-service-panel__name {
        font-size: var(--fs-h2);
    }

    .hm-service-panel__content {
        padding: 2.5rem 1.5rem;
    }
}

/* ==============================================
   HOMEPAGE - Testimonials (editorial quote carousel)
   ============================================== */
/* ---- Animated section separator ---- */
.b-separator {
    padding: 0 var(--gutter-x);
    background: var(--color-bg);
}

.b-separator__line {
    display: block;
    height: 1px;
    background: rgba(77, 77, 77, 0.18);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.b-separator.is-animated.is-visible .b-separator__line {
    transform: scaleX(1);
}

@media (max-width: 768px) {
    .b-separator { padding-left: 2rem; padding-right: 2rem; }
}

@media (max-width: 480px) {
    .b-separator { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* ==============================================
   HOMEPAGE - Testimonials (editorial quote carousel)
   ============================================== */
.hm-testimonials {
    background: var(--color-bg);
    padding: var(--section-y) var(--gutter-x);
}

/* ---- Head ---- */
.hm-testimonials__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: clamp(3rem, 6vw, 5rem);
}

.hm-testimonials__label {
    font-size: var(--fs-label);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-brand-red);
    line-height: 1;
}

.hm-testimonials__year {
    font-size: var(--fs-label);
    font-weight: 400;
    letter-spacing: 0.06em;
    color: rgba(77, 77, 77, 0.38);
    font-style: italic;
}

/* ---- Quote stage ---- */
.hm-tq {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    padding: 0 clamp(3rem, 8vw, 7rem);
}

/* Large decorative quote marks */
.hm-tq__mark {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(7rem, 14vw, 13rem);
    line-height: 0.85;
    color: var(--color-brand-blue);
    opacity: 0.13;
    position: absolute;
    pointer-events: none;
    user-select: none;
}

.hm-tq__mark--open {
    top: -0.25rem;
    left: 0;
}

.hm-tq__mark--close {
    bottom: -0.25rem;
    right: 0;
}

/* ---- Track: CSS grid stacking - all items share the same cell ---- */
.hm-tq__track {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    padding: clamp(1.5rem, 3vw, 2.5rem) 0;
    overflow: hidden;
}

/* Default: waiting off-screen to the right */
.hm-tq__item {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(1.25rem, 2.5vw, 1.75rem);
    opacity: 0;
    visibility: hidden;
    transform: translateX(60px);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0.55s;
}

/* Active: slides in from right to center */
.hm-tq__item.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0s;
}

/* Exiting: slides out to the left (forward nav) */
.hm-tq__item.is-exiting {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-60px);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0.55s;
}

/* Waiting off-screen left (backward nav entry staging - no transition) */
.hm-tq__item.is-waiting-left {
    transform: translateX(-60px);
    transition: none;
}

/* Exiting: slides out to the right (backward nav) */
.hm-tq__item.is-exiting-right {
    opacity: 0;
    visibility: hidden;
    transform: translateX(60px);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0.55s;
}

.hm-tq__text {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: clamp(1.3rem, 2.2vw, 1.9rem);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.01em;
    color: #1a1a1a;
    max-width: 66ch;
    margin: 0;
}

.hm-tq__credit {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.hm-tq__name {
    font-family: var(--font-primary);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #2a2a2a;
}

.hm-tq__sep {
    color: rgba(77, 77, 77, 0.3);
    font-size: var(--fs-label);
}

.hm-tq__co {
    font-family: var(--font-primary);
    font-size: var(--fs-label);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: rgba(77, 77, 77, 0.55);
}

a.hm-tq__co {
    color: rgba(77, 77, 77, 0.55);
    text-decoration: none;
    transition: color 0.2s ease;
}

a.hm-tq__co:hover {
    color: var(--color-brand-blue);
}

/* ---- Navigation dots ---- */
.hm-tq__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-top: clamp(2rem, 4vw, 3.5rem);
}

.hm-tq__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(77, 77, 77, 0.2);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.35s ease, transform 0.35s ease;
}

.hm-tq__dot.is-active {
    background: var(--color-brand-blue);
    transform: scale(1.45);
}

.hm-tq__dot:focus-visible {
    outline: 2px solid var(--color-brand-blue);
    outline-offset: 3px;
}

/* ---- Scroll-entry reveal (homepage only) ---- */
.hm-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--i, 0) * 110ms);
}

.hm-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hm-testimonials {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .hm-tq {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }

    .hm-tq__mark {
        font-size: clamp(5rem, 14vw, 7rem);
    }

    .hm-tq__name,
    .hm-tq__co {
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .hm-testimonials {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .hm-tq {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .hm-services__head {
        text-align: center;
    }

    .hm-testimonials__head {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hm-tq__item,
    .hm-tq__item.is-exiting,
    .hm-tq__item.is-exiting-right,
    .hm-tq__dot {
        transition: opacity 0.2s ease, visibility 0s;
    }
    .hm-tq__item,
    .hm-tq__item.is-exiting,
    .hm-tq__item.is-exiting-right { transform: none !important; }
}

/* ---- Services CTA: View our work (brand green) ---- */
.hm-services .ap-cta {
    padding: clamp(1.25rem, 2vw, 2rem) 0 clamp(4rem, 7vw, 7rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(2rem, 4vw, 3rem);
    text-align: center;
}

.hm-services .ap-cta__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    font-weight: 500;
    color: var(--color-brand-green);
    text-decoration: none;
    letter-spacing: -0.01em;
    position: relative;
    padding-bottom: 2px;
}

.hm-services .ap-cta__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform-origin: left;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.hm-services .ap-cta__link:hover::after {
    transform: scaleX(0);
    transform-origin: right;
}

.hm-services .ap-cta__link svg {
    color: var(--cta-accent, currentColor);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.hm-services .ap-cta__link:hover svg {
    transform: translateX(4px);
}
