/* ═══════════════════════════════════════════
   FINALE CHAPTER — Automatic "Mission Accomplished" Reveal
   Hidden by default; js/finaleChapter.js adds .is-active (unhides,
   display) then .is-revealed (triggers the transition below) the
   moment every exam card on the page is resolved — automatically,
   with no future edits needed here.
   ═══════════════════════════════════════════ */

.finale-chapter {
    display: none;
    position: relative;
    text-align: center;
    padding: 2rem 1.5rem 7rem;
}
.finale-chapter.is-active {
    display: block;
}

.finale-chapter-inner {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(50px) scale(0.97);
    transition: opacity 1.1s cubic-bezier(.16, 1, .3, 1),
                transform 1.1s cubic-bezier(.16, 1, .3, 1);
}
.finale-chapter.is-revealed .finale-chapter-inner {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ── Spark burst (same confettiRise motion as exam cards, larger field) ── */
.finale-chapter-sparks {
    position: absolute;
    top: -1rem;
    left: 0;
    right: 0;
    height: 380px;
    pointer-events: none;
}
.finale-spark {
    position: absolute;
    bottom: 0;
    color: var(--neon);
    text-shadow: 0 0 10px var(--neon-glow);
    opacity: 0;
    pointer-events: none;
    animation: confettiRise 2.6s ease-out forwards;
}

.finale-chapter-kicker {
    position: relative;
    font-size: 0.72rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-weight: 700;
    color: #888;
    margin-bottom: 2.2rem;
}
.finale-chapter-kicker span {
    color: var(--neon);
    text-shadow: 0 0 16px var(--neon-glow);
}

/* ── Medallion ── */
.finale-medallion {
    position: relative;
    width: 108px;
    height: 108px;
    margin: 0 auto 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.finale-medallion::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(5, 0, 5, 0.9);
    border: 1px solid rgba(255, 42, 133, 0.6);
    box-shadow: 0 0 45px rgba(255, 42, 133, 0.35),
                inset 0 0 25px rgba(255, 42, 133, 0.15);
}
.finale-medallion-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 42, 133, 0.4);
    animation: slowSpin 14s linear infinite;
}
.finale-medallion-glyph {
    position: relative;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--neon);
    text-shadow: 0 0 14px var(--neon-glow);
}

.finale-chapter-headline {
    position: relative;
    font-size: clamp(2rem, 6vw, 3.6rem);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 0 30px var(--neon-glow);
    margin-bottom: 1.6rem;
}

.finale-chapter-body {
    font-size: 1.02rem;
    color: #999;
    max-width: 520px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.finale-chapter-badge {
    display: inline-block;
    font-size: 0.76rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--neon);
    border: 1px solid rgba(255, 42, 133, 0.35);
    background: rgba(255, 42, 133, 0.08);
    padding: 0.85rem 2rem;
    border-radius: 100px;
    margin-bottom: 3rem;
}

/* ── Mini certificate teaser → links to the full Diploma section ── */
.finale-cert {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    text-align: left;
    background: linear-gradient(160deg, rgba(22, 4, 15, 0.9), rgba(5, 0, 5, 0.95));
    border: 1px solid rgba(255, 42, 133, 0.3);
    border-radius: 1.5rem;
    padding: 1.5rem 1.6rem;
    max-width: 460px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.finale-cert-seal {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: rgba(255, 42, 133, 0.12);
    color: var(--neon);
    text-shadow: 0 0 10px var(--neon-glow);
}
.finale-cert-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 180px;
}
.finale-cert-text strong {
    font-size: 0.92rem;
    color: #fff;
}
.finale-cert-text span {
    font-size: 0.76rem;
    color: #888;
    line-height: 1.5;
}
.finale-cert-cta {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--neon);
    text-decoration: none;
    border: 1px solid rgba(255, 42, 133, 0.4);
    border-radius: 100px;
    padding: 0.6rem 1.1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.finale-cert-cta:hover {
    background: rgba(255, 42, 133, 0.12);
    border-color: var(--neon);
}
.finale-cert-cta:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 3px;
}
