/* ============================================
   Reusable Components
   ============================================ */

/* ----- Glassmorphism card ----- */
.glass {
    background: var(--surface);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}
.glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--grad-border);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}
.glass:hover::before { opacity: 1; }

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font-body);
    letter-spacing: 0.01em;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
    will-change: transform;
}
.btn svg { transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn--primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.4);
}
.btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(108, 92, 231, 0.6);
}

.btn--ghost {
    background: var(--surface-strong);
    border: 1px solid var(--border-strong);
    color: var(--text);
    backdrop-filter: blur(10px);
}
.btn--ghost:hover {
    transform: translateY(-3px);
    border-color: var(--accent-2);
    box-shadow: 0 0 24px var(--cyan-glow);
}

.btn--sm { padding: 0.5rem 1.1rem; font-size: 0.85rem; }

/* ----- Badge ----- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    backdrop-filter: blur(10px);
}
.badge__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #2ee6a6;
    box-shadow: 0 0 10px #2ee6a6;
    animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ----- Social icons ----- */
.social-icon {
    width: 42px; height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.3s var(--ease);
}
.social-icon:hover {
    color: #fff;
    transform: translateY(-4px);
    border-color: var(--accent-2);
    box-shadow: 0 0 20px var(--cyan-glow);
}

/* ----- Floating profile card ----- */
.profile-card {
    position: relative;
    width: clamp(260px, 32vw, 360px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}
.profile-card__glow {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: var(--grad-primary);
    filter: blur(60px);
    opacity: 0.5;
}
.profile-card__photo {
    position: relative;
    width: 78%;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 30% 25%, #1b2050, #0a0d1f);
    border: 2px solid var(--border-strong);
    box-shadow: inset 0 0 40px rgba(108,92,231,.3), var(--shadow-soft);
    overflow: hidden;
}
.profile-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-card__initials {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 700;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.profile-card__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px dashed rgba(0,212,255,.35);
    animation: spin 24s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.profile-chip {
    position: absolute;
    padding: 0.5rem 0.9rem;
    border-radius: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--surface-strong);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-soft);
}
.profile-chip--1 { top: 6%; right: -4%; color: var(--accent-2); animation: floatY 5s ease-in-out infinite; }
.profile-chip--2 { bottom: 14%; left: -8%; color: var(--accent); animation: floatY 6s ease-in-out infinite 0.5s; }
.profile-chip--3 { bottom: -2%; right: 12%; color: var(--accent-3); animation: floatY 7s ease-in-out infinite 1s; }

.float { animation: floatY 6s ease-in-out infinite; }
@keyframes floatY {
    50% { transform: translateY(-16px); }
}

/* ----- Skill card ----- */
.skill-card {
    padding: 1.6rem;
    border-radius: var(--radius);
    transition: transform 0.4s var(--ease);
}
.skill-card:hover { transform: translateY(-8px); }
.skill-card__head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.1rem;
}
.skill-card__icon {
    width: 46px; height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 1.4rem;
    background: var(--grad-primary);
    box-shadow: 0 8px 24px rgba(108,92,231,.35);
}
.skill-card__title {
    font-size: 1.1rem;
    font-weight: 600;
}
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.skill-tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.25s var(--ease);
}
.skill-card:hover .skill-tag { border-color: var(--border-strong); color: var(--text); }

/* ----- Project card ----- */
.project-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.4s var(--ease);
}
.project-card:hover { transform: translateY(-10px); }
.project-card__media {
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    font-size: 3rem;
    position: relative;
    background: linear-gradient(135deg, rgba(108,92,231,.25), rgba(0,212,255,.18));
    border-bottom: 1px solid var(--border);
}
.project-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 120%, rgba(0,212,255,.25), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}
.project-card:hover .project-card__media::after { opacity: 1; }
.project-card__body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.project-card__title { font-size: 1.2rem; margin-bottom: 0.5rem; }
.project-card__desc { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1.1rem; flex: 1; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.1rem; }
.project-card__tags span {
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: var(--surface-strong);
    color: var(--accent-2);
    border: 1px solid var(--border);
}
.project-card__links { display: flex; gap: 1rem; }
.project-card__links a {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.project-card__links a:hover { color: var(--accent-2); }

/* ----- Stat card ----- */
.stat {
    padding: 1.5rem 1.3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.4s var(--ease);
}
.stat:hover { transform: translateY(-6px); }
.stat__num, .stat__suffix {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
.stat__label { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.3rem; }

/* ----- Contact card ----- */
.contact-card {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: transform 0.4s var(--ease);
}
.contact-card:hover { transform: translateY(-6px); }
.contact-card__icon { font-size: 1.6rem; }
.contact-card__label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
.contact-card__value { font-weight: 500; color: var(--text); word-break: break-word; }

/* ----- Skill progress bars ----- */
.skill-bars { display: grid; gap: 1rem; }
.skill-bar__top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
}
.skill-bar__name { font-size: 0.9rem; font-weight: 500; }
.skill-bar__pct { font-size: 0.8rem; color: var(--accent-2); font-family: var(--font-display); }
.skill-bar__track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}
.skill-bar__fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--grad-primary);
    box-shadow: 0 0 12px var(--accent-glow);
    transition: width 1.2s var(--ease);
}

