*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--background);
    color: var(--text);
    transition:
        background .4s ease,
        color .4s ease;
}

/* =======================================================
   VARIABLES
======================================================= */
:root {
    --background: #09090B;
    --surface: rgba(255, 255, 255, .06);
    --surface-hover: rgba(255, 255, 255, .10);
    --border: rgba(255, 255, 255, .08);
    --text: #F8F8F8;
    --text-secondary: #A1A1AA;
    --shadow: 0 10px 35px rgba(0, 0, 0, .35);
    --blur: 20px;
    --primary: #5D2291;
    --secondary: #33D1D1;
    --success: #93D93D;
}

/* ---------- LIGHT MODE ---------- */
[data-theme="light"] {
    --background: #F6F7FB;
    --surface: rgba(255, 255, 255, .75);
    --surface-hover: #ffffff;
    --border: rgba(0, 0, 0, .06);
    --text: #161616;
    --text-secondary: #666;
    --shadow: 0 15px 35px rgba(0, 0, 0, .08);
}

/* =======================================================
   BACKGROUND
======================================================= */
.background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -10;
}

/* blobs */
.gradient {
    position: absolute;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .45;
    animation: float 18s infinite alternate ease-in-out;
}

.gradient-1 {
    background: #5D2291;
    top: -220px;
    left: -150px;
}

.gradient-2 {
    background: #33D1D1;
    bottom: -250px;
    right: -180px;
    animation-duration: 22s;
}

.noise {
    position: absolute;
    inset: 0;
    opacity: .05;
    background-image:
        radial-gradient(circle at center,
            rgba(255, 255, 255, .08) 1px,
            transparent 1px);
    background-size: 22px 22px;
}

/* =======================================================
   ACTIONS
======================================================= */
.actions { position: fixed; top: 25px; right: 25px; z-index: 999; display: flex; gap: 10px; }
.icon-button {
    height: 52px; min-width: 52px; padding: 0 14px; border: none; border-radius: 999px; cursor: pointer;
    backdrop-filter: blur(var(--blur)); background: var(--surface); border: 1px solid var(--border);
    color: var(--text); font-size: 1.1rem; transition: .55s; display: flex; align-items: center; justify-content: center;
}
.icon-button:hover { transform: translateY(-4px); background: var(--surface-hover); box-shadow: 0 0 22px rgba(124,58,237,.35); }
.lang-button { font-family: var(--mono); font-weight: 600; font-size: .85rem; letter-spacing: .5px; }

/* =======================================================
   CONTAINER
======================================================= */
.container {
    width: min(650px, 90%);
    margin: auto;
    padding:
        90px 0 50px;
}

/* =======================================================
   PROFILE
======================================================= */
.profile {
    text-align: center;
    animation: fadeUp .8s ease;
}

.avatar {
    width: 145px;
    height: 145px;
    margin: auto;
    border-radius: 50%;
    padding: 5px;
    background:
        linear-gradient(135deg,
            var(--primary),
            var(--secondary));
    box-shadow: var(--shadow);
}

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

.profile h1 {
    margin-top: 22px;
    font-size: 2.3rem;
    font-weight: 700;
}

.subtitle {
    margin-top: 10px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =======================================================
   STATUS
======================================================= */
.status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 26px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--surface);
    backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border);

}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

/* =======================================================
   LINKS
======================================================= */
.links {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 50px;
}

/* =======================================================
   LINK CARD
======================================================= */
.link-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition:
        transform .35s ease,
        background .35s ease,
        border-color .35s ease,
        box-shadow .35s ease;
}

/* línea superior con degradado */
.link-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background:
        linear-gradient(90deg,
            transparent,
            var(--primary),
            var(--secondary),
            transparent);
    opacity: 0;
    transition: .35s;
}

.link-card:hover {
    transform:
        translateY(-6px) scale(1.015);
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, .14);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, .35);
}

.link-card:hover::before {
    opacity: 1;
}

/* =======================================================
   LEFT SIDE
======================================================= */
.link-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

/* =======================================================
   ICONS
======================================================= */
.icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.35rem;
    flex-shrink: 0;
    transition:
        transform .35s ease,
        box-shadow .35s ease;
}

