/* AMX Ranks — career ladder + type ratings */

.amx-rank-page .home-hero__lead { max-width: 36rem; }

.amx-rank.home-section--light {
    background: #fff;
    padding-top: 4.5rem;
    padding-bottom: 2.5rem;
}

.amx-rank--types.home-section--light {
    padding-top: 1.25rem;
    padding-bottom: 4.75rem;
    border-top: 1px solid rgba(3, 13, 117, 0.06);
}

.amx-rank__wrap {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Intro — fleet-style, no essay */
.amx-rank__intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    margin: 0 auto 2.35rem;
    max-width: 40rem;
    padding-bottom: 1.35rem;
    border-bottom: 1px solid rgba(3, 13, 117, 0.08);
}

.amx-rank__intro-copy { max-width: 36rem; margin: 0 auto; }

.amx-rank__kicker {
    display: inline-block;
    margin: 0 0 0.55rem;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #fa0073;
}

.amx-rank__title {
    margin: 0;
    font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(1.65rem, 3.2vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #020c41;
}

.amx-rank__intro-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
}

.amx-rank__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid rgba(3, 13, 117, 0.08);
    color: #030d75;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.amx-rank__chip i { font-size: 0.7rem; opacity: 0.85; }

.amx-rank__chip--pink {
    background: rgba(250, 0, 115, 0.08);
    border-color: rgba(250, 0, 115, 0.18);
    color: #fa0073;
}

/* Section heads inside content */
.amx-rank__sec-head {
    text-align: center;
    margin: 0 auto 1.65rem;
    max-width: 32rem;
}

.amx-rank__sec-head h3 {
    margin: 0 0 0.4rem;
    font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(1.25rem, 2.4vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #020c41;
}

.amx-rank__sec-head p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #64748b;
}

/* ── Career ladder ── */
.ranks-ladder {
    position: relative;
    max-width: 40rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ranks-ladder::before {
    content: '';
    position: absolute;
    left: 2.35rem;
    top: 2.5rem;
    bottom: 2.5rem;
    width: 2px;
    background: linear-gradient(180deg, rgba(250, 0, 115, 0.35), rgba(3, 13, 117, 0.12));
    border-radius: 999px;
    pointer-events: none;
}

.rank-step {
    position: relative;
    display: grid;
    grid-template-columns: 4.7rem minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 0.65rem 0;
}

.rank-step__badge {
    position: relative;
    z-index: 1;
    width: 4.7rem;
    height: 4.7rem;
    border-radius: 1.15rem;
    background:
        radial-gradient(ellipse 80% 80% at 50% 18%, rgba(255, 255, 255, 0.22), transparent 58%),
        linear-gradient(160deg, #fa0073 0%, #e91e6e 55%, #c4015c 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(250, 0, 115, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.rank-step__badge .rank-img {
    width: 3.15rem;
    height: 3.15rem;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.22s ease;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.rank-step__badge .rank-img:hover { transform: scale(1.1); }

.rank-icon-fallback {
    display: none;
    color: #fff;
    font-size: 1.35rem;
}

.rank-icon-fallback.show { display: flex; }

.rank-step__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    min-width: 0;
    padding: 1rem 1.15rem;
    border-radius: 1.1rem;
    background: #fff;
    border: 1px solid rgba(3, 13, 117, 0.08);
    box-shadow: 0 8px 22px rgba(2, 12, 65, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.rank-step:hover .rank-step__body {
    border-color: rgba(250, 0, 115, 0.2);
    box-shadow: 0 14px 32px rgba(2, 12, 65, 0.08);
    transform: translateY(-1px);
}

.rank-step__meta { min-width: 0; text-align: left; }

.rank-step__num {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #94a3b8;
}

.rank-step__name {
    display: block;
    font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #020c41;
}

.rank-step__hours {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(250, 0, 115, 0.08);
    border: 1px solid rgba(250, 0, 115, 0.16);
    color: #fa0073;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.rank-step__hours i {
    font-size: 0.7rem;
    opacity: 0.85;
}

.rank-note {
    max-width: 40rem;
    margin: 1.5rem auto 0;
    padding: 1rem 1.15rem;
    border-radius: 1rem;
    background: rgba(3, 13, 117, 0.035);
    border: 1px solid rgba(3, 13, 117, 0.08);
    font-size: 0.84rem;
    line-height: 1.55;
    color: #64748b;
    text-align: center;
}

.rank-note strong { color: #030d75; }

/* ── Type ratings ── */
.type-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .type-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1100px) {
    .type-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.type-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 1.25rem;
    background: #fff;
    border: 1px solid rgba(3, 13, 117, 0.08);
    box-shadow: 0 10px 28px rgba(2, 12, 65, 0.05);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.type-card:hover {
    border-color: rgba(250, 0, 115, 0.22);
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(2, 12, 65, 0.1);
}

.type-card__media {
    position: relative;
    height: 8.5rem;
    background:
        radial-gradient(ellipse 70% 80% at 80% 20%, rgba(250, 0, 115, 0.18), transparent 55%),
        linear-gradient(135deg, #020c41 0%, #030d75 55%, #05124a 100%);
    overflow: hidden;
}

.type-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center 60%;
    padding: 0.65rem 1rem 0.35rem;
    transition: transform 0.35s ease;
}

.type-card:hover .type-card__media img { transform: scale(1.06); }

.type-card__code {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    backdrop-filter: blur(6px);
}

.type-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.05rem 1.15rem 1.2rem;
    flex: 1;
    text-align: left;
}

.type-card-title {
    margin: 0;
    font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #020c41;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.type-card__desc {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.5;
    color: #64748b;
    flex: 1;
}

.type-card-rank {
    margin-top: 0.35rem;
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(3, 13, 117, 0.06);
    border: 1px solid rgba(3, 13, 117, 0.08);
    color: #030d75;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.type-card-rank i {
    font-size: 0.65rem;
    color: #fa0073;
}

/* Rank image popup */
.rank-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 12, 65, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.rank-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.rank-popup-content {
    position: relative;
    width: min(100%, 22rem);
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 1.35rem;
    background:
        radial-gradient(ellipse 70% 90% at 100% 0%, rgba(250, 0, 115, 0.22), transparent 55%),
        linear-gradient(135deg, #020c41 0%, #030d75 55%, #05124a 100%);
    box-shadow: 0 28px 64px rgba(2, 12, 65, 0.32);
    text-align: center;
}

.rank-popup-content img {
    width: min(100%, 14rem);
    height: auto;
    max-height: 14rem;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.rank-popup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.15rem;
    height: 2.15rem;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.rank-popup-close:hover { background: #fa0073; }

@media (max-width: 560px) {
    .amx-rank.home-section--light {
        padding-top: 3rem;
        padding-bottom: 1.5rem;
    }

    .amx-rank--types.home-section--light {
        padding-bottom: 3.5rem;
    }

    .ranks-ladder::before { left: 2rem; }

    .rank-step {
        grid-template-columns: 4rem minmax(0, 1fr);
        gap: 0.75rem;
    }

    .rank-step__badge {
        width: 4rem;
        height: 4rem;
        border-radius: 1rem;
    }

    .rank-step__badge .rank-img {
        width: 2.65rem;
        height: 2.65rem;
    }

    .rank-step__body {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.9rem 1rem;
        gap: 0.55rem;
    }

    .rank-step__name { font-size: 0.98rem; }

    .type-card__media { height: 7.5rem; }
}
