/* =========================================
   EXPERIENCE: a year by year logbook
   Big serif years on the left, one rail, one node per role.
   Proof sits on white "paper tape" so outcomes read without clicking.
   ========================================= */

#experience.experience-section {
    /* full width sand band; the content inside is capped */
    max-width: none;
    margin: 0;
    padding: 80px 5% 72px;
    --xp-ink: var(--text-pencil, #1A1A18);
    --xp-muted: #6B665C;
    --xp-body: #3B3934;
    --xp-rail: rgba(26, 26, 24, 0.22);
    --xp-teal: var(--color-highlight, #266268);
    --xp-teal-ink: var(--color-accent-ink, #14545E);
    --xp-live: #2FA66A;
    --xp-year-col: 168px;
    --xp-gap: 44px;
    --xp-indent: 36px;
}

.xp-head {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.xp-head .section-subtitle {
    margin-bottom: 18px;
}

.xp-legend {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 22px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    color: var(--xp-muted);
}

.xp-legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.xp-key {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1.5px solid var(--xp-ink);
    background: var(--bg-sand, #E1DACD);
}

.xp-key-founding {
    background: var(--xp-teal);
    border-color: var(--xp-teal-ink);
}

.xp-key-win {
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 0;
    background: var(--xp-ink);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* ---------- The log ---------- */
.xp-log {
    max-width: 980px;
    margin: 56px auto 0;
}

.xp-year {
    display: grid;
    grid-template-columns: var(--xp-year-col) minmax(0, 1fr);
    column-gap: var(--xp-gap);
}

.xp-year-label {
    position: sticky;
    top: 110px;
    align-self: start;
    text-align: right;
    padding-top: 2px;
}

.xp-year-num {
    display: block;
    font-family: var(--font-sketch);
    font-size: 76px;
    font-weight: 400;
    line-height: 0.85;
    letter-spacing: -0.02em;
    color: var(--xp-ink);
    font-variant-numeric: lining-nums;
    transition: color 0.5s ease;
}

.xp-year-note {
    display: inline-block;
    margin-top: 10px;
    font-family: var(--font-sketch);
    font-style: italic;
    font-size: 22px;
    color: var(--xp-teal-ink);
    transform: rotate(-4deg);
}

.xp-year-note::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 8px 2px 0;
    border-radius: 50%;
    background: var(--xp-live);
    vertical-align: middle;
}

/* the rail */
.xp-entries {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0 0 36px var(--xp-indent);
}

.xp-entries::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: var(--xp-rail);
}

.xp-year:first-child .xp-entries::before {
    top: 14px;
}

.xp-year-start .xp-entries {
    padding-bottom: 0;
}

.xp-year-start .xp-entries::before {
    bottom: auto;
    height: 14px;
}

/* ---------- One entry ---------- */
.xp-entry {
    position: relative;
    padding-bottom: 40px;
}

.xp-entry:last-child {
    padding-bottom: 0;
}

.xp-year:not(.xp-year-start) .xp-entry:last-child {
    padding-bottom: 8px;
}

/* node on the rail */
.xp-entry::before {
    content: "";
    position: absolute;
    left: calc(var(--xp-indent) * -1 - 6px);
    top: 9px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1.5px solid var(--xp-ink);
    background: var(--bg-sand, #E1DACD);
    box-sizing: border-box;
    transition: transform 0.4s var(--ease-sketch, ease);
}

.xp-entry[data-kind="founding"]::before {
    background: var(--xp-teal);
    border-color: var(--xp-teal-ink);
}

.xp-entry.is-current::before {
    background: var(--xp-live);
    border-color: #1F7A4B;
    animation: xp-pulse 2.4s ease-out infinite;
}

.xp-entry[data-kind="win"]::before {
    left: calc(var(--xp-indent) * -1 - 7.25px);
    top: 6px;
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 0;
    background: var(--xp-ink);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.xp-entry[data-kind="study"]::before {
    top: 7px;
}

@keyframes xp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(47, 166, 106, 0.5);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(47, 166, 106, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(47, 166, 106, 0);
    }
}

.xp-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 20px;
    flex-wrap: wrap;
}

.xp-company {
    font-family: var(--font-sketch);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--xp-ink);
    margin: 0;
}

.xp-at {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    color: var(--xp-muted);
    margin-left: 4px;
}

.xp-when {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    color: var(--xp-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.xp-role {
    margin: 4px 0 0;
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 600;
    color: var(--xp-ink);
}

.xp-type {
    margin-left: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--xp-muted);
    white-space: nowrap;
}

.xp-entry[data-kind="founding"] .xp-type {
    color: var(--xp-teal-ink);
}

.xp-desc {
    margin: 8px 0 0;
    max-width: 62ch;
    font-family: var(--font-ui);
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--xp-body);
}

/* proof on paper tape */
.xp-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 0;
}

.xp-proof mark {
    display: inline-block;
    padding: 6px 12px;
    background: var(--card-bg, #fff);
    border: var(--card-border, 0.5px solid var(--xp-ink));
    border-radius: var(--card-radius, 4px);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--xp-ink);
}

.xp-proof mark::before {
    content: "↗";
    margin-right: 7px;
    color: var(--xp-teal);
    font-weight: 700;
}

.xp-link {
    display: inline-block;
    margin-top: 14px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    color: var(--xp-teal-ink);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.xp-link::after {
    content: " →";
    display: inline-block;
    text-decoration: none;
    transition: transform 0.25s var(--ease-polish, ease);
}

.xp-link:hover {
    color: var(--xp-ink);
}

.xp-link:hover::after {
    transform: translateX(3px);
}

.xp-link:focus-visible {
    outline: 2px solid var(--xp-teal);
    outline-offset: 3px;
    border-radius: 2px;
}

/* hackathon wins and the start line: one quiet row */
.xp-win,
.xp-origin {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 20px;
    flex-wrap: wrap;
}

.xp-win-text {
    margin: 0;
    font-family: var(--font-sketch);
    font-style: italic;
    font-size: 22px;
    line-height: 1.3;
    color: var(--xp-body);
}

.xp-win-text strong {
    font-style: normal;
    font-weight: 700;
    color: var(--xp-ink);
}

/* ---------- Motion (only when experience.js runs) ---------- */
.xp-js .xp-year:not(.is-active) .xp-year-num {
    color: rgba(26, 26, 24, 0.26);
}

.xp-js .xp-entry {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s var(--ease-polish, ease), transform 0.6s var(--ease-polish, ease);
}

.xp-js .xp-entry::before {
    transform: scale(0.3);
}

.xp-js .xp-entry.is-in {
    opacity: 1;
    transform: none;
}

.xp-js .xp-entry.is-in::before {
    transform: scale(1);
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    #experience.experience-section {
        padding: 56px 16px 48px;
        --xp-indent: 26px;
    }

    .xp-log {
        margin-top: 36px;
    }

    .xp-year {
        grid-template-columns: minmax(0, 1fr);
    }

    .xp-year-label {
        position: static;
        display: flex;
        align-items: baseline;
        gap: 12px;
        text-align: left;
        padding: 4px 0 16px;
    }

    .xp-year-num {
        font-size: 48px;
    }

    .xp-year-note {
        margin-top: 0;
        font-size: 19px;
    }

    .xp-entries {
        margin-left: 7px;
        padding-bottom: 28px;
    }

    .xp-year:first-child .xp-entries::before {
        top: 12px;
    }

    .xp-entry {
        padding-bottom: 32px;
    }

    .xp-company {
        font-size: 25px;
    }

    .xp-top {
        flex-direction: column;
        gap: 2px;
    }

    .xp-role {
        font-size: 15px;
    }

    .xp-type {
        display: block;
        margin: 4px 0 0;
    }

    .xp-desc {
        font-size: 15px;
    }

    .xp-proof mark {
        font-size: 13.5px;
    }

    .xp-win-text {
        font-size: 19px;
    }
}

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

    .xp-js .xp-entry,
    .xp-js .xp-entry::before {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .xp-entry.is-current::before {
        animation: none;
    }

    .xp-year-num {
        transition: none;
    }
}
