/* Purpose journey: a pinned stage where each scroll step swaps the active purpose.
   Palette follows the site: pale yellow, olive, charcoal. One accent (olive). */

.pj {
    --pj-ink: #2d3436;
    --pj-ink-soft: #5f6b6e;
    --pj-olive: #6b7a3a;
    --pj-sage: #a3b18a;
    --pj-yellow: #fcf4ad;
    --pj-cream: #fff8e1;
    --pj-hair: rgba(107, 122, 58, 0.28);
    --pj-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --pj-radius: 16px;
    position: relative;
    background:
        radial-gradient(1100px 620px at 82% 55%, rgba(252, 244, 173, 0.9), transparent 70%),
        linear-gradient(180deg, #fff8e1 0%, #fffbea 100%);
    color: var(--pj-ink);
    font-family: var(--pu-font-body);
    overflow: hidden;
}

.pj-inner {
    min-height: 100dvh;
    max-width: 1320px;
    margin: 0 auto;
    padding: clamp(96px, 13vh, 128px) clamp(20px, 4vw, 56px) clamp(40px, 6vh, 64px);
    display: grid;
    grid-template-columns: minmax(300px, 5fr) 7fr;
    gap: clamp(24px, 5vw, 80px);
    align-items: center;
}

/* ---------- intro + rail ---------- */
.pj-title {
    font-weight: 700;
    font-size: clamp(1.9rem, 3.3vw, 3.2rem);
    line-height: 1.14;
    letter-spacing: -0.035em;
    margin: 0 0 18px;
    padding-bottom: 4px;
    color: var(--pj-ink);
}

.pj-title em {
    font-style: italic;
    color: var(--pj-olive);
}

.pj-lead {
    margin: 0 0 clamp(20px, 4vh, 40px);
    max-width: 44ch;
    font-size: clamp(0.95rem, 1.05vw, 1.05rem);
    line-height: 1.65;
    color: var(--pj-ink-soft);
}

.pj-rail {
    list-style: none;
    margin: 0;
    padding: 0 0 0 22px;
    position: relative;
    display: none;
}

.pj-live .pj-rail { display: block; }

.pj-rail::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: var(--pj-hair);
}

.pj-rail-mark {
    position: absolute;
    left: -1px;
    top: 4px;
    width: 3px;
    height: 40px;
    border-radius: 3px;
    background: var(--pj-olive);
    transform: translateY(calc(var(--pj-i, 0) * 44px));
    transition: transform 0.7s var(--pj-ease);
}

.pj-rail li { height: 44px; }

.pj-rail button {
    all: unset;
    box-sizing: border-box;
    height: 44px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    color: rgba(45, 52, 54, 0.45);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    transition: color 0.4s ease, transform 0.6s var(--pj-ease);
}

.pj-rail button:hover { color: var(--pj-ink); }

.pj-rail button:focus-visible {
    outline: 2px solid var(--pj-olive);
    outline-offset: 2px;
    border-radius: 8px;
}

.pj-rail button[aria-current='true'] {
    color: var(--pj-ink);
    transform: translateX(8px);
}

.pj-rail-n {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--pj-olive);
    min-width: 22px;
}

/* ---------- stage ---------- */
.pj-stage {
    position: relative;
    display: grid;
    gap: 28px;
}

.pj-live .pj-stage {
    display: block;
    min-height: clamp(380px, 62vh, 620px);
}

.pj-bignum {
    display: none;
}

.pj-live .pj-bignum {
    display: block;
    position: absolute;
    right: -2%;
    bottom: -9%;
    font-weight: 800;
    font-size: clamp(11rem, 27vw, 24rem);
    line-height: 0.8;
    letter-spacing: -0.06em;
    color: rgba(107, 122, 58, 0.09);
    user-select: none;
    pointer-events: none;
}

.pj-bignum span {
    display: block;
    transition: transform 0.9s var(--pj-ease), opacity 0.6s ease;
}

.pj-bignum.is-swapping span {
    transform: translateY(24px);
    opacity: 0;
}

.pj-panel {
    display: grid;
    gap: 14px;
    align-content: center;
    padding: 4px 0;
}

.pj-live .pj-panel {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(56px);
    pointer-events: none;
    transition: opacity 0.55s ease, transform 0.9s var(--pj-ease);
}

.pj-live .pj-panel.is-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.pj-live .pj-panel.is-past { transform: translateY(-56px); }