/* ----- Timeline ----- */
.timeline {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
    padding-left: 2.4rem;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 7px; top: 6px; bottom: 6px;
    width: 2px;
    background: linear-gradient(var(--accent), var(--accent-2), transparent);
}
.timeline__item { position: relative; margin-bottom: 1.6rem; }
.timeline__item:last-child { margin-bottom: 0; }
.timeline__dot {
    position: absolute;
    left: -2.4rem; top: 1.6rem;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--grad-primary);
    border: 3px solid var(--bg);
    box-shadow: 0 0 14px var(--accent-glow);
}
.timeline__card { padding: 1.5rem 1.7rem; transition: transform 0.4s var(--ease); }
.timeline__card:hover { transform: translateX(6px); }
.timeline__period {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--accent-2);
    margin-bottom: 0.4rem;
}
.timeline__role { font-size: 1.15rem; }
.timeline__company { color: var(--text); font-weight: 500; margin-bottom: 0.5rem; }
.timeline__desc { color: var(--text-muted); font-size: 0.92rem; }

/* ----- Testimonials ----- */
.testimonial {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s var(--ease);
}
.testimonial:hover { transform: translateY(-8px); }
.testimonial__mark {
    font-family: var(--font-display);
    font-size: 3.4rem;
    line-height: 0.6;
    color: var(--accent);
    opacity: 0.5;
    margin-bottom: 0.4rem;
}
.testimonial__quote { color: var(--text-muted); font-size: 0.95rem; font-style: italic; flex: 1; margin-bottom: 1.4rem; }
.testimonial__author { display: flex; align-items: center; gap: 0.8rem; }
.testimonial__avatar {
    width: 46px; height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    background: var(--grad-primary);
    flex-shrink: 0;
}
.testimonial__name { display: block; font-size: 0.95rem; }
.testimonial__role { font-size: 0.8rem; color: var(--text-dim); }

/* ----- Contact form ----- */
.contact-form { padding: 2rem; display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.field input,
.field textarea {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    resize: vertical;
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.14);
}
.field.has-error input,
.field.has-error textarea { border-color: #ff6b7d; box-shadow: 0 0 0 3px rgba(255, 107, 125, 0.14); }
.field__error { font-size: 0.78rem; color: #ff8a97; min-height: 1em; }
.form-submit { justify-content: center; margin-top: 0.3rem; }
.form-status { font-size: 0.9rem; text-align: center; min-height: 1.2em; }
.form-status.is-success { color: #2ee6a6; }
.form-status.is-error { color: #ff8a97; }

/* ----- Map embed ----- */
.map-embed { position: relative; grid-column: 1 / -1; height: 220px; padding: 0; }
.map-embed iframe {
    width: 100%; height: 100%;
    border: 0;
    border-radius: inherit;
    filter: grayscale(0.3) invert(0.9) hue-rotate(180deg) contrast(0.9);
}
.map-embed__badge {
    position: absolute;
    bottom: 12px; left: 12px;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: rgba(6, 8, 20, 0.8);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(8px);
}

/* ----- Back to top ----- */
.to-top {
    position: fixed;
    right: 1.5rem; bottom: 1.5rem;
    width: 48px; height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--grad-primary);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: all 0.4s var(--ease);
    z-index: 800;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { transform: translateY(-4px); box-shadow: 0 14px 36px rgba(108, 92, 231, 0.7); }
