/* =========================================================================
   SYNERGY SECTION — Cascading tier reveal, hover glow rings, peak aurora.
   Derived from: Synergy score tiers in app, GlassContainer hover states.
   ========================================================================= */

section#synergy {
    background: var(--clr-bg-light);
    padding-block: clamp(3rem, 6vh, 5.5rem);
    position: relative;
    overflow: hidden;
}

section#synergy::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(244, 123, 37, 0.06), transparent 60%);
    pointer-events: none;
}

section#synergy > .container {
    position: relative;
    z-index: 1;
}

.synergy-header {
    text-align: center;
    max-width: 680px;
    margin-inline: auto;
    margin-bottom: 3.5rem;
}

.synergy-header h2 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.synergy-sub {
    font-size: clamp(1.05rem, 1.4vw, 1.2rem);
    opacity: 0.75;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.synergy-body {
    font-size: 1rem;
    opacity: 0.6;
    font-style: italic;
}

/* ── Tier Ladder — Staggered Cascade Reveal ──────────────────────── */

.tier-ladder {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 1rem 0.25rem 1.5rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    justify-content: flex-start;
    max-width: 100%;
}

.tier-ladder::-webkit-scrollbar {
    display: none;
}

@media (min-width: 1100px) {
    .tier-ladder {
        justify-content: center;
        flex-wrap: nowrap;
    }
}

/* ── Tier Chip — Enhanced with glow rings ────────────────────────── */

.tier-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.9rem 0.85rem;
    min-width: 92px;
    border-radius: 18px;
    scroll-snap-align: center;
    flex-shrink: 0;
    transition:
        transform 0.4s var(--ease-bounce),
        box-shadow 0.4s var(--ease-smooth),
        border-color 0.4s ease;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(244, 123, 37, 0.15);
    position: relative;
    cursor: default;
}

/* Glow ring on hover — colored per tier */
.tier-chip::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 21px;
    background: radial-gradient(
        ellipse at center,
        rgba(244, 123, 37, 0.15) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.tier-chip:hover::before {
    opacity: 1;
}

.tier-chip:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow:
        0 12px 32px rgba(244, 123, 37, 0.2),
        0 0 0 1px rgba(244, 123, 37, 0.25);
}

/* Stagger animation — works with IntersectionObserver stagger-children */
.tier-ladder.stagger-children > .tier-chip {
    opacity: 0;
    transform: translateY(24px) scale(0.9);
}

.tier-ladder.stagger-children.is-visible > .tier-chip {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Per-chip delays for cascade effect */
.tier-ladder.stagger-children.is-visible > .tier-chip:nth-child(1)  { transition-delay: 80ms; }
.tier-ladder.stagger-children.is-visible > .tier-chip:nth-child(2)  { transition-delay: 140ms; }
.tier-ladder.stagger-children.is-visible > .tier-chip:nth-child(3)  { transition-delay: 200ms; }
.tier-ladder.stagger-children.is-visible > .tier-chip:nth-child(4)  { transition-delay: 260ms; }
.tier-ladder.stagger-children.is-visible > .tier-chip:nth-child(5)  { transition-delay: 320ms; }
.tier-ladder.stagger-children.is-visible > .tier-chip:nth-child(6)  { transition-delay: 380ms; }
.tier-ladder.stagger-children.is-visible > .tier-chip:nth-child(7)  { transition-delay: 440ms; }
.tier-ladder.stagger-children.is-visible > .tier-chip:nth-child(8)  { transition-delay: 500ms; }
.tier-ladder.stagger-children.is-visible > .tier-chip:nth-child(9)  { transition-delay: 560ms; }
.tier-ladder.stagger-children.is-visible > .tier-chip:nth-child(10) { transition-delay: 620ms; }

.tier-emoji {
    font-size: 1.6rem;
    line-height: 1;
    transition: transform 0.3s var(--ease-bounce);
}

.tier-chip:hover .tier-emoji {
    transform: scale(1.2) rotate(-5deg);
}

.tier-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--clr-text-dark);
    opacity: 0.85;
}

/* ── Peak Chip — Legendary with Aurora Border ────────────────────── */

.tier-chip--peak {
    background: linear-gradient(135deg, rgba(244, 123, 37, 0.18), rgba(251, 191, 36, 0.15));
    border-color: rgba(244, 123, 37, 0.4);
    box-shadow: 0 0 24px rgba(244, 123, 37, 0.2);
    position: relative;
    z-index: 1;
    overflow: visible;
}

/* Aurora rotating conic gradient border */
.tier-chip--peak::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    padding: 2px;
    background: conic-gradient(
        from 0deg,
        rgba(244, 123, 37, 0.6),
        rgba(251, 191, 36, 0.4),
        rgba(244, 123, 37, 0.1),
        rgba(167, 139, 250, 0.3),
        rgba(244, 123, 37, 0.6)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: auroraRotate 6s linear infinite;
    z-index: -1;
    pointer-events: none;
}

.tier-chip--peak .tier-name {
    color: var(--clr-primary);
    opacity: 1;
}

.tier-chip--peak:hover {
    box-shadow:
        0 12px 40px rgba(244, 123, 37, 0.35),
        0 0 20px rgba(251, 191, 36, 0.2);
    transform: translateY(-8px) scale(1.08);
}

/* ── Caption ─────────────────────────────────────────────────────── */

.synergy-caption {
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.6;
    margin-top: 1rem;
    max-width: 56ch;
    margin-inline: auto;
    line-height: 1.6;
    font-style: italic;
}

/* ── Mobile ──────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .tier-ladder {
        gap: 0.5rem;
    }

    .tier-chip {
        min-width: 80px;
        padding: 0.75rem 0.6rem;
    }

    .tier-emoji {
        font-size: 1.4rem;
    }

    .tier-name {
        font-size: 0.72rem;
    }
}