.pj-icon {
    position: relative;
    width: clamp(84px, 9vw, 116px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--pj-yellow);
    color: var(--pj-olive);
    font-size: clamp(1.9rem, 3.2vw, 2.7rem);
    box-shadow: 0 14px 34px rgba(107, 122, 58, 0.18);
}

.pj-icon::before {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 1.5px dashed var(--pj-sage);
    transform: rotate(var(--pj-rot, 0deg));
}

.pj-kicker {
    margin: 14px 0 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--pj-ink-soft);
}

.pj-word {
    margin: 0;
    font-weight: 700;
    font-size: clamp(3rem, 7.4vw, 6.6rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
    color: var(--pj-ink);
    padding-bottom: 6px;
}

.pj-desc {
    margin: 4px 0 0;
    max-width: 34ch;
    font-size: clamp(1.02rem, 1.4vw, 1.3rem);
    line-height: 1.55;
    color: var(--pj-ink-soft);
}

/* staggered child entrance, only while live */
.pj-live .pj-icon,
.pj-live .pj-kicker,
.pj-live .pj-word,
.pj-live .pj-desc {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.5s ease, transform 0.9s var(--pj-ease);
}

.pj-live .is-active .pj-icon,
.pj-live .is-active .pj-kicker,
.pj-live .is-active .pj-word,
.pj-live .is-active .pj-desc {
    opacity: 1;
    transform: none;
}

.pj-live .is-active .pj-icon   { transition-delay: 0.04s; }
.pj-live .is-active .pj-kicker { transition-delay: 0.1s; }
.pj-live .is-active .pj-word   { transition-delay: 0.16s; }
.pj-live .is-active .pj-desc   { transition-delay: 0.24s; }

/* thin progress line along the bottom of the pinned view */
.pj-progress {
    display: none;
}

.pj-live .pj-progress {
    display: block;
    position: absolute;
    left: clamp(20px, 4vw, 56px);
    right: clamp(20px, 4vw, 56px);
    bottom: clamp(18px, 3vh, 30px);
    height: 2px;
}

.pj-progress span {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--pj-olive);
    transform-origin: left center;
    transform: scaleX(var(--pj-p, 0));
}

/* ---------- not live (reduced motion / no JS): readable stacked list ---------- */
.pj:not(.pj-live) .pj-inner { align-items: start; }
.pj:not(.pj-live) .pj-panel {
    padding: 22px 0;
    border-top: 1px solid var(--pj-hair);
    grid-template-columns: auto 1fr;
    column-gap: 22px;
}
.pj:not(.pj-live) .pj-icon { grid-row: span 3; width: 72px; font-size: 1.6rem; }
.pj:not(.pj-live) .pj-icon::before { display: none; }
.pj:not(.pj-live) .pj-kicker { display: none; }
.pj:not(.pj-live) .pj-word { font-size: clamp(1.8rem, 3vw, 2.6rem); }

/* ---------- tablet / phone ---------- */
@media (max-width: 900px) {
    .pj-inner {
        grid-template-columns: 1fr;
        align-content: start;
        gap: 18px;
        padding-top: clamp(92px, 14vh, 112px);
    }

    .pj-title { font-size: clamp(1.55rem, 6vw, 2.1rem); margin-bottom: 10px; }
    .pj-lead { font-size: 0.9rem; margin-bottom: 4px; line-height: 1.55; }

    .pj-live .pj-rail {
        display: flex;
        justify-content: center;
        gap: 10px;
        padding: 0;
        margin-top: 14px;
        order: 3;
    }

    .pj-rail::before, .pj-rail-mark { display: none; }
    .pj-rail li { height: auto; }

    .pj-rail button {
        width: 10px;
        height: 10px;
        padding: 0;
        border-radius: 50%;
        background: var(--pj-hair);
        transition: background 0.4s ease, width 0.5s var(--pj-ease);
    }

    .pj-rail button[aria-current='true'] {
        width: 30px;
        border-radius: 999px;
        background: var(--pj-olive);
        transform: none;
    }

    .pj-rail button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

    .pj-live .pj-stage { min-height: clamp(300px, 46vh, 420px); }
    .pj-live .pj-bignum { font-size: 9rem; bottom: -4%; }
    .pj-icon { width: 68px; font-size: 1.5rem; }
    .pj-icon::before { inset: -8px; }
    .pj-kicker { margin-top: 6px; }
    .pj-word { font-size: clamp(2.6rem, 14vw, 4rem); }
    .pj-desc { font-size: 1rem; }
}

@media (max-height: 700px) and (min-width: 901px) {
    .pj-lead { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pj *, .pj *::before { transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
