/* ============================================================
   journey.css — Vyshnav P C Portfolio
   Grid matches HBS: [journey__left(year+dot)] [journey__line-col] [journey__box]
   Mobile-first responsive
   ============================================================ */

/* ── Section wrapper ─────────────────────────────────────── */
.journey {
    background: var(--bg);
    padding: 80px 0 80px;
    position: relative;
    overflow: hidden;
}

/* Subtle grid background */
.journey::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    opacity: 0.4;
}

.journey__container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* ── Header ──────────────────────────────────────────────── */
.journey__header {
    margin-bottom: 48px;
}

.journey__label {
    display: block;
    font-family: var(--fm);
    font-size: 0.72rem;
    color: var(--accent2);
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    opacity: 0.8;
}

.journey__title {
    font-family: var(--fd);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin: 0 0 10px;
}

.journey__title em {
    background: linear-gradient(135deg, var(--accent2) 0%, #c4b5fd 45%, var(--teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.journey__subtitle {
    font-family: var(--fb);
    font-size: 0.95rem;
    color: var(--text2);
    max-width: 480px;
    line-height: 1.7;
    margin: 0;
}

/* ── Timeline wrapper ────────────────────────────────────── */
.journey__timeline {
    position: relative;
}

/* Vertical line runs through the journey__line-col cells.
   Positioned relative to the container using the col 2 center.
   Col 1 = 52px, gap = 12px → line center ≈ 52 + 12 + 8 = 72px from left */
.journey__timeline::before {
    content: '';
    position: absolute;
    left: 72px;
    top: 28px;
    bottom: 28px;
    width: 1px;
    background: linear-gradient(to bottom,
            transparent,
            rgba(165, 148, 255, 0.22) 6%,
            rgba(165, 148, 255, 0.22) 94%,
            transparent);
    pointer-events: none;
}

/* ── Single timeline item ────────────────────────────────── */
.journey__item {
    display: grid;
    /* col1=year+dot | col2=line spacer | col3=box */
    grid-template-columns: 52px 16px 1fr;
    gap: 0 12px;
    margin-bottom: 24px;
    align-items: flex-start;
    position: relative;
}

/* ── Col 1: year + dot stacked ───────────────────────────── */
.journey__left {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-top: 18px;
    gap: 6px;
}

.journey__year {
    font-family: var(--fm);
    font-size: 0.62rem;
    color: var(--text3);
    letter-spacing: 0.04em;
    line-height: 1;
    text-align: right;
    white-space: nowrap;
}

.journey__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(165, 148, 255, 0.22);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.journey__dot-inner {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text3);
    transition: background 0.3s ease, transform 0.3s ease;
}

.journey__item:hover .journey__dot {
    border-color: var(--accent2);
    box-shadow: 0 0 10px var(--glow);
}

.journey__item:hover .journey__dot-inner {
    background: var(--accent2);
    transform: scale(1.3);
}

.journey__item--highlight .journey__dot {
    border-color: var(--accent2);
}

.journey__item--highlight .journey__dot-inner {
    background: var(--accent2);
}

/* ── Col 2: line spacer (visual only, line from ::before) ── */
.journey__line-col {
    /* Empty — vertical line comes from .journey__timeline::before */
}

/* ── Col 3: content box ──────────────────────────────────── */
.journey__box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r12);
    padding: 18px 20px;
    position: relative;
    transition:
        border-color 0.3s ease,
        background 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

/* Horizontal connector: line-col → box */
.journey__box::before {
    content: '';
    position: absolute;
    left: -13px;
    top: 22px;
    width: 12px;
    height: 1px;
    background: rgba(165, 148, 255, 0.20);
    transition: background 0.3s ease;
}

