/* The public page is one continuous surface divided by subtle rules. */
.site-shell {
    gap: 0;
}

.site-shell > * {
    animation: portfolio-enter .65s cubic-bezier(.2, .8, .2, 1) both;
}

.site-shell > .content { animation-delay: .08s; }
.site-shell > .right-nav { animation-delay: .16s; }

.site-shell > .card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.site-shell > .profile {
    border-right: 1px solid var(--color-border);
}

.site-shell > .profile .avatar {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 636 / 637;
    object-fit: contain;
}

.profile > .social-links {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.social-icon {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--color-text-primary);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.social-icon:hover {
    color: #fff;
    background: var(--color-accent);
    transform: translateY(-3px);
}

.right-nav li a,
.right-nav .nav-item {
    transition: color .2s ease, transform .2s ease;
}

.right-nav li a:hover,
.right-nav .nav-item:hover {
    transform: translateX(4px);
}

@keyframes portfolio-enter {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.site-shell > .right-nav {
    border-left: 1px solid var(--color-border);
    min-height: calc(100vh - (var(--space-5) * 2));
}

.site-shell > .right-nav nav {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - (var(--space-5) * 4));
}

.site-shell > .right-nav .see-more-link {
    margin-top: auto;
}

.see-more-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--color-accent);
    font-weight: 750;
    letter-spacing: .02em;
}

.see-more-link:hover {
    color: var(--color-accent-hover);
}

.whatsapp-float {
    position: fixed;
    right: var(--space-5);
    bottom: var(--space-5);
    z-index: 30;
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    color: #fff;
    background: #25d366;
    border-radius: 50%;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
    transition: background-color .2s ease, transform .2s ease;
    animation: whatsapp-float 2.8s ease-in-out infinite;
}

.whatsapp-float:hover {
    color: #fff;
    background: #1fbd59;
    transform: translateY(-4px) scale(1.04);
}

.whatsapp-float svg {
    width: 27px;
    height: 27px;
    fill: currentColor;
}

.whatsapp-tooltip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: max-content;
    padding: .45rem .7rem;
    color: var(--color-text-primary);
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: .78rem;
    font-weight: 750;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px) scale(.96);
    transition: opacity .18s ease, transform .18s ease;
}

.whatsapp-tooltip::after {
    position: absolute;
    top: 100%;
    right: 20px;
    content: "";
    border: 6px solid transparent;
    border-top-color: var(--color-border);
}

.whatsapp-float:hover .whatsapp-tooltip,
.whatsapp-float:focus-visible .whatsapp-tooltip {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes whatsapp-float {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
    }
    50% {
        transform: translateY(-9px);
        box-shadow: 0 20px 34px rgba(0, 0, 0, .28);
    }
}

.cv-download {
    margin-top: var(--space-5);
    color: var(--color-text-primary);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 0 !important;
}

.cv-download:hover {
    color: #fff;
    background: var(--color-accent);
    border-color: var(--color-accent);
}

@media (max-width: 1050px) {
    .site-shell > .right-nav {
        border-top: 1px solid var(--color-border);
        border-left: 0;
        min-height: 0;
    }

    .site-shell > .right-nav nav {
        min-height: 0;
    }

    .site-shell > .right-nav .see-more-link {
        margin-top: var(--space-5);
    }
}

@media (max-width: 760px) {
    .profile,
    .right-nav,
    .content {
        margin-bottom: 0;
    }

    .site-shell > .profile {
        border-right: 0;
        border-bottom: 1px solid var(--color-border);
    }

    .site-shell > .content {
        border-bottom: 1px solid var(--color-border);
    }

    .site-shell > .right-nav {
        border-top: 0;
        animation: none !important;
        transform: none !important;
    }

    .profile > h2 {
        align-self: end;
        margin: 0;
    }

    .profile > .role {
        grid-column: 2;
        align-self: start;
        margin: 0;
    }

    .profile > .social-links {
        display: grid;
        grid-template-columns: repeat(4, minmax(44px, 1fr));
        grid-column: 1 / -1;
        gap: var(--space-4);
        width: 100%;
    }

    .profile > .social-links .social-icon {
        width: 100%;
    }

    .whatsapp-float {
        position: fixed !important;
        right: max(var(--space-4), env(safe-area-inset-right));
        bottom: max(var(--space-4), env(safe-area-inset-bottom));
        z-index: 100;
        margin: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-shell > * { animation: none; }
    .social-icon,
    .right-nav li a,
    .right-nav .nav-item,
    .whatsapp-float {
        transition: none;
        animation: none;
    }
}
