/* =========================
   CongHoan Base UI (Clean)
   ========================= */

:root {
    --bg: #0b0f19;
    --panel: rgba(255, 255, 255, .06);
    --panel2: rgba(255, 255, 255, .08);
    --border: rgba(255, 255, 255, .10);
    --text: rgba(255, 255, 255, .92);
    --muted: rgba(255, 255, 255, .66);
    --shadow: 0 12px 40px rgba(0, 0, 0, .35);

    --brand: #7c5cff;
    --brand2: #2dd4bf;

    --radius: 18px;
    --radius2: 24px;
    --container: 1024px;

    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

html.theme-light {
    --bg: #f7f8fb;
    --panel: rgba(0, 0, 0, .04);
    --panel2: rgba(0, 0, 0, .06);
    --border: rgba(0, 0, 0, .08);
    --text: rgba(0, 0, 0, .88);
    --muted: rgba(0, 0, 0, .62);
    --shadow: 0 12px 40px rgba(0, 0, 0, .10);

    --brand: #5b5cff;
    --brand2: #0ea5e9;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(var(--container), calc(100% - 28px));
    margin-inline: auto;
}

/* Page header */
.page-head {
    padding: 34px 0 14px;
}

.page-head__inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.page-title {
    font-size: clamp(22px, 4vw, 34px);
    letter-spacing: -.02em;
    margin: 0;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    max-width: 72ch;
}

.breadcrumbs {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumbs a {
    color: inherit;
}

.breadcrumbs a:hover {
    color: var(--text);
}

/* Background effects */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: .10;
    pointer-events: none;
    z-index: -2;
}

html.theme-light .bg-grid {
    opacity: .08;
}

.bg-glow {
    position: fixed;
    inset: -30%;
    background:
        radial-gradient(600px 600px at 20% 10%, rgba(124, 92, 255, .25), transparent 60%),
        radial-gradient(600px 600px at 80% 30%, rgba(45, 212, 191, .20), transparent 60%),
        radial-gradient(700px 700px at 50% 90%, rgba(14, 165, 233, .16), transparent 60%);
    pointer-events: none;
    z-index: -3;
    filter: blur(10px);
}

/* Topbar */
.topbar {
    position: sticky;
    top: 14px;
    z-index: 40;
    margin-top: 14px;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}

.brand__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent);
}

.brand__name {
    font-weight: 800;
    letter-spacing: .2px;
}

.brand__tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: var(--panel);
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav__link {
    font-size: 14px;
    color: var(--muted);
    padding: 8px 10px;
    border-radius: 12px;
    transition: .18s ease;
}

.nav__link:hover {
    color: var(--text);
    background: var(--panel);
}

.nav__link.is-active {
    color: var(--text);
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 22%, transparent), transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--border));
}

.nav__cta {
    color: var(--text);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 25%, transparent), transparent);
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    transition: .18s ease;
}

.icon-btn:hover {
    transform: translateY(-1px);
    background: var(--panel2);
}

#icoMoon {
    display: none;
}

html.theme-dark #icoSun {
    display: inline-block;
}

html.theme-dark #icoMoon {
    display: none;
}

html.theme-light #icoSun {
    display: none;
}

html.theme-light #icoMoon {
    display: inline-block;
}

.nav__burger {
    display: none;
}

/* Drawer */
.drawer {
    display: none;
}

.drawer.is-open {
    display: block;
}

.drawer__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.drawer__panel {
    position: fixed;
    top: 18px;
    right: 14px;
    width: min(360px, calc(100% - 28px));
    border-radius: var(--radius2);
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.drawer__head {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.drawer__title {
    font-weight: 800;
}

.drawer__links {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer__link {
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
}

.drawer__link--cta {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 25%, transparent), transparent);
}

/* Layout */
.hero {
    margin-top: 18px;
}

.section {
    margin-top: 26px;
}

.section__head {
    margin-bottom: 12px;
}

.section__title {
    font-size: 22px;
    margin: 0 0 6px 0;
    letter-spacing: .2px;
}

.section__desc {
    margin: 0;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 14px;
}

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

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

.card {
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: var(--radius2);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card--soft {
    background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.card__head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.card__title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.card__body {
    padding: 14px 16px;
}

.muted {
    color: var(--muted);
}

.mono {
    font-family: var(--mono);
}

/* =========================
   HERO (FIXED)
   ========================= */

/* Hero card: to hơn + không làm mini bị kéo dài */
.hero__card {
    position: relative;
    overflow: visible;
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 16px;

    padding: 32px 26px 26px;
    min-height: 310px;
    /* khung to hơn */
    border-radius: 30px;
}

/* Left layout */
.hero__left {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 18px;
    align-items: center;
    min-width: 0;
    overflow: visible;
}

.hero__meta {
    min-width: 0;
}

.hero__title {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pill {
    font-size: 12px;
    padding: 6px 0px;
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pill--verified .pill__icon {
    width: 25px;
    height: 25px;
    display: inline-block;
}

.hero__subtitle {
    margin: 8px 0 0 0;
    color: var(--muted);
}

.hero__chips {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel2);
    color: var(--muted);
}

.chip--link:hover {
    color: var(--text);
}

.hero__actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    background: var(--panel2);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    background: var(--panel);
}

.btn--primary {
    background: linear-gradient(135deg,
            color-mix(in srgb, var(--brand) 45%, transparent),
            color-mix(in srgb, var(--brand2) 20%, transparent));
    border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
}

.btn--ghost {
    background: var(--panel);
}

.hero__stats {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.stat {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
    padding: 10px 12px;
}

.stat__num {
    font-weight: 900;
}

.stat__label {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

/* Avatar wrap */
.hero__avatarWrap {
    width: 190px;
    height: 190px;
    position: relative;
    overflow: visible;
    margin-left: 8px;
}

/* Avatar (nằm dưới crown) */
.avatar {
    width: 190px;
    height: 190px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel2);
    padding: 7px;
    position: relative;
    display: grid;
    place-items: center;
    overflow: visible;
    z-index: 10;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .35);
}

.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
}

/* Crown: ÔM avatar (đè lên) */
.crown3 {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 240px;
    /* lớn hơn avatar để ôm */
    max-width: none;
    height: auto;
    z-index: 50;
    /* QUAN TRỌNG: cao hơn avatar */
    pointer-events: none;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .45));
}

