/* =========================================== */
/*        УЕБ CV – Лъчезар Кълвачев            */
/* =========================================== */

.cv {
    --accent: #ff2a2a;
    --accent2: #25f4ee;
    --glass: rgba(255, 255, 255, 0.06);
    --line: rgba(255, 255, 255, 0.12);
    --muted: rgba(255, 255, 255, 0.72);
    position: relative;
    overflow-x: clip; /* clip (не hidden) – за да не се чупи залепването на панела */
}

/* ---------- фон: плаващи форми ---------- */
.cv-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.cv-blob {
    position: absolute;
    width: 460px; height: 460px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.32;
    animation: cvDrift 22s ease-in-out infinite alternate;
}
.cv-blob.b1 { background: var(--accent);  top: -120px; left: -140px; }
.cv-blob.b2 { background: #3b6cff; top: 32%; right: -180px; animation-delay: -7s; opacity: 0.26; }
.cv-blob.b3 { background: var(--accent2); bottom: -160px; left: 22%; animation-delay: -13s; opacity: 0.16; }

.cv-shape {
    position: absolute;
    width: 22px; height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    animation: cvFloat 9s ease-in-out infinite;
}
.cv-shape.s1 { left: 6%;  top: 18%; }
.cv-shape.s2 { left: 92%; top: 12%; width: 14px; height: 14px; border-color: var(--accent); animation-delay: -3s; }
.cv-shape.s3 { left: 48%; top: 8%;  border-radius: 4px; border-color: var(--accent2); animation-delay: -5s; transform: rotate(20deg); }
.cv-shape.s4 { left: 3%;  top: 62%; width: 16px; height: 16px; border-radius: 4px; border-color: var(--accent); animation-delay: -2s; }
.cv-shape.s5 { left: 95%; top: 58%; animation-delay: -6s; }
.cv-shape.s6 { left: 70%; top: 88%; width: 30px; height: 30px; border-color: rgba(255, 255, 255, 0.2); animation-delay: -4s; }

@keyframes cvDrift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(60px, 50px) scale(1.18); }
}
@keyframes cvFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-26px) rotate(90deg); }
}

/* ---------- мрежа ---------- */
.cv-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 34px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 36px 20px 80px;
}

/* ---------- страничен панел ---------- */
.cv-side {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 116px);
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 18px 22px;
    text-align: center;
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 24px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    animation: cvSideIn 0.8s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes cvSideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: none; }
}

.cv-back {
    display: block;
    text-align: left;
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.25s, transform 0.25s;
}
.cv-back:hover { color: #fff; transform: translateX(-4px); }

/* снимка + орбита */
.cv-stage {
    --d: 160px;
    --r: 106px;
    position: relative;
    width: 246px; height: 246px;
    margin: 6px auto 6px;
}
.cv-photo {
    position: absolute;
    left: 50%; top: 50%;
    width: var(--d); height: var(--d);
    margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 30%, #3a4f6b 0%, #1b2538 70%);
    box-shadow: 0 0 40px rgba(255, 42, 42, 0.35);
    animation: cvGlow 3.2s ease-in-out infinite;
}
.cv-photo::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent), var(--accent2), #fff, var(--accent));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    animation: cvSpin 6s linear infinite;
}
.cv-photo picture { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.cv-photo img {
    display: block;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: 50% 0;
    transform-origin: 50% 0;
    transform: scale(1.12);
    transition: transform 0.6s ease;
}
.cv-stage:hover .cv-photo img { transform: scale(1.2); }

@keyframes cvGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 42, 42, 0.30); }
    50%      { box-shadow: 0 0 60px rgba(255, 42, 42, 0.60); }
}
@keyframes cvSpin { to { transform: rotate(360deg); } }

.cv-pulse {
    position: absolute;
    left: 50%; top: 50%;
    width: var(--d); height: var(--d);
    margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
    border: 2px solid var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: cvPulse 3.2s ease-out infinite;
}
.cv-pulse.p2 { animation-delay: 1.6s; }
@keyframes cvPulse {
    0%   { transform: scale(1);    opacity: 0.65; }
    100% { transform: scale(1.55); opacity: 0; }
}