/* colores */
.portfolio {
    background:
        linear-gradient(135deg,
            #5D2291,
            #CBB9E7);
}

.github {
    background:
        linear-gradient(135deg,
            #18181B,
            #3F3F46);
}

.linkedin {
    background:
        linear-gradient(135deg,
            #0077B5,
            #00A0DC);
}

.resume {
    background:
        linear-gradient(135deg,
            #33D1D1,
            #93D93D);
}

.instagram {
    background:
        linear-gradient(135deg,
            #F58529,
            #DD2A7B,
            #8134AF);
}

.link-card:hover .icon {
    transform:
        rotate(-8deg) scale(1.08);
}

/* =======================================================
   TEXT
======================================================= */
.link-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.link-text h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.link-text span {
    margin-top: 4px;
    font-size: .92rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =======================================================
   COPY BUTTON
======================================================= */
.copy-button {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    opacity: 0;
    transform: translateX(10px) scale(.9);
    pointer-events: none;
    transition:
        opacity .25s ease,
        transform .25s ease,
        background .25s ease,
        color .25s ease;
}

.link-card:hover .copy-button {
    opacity: 1;
    transform:
        translateX(0) scale(1);
    pointer-events: auto;
}

.copy-button:hover {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
}

.copy-button:active {
    transform: scale(.90);
}

/* =======================================================
   FOOTER
======================================================= */
footer {
    margin-top: 55px;
    text-align: center;
    color: var(--text-secondary);
}

footer span {
    display: block;
    margin-top: 8px;
    font-size: .85rem;
    opacity: .8;
}

/* =======================================================
   TOAST
======================================================= */
.toast {
    position: fixed;
    left: 50%;
    bottom: 35px;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 18px;
    background: var(--surface);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity .35s ease,
        transform .35s ease;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast i {
    color: var(--success);
}

/* =======================================================
   ANIMACIONES
======================================================= */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

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

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(40px, -30px) scale(1.08);
    }

    100% {
        transform: translate(-20px, 40px) scale(.95);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
    }

    70% {
        transform: scale(1.15);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* =======================================================
   ANIMACIÓN ESCALONADA
======================================================= */
.links .link-card {
    opacity: 0;
    animation: fadeUp .7s ease forwards;
}

.links .link-card:nth-child(1) {
    animation-delay: .15s;
}

.links .link-card:nth-child(2) {
    animation-delay: .28s;
}

.links .link-card:nth-child(3) {
    animation-delay: .41s;
}

.links .link-card:nth-child(4) {
    animation-delay: .54s;
}

/* =======================================================
   FOCUS (Accesibilidad)
======================================================= */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

/* =======================================================
   SELECCIÓN DE TEXTO
======================================================= */
::selection {
    background: var(--primary);
    color: white;
}

/* =======================================================
   SCROLLBAR
======================================================= */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .30);
}

/* =======================================================
   RESPONSIVE TABLET
======================================================= */
@media (max-width:768px) {
    .container {
        width: 92%;
        padding-top: 70px;
    }

    .profile h1 {
        font-size: 2rem;
    }

    .avatar {
        width: 125px;
        height: 125px;
    }

    .status {
        font-size: .9rem;
        padding: 10px 18px;
    }

    .link-card {
        padding: 18px;
        border-radius: 20px;
    }

    .icon {
        width: 52px;
        height: 52px;
        font-size: 1.2rem;
    }

    .copy-button {
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .actions {
        top: 18px;
        right: 18px;
    }
}

/* =======================================================
   RESPONSIVE MÓVIL
======================================================= */
@media (max-width:500px) {
    .container {
        width: 94%;
    }

    .profile h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: .92rem;
    }

    .link-card {
        padding: 16px;
    }

    .icon {
        width: 48px;
        height: 48px;
        border-radius: 15px;
    }

    .link-text h3 {
        font-size: 1rem;
    }

    .link-text span {
        font-size: .82rem;
    }

    .copy-button {
        width: 42px;
        height: 42px;
    }

    footer {
        margin-bottom: 25px;
    }
}

/* =======================================================
   PREFERS REDUCED MOTION
======================================================= */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* =======================================================
   UTILIDADES
======================================================= */
.hidden {
    display: none !important;
}

.no-select {
    user-select: none;
}

.pointer {
    cursor: pointer;
}