.journey__item:hover .journey__box {
    border-color: rgba(165, 148, 255, 0.28);
    background: rgba(165, 148, 255, 0.04);
    transform: translateX(3px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(165, 148, 255, 0.07);
}

.journey__item:hover .journey__box::before {
    background: var(--accent2);
}

.journey__item--highlight .journey__box {
    border-color: rgba(165, 148, 255, 0.28);
    background: rgba(165, 148, 255, 0.04);
}

/* ── Box internals ───────────────────────────────────────── */
.journey__box-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.journey__icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.journey__tag {
    font-family: var(--fm);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent2);
    background: var(--glow);
    border: 1px solid rgba(165, 148, 255, 0.18);
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.journey__box-title {
    font-family: var(--fd);
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 7px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.journey__box-desc {
    font-family: var(--fb);
    font-size: 0.84rem;
    color: var(--text2);
    line-height: 1.7;
    margin: 0 0 12px;
}

/* ── Metrics ─────────────────────────────────────────────── */
.journey__metrics {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.journey__metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 14px;
    min-width: 72px;
}

.journey__metric-value {
    font-family: var(--fm);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent2);
    line-height: 1;
    margin-bottom: 3px;
}

.journey__metric-label {
    font-family: var(--fm);
    font-size: 0.58rem;
    color: var(--text3);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── Skill tags ──────────────────────────────────────────── */
.journey__skills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.journey__skill-tag {
    font-family: var(--fm);
    font-size: 0.62rem;
    color: var(--text3);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    transition: color 0.2s, border-color 0.2s;
}

.journey__item:hover .journey__skill-tag {
    color: var(--text2);
    border-color: var(--border2);
}

/* ── End cap ─────────────────────────────────────────────── */
.journey__end {
    display: flex;
    align-items: center;
    gap: 12px;
    /* align with dot column: col1(52) + gap(12) + half of col2(8) = 72 - half dot(7) = 65 */
    padding-left: 65px;
    margin-top: 4px;
}

.journey__end-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent2);
    box-shadow: 0 0 14px var(--glow);
    flex-shrink: 0;
    animation: journey-pulse 2.4s ease-in-out infinite;
}

@keyframes journey-pulse {

    0%,
    100% {
        box-shadow: 0 0 14px var(--glow);
    }

    50% {
        box-shadow: 0 0 24px rgba(165, 148, 255, 0.5), 0 0 48px rgba(124, 110, 247, 0.16);
    }
}

.journey__end-label {
    font-family: var(--fm);
    font-size: 0.72rem;
    color: var(--accent2);
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.journey__cursor {
    animation: jrny-blink 1.1s step-end infinite;
}

@keyframes jrny-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ── Reveal animation ────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.v {
    opacity: 1;
    transform: none;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

/* ── Tablet ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .journey {
        padding: 64px 0 64px;
    }

    .journey__container {
        padding: 0 16px;
    }

    .journey__header {
        margin-bottom: 36px;
    }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .journey {
        padding: 56px 0 56px;
    }

    /* Collapse left col: year above, dot inline with line */
    .journey__item {
        grid-template-columns: 40px 12px 1fr;
        gap: 0 10px;
        margin-bottom: 20px;
    }

    /* Vertical line repositioned for new col widths:
       col1(40) + gap(10) + half col2(6) = 56px */
    .journey__timeline::before {
        left: 56px;
    }

    .journey__left {
        padding-top: 16px;
        gap: 5px;
    }

    .journey__year {
        font-size: 0.58rem;
    }

    .journey__dot {
        width: 12px;
        height: 12px;
    }

    .journey__dot-inner {
        width: 4px;
        height: 4px;
    }

    .journey__box {
        padding: 14px 14px;
    }

    /* Connector tweak for narrower col2 */
    .journey__box::before {
        left: -11px;
        width: 10px;
    }

    .journey__box-title {
        font-size: 0.88rem;
    }

    .journey__box-desc {
        font-size: 0.8rem;
    }

    .journey__tag {
        font-size: 0.56rem;
    }

    .journey__end {
        /* col1(40) + gap(10) + half col2(6) - half dot(6) = 50 */
        padding-left: 50px;
        gap: 10px;
    }

    .journey__end-dot {
        width: 12px;
        height: 12px;
    }

    .journey__metrics {
        gap: 5px;
    }

    .journey__metric {
        padding: 5px 10px;
        min-width: 60px;
    }

    .journey__metric-value {
        font-size: 0.85rem;
    }
}

/* ── Very small screens ──────────────────────────────────── */
@media (max-width: 360px) {
    .journey__item {
        grid-template-columns: 32px 10px 1fr;
        gap: 0 8px;
    }

    .journey__timeline::before {
        left: 47px;
    }

    .journey__end {
        padding-left: 42px;
    }
}