/* =========================================================
   ABOUT PAGE: portrait hero and experience line
   Loaded only by /sergiy-belyakov/ (uk, en, pt).
   ========================================================= */

/* --- Hero with portrait --- */
.profile-hero {
    min-height: 0;
    padding: 168px 0 92px;
    background:
        radial-gradient(circle at 21% 44%, rgba(217, 4, 41, .16), transparent 33%),
        linear-gradient(180deg, #080c12 0%, #05070a 100%);
}
.profile-hero-grid {
    position: relative; z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
    grid-template-areas: "crumbs crumbs" "photo copy";
    column-gap: 76px;
    align-items: center;
}
.profile-hero-grid .breadcrumbs { grid-area: crumbs; margin-bottom: 38px; }
.profile-hero-grid .detail-hero-copy { grid-area: copy; }
.profile-hero .detail-hero-copy h1 {
    font-size: clamp(2.1rem, 3.5vw, 3.25rem);
    line-height: 1.1; letter-spacing: -.035em;
    margin: 14px 0 24px;
}
.profile-hero .detail-hero-copy > p { font-size: 1.08rem; line-height: 1.8; margin-bottom: 34px; }

.profile-portrait { grid-area: photo; position: relative; margin: 0; }
.profile-portrait img {
    display: block;
    width: 122%; max-width: none; height: auto;
    margin: -5% 0 -7% -15%;
    user-select: none; -webkit-user-drag: none;
}
/* Viewfinder corners: the frame is implied, the photo itself has no hard edges. */
.profile-portrait::before,
.profile-portrait::after {
    content: ''; position: absolute; width: 26px; height: 26px; pointer-events: none;
}
.profile-portrait::before {
    left: 0; top: 0;
    border-left: 1px solid rgba(217, 4, 41, .85); border-top: 1px solid rgba(217, 4, 41, .85);
    box-shadow: -6px -6px 22px -10px rgba(217, 4, 41, .8);
}
.profile-portrait::after {
    right: 0; bottom: 0;
    border-right: 1px solid rgba(255, 255, 255, .26); border-bottom: 1px solid rgba(255, 255, 255, .26);
}
.profile-portrait figcaption {
    position: absolute; left: 0; bottom: 0;
    display: flex; flex-direction: column; gap: 5px;
    padding-left: 16px; border-left: 2px solid #D90429;
}
.profile-portrait figcaption strong {
    font-family: var(--font-h); font-weight: 700; font-size: 1.08rem; color: #fff; letter-spacing: -.01em;
}
.profile-portrait figcaption span { font-size: .78rem; color: #9aa6b4; letter-spacing: .04em; }

@media (max-width: 1000px) {
    .profile-hero-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); column-gap: 44px; }
}
@media (max-width: 820px) {
    .profile-hero { padding: 132px 0 64px; background:
        radial-gradient(circle at 50% 30%, rgba(217, 4, 41, .16), transparent 46%),
        linear-gradient(180deg, #080c12 0%, #05070a 100%); }
    .profile-hero-grid { grid-template-columns: 1fr; grid-template-areas: "crumbs" "photo" "copy"; }
    .profile-hero-grid .breadcrumbs { margin-bottom: 14px; }
    .profile-portrait { max-width: 400px; margin: 0 auto 30px; width: 100%; }
    .profile-portrait img { width: 112%; margin: -3% 0 -6% -6%; }
    .profile-hero .detail-hero-copy h1 { font-size: 2.05rem; }
    .profile-hero .detail-hero-copy > p { font-size: 1.02rem; }
}

/* --- Experience: one interactive line of stages --- */
.exp-section .section-title { max-width: 940px; margin-bottom: 16px; }
.exp-lead { max-width: 760px; color: #aeb8c4; font-size: 1.05rem; line-height: 1.8; margin: 0 0 40px; }

.exp {
    --room: 112px;      /* right of the line: the "today" label and the overhang of the last label */
    --line-y: 122px;    /* where the line runs inside the stage */
    --labelw: 184px;
    --years: 15; --now: 99.1%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, .10);
    background: linear-gradient(180deg, rgba(17, 22, 29, .90), rgba(8, 11, 16, .94));
    padding: 28px 32px 10px;
}
.exp-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; }
.exp-filter-label {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; color: #7f8a97; margin-right: 10px;
}
.exp-chip {
    appearance: none; -webkit-appearance: none; font: inherit; cursor: pointer;
    padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 0;
    background: transparent; color: #bfc8d2; font-size: .78rem; line-height: 1.2;
    transition: border-color .2s, color .2s, background .2s;
}
.exp-chip:hover { border-color: rgba(255, 255, 255, .32); color: #fff; }
.exp-chip.is-linked { border-color: rgba(217, 4, 41, .6); color: #fff; }
.exp-chip[aria-pressed="true"] { border-color: #D90429; color: #fff; background: rgba(217, 4, 41, .14); }
.exp-chip:focus-visible, .exp-item:focus-visible, .exp-nav button:focus-visible { outline: 2px solid #ff8989; outline-offset: 3px; }
.exp-hint { display: none; margin-left: auto; color: #7f8a97; font-size: .76rem; letter-spacing: .02em; }

/* Default layout: a vertical line, newest stage first (phones, tablets, no script). */
.exp-stage { position: relative; }
.exp-line { display: none; }
.exp-rows { position: relative; list-style: none; margin: 0; padding: 0 0 0 30px; }
.exp-rows::before {
    content: ''; position: absolute; left: 6px; top: 22px; bottom: 30px; width: 2px;
    background: linear-gradient(180deg, #D90429 0, rgba(255, 255, 255, .2) 52px, rgba(255, 255, 255, .2) 100%);
}
.exp-row { position: relative; transition: opacity .25s; }
.exp-row.is-dim { opacity: .3; }
.exp-item {
    appearance: none; -webkit-appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
    position: relative; display: block; width: 100%; margin: 0; padding: 14px 0 16px;
    border: 0; border-bottom: 1px solid rgba(255, 255, 255, .06); border-radius: 0; background: none;
}
.exp-row:last-child .exp-item { border-bottom: 0; }
.exp-node {
    position: absolute; left: -30px; top: 17px; width: 14px; height: 14px; border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #ffffff 0%, #c3ccd6 40%, #687382 100%);
    box-shadow: 0 0 0 3px #0c1016;
    transition: background .25s, box-shadow .25s;
}
.exp-label { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.exp-name { color: #cfd7e0; font-weight: 600; font-size: .98rem; line-height: 1.35; transition: color .2s; }
.exp-years { color: #7f8a97; font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; transition: color .2s; }
.exp-note { display: block; color: #98a5b3; font-size: .92rem; line-height: 1.6; margin-top: 6px; }
.exp-item:hover .exp-name, .exp-row.is-active .exp-name, .exp-row.is-hit .exp-name,
.exp-item[aria-pressed="true"] .exp-name { color: #fff; }
.exp-item[aria-pressed="true"] .exp-years { color: #c9d1da; }
.exp-row.is-hit .exp-node, .exp-row.is-active .exp-node { box-shadow: 0 0 0 3px #0c1016, 0 0 14px rgba(255, 255, 255, .55); }
.exp-item[aria-pressed="true"] .exp-node {
    background: radial-gradient(circle at 35% 30%, #ff8a8a 0%, #D90429 55%, #8A0012 100%);
    box-shadow: 0 0 0 3px #0c1016, 0 0 16px rgba(217, 4, 41, .85);
}
.exp-card { display: none; }
.exp:not([data-js]) .exp-filter { display: none; } /* the filter needs the script */

/* Wide screens with script: one horizontal line from the first year to today.
   Same breakpoint as the full header menu (style.css): from here the line is always 982px long. */
@media (min-width: 1241px) {
    .exp[data-js] { padding-bottom: 0; }
    .exp[data-js] .exp-hint { display: inline; }
    .exp[data-js] .exp-stage { height: 260px; }

    .exp[data-js] .exp-line {
        display: block; position: absolute; left: 0; right: var(--room);
        top: calc(var(--line-y) - 9px); height: 18px; cursor: pointer;
    }
    .exp-rail, .exp-ticks, .exp-span { position: absolute; top: 50%; }
    .exp-rail {
        left: 0; right: calc(100% - var(--now)); height: 2px; margin-top: -1px;
        background: rgba(255, 255, 255, .22); transform-origin: left center;
    }
    .exp-ticks { /* a notch at every New Year */
        left: 0; right: 0; height: 8px; margin-top: -4px;
        background-image: linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px);
        background-size: calc(100% / var(--years)) 100%;
        clip-path: inset(0 calc(100% - var(--now)) 0 0);
    }
    .exp-span { /* how long the selected stage lasted */
        left: var(--sx, 0%); width: var(--sw, 0%); height: 4px; margin-top: -2px;
        background: #D90429; box-shadow: 0 0 16px rgba(217, 4, 41, .6);
        transition: left .5s cubic-bezier(.16, 1, .3, 1), width .5s cubic-bezier(.16, 1, .3, 1);
    }
    .exp-span::after {
        content: ''; position: absolute; right: -1px; top: 50%; width: 2px; height: 14px; margin-top: -7px;
        background: #D90429;
    }
    .exp-line.is-open .exp-span::after { display: none; } /* still running: the span meets "today" */
    .exp-now { position: absolute; left: var(--now); top: 50%; }
    .exp-now i {
        position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%;
        background: radial-gradient(circle at 35% 30%, #ff8a8a 0%, #D90429 55%, #8A0012 100%);
        box-shadow: 0 0 0 3px #0c1016, 0 0 14px rgba(217, 4, 41, .8);
    }
    .exp-now b {
        position: absolute; left: 17px; top: -8px; line-height: 16px; white-space: nowrap;
        font-weight: 600; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: #ff6b7d;
    }
    .exp-cursor { /* year under the pointer */
        position: absolute; top: -8px; bottom: -8px; left: var(--cx, 0); width: 1px;
        background: rgba(255, 255, 255, .7); opacity: 0; pointer-events: none; transition: opacity .15s;
    }
    .exp-cursor.is-on { opacity: 1; }
    .exp-cursor b {
        position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 1px;
        padding: 1px 6px; background: #F4F6F8; color: #05070a;
        font-size: .64rem; font-weight: 700; letter-spacing: .06em; line-height: 1.5; font-variant-numeric: tabular-nums;
    }

    .exp[data-js] .exp-rows { position: absolute; left: 0; right: var(--room); top: 0; bottom: 0; padding: 0; pointer-events: none; }
    .exp[data-js] .exp-rows::before { display: none; }
    .exp[data-js] .exp-row { position: absolute; left: var(--x); top: 0; bottom: 0; width: 0; }
    .exp[data-js] .exp-item { /* a flag: the node sits on the line, the label hangs on a thin pole */
        position: absolute; left: -7px; width: var(--lw, var(--labelw));
        display: flex; flex-direction: column; align-items: flex-start;
        padding: 0; border: 0; pointer-events: none;
    }
    .exp[data-js] .exp-node, .exp[data-js] .exp-label { pointer-events: auto; }
    .exp[data-js] .is-up .exp-item { bottom: calc(100% - var(--line-y) - 7px); flex-direction: column-reverse; }
    .exp[data-js] .is-down .exp-item { top: calc(var(--line-y) - 7px); }
    /* a neighbour stands close on the right: the label hangs to the left of its node */
    .exp[data-js] .is-end .exp-item { left: auto; right: -7px; align-items: flex-end; text-align: right; }
    .exp[data-js] .exp-node { position: static; flex: none; }
    .exp[data-js] .exp-label {
        display: block; margin: 0 0 0 6px; padding: 0 0 14px 13px;
        border-left: 1px solid rgba(255, 255, 255, .16); transition: border-color .25s;
    }
    .exp[data-js] .is-down .exp-label { padding: 32px 0 0 13px; }
    .exp[data-js] .is-end .exp-label {
        margin: 0 6px 0 0; padding-left: 0; padding-right: 13px;
        border-left: 0; border-right: 1px solid rgba(255, 255, 255, .16);
    }
    .exp[data-js] .exp-name, .exp[data-js] .exp-years { display: block; }
    .exp[data-js] .exp-name { text-wrap: balance; }
    .exp[data-js] .exp-years { margin-top: 4px; }
    .exp[data-js] .exp-item[aria-pressed="true"] .exp-label { border-color: rgba(217, 4, 41, .8); }
    .exp[data-js] .exp-rows.has-cursor .exp-row:not(.is-active):not(.is-selected) { opacity: .42; }
    .exp[data-js] .exp-note {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
        clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
    }

    /* The selected stage, spelled out */
    .exp[data-js] .exp-card {
        display: flex; align-items: center; gap: 26px;
        margin: 0 -32px; padding: 22px 32px; min-height: 124px;
        border-top: 1px solid rgba(217, 4, 41, .34);
        background: linear-gradient(145deg, rgba(217, 4, 41, .10), rgba(255, 255, 255, .02));
    }
    .exp-detail { flex: 1; display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; column-gap: 24px; align-items: center; }
    .exp-detail-years { font-family: var(--font-h); font-weight: 700; font-size: 1.75rem; line-height: 1.1; letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; }
    .exp-detail-name { font-family: var(--font-h); font-weight: 700; font-size: 1.12rem; line-height: 1.3; color: #fff; margin: 0; }
    .exp-detail-note { color: #b9c4cf; font-size: .98rem; line-height: 1.6; margin: 6px 0 0; text-wrap: balance; }
    .exp-detail-note[hidden] { display: none; }
    .exp-detail-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 330px; }
    .exp-detail-tags span { padding: 7px 11px; border: 1px solid rgba(217, 4, 41, .5); color: #fff; font-size: .74rem; line-height: 1.2; white-space: nowrap; }
    .exp-nav { display: flex; gap: 8px; }
    .exp-nav button {
        appearance: none; -webkit-appearance: none; display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
        border: 1px solid rgba(255, 255, 255, .14); border-radius: 0; background: transparent; color: #dfe5ec; cursor: pointer;
        transition: border-color .2s, color .2s, background .2s;
    }
    .exp-nav button:hover:not(:disabled) { border-color: #D90429; color: #fff; background: rgba(217, 4, 41, .12); }
    .exp-nav button:disabled { opacity: .3; cursor: default; }
    .exp-nav svg { width: 18px; height: 18px; display: block; }

    /* Entrance: the line is drawn, then the stages appear in the order they happened */
    .exp.is-anim .exp-rail { transform: scaleX(0); }
    .exp.is-anim .exp-ticks, .exp.is-anim .exp-span, .exp.is-anim .exp-now, .exp.is-anim .exp-item { opacity: 0; }
    .exp.is-anim.is-in .exp-rail { transform: scaleX(1); transition: transform 1.1s cubic-bezier(.16, 1, .3, 1); }
    .exp.is-anim.is-in .exp-ticks, .exp.is-anim.is-in .exp-span, .exp.is-anim.is-in .exp-now { opacity: 1; transition: opacity .6s ease .7s, left .5s cubic-bezier(.16, 1, .3, 1), width .5s cubic-bezier(.16, 1, .3, 1); }
    .exp.is-anim.is-in .exp-item { opacity: 1; transition: opacity .5s ease calc(.2s + var(--i, 0) * 90ms); }
}

/* Quiet facts under the line */
.exp-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin-top: 34px; }
.exp-meta div { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 16px; }
.exp-meta span { display: block; color: #7f8a97; font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; margin-bottom: 9px; }
.exp-meta p { color: #aeb8c4; font-size: .92rem; line-height: 1.6; margin: 0; }

@media (max-width: 820px) {
    .exp { padding: 22px 18px 6px; }
    .exp-filter { margin-bottom: 14px; }
    .exp-filter-label { flex-basis: 100%; margin: 0 0 4px; }
    .exp-meta { grid-template-columns: 1fr; gap: 0; margin-top: 26px; }
    .exp-meta div { padding: 16px 0; }
}

@media (prefers-reduced-motion: reduce) {
    .exp-span, .exp-row, .exp-chip, .exp-name, .exp-node, .exp-rail, .exp-item { transition: none !important; }
}
