/* ============================================================
   REIS HR — Our Journey  |  Premium Timeline v4 (Labaton-inspired)
   Executive storytelling, hyper-legible, seamless GSAP
   ============================================================ */

/* ─── Section ─────────────────────────────────────────────── */
.journey-section {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 50%, #ffffff 100%);
}

/* ─── Intro header ────────────────────────────────────────── */
.journey-intro {
    padding: 80px 0 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.journey-intro h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    line-height: 1.2;
    max-width: 800px;
    margin: 12px auto 20px;
    letter-spacing: -0.02em;
}

.journey-intro .lead {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--ink-2);
}

/* ─── Pinned experience ───────────────────────────────────── */
.journey-experience {
    position: relative;
}

.journey-stage {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center everything vertically */
    align-items: center;
    padding-top: calc(var(--header-h, 92px));
    padding-bottom: 20px;
    background: linear-gradient(170deg, #f5f7fd 0%, #ffffff 60%, #f4f6fb 100%);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* ─── Background year watermark ───────────────────────────── */
.journey-year-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Poppins', sans-serif;
    font-size: clamp(14rem, 25vw, 24rem);
    font-weight: 800;
    letter-spacing: -.05em;
    opacity: .025;
    color: var(--blue-dark);
    line-height: 1;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    transition: opacity .5s, transform .5s ease-out;
}

.journey-stage[data-changing="true"] .journey-year-display {
    transform: translate(-50%, -55%) scale(1.02);
    opacity: 0;
}

/* ─── Card area ───────────────────────────────────────────── */
.journey-card-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 40px;
    position: relative;
    min-height: 0;
    z-index: 1;
    margin-bottom: 30px;
    /* Tightly coupled to the timeline below */
}

/* ─── Milestone Card — Massive & Premium ──────────────────── */
.jcard {
    position: absolute;
    max-width: 1100px;
    width: 95%;
    border-radius: 24px;
    background: rgba(255, 255, 255, .90);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(43, 118, 185, .08);
    box-shadow:
        0 32px 80px -20px rgba(30, 61, 107, .12),
        0 0 0 1px rgba(255, 255, 255, .8) inset;
    transition:
        opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s ease;
    will-change: opacity, transform;
    pointer-events: none;
    opacity: 0;
    transform: translateY(40px) scale(0.98);
}

.jcard.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    z-index: 2;
}

.jcard.exit-up {
    opacity: 0;
    transform: translateY(-40px) scale(0.98);
    z-index: 1;
    pointer-events: none;
}

.jcard.active:hover {
    box-shadow:
        0 45px 95px -25px rgba(30, 61, 107, .18),
        0 0 0 1.5px rgba(43, 118, 185, .12) inset,
        0 0 0 1px rgba(255, 255, 255, .8) inset;
    transform: translateY(-4px);
}

/* ─── Card inner layout ───────────────────────────────────── */
.jcard-inner {
    display: grid;
    grid-template-columns: 8px 1fr;
    gap: 0;
}

/* Elegant left accent */
.jcard-accent {
    background: linear-gradient(180deg, var(--orange) 0%, var(--blue) 100%);
    border-radius: 24px 0 0 24px;
}

/* Content area */
.jcard-content {
    padding: 60px 80px;
    /* Massive inner breathing room */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ─── Sequential Card Animations ──────────────────────────── */
.jcard-year,
.jcard h3,
.jcard-divider,
.jcard-desc,
.jcard-badges {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s cubic-bezier(0, 0, 0.2, 1), transform 0.5s cubic-bezier(0, 0, 0.2, 1);
}

.jcard.active .jcard-year {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.10s;
}

.jcard.active h3 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.18s;
}

.jcard.active .jcard-divider {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.26s;
}

.jcard.active .jcard-desc {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.34s;
}

.jcard.active .jcard-badges {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.42s;
}

/* ─── Typography ──────────────────────────────────────────── */
.jcard-year {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(4rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.jcard-content h3 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--blue-dark);
    line-height: 1.25;
    margin-bottom: 24px;
    letter-spacing: -.01em;
}

.jcard-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--orange) 0%, var(--orange-dark) 100%);
    border-radius: 2px;
    margin-bottom: 28px;
}

.jcard-desc {
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    line-height: 1.8;
    color: var(--ink-2);
    margin-bottom: 36px;
    max-width: 75ch;
    font-weight: 400;
}

/* Badges */
.jcard-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.jcard-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--blue-dark);
    background: rgba(43, 118, 185, .05);
    border-radius: 999px;
    border: 1px solid rgba(43, 118, 185, .12);
    transition: background .3s ease, border-color .3s ease, transform .3s ease;
}

.jcard-badge:hover {
    background: rgba(43, 118, 185, .1);
    border-color: rgba(43, 118, 185, .25);
    transform: translateY(-2px);
}

/* ─── Timeline ─────────────────────────────────────────────── */
.journey-timeline {
    width: 100%;
    max-width: 1240px;
    flex-shrink: 0;
    padding: 0 40px;
    position: relative;
    z-index: 2;
    margin: 0 auto;
}

.jtl-track {
    position: relative;
    height: 110px;
    display: flex;
    align-items: flex-start;
}

/* Rail */
.jtl-line {
    position: absolute;
    top: 25px;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(30, 61, 107, .12);
    border-radius: 1.5px;
    z-index: 0;
}

