* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --background: #20262d;
    --card: #f4f1ed;
    --navy: #14212c;
    --navy-soft: #1c2a36;
    --gold: #b18a5a;
    --text: #18242e;
    --muted: #666b70;
    --white: #f8f8f8;
}
html,
body {
    min-height: 100%;
}
body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: "Manrope", sans-serif;
    background:
        radial-gradient(
            circle at 50% 20%,
            #343b42 0%,
            #20262d 45%,
            #15191d 100%
        );
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.card {
    position: relative;
    width: 100%;
    max-width: 430px;
    min-height: 720px;
    overflow: hidden;
    background: var(--card);
    border-radius: 34px;
    box-shadow:
        0 40px 90px rgba(0, 0, 0, .42),
        0 10px 30px rgba(0, 0, 0, .20);
    /* border: 1px solid rgba(255,255,255,.3); */
    border: none;
}
.profile-section {
    position: relative;
    z-index: 2;
    height: 475px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 54px 35px 0;
    text-align: center;
}

.profile-section::before {
content: "";
position: absolute;
inset: 0;
pointer-events: none;
z-index: -1;
background:
    radial-gradient(
        circle at 90% 5%,
        color-mix(in srgb, var(--gold) 13%, transparent) 0%,
        color-mix(in srgb, var(--gold) 5%, transparent) 25%,
        transparent 48%
    ),
    radial-gradient(
        circle at 5% 55%,
        color-mix(in srgb, var(--gold) 10%, transparent) 0%,
        transparent 38%
    ),
    repeating-radial-gradient(
        ellipse at -20% 45%,
        transparent 0px,
        transparent 14px,
        color-mix(in srgb, var(--gold) 8%, transparent) 15px,
        transparent 16px,
        transparent 23px
    ),
    repeating-radial-gradient(
        ellipse at 120% 75%,
        transparent 0px,
        transparent 17px,
        color-mix(in srgb, var(--gold) 6%, transparent) 18px,
        transparent 19px,
        transparent 27px
    );
}
.photo-wrapper {
    position: relative;
    z-index: 2;
    width: 180px;
    height: 180px;
    margin-bottom: 32px;
    padding: 5px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    background: rgba(255,255,255,.65);
    box-shadow:
        0 12px 30px rgba(0,0,0,.13);
}
.photo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 50%;
}

.name {
    position: relative;
    z-index: 2;
    font-size: 38px;
    line-height: 1.1;
    font-weight: 500;
    letter-spacing: -1.5px;
    color: var(--text);
}
.name::after {
    content: "";
    display: block;
    width: 38px;
    height: 3px;
    margin: 18px auto;
    background: var(--gold);
    border-radius: 20px;
}

.title {
    position: relative;
    z-index: 2;
    color: var(--gold);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 3px;
    margin-bottom: 17px;
}
.institution {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #3f474d;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: .5px;
}

.institution::before,
.institution::after {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--gold);
    opacity: .8;
}


.contact-section {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 285px;
    padding:
        75px
        45px
        38px;
    color: var(--white);
    background:
        linear-gradient(
            145deg,
            var(--navy-soft),
            var(--navy)
        );
}

.contact-section::before {
    content: "";
    position: absolute;
    top: -42px;
    left: -5%;
    width: 110%;
    height: 85px;
    background: var(--card);
    transform: rotate(7deg);
    transform-origin: center;
    border-bottom: 2px solid var(--gold);
}
.contact-list {
    position: relative;
    z-index: 3;
}
.contact-item {
    display: grid;
    grid-template-columns: 52px 1fr;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: inherit;
    padding: 20px 0;
    border-bottom:
        1px solid rgba(255,255,255,.16);
}
.contact-item:last-child {
    border-bottom: none;
}

.icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: #ebe7df;
    color: var(--navy);
    font-size: 21px;
    box-shadow:
        0 5px 15px rgba(0,0,0,.12);
    transition:
        transform .2s ease,
        background .2s ease;
}
.contact-item:hover .icon {
    transform: translateY(-2px);
    background: #ffffff;
}

.contact-content {
    min-width: 0;
}

.contact-label {
    display: block;
    margin-bottom: 5px;
    color: var(--gold);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.8px;
}

.contact-value {
    display: block;
    color: var(--white);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    word-break: break-word;
}

.top-actions {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--gold);
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.35);
    transition: transform 0.2s ease, background 0.2s ease;
}

.action-btn:hover {
    transform: scale(1.08);
    background: var(--navy-soft);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 340px;
    background: var(--card);
    border-radius: 28px;
    padding: 24px 20px 20px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--gold);
    transform: translateY(15px);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 26px;
    color: var(--text);
    cursor: pointer;
    line-height: 1;
}

.modal-title {
    font-size: 19px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.qr-container {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
    padding: 8px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.qr-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.share-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    text-decoration: none;
    color: var(--text);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}

.share-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease;
}

.share-grid-item:hover .share-icon {
    transform: translateY(-2px);
}