.cv-orbit {
    position: absolute;
    inset: 0;
    animation: cvSpin 28s linear infinite;
}
.cv-chip {
    --a: calc(360deg / var(--n) * var(--i));
    position: absolute;
    left: 50%; top: 50%;
    width: 0; height: 0;
    transform: rotate(var(--a)) translateY(calc(var(--r, 118px) * -1));
}
.cv-chip span {
    position: absolute;
    left: 0; top: 0;
    padding: 4px 9px;
    font-size: 0.66rem;
    font-weight: 600;
    white-space: nowrap;
    color: #fff;
    background: rgba(20, 24, 40, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom: 2px solid var(--accent);
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    transform: translate(-50%, -50%) rotate(calc(var(--a) * -1));
    animation: cvUpright 28s linear infinite;
}
.cv-chip:nth-child(even) span { border-bottom-color: var(--accent2); }
@keyframes cvUpright {
    from { transform: translate(-50%, -50%) rotate(calc(var(--a) * -1)); }
    to   { transform: translate(-50%, -50%) rotate(calc(var(--a) * -1 - 360deg)); }
}

/* име и роля */
.cv-name {
    margin: 10px 0 20px;
    font-size: 1.75rem;
    line-height: 1.15;
    background: linear-gradient(90deg, #fff 0%, #ff8a8a 35%, #fff 70%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: cvShimmer 5s linear infinite;
}
@keyframes cvShimmer { to { background-position: -220% 0; } }

.cv-role {
    min-height: 1.6em;
    margin: 0 0 12px;
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--accent2);
}
.cv-role span {
    display: inline-block;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.cv-role span.out { opacity: 0; transform: translateY(-8px); }

.cv-avail {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 6px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(46, 229, 157, 0.12);
    border: 1px solid rgba(46, 229, 157, 0.4);
    border-radius: 999px;
}
.cv-avail i {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #2ee59d;
    animation: cvDot 1.8s ease-out infinite;
}
@keyframes cvDot {
    0%   { box-shadow: 0 0 0 0 rgba(46, 229, 157, 0.7); }
    100% { box-shadow: 0 0 0 12px rgba(46, 229, 157, 0); }
}

.cv-side-h {
    margin: 16px 0 8px;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.cv-contact { list-style: none; margin: 0 0 16px; padding: 0; text-align: left; }
.cv-contact li {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 8px;
    font-size: 0.88rem;
    border-radius: 10px;
    transition: background 0.25s, transform 0.25s;
}
.cv-contact li:hover { background: rgba(255, 255, 255, 0.07); transform: translateX(4px); }
.cv-contact svg {
    flex: 0 0 18px;
    width: 18px; height: 18px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.cv-contact a, .cv-contact span { color: #fff; text-decoration: none; word-break: break-word; }
.cv-contact a:hover { text-decoration: underline; }

.cv-cta { animation: cvCta 2.4s ease-in-out infinite; }
@keyframes cvCta {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 42, 42, 0.55); }
    50%      { box-shadow: 0 0 0 12px rgba(255, 42, 42, 0); }
}

/* ---------- основна колона ---------- */
.cv-main { min-width: 0; }
.cv-sec { margin-bottom: 38px; }
.cv-sec h2 {
    position: relative;
    display: inline-block;
    margin: 0 0 18px;
    padding-bottom: 8px;
    font-size: 1.45rem;
}
.cv-sec h2::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform-origin: left;
    transition: transform 0.9s cubic-bezier(.2, .8, .2, 1) 0.25s;
}
.cv-js .cv-sec h2::after { transform: scaleX(0); }
.cv-js .rv.in h2::after,
.cv-js h2.rv.in::after { transform: scaleX(1); }

.cv-about { margin: 0; font-size: 1.05rem; line-height: 1.75; color: rgba(255, 255, 255, 0.9); }

/* статистики */
.cv-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 40px;
}
.cv-stat {
    padding: 18px 14px;
    text-align: center;
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.cv-stat:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 14px 30px rgba(255, 42, 42, 0.25);
}
.cv-stat strong {
    display: block;
    font-size: 2.2rem;
    line-height: 1.1;
    color: #fff;
}
.cv-glyph {
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent));
    background-size: 200% 100%;
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: cvShimmer 4s linear infinite;
}
.cv-stat small { display: block; margin-top: 6px; font-size: 0.8rem; color: var(--muted); }