/* Animated fill */
.jtl-fill {
    position: absolute;
    top: 25px;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--orange) 0%, var(--blue) 100%);
    border-radius: 1.5px;
    transition: width .15s ease-out;
    z-index: 1;
}

/* Dots row */
.jtl-dots {
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Individual dot button */
.jtl-dot {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 0;
    position: relative;
    outline: none;
    flex: 1;
    transition: opacity .3s;
}

/* Ring + circle wrapper */
.jtl-dot-ring {
    position: relative;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.jtl-dot-ring svg {
    position: absolute;
    inset: 0;
    width: 46px;
    height: 46px;
    transform: rotate(-90deg);
    pointer-events: none;
}

.jtl-ring-bg {
    fill: none;
    stroke: rgba(43, 118, 185, .1);
    stroke-width: 2.5;
}

.jtl-ring-progress {
    fill: none;
    stroke: var(--orange);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 113.1;
    /* 2π × 18 = 113.097 */
    stroke-dashoffset: 113.1;
    transition: stroke-dashoffset .05s linear;
}

/* Circle dot */
.jtl-dot-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(30, 61, 107, .18);
    border: 3px solid transparent;
    transition: all .4s cubic-bezier(.22, 1, .36, 1);
    position: relative;
    z-index: 2;
}

.jtl-dot.completed .jtl-dot-circle {
    background: var(--blue);
}

.jtl-dot.active .jtl-dot-circle {
    width: 24px;
    height: 24px;
    background: var(--orange);
    border-color: #fff;
    box-shadow:
        0 0 0 5px rgba(241, 122, 48, .25),
        0 0 20px rgba(241, 122, 48, .3);
    animation: dotGlow 2.5s ease-in-out infinite;
}

@keyframes dotGlow {

    0%,
    100% {
        box-shadow: 0 0 0 5px rgba(241, 122, 48, .25), 0 0 20px rgba(241, 122, 48, .3);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(241, 122, 48, .12), 0 0 30px rgba(241, 122, 48, .18);
    }
}

/* Year labels */
.jtl-dot-year {
    font-size: .85rem;
    font-weight: 600;
    color: rgba(30, 61, 107, .4);
    transition: all .4s ease;
    white-space: nowrap;
    letter-spacing: .02em;
    line-height: 1;
}

.jtl-dot.active .jtl-dot-year {
    color: var(--orange-dark);
    font-weight: 800;
    font-size: .95rem;
    transform: scale(1.2);
}

.jtl-dot.completed .jtl-dot-year {
    color: var(--blue);
    font-weight: 700;
}

.jtl-dot:hover .jtl-dot-circle {
    transform: scale(1.3);
    box-shadow: 0 0 0 5px rgba(43, 118, 185, .15);
}

.jtl-dot.active:hover .jtl-dot-circle {
    transform: scale(1);
}

.jtl-dot:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 4px;
    border-radius: 6px;
}

/* ─── Mobile vertical timeline ─────────────────────────────── */
.journey-mobile-timeline {
    display: none;
    padding: 24px 0 60px;
}

.jm-list {
    position: relative;
    padding-left: 48px;
}

.jm-list::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(30, 61, 107, .1);
    border-radius: 2px;
}

.jm-item {
    position: relative;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .6s ease, transform .6s ease;
}

.jm-item.in {
    opacity: 1;
    transform: translateY(0);
}

.jm-dot {
    position: absolute;
    left: -43px;
    top: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--blue);
    border: 3px solid #fff;
    box-shadow: 0 0 0 4px rgba(43, 118, 185, .2);
    z-index: 1;
}

.jm-year {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -.02em;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    display: block;
}

.jm-card {
    border-radius: 20px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(30, 61, 107, .08);
    box-shadow: 0 12px 48px -12px rgba(30, 61, 107, .15);
    overflow: hidden;
    transition: transform .4s ease, box-shadow .4s ease;
}

.jm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 60px -15px rgba(30, 61, 107, .2);
}

.jm-card-body {
    padding: 30px;
    border-left: 6px solid;
    border-image: linear-gradient(180deg, var(--orange), var(--blue)) 1;
}

.jm-card-body h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    line-height: 1.3;
}

.jm-card-body p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 18px;
    color: var(--ink-2);
}

.jm-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.jm-badge {
    padding: 6px 14px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--blue-dark);
    background: rgba(43, 118, 185, .08);
    border-radius: 999px;
    border: 1px solid rgba(43, 118, 185, .1);
}

/* ─── Responsive Adjustments ───────────────────────────── */
@media (max-width: 768px) {
    .journey-experience {
        display: none !important;
    }

    .journey-mobile-timeline {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .journey-mobile-timeline {
        display: none !important;
    }
}

@media (max-width: 1200px) and (min-width: 769px) {
    .jcard {
        max-width: 900px;
    }

    .jcard-content {
        padding: 40px 50px;
    }

    .journey-timeline {
        padding: 0 24px;
    }

    .jtl-dot-year {
        font-size: .75rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .jcard,
    .jcard.active,
    .jcard.exit-up {
        transition: opacity .1s !important;
        transform: none !important;
    }

    .jcard-content>* {
        transition: opacity .1s !important;
        transform: none !important;
    }

    .jtl-dot-circle {
        animation: none !important;
    }

    .jtl-ring-progress {
        transition: none !important;
    }
}