:root {
    --bg-base: #030305;
    --glass-surface: rgba(18, 18, 24, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    --neon-blue: #00e5ff;
    --neon-pink: #ff0077;
    --neon-purple: #a020f0;
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    
    --space-xs: 1vmin;
    --space-sm: 1.618vmin;
    --space-md: 2.618vmin;
    --space-lg: 4.236vmin;
    
    --grid-cap: 290px;
}
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
html, body {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    background: var(--bg-base);
    font-family: 'Cairo', sans-serif;
    color: var(--text-primary);
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overscroll-behavior: none;
}
.mesh-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 25% 30%, rgba(0, 229, 255, 0.13) 0%, transparent 55%),
        radial-gradient(circle at 78% 22%, rgba(160, 32, 240, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 55% 85%, rgba(255, 0, 119, 0.10) 0%, transparent 55%);
    background-size: 160% 160%;
    background-repeat: no-repeat;
    background-position: 0% 0%;
    animation: auroraA 36s ease-in-out infinite;
}
.mesh-bg::before {
    content: '';
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(circle at 80% 65%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 20% 75%, rgba(160, 32, 240, 0.10) 0%, transparent 50%);
    background-size: 170% 170%;
    background-repeat: no-repeat;
    background-position: 100% 0%;
    animation: auroraB 44s ease-in-out infinite;
}
.mesh-bg::after {
    content: '';
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(circle at 70% 20%, rgba(255, 0, 119, 0.07) 0%, transparent 52%),
        radial-gradient(circle at 30% 90%, rgba(0, 229, 255, 0.06) 0%, transparent 52%);
    background-size: 180% 180%;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    animation: auroraC 52s ease-in-out infinite;
}
.noise-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.025;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.core {
    position: relative;
    z-index: 2;
    width: min(90vmin, 520px);
    height: min(90vmin, 780px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-radius: 4vmin;
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.6),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.core::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}
.avatar-wrapper {
    position: relative;
    width: 28vmin;
    height: 28vmin;
    max-width: 170px;
    max-height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.avatar-ring-container {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--neon-blue), var(--neon-pink), var(--neon-purple), var(--neon-blue));
    animation: rotate 8s linear infinite;
    mask: radial-gradient(circle, transparent 60%, black 61%);
    -webkit-mask: radial-gradient(circle, transparent 60%, black 61%);
}
.avatar-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--neon-blue), var(--neon-pink), var(--neon-purple), var(--neon-blue));
    filter: blur(35px);
    opacity: 0.3;
    z-index: -1;
    animation: rotate 8s linear infinite;
}
.avatar {
    position: relative;
    width: 92%;
    height: 92%;
    border-radius: 50%;
    object-fit: cover;
    z-index: 2;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: #111;
}
.identity {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    margin-top: 4vmin;
    width: 100%;
    flex-shrink: 0;
}
.name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.8rem, 6vmin, 2.8rem);
    font-weight: 700;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, #ffffff 0%, #d0d0d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}
.tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, 2.2vmin, 1rem);
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.typewriter {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.95rem, 2.8vmin, 1.2rem);
    color: var(--neon-blue);
    height: 1.5em;
    direction: ltr;
    margin-top: var(--space-xs);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}
.cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    color: var(--neon-blue);
}
.grid-wrap {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: grid;
    place-items: center;
    padding-top: var(--space-xs);
    z-index: 2;
}
.social-grid {
    width: min(100%, 50dvh, var(--grid-cap));
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: var(--space-md);
}
@supports (width: 100cqw) {
    .grid-wrap {
        container-type: size;
    }
    .social-grid {
        width: min(100cqw, 100cqh, var(--grid-cap));
        height: min(100cqw, 100cqh, var(--grid-cap));
    }
}
.social-link {
    --brand: #ffffff;
    aspect-ratio: 1 / 1;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.035) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 4px 14px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
    border-radius: 3vmin;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    text-decoration: none;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                border-color 0.4s ease,
                box-shadow 0.45s ease;
}
.social-link.twitter { --brand: #1DA1F2; }
.social-link.instagram { --brand: #E4405F; }
.social-link.github { --brand: #d8d8d8; }
.social-link.snapchat { --brand: #FFFC00; }
.social-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--brand) 0%, transparent 75%);
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
}
.social-link::after {
    content: '';
    position: absolute;
    top: -25%;
    bottom: -25%;
    left: 0;
    width: 45%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
    transform: translateX(-250%) skewX(-18deg);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.social-link i {
    font-size: clamp(1.7rem, 5vmin, 2.4rem);
    color: var(--text-secondary);
    position: relative;
    z-index: 2;
    transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                color 0.35s ease;
}
.social-link span {
    font-size: clamp(0.65rem, 1.8vmin, 0.85rem);
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
    z-index: 2;
}
@supports (width: 100cqw) {
    .social-link i {
        font-size: clamp(1.7rem, 10.5cqw, 2.7rem);
    }
    .social-link span {
        font-size: clamp(0.62rem, 3.4cqw, 0.92rem);
    }
}
.social-link:hover, .social-link:active {
    transform: translateY(-5px) scale(1.015);
    box-shadow: 
        0 16px 32px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.13);
}
.social-link.twitter:hover, .social-link.twitter:active { border-color: rgba(29, 161, 242, 0.5); }
.social-link.instagram:hover, .social-link.instagram:active { border-color: rgba(228, 64, 95, 0.5); }
.social-link.github:hover, .social-link.github:active { border-color: rgba(216, 216, 216, 0.4); }
.social-link.snapchat:hover, .social-link.snapchat:active { border-color: rgba(255, 252, 0, 0.45); }
.social-link:hover::before, .social-link:active::before { opacity: 0.15; }
.social-link:hover::after, .social-link:active::after { transform: translateX(330%) skewX(-18deg); }
.social-link:hover i, .social-link:active i {
    color: var(--brand);
    transform: translateY(-2px) scale(1.12);
}
.social-link:hover span, .social-link:active span {
    color: var(--text-primary);
}
.floater {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}
.floater-1 {
    top: 15%;
    left: 10%;
    width: 6vmin;
    height: 6vmin;
    background: var(--neon-blue);
    filter: blur(25px);
    animation: float 8s ease-in-out infinite;
}
.floater-2 {
    bottom: 20%;
    right: 10%;
    width: 8vmin;
    height: 8vmin;
    background: var(--neon-pink);
    filter: blur(30px);
    animation: float 10s ease-in-out infinite reverse;
}
.reveal {
    animation: rise 300ms ease-out backwards;
    animation-delay: var(--d, 0ms);
}
.avatar-wrapper.reveal { --d: 0ms; }
.name.reveal { --d: 90ms; }
.tagline.reveal { --d: 170ms; }
.typewriter.reveal { --d: 250ms; }
.social-link.reveal { --d: 330ms; }
.social-link.reveal:nth-child(2) { --d: 410ms; }
.social-link.reveal:nth-child(3) { --d: 490ms; }
.social-link.reveal:nth-child(4) { --d: 570ms; }
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes auroraA {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
}
@keyframes auroraB {
    0%, 100% { background-position: 100% 0%; }
    50% { background-position: 0% 100%; }
}
@keyframes auroraC {
    0%, 100% { background-position: 50% 50%; }
    50% { background-position: 82% 18%; }
}
@keyframes rotate {
    100% { transform: rotate(360deg); }
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(15px, -15px); }
}
@media (max-aspect-ratio: 3/4) {
    .core {
        width: 94vw;
        height: 92dvh;
        border-radius: 6vmin;
        padding: var(--space-md);
    }
    .social-grid {
        gap: var(--space-sm);
    }
    .avatar-wrapper {
        width: 26vmin;
        height: 26vmin;
    }
}
@media (max-height: 480px) {
    .avatar-wrapper {
        width: 20vmin;
        height: 20vmin;
        max-width: 110px;
        max-height: 110px;
    }
    .identity {
        margin-top: 2vmin;
    }
    .social-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: 1fr;
        max-width: min(92%, 420px);
    }
    @supports (width: 100cqw) {
        .social-grid {
            width: auto;
            height: min(100cqh, calc(100cqw / 4.5));
            max-width: none;
        }
    }
}
@media (min-width: 1100px) and (min-height: 760px) {
    .core {
        --grid-cap: 310px;
        width: 480px;
        height: min(760px, 94dvh);
        padding: 36px;
    }
    .avatar-wrapper {
        width: 160px;
        height: 160px;
    }
    .identity {
        margin-top: 26px;
    }
    .social-grid {
        gap: 22px;
    }
    .social-link {
        border-radius: 22px;
    }
}
@supports (padding: max(0px)) {
    .core {
        padding-top: max(var(--space-lg), env(safe-area-inset-top));
        padding-bottom: max(var(--space-lg), env(safe-area-inset-bottom));
    }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
