/*
 * Me2 profile frames
 * Add new frame designs here with the .me2-frame--{key} convention.
 * Card interiors stay neutral; each design is defined by its frame.
 */

@property --me2-frame-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

/*
 * Shared card geometry
 * Homepage and directory cards intentionally use the same visual proportions.
 */
.stage2__card,
.senior-list__card {
    display: flex;
    height: auto;
    align-self: stretch;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: .1rem solid var(--color-border);
    border-radius: 2.4rem;
    box-shadow: 0 1.2rem 3.5rem rgba(17, 17, 22, .045);
    transition: none;
}

@media screen and (min-width: 981px) {
    .stage2__grid,
    .senior-list__grid {
        width: 96%;
        margin-inline: auto;
    }
}

.stage2__card-visual,
.senior-list__card-visual {
    width: calc(100% - 2.4rem);
    height: 19rem;
    flex: 0 0 auto;
    margin: 1.2rem 1.2rem 0;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, .8), transparent 27%),
        linear-gradient(145deg, var(--card-accent), color-mix(in srgb, var(--card-accent), #ffffff 58%));
    border: .1rem solid rgba(17, 17, 22, .14);
    border-radius: 2rem;
    clip-path: inset(0 round 2rem);
    transition: box-shadow 220ms ease;
    transform: none;
}

.stage2__card:hover .stage2__card-visual,
.senior-list__card:hover .senior-list__card-visual {
    box-shadow: none;
    transform: none;
}

.stage2__card-content,
.senior-list__card-body {
    display: flex;
    min-height: 0;
    flex: 0 0 auto;
    flex-direction: column;
    padding: 2.3rem;
}

.stage2__identity,
.senior-list__identity {
    display: grid;
    height: 8.4rem;
    min-height: 8.4rem;
    flex: 0 0 8.4rem;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.2rem;
    overflow: hidden;
}

.stage2__card:has(.me2-profile-badges:empty) .stage2__identity,
.senior-list__card:has(.me2-profile-badges:empty) .senior-list__identity {
    height: 5.6rem;
    min-height: 5.6rem;
    flex-basis: 5.6rem;
}

.stage2__identity > div,
.senior-list__identity > div {
    min-width: 0;
}

.stage2__card .me2-profile-heading,
.senior-list__card .me2-profile-heading {
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: .75rem;
}

.stage2__card .me2-profile-heading > h3,
.senior-list__card .me2-profile-heading > h2 {
    max-width: 100%;
    flex: 0 0 auto;
}

.stage2__identity h3,
.senior-list__identity h2 {
    overflow-wrap: anywhere;
    font-size: 2rem;
    line-height: 1.2;
}

.stage2__identity p,
.senior-list__identity p {
    margin-top: .35rem;
}

.stage2__identity > span,
.senior-list__identity > span {
    margin-top: .3rem;
}

.stage2__description,
.senior-list__description {
    display: block;
    height: 10.5rem;
    min-height: 10.5rem;
    flex: 0 0 10.5rem;
    margin-top: 1.1rem;
    overflow: hidden;
    line-height: 1.7;
}

.stage2__skills,
.senior-list__skills {
    height: 3.4rem;
    min-height: 3.4rem;
    flex: 0 0 3.4rem;
    margin-top: 1rem;
    align-content: flex-start;
    overflow: hidden;
}

.stage2__meta,
.senior-list__meta {
    display: flex;
    box-sizing: border-box;
    height: 4rem;
    min-height: 4rem;
    flex: 0 0 4rem;
    align-items: center;
    align-content: center;
    flex-wrap: nowrap;
    gap: .4rem 1.2rem;
    margin-top: .8rem;
    padding: 0;
    border-bottom: .1rem solid var(--color-border);
}

.stage2__meta-item,
.senior-list__meta-item {
    display: inline-flex;
    min-width: 0;
    height: 1.4rem;
    min-height: 1.4rem;
    align-self: center;
    align-items: center;
    gap: .5rem;
    line-height: 1.4rem;
    white-space: nowrap;
    transform: none;
}

.stage2__meta-item svg,
.senior-list__meta-item svg {
    display: block;
    width: 1.4rem;
    height: 1.4rem;
    flex: 0 0 1.4rem;
}

.stage2__meta-label,
.senior-list__meta-label {
    display: block;
    overflow: hidden;
    height: 1.4rem;
    line-height: 1.4rem;
    text-overflow: ellipsis;
}

.stage2__card-content .me2-card-actions,
.senior-list__card-body .me2-card-actions {
    margin-top: .8rem;
    padding-top: .8rem;
    border-top: 0;
}

.stage2__card .me2-card-actions > a,
.senior-list__card .me2-card-actions > a {
    min-height: 3.6rem;
    padding-inline: 1.1rem;
    font-size: 1rem;
}

@media screen and (max-width: 640px) {
    .stage2__card-visual,
    .senior-list__card-visual {
        height: 21rem;
    }

    .stage2__card-content,
    .senior-list__card-body {
        padding: 2rem;
    }
}

.me2-frame--first-100,
.me2-frame--influencer,
.me2-frame--muysl-card {
    color: var(--color-text);
}

/* Automatic frame for the first 100 approved and published Senior profiles. */
.me2-frame--first-100 {
    border: .22rem solid var(--brand-cyan);
    background: #ffffff;
    box-shadow:
        0 1.4rem 3.4rem rgba(17, 17, 22, .07),
        0 0 0 .1rem rgba(0, 205, 255, .08);
}

/* Every Muysl Card level shares one continuously moving metal edge. */
.me2-frame--muysl-card {
    --me2-frame-angle: 0deg;
    border: .24rem solid transparent;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        conic-gradient(
            from var(--me2-frame-angle),
            #050505 0deg,
            #d8d8d8 45deg,
            #ffffff 78deg,
            #d1b24a 116deg,
            #f0d97a 148deg,
            #111116 192deg,
            #9f9f9f 232deg,
            #f8f8f8 266deg,
            #b48b2c 308deg,
            #050505 360deg
        ) border-box;
    box-shadow:
        0 1.6rem 3.8rem rgba(17, 17, 22, .12),
        0 0 2.2rem rgba(209, 178, 74, .12),
        0 0 1.4rem rgba(216, 216, 216, .16);
    animation: me2-frame-card-metal 7.5s linear infinite;
}

.me2-frame--muysl-card .stage2__card-visual,
.me2-frame--muysl-card .senior-list__card-visual {
    border-color: rgba(17, 17, 22, .28);
}

/* Continuously moving Influencer edge with an uncoloured white interior. */
.me2-frame--influencer {
    --me2-frame-angle: 0deg;
    border: .25rem solid transparent;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        conic-gradient(
            from var(--me2-frame-angle),
            #ff45b5,
            #8a52ff,
            #00d5ff,
            #ff7ac8,
            #ff45b5
        ) border-box;
    box-shadow: 0 1.6rem 4rem rgba(93, 34, 151, .12);
    animation: me2-frame-influencer 3.2s linear infinite;
}

@keyframes me2-frame-influencer {
    to { --me2-frame-angle: 360deg; }
}

@keyframes me2-frame-card-metal {
    to { --me2-frame-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
    .me2-frame--influencer,
    .me2-frame--muysl-card {
        animation-duration: 14s;
    }
}