/* времева линия */
.cv-timeline {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0 0 0 34px;
}
.cv-timeline::before {
    content: "";
    position: absolute;
    left: 9px; top: 6px; bottom: 6px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent2) 60%, rgba(255, 255, 255, 0.1));
    transform-origin: top;
    animation: cvLine 1.8s ease-out both;
}
@keyframes cvLine { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.cv-job { position: relative; margin-bottom: 22px; }
.cv-dot {
    position: absolute;
    left: -34px; top: 22px;
    width: 21px; height: 21px;
    border-radius: 50%;
    background: #1e1e2f;
    border: 4px solid var(--accent);
    transition: transform 0.3s;
}
.cv-job:hover .cv-dot { transform: scale(1.25); }
.cv-job.is-now .cv-dot { animation: cvDotNow 1.8s ease-out infinite; background: var(--accent); }
@keyframes cvDotNow {
    0%   { box-shadow: 0 0 0 0 rgba(255, 42, 42, 0.7); }
    100% { box-shadow: 0 0 0 16px rgba(255, 42, 42, 0); }
}

.cv-card {
    padding: 20px 22px;
    background: var(--glass);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.cv-job:hover .cv-card {
    transform: translateX(6px);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}
.cv-job.is-now .cv-card { animation: cvCardNow 3s ease-in-out infinite; }
@keyframes cvCardNow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 42, 42, 0); }
    50%      { box-shadow: 0 0 26px 2px rgba(255, 42, 42, 0.35); }
}
.cv-when {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--accent2);
}
.cv-when em {
    padding: 2px 9px;
    font-style: normal;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
    animation: cvBadge 1.6s ease-in-out infinite;
}
@keyframes cvBadge { 50% { transform: scale(1.12); } }
.cv-card h3 { margin: 6px 0 2px; font-size: 1.12rem; }
.cv-co { margin: 0 0 10px; font-size: 0.92rem; color: var(--muted); }
.cv-card ul { margin: 0; padding-left: 18px; }
.cv-card li { margin: 5px 0; font-size: 0.93rem; line-height: 1.55; color: rgba(255, 255, 255, 0.88); }
.cv-card li strong { font-weight: 700; color: #fff; }
.cv-card li::marker { color: var(--accent); }

/* образование / курсове */
.cv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cv-h2-gap { margin-top: 26px !important; }
.cv-mini {
    margin-bottom: 12px;
    padding: 14px 16px;
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 14px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.cv-mini:hover { transform: translateY(-4px); border-color: var(--accent2); }
.cv-mini span { display: block; font-size: 0.78rem; font-weight: 600; color: var(--accent2); }
.cv-mini strong { display: block; margin-top: 2px; font-size: 0.98rem; }
.cv-mini small { display: block; margin-top: 2px; font-size: 0.85rem; color: var(--muted); }

/* умения */
.cv-skillgrp { margin-bottom: 18px; }
.cv-skillgrp h3 { margin: 0 0 8px; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cv-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-tags span {
    padding: 7px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, opacity 0.5s ease var(--d, 0ms);
}
.cv-tags span:hover { transform: translateY(-4px) scale(1.06); background: var(--accent); border-color: var(--accent); }

/* ---------- появяване при скрол (само ако работи JS) ---------- */
.cv-js .rv {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2, .8, .2, 1);
}
.cv-js .rv.in { opacity: 1; transform: none; }
.cv-js .cv-job.rv { transform: translateX(34px); }
.cv-js .cv-job.rv.in { transform: none; }
.cv-js .cv-skillgrp .cv-tags span { opacity: 0; transform: translateY(10px) scale(0.85); }
.cv-js .cv-skillgrp.in .cv-tags span { opacity: 1; transform: none; }

/* ---------- мобилни ---------- */
@media (max-width: 960px) {
    .cv-js .cv-job.rv { transform: translateY(28px); }
    .cv-js .cv-job.rv.in { transform: none; }
    .cv-grid { grid-template-columns: 1fr; gap: 24px; padding-top: 22px; }
    .cv-side { position: relative; top: auto; max-height: none; overflow: visible; }
    .cv-two { grid-template-columns: 1fr; gap: 0; }
    .cv-two > div { margin-bottom: 22px; }
}
@media (max-width: 560px) {
    .cv-stats { grid-template-columns: 1fr; }
    .cv-stat { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; }
    .cv-stat strong { font-size: 1.7rem; min-width: 76px; }
    .cv-stat small { margin: 0; }
    .cv-timeline { padding-left: 28px; }
    .cv-dot { left: -28px; }
    .cv-timeline::before { left: 4px; }
    .cv-card { padding: 16px; }
    .cv-name { font-size: 1.55rem; }
}

/* ---------- по-малко движение ---------- */
@media (prefers-reduced-motion: reduce) {
    .cv *, .cv *::before, .cv *::after { animation: none !important; transition: none !important; }
    .cv-js .rv, .cv-js .cv-skillgrp .cv-tags span { opacity: 1; transform: none; }
    .cv-js .cv-sec h2::after { transform: scaleX(1); }
}
