/** Shared page layouts for the FE-02 commercial surface. */
.page-hero { overflow: hidden; border-block-end: 1px solid var(--color-border); background: radial-gradient(circle at 85% 15%, rgb(242 194 48 / 13%), transparent 30rem), var(--color-bg); }
.page-hero__inner { display: grid; min-height: min(31rem, 68vh); align-content: center; justify-items: start; padding-block: clamp(4rem, 10vw, 7rem); }
.page-hero--home .page-hero__inner { min-height: min(40rem, 78vh); }
.eyebrow { margin-block-end: var(--space-2); color: var(--color-accent); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.page-hero h1 { max-width: 17ch; margin-block-end: var(--space-4); font-size: clamp(2.5rem, 8vw, 5.5rem); letter-spacing: -0.04em; }
.page-hero__intro { max-width: 46rem; margin-block-end: var(--space-4); color: var(--color-muted); font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
.page-section { padding-block: clamp(4rem, 9vw, 7rem); }
.page-section--surface { background: var(--color-surface); }
.section-heading { max-width: 46rem; margin-block-end: var(--space-5); }
.section-heading h2,
.final-cta h2 { margin-block-end: var(--space-3); font-size: clamp(2rem, 5vw, 3.25rem); }
.section-heading p,
.prose-grid p,
.article__body p,
.cv__body p,
.final-cta p { color: var(--color-muted); }
.section-heading--spaced { margin-block-start: var(--space-6); }

/* Home — Servicios: título y distribución centrados sin alterar el contenido interno de las cards. */
.home-services__heading {
    max-width: none;
    text-align: center;
}
.home-services__heading h2 { margin-inline: auto; }
.home-services .card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.home-services .swd-parallax-card {
    flex: 0 1 22rem;
    width: min(100%, 22rem);
    max-width: 22rem;
}

/* Home — Noticias/recursos: 45 px menos de aire vertical respecto a page-section. */
#main-content[data-page-key="home"] .editorial-carousel {
    padding-block: calc(clamp(4rem, 9vw, 7rem) - 45px);
}

.section-action { margin-block-start: var(--space-4); }
.prose-grid { display: grid; gap: var(--space-4); }
.prose-grid section { padding: var(--space-4); border-block-start: 1px solid var(--color-border); }
.split-panel,
.final-cta__inner { display: grid; gap: var(--space-4); align-items: center; }
.final-cta { padding-block: clamp(4rem, 8vw, 6rem); border-block-start: 1px solid var(--color-border); background: linear-gradient(125deg, #171300, var(--color-bg) 60%); }

.home-final-cta {
    position: relative;
    z-index: 2;
}

.contact-final-cta {
    --hero-parallax-bg-y: 0px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-block-start: 1px solid var(--color-border);
    background: #090909;
}
.contact-final-cta::before {
    position: absolute;
    z-index: -1;
    inset: -5rem 0;
    background-image:
        linear-gradient(90deg, rgb(5 5 5 / 94%) 0%, rgb(5 5 5 / 78%) 52%, rgb(5 5 5 / 58%) 100%),
        url("/assets/images/heroes/hero-contact.webp");
    background-position: center, center;
    background-size: cover;
    content: "";
    transform: translate3d(0, var(--hero-parallax-bg-y), 0) scale(1.13);
    transform-origin: center;
    will-change: transform;
}
.contact-final-cta__inner { position: relative; z-index: 1; }
.contact-final-cta h2 { color: #fff; text-shadow: 0 0.12em 0.8em rgb(0 0 0 / 45%); }
.contact-final-cta p { max-width: 44rem; color: rgb(255 255 255 / 82%); }
.contact-final-cta__actions { justify-content: flex-start; }
@media (prefers-reduced-motion: reduce) {
    .contact-final-cta::before { transform: scale(1.13); will-change: auto; }
}
.article__header { max-width: var(--container); }
.article__body,
.cv__body { display: grid; gap: var(--space-5); max-width: 50rem; padding-block: clamp(3rem, 8vw, 6rem); }
.article__body h2,
.cv__body h2 { font-size: clamp(1.6rem, 4vw, 2.25rem); }
.resource-support { margin-block-start: var(--space-4); text-align: end; }
.resource-support p { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 0.25rem; margin: 0; color: var(--color-muted); font-size: 0.74rem; line-height: 1.45; }
.resource-support__coffee { gap: 0.2rem; }
.resource-support__coffee .coffee-trigger__text { min-height: 2.5rem; font-size: 0.78rem; }
.resource-support__coffee .coffee-trigger__icon { width: 2.35rem; height: 2.35rem; }
.legal__status { padding: var(--space-2) var(--space-3); border: 1px solid var(--color-accent); border-radius: var(--radius-sm); color: var(--color-accent); }
.resource-browser__layout { display: grid; gap: var(--space-5); align-items: start; }
.resource-list { display: grid; gap: var(--space-4); }
.resource-entry { display: grid; gap: var(--space-2); padding-block: var(--space-4); border-block-start: 1px solid var(--color-border); }
.resource-entry > * { margin: 0; }
.resource-entry :is(h2, h3) { max-width: 40rem; font-size: clamp(1.35rem, 3vw, 2rem); }
.resource-entry__context { display: flex; flex-wrap: wrap; gap: 0.45rem; color: var(--color-accent); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.resource-entry__subtitle { max-width: 48rem; color: var(--color-text); font-size: 1.08rem; font-weight: 600; }
.resource-entry > p:not(.resource-entry__context, .resource-entry__subtitle) { max-width: 48rem; color: var(--color-muted); }
.profile-actions .section-heading { margin-block-end: var(--space-3); }

/* Sobre mí — acordeón persistente del perfil */
.profile-grid { align-items: start; }
.profile-section {
    display: grid;
    align-content: start;
    overflow: hidden;
    border-block-start: 1px solid var(--color-border);
    transition: border-color 320ms ease;
}
.profile-section__title {
    position: relative;
    z-index: 2;
    margin: 0;
    background: var(--color-bg);
}
.profile-section__trigger {
    display: flex;
    width: 100%;
    min-height: 4.5rem;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border: 0;
    color: var(--color-text);
    background: var(--color-bg);
    font: inherit;
    text-align: start;
    cursor: pointer;
}
.profile-section__trigger:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}
.profile-section__label {
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.15;
}
.profile-section__icon {
    display: grid;
    flex: 0 0 auto;
    width: 3.25rem;
    height: 3.25rem;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-muted);
    background: var(--color-surface);
    transition: color 320ms ease, border-color 320ms ease;
}
.profile-section__icon svg { width: 1.9rem; height: 1.9rem; }
.profile-section__panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: 0fr;
    margin-block-start: -0.65rem;
    opacity: 0;
    transform: translateY(-1.15rem);
    transform-origin: top;
    transition:
        grid-template-rows 620ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 620ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 420ms ease;
    will-change: grid-template-rows, transform, opacity;
}
.profile-section__panel-inner {
    min-height: 0;
    overflow: hidden;
}
.profile-section__panel p {
    margin: 0;
    padding-block: calc(var(--space-3) + 0.65rem) var(--space-4);
    color: var(--color-muted);
}
.profile-section.is-active { border-block-start-color: var(--color-accent); }
.profile-section.is-active .profile-section__panel {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: translateY(0);
}
.profile-section.is-active .profile-section__icon {
    color: var(--color-accent);
    border-color: var(--color-accent);
}
@media (hover: hover) and (pointer: fine) {
    .profile-section__trigger:hover .profile-section__icon {
        color: var(--color-accent);
        border-color: var(--color-accent);
    }
}


/* Home — Perfil profesional */
.home-profile {
    --home-profile-media-y: 0px;
    --home-profile-shadow-y: 0px;
    --home-profile-image-y: 0px;
    --home-profile-section-pad: max(0px, calc(clamp(2rem, 4.5vw, 3.5rem) - 20px));
    --home-profile-base-bleed: calc(clamp(1rem, 2.8vw, 1.9rem) + 10px);
    position: relative;
    z-index: 1;
    overflow: visible;
    padding-block: var(--home-profile-section-pad);
}

.home-profile__inner {
    position: relative;
    min-height: clamp(9.5rem, 42vw, 12.5rem);
}

.home-profile__content {
    position: relative;
    z-index: 3;
    width: min(54%, 14rem);
}

.home-profile__content > p:not(.eyebrow) {
    color: var(--color-muted);
}

.home-profile__description {
    display: none;
}

.home-profile__actions {
    margin-block-start: var(--space-3);
}

.home-profile__visual {
    position: absolute;
    z-index: 1;
    inset-inline-end: -0.35rem;
    inset-block-end: calc(-1 * (var(--home-profile-section-pad) + var(--home-profile-base-bleed)));
    width: min(70vw, 19rem);
    pointer-events: none;
    /* La región puede crecer hacia arriba y sangrar por debajo, pero queda cubierta por la sección siguiente. */
    clip-path: inset(-9rem 0 var(--home-profile-section-pad) 0);
}

.home-profile__media {
    position: relative;
    transform: translate3d(0, var(--home-profile-media-y), 0);
    transform-origin: center bottom;
    will-change: transform;
}

.home-profile__shadow,
.home-profile__image {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    object-fit: contain;
    object-position: center bottom;
    transform-origin: center bottom;
    will-change: transform;
}

.home-profile__shadow {
    position: absolute;
    z-index: 0;
    inset: 0;
    opacity: 0.92;
    transform: translate3d(-1rem, var(--home-profile-shadow-y), 0) scale(1.055);
}

.home-profile__image {
    position: relative;
    z-index: 1;
    transform: translate3d(0, var(--home-profile-image-y), 0);
}

/* Tablet: mantiene la composición lateral y da más presencia al retrato. */
@media (max-width: 47.99rem) {
    .home-services .swd-parallax-card {
        flex-basis: 100%;
        max-width: none;
    }
}

@media (min-width: 48rem) {
    .prose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-grid > .profile-section:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .split-panel,
    .final-cta__inner { grid-template-columns: 1.5fr 1fr; }

    .home-profile__inner {
        min-height: clamp(11rem, 22vw, 14rem);
    }

    .home-profile__content {
        width: auto;
        max-width: min(50%, 31rem);
        padding-block: var(--space-2);
    }

    .home-profile__description {
        display: block;
    }

    .home-profile__visual {
        inset-inline-end: 0;
        width: min(54vw, 32rem);
        clip-path: inset(-11rem 0 var(--home-profile-section-pad) 0);
    }

    .home-profile__shadow {
        transform: translate3d(-1.25rem, var(--home-profile-shadow-y), 0) scale(1.06);
    }
}

/* Desktop: conserva la composición ya aprobada, con parallax sutil. */
@media (min-width: 64rem) {
    .home-profile__inner {
        min-height: clamp(9rem, 12vw, 11rem);
    }

    .home-profile__content {
        max-width: min(52%, 39rem);
    }

    .home-profile__visual {
        width: min(50vw, 40rem);
        clip-path: inset(-12rem 0 var(--home-profile-section-pad) 0);
    }

    .home-profile__shadow {
        transform: translate3d(-1.5rem, var(--home-profile-shadow-y), 0) scale(1.065);
    }
}

@media (min-width: 64rem) {
    .profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .profile-grid > .profile-section:last-child:nth-child(odd) { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .profile-section,
    .profile-section__icon,
    .profile-section__panel {
        transition: none;
    }

    .home-profile__media,
    .home-profile__shadow,
    .home-profile__image {
        transform: none;
        will-change: auto;
    }

    .home-profile__shadow {
        transform: translate3d(-1rem, 0, 0) scale(1.055);
        will-change: auto;
    }
}

@media (min-width: 75rem) {
    .resource-browser__layout { grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem); gap: var(--space-6); }
    .resource-navigation { position: sticky; inset-block-start: 7rem; }
}