/* Badge avatar */
.avatar__badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    border: 1px solid rgba(255, 255, 255, .20);
    z-index: 60;
}

/* Right side: KHÔNG stretch để khỏi dài */
.hero__right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
    /* đổi từ stretch -> start */
    align-content: start;
    grid-auto-rows: min-content;
    /* cao theo nội dung */
}

/* Mini: bỏ height:100% để khỏi bị kéo dài */
.mini {
    height: auto;
}

.mini__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mini__title {
    font-weight: 900;
    padding-left: 6px;
    margin: 5px 5px;
}

.mini__badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.dot--ok {
    background: #22c55e;
    box-shadow: none;
}

.mini__row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.mini__row:last-child {
    border-bottom: none;
}

/* Quick links */
.quick {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
}

.quick:hover {
    color: var(--text);
    background: var(--panel2);
}

/* Lists */
.list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list__item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.list__item i {
    color: color-mix(in srgb, var(--brand2) 70%, #fff);
}

.kv {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kv__row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
}

.kv__k {
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.kv__v {
    text-align: right;
}

.link {
    color: color-mix(in srgb, var(--brand2) 70%, var(--text));
}

.link:hover {
    text-decoration: underline;
}

.note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, transparent), transparent);
    color: var(--muted);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* Skills */
.skills {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skill__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.skill__name {
    font-weight: 800;
}

.skill__pct {
    color: var(--muted);
    font-family: var(--mono);
}

.bar {
    height: 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--panel2) 80%, transparent);
    border: 1px solid var(--border);
    overflow: hidden;
}

.bar__fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--brand2));
    transition: width 900ms cubic-bezier(.2, .9, .2, 1);
}

/* Tags */
.tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: var(--panel);
}

/* Job CTA */
.job-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.job-cta__title {
    font-weight: 900;
}

.card.card--soft {
    margin-top: 28px;
}

/* Community */
.community {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tick {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

.timeline__item {
    display: flex;
    gap: 10px;
}

.timeline__dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 999px;
    background: var(--brand2);
    box-shadow: 0 0 0 6px rgba(45, 212, 191, .12);
}

/* Contact */
.contact-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--panel);
}

.contact-item i {
    font-size: 20px;
    color: color-mix(in srgb, var(--brand) 55%, var(--text));
}

.contact-item__k {
    font-size: 12px;
    color: var(--muted);
}

.contact-item__v {
    font-weight: 800;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form__row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}


.form__label {
    font-size: 13px;
    color: var(--muted);
}

.input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    outline: none;
}

select.input {
    background: var(--panel);
    color: var(--text);
}

select.input option {
    background-color: #0b0f19;
    /* hoặc var(--bg) */
    color: rgba(255, 255, 255, 0.92);
}

select.input option:hover,
select.input option:checked {
    background-color: rgba(124, 92, 255, 0.35);
    color: #fff;
}

html.theme-light select.input option {
    background-color: #ffffff;
    color: #595757;
}

html.theme-light select.input option:hover,
html.theme-light select.input option:checked {
    background-color: rgba(91, 92, 255, 0.15);
    color: #ececec;
}

.input:focus {
    border-color: color-mix(in srgb, var(--brand2) 35%, var(--border));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand2) 16%, transparent);
}

.form__hint {
    margin-top: 6px;
    font-size: 12px;
}

/* mini copy button */
.mini-btn {
    margin-left: 8px;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel2);
    color: var(--text);
    cursor: pointer;
}

.mini-btn:hover {
    background: var(--panel);
}

/* Footer */
.footer {
    margin: 26px 0 60px 0;
}

.footer__inner {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: color-mix(in srgb, var(--bg) 75%, transparent);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 14px;
    box-shadow: var(--shadow);
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
}

.toast.show {
    opacity: 1;
}

/* Responsive */
@media (max-width: 860px) {
    .grid--2 {
        grid-template-columns: 1fr;
    }

    .grid--3 {
        grid-template-columns: 1fr;
    }

    .hero__card {
        grid-template-columns: 1fr;
    }

    .hero__right {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .nav__link {
        display: none;
    }

    .nav__burger {
        display: inline-flex;
    }

    .brand {
        min-width: auto;
    }

    .hero__left {
        grid-template-columns: 110px 1fr;
        align-items: start;
    }

    .hero__avatarWrap {
        width: 110px;
        height: 110px;
        margin-left: 0;
    }

    .avatar {
        width: 110px;
        height: 110px;
        padding: 5px;
    }

    .crown3 {
        width: 150px;
    }

    .hero__stats {
        grid-template-columns: 1fr;
    }
}