.share-icon.wa { background: #25D366; }
.share-icon.sms { background: #f39c12; }
.share-icon.tg { background: #229ED9; }
.share-icon.mail { background: #EA4335; }

.copy-link-btn {
    width: 100%;
    padding: 11px;
    border-radius: 14px;
    border: 1px solid var(--gold);
    background: var(--navy);
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.copy-link-btn i {
    color: var(--gold);
}

.copy-link-btn:hover {
    background: var(--navy-soft);
}

@media (max-width: 480px) {

    html,
    body {
        width: 100%;
        height: 100%;
        min-height: 100dvh;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background: var(--card);
    }

    body {
        display: block;
    }

    .card {
        width: 100%;
        max-width: none;

        height: 100dvh;
        min-height: 100dvh;

        margin: 0;

        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .profile-section {
        height: 66dvh;

        padding:
            clamp(38px, 6dvh, 58px)
            28px
            0;
    }

    .photo-wrapper {
        width: clamp(155px, 42vw, 185px);
        height: clamp(155px, 42vw, 185px);

        margin-bottom: clamp(24px, 4dvh, 34px);
    }

    .name {
        font-size: clamp(32px, 9vw, 40px);
        line-height: 1.05;
    }

    .name::after {
        margin: clamp(13px, 2.2dvh, 19px) auto;
    }

    .title {
        font-size: clamp(14px, 4vw, 17px);
        letter-spacing: 2.5px;

        margin-bottom: clamp(11px, 2dvh, 17px);
    }

    .institution {
        font-size: clamp(12px, 3.4vw, 14px);
        line-height: 1.55;
    }

    .contact-section {
        top: 62dvh;
        bottom: 0;

        min-height: 0;

        padding:
            clamp(58px, 8dvh, 76px)
            28px
            20px;
    }

    .contact-section::before {
        top: -38px;

        height: 76px;

        left: -10%;
        width: 120%;
    }

    .contact-item {
        grid-template-columns: 50px 1fr;

        gap: 17px;

        padding: clamp(14px, 2.3dvh, 20px) 0;
    }

    .icon {
        width: 50px;
        height: 50px;

        font-size: 20px;
    }

    .contact-label {
        font-size: 11px;
    }

    .contact-value {
        font-size: clamp(15px, 4vw, 17px);
    }

    .portfolio-btn span {
    display: none;
    }

    .portfolio-btn {
        padding: 0 14px;
        width: 44px;
        justify-content: center;
    }
}

@media (max-width: 350px) {

    .name {
        font-size: 28px;
    }

    .institution::before,
    .institution::after {
        display: none;
    }

    .contact-section {
        padding-left: 22px;
        padding-right: 22px;
    }
}

.portfolio-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px 0 14px;
    border-radius: 22px;
    background: var(--navy);
    color: var(--gold);
    border: 1px solid var(--gold);
    text-decoration: none;
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.35);
    transition: transform 0.2s ease, background 0.2s ease;
}

.portfolio-btn i {
    font-size: 16px;
}

.portfolio-btn:hover {
    transform: scale(1.05);
    background: var(--navy-soft);
}

.loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    background:
        radial-gradient(
            circle at 50% 40%,
            #343b42 0%,
            #20262d 55%,
            #15191d 100%
        );
    transition: opacity 0.55s ease, visibility 0.55s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-name {
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 6px;
    color: var(--gold);
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(6px);
    animation: loaderFadeUp 0.5s ease 0.1s forwards;
}

@keyframes loaderFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loader-photo {
    position: relative;
    width: 160px;
    height: 160px;
    padding: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    opacity: 0;
    transform: scale(0.85);
    animation: photoAppear 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards;
}

@keyframes photoAppear {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loader-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    opacity: 0;
    animation: photoFade 0.5s ease 0.9s forwards;
}

@keyframes photoFade {
    to { opacity: 1; }
}

.loader-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 270deg,
        color-mix(in srgb, var(--gold) 30%, transparent) 300deg,
        var(--gold) 345deg,
        #f4e0b8 355deg,
        var(--gold) 360deg
    );
    -webkit-mask:
        radial-gradient(
            farthest-side,
            transparent calc(100% - 3px),
            #000 calc(100% - 3px)
        );
    mask:
        radial-gradient(
            farthest-side,
            transparent calc(100% - 3px),
            #000 calc(100% - 3px)
        );
    opacity: 0;
    animation:
        ringAppear 0.3s ease 1.2s forwards,
        ringSpin 1.2s linear 1.2s infinite;
    z-index: -1;
}

@keyframes ringAppear {
    to { opacity: 1; }
}

@keyframes ringSpin {
    to { transform: rotate(360deg); }
}

.card {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    animation: cardReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 2.4s forwards;
}

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .loader-name,
    .loader-photo,
    .loader-photo img,
    .loader-ring,
    .card {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
    }
    .card {
        opacity: 1;
        transform: none;
    }
}