/* ========================================
   NURISLOM SAMARIDDINOV — Personal Website
   ======================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #050810;
    --bg-card: rgba(15, 23, 42, 0.7);
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-2: #8b5cf6;
    --accent-3: #06b6d4;
    --border: rgba(148, 163, 184, 0.08);
    --border-glow: rgba(59, 130, 246, 0.25);
    --linkedin: #0A66C2;
    --github: #f0f4f8;
    --telegram: #26A5E4;
    --instagram: #E4405F;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-full: 9999px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Background Effects ---------- */
.bg-effects {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}

.orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(59,130,246,0.5), transparent 70%);
    top: -150px; right: -100px;
    animation: orbit-1 20s ease-in-out infinite;
}
.orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(139,92,246,0.4), transparent 70%);
    bottom: -100px; left: -150px;
    animation: orbit-2 25s ease-in-out infinite;
}
.orb-3 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(6,182,212,0.3), transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: orbit-3 18s ease-in-out infinite;
}

@keyframes orbit-1 {
    0%, 100% { transform: translate(0,0) scale(1); }
    25% { transform: translate(-80px,60px) scale(1.1); }
    50% { transform: translate(-40px,120px) scale(0.9); }
    75% { transform: translate(60px,40px) scale(1.05); }
}
@keyframes orbit-2 {
    0%, 100% { transform: translate(0,0) scale(1); }
    25% { transform: translate(100px,-50px) scale(1.15); }
    50% { transform: translate(50px,-100px) scale(0.85); }
    75% { transform: translate(-40px,-60px) scale(1.1); }
}
@keyframes orbit-3 {
    0%, 100% { transform: translate(-50%,-50%) scale(1); }
    33% { transform: translate(-30%,-60%) scale(1.2); }
    66% { transform: translate(-70%,-40%) scale(0.8); }
}

.grid-overlay {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(59,130,246,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: grid-move 30s linear infinite;
}
@keyframes grid-move {
    0% { transform: translate(0,0); }
    100% { transform: translate(60px,60px); }
}

.aurora {
    position: absolute;
    top: 0; left: -50%; width: 200%; height: 300px;
    background: linear-gradient(90deg, transparent, rgba(59,130,246,0.06), rgba(139,92,246,0.08), rgba(6,182,212,0.06), transparent);
    animation: aurora-shift 12s ease-in-out infinite alternate;
    filter: blur(40px);
}
@keyframes aurora-shift {
    0% { transform: translateX(-20%) skewX(-5deg); }
    100% { transform: translateX(20%) skewX(5deg); }
}

/* ---------- TYPING CODE BACKGROUND ---------- */
.typing-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.typing-line {
    position: absolute;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    animation: typing-fade 1s ease-out forwards;
}

.typing-line .cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: currentColor;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink-cursor 0.7s step-end infinite;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes typing-fade {
    0% { opacity: 0; transform: translateY(5px); }
    5% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* ---------- Container ---------- */
.container {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 80px 24px 40px;
}

/* ---------- Hero ---------- */
.hero { text-align: center; margin-bottom: 56px; }

.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 32px;
    width: 180px; height: 180px;
}

.avatar-ring {
    position: absolute; inset: -8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-right-color: var(--accent-2);
    animation: spin-ring 3s linear infinite;
}
.avatar-ring.ring-2 {
    inset: -16px;
    border-top-color: var(--accent-3);
    border-right-color: var(--accent);
    animation: spin-ring-reverse 5s linear infinite;
    opacity: 0.5;
}

@keyframes spin-ring { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spin-ring-reverse { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }

.avatar {
    width: 180px; height: 180px;
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    position: relative; z-index: 2;
    object-fit: cover;
    box-shadow: 0 0 30px rgba(59,130,246,0.15), 0 0 60px rgba(139,92,246,0.1);
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), box-shadow 0.4s ease;
}
.avatar:hover {
    transform: scale(1.1) rotate(3deg);
    box-shadow: 0 0 50px rgba(59,130,246,0.3), 0 0 100px rgba(139,92,246,0.2);
}

.name {
    font-size: 36px; font-weight: 900;
    line-height: 1.15; letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent) 50%, var(--accent-2) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-text 6s ease infinite;
}
@keyframes gradient-text {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tagline {
    margin-top: 12px; font-size: 17px;
    font-weight: 400; color: var(--text-secondary);
    letter-spacing: 1px;
}

/* ---------- University Badge ---------- */
.uni-badge {
    display: inline-flex; align-items: center; gap: 20px;
    margin-top: 32px;
    background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 36px;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
    position: relative; overflow: hidden;
}
.uni-badge::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(59,130,246,0.05), transparent);
    opacity: 0; transition: opacity 0.4s ease;
}
.uni-badge:hover {
    border-color: var(--border-glow);
    transform: translateY(-4px);
    box-shadow: 0 12px 50px rgba(59,130,246,0.15);
}
.uni-badge:hover::before { opacity: 1; }

.uni-logo { width: 72px; height: auto; flex-shrink: 0; position: relative; z-index: 1; }
.uni-text { display: flex; flex-direction: column; text-align: left; position: relative; z-index: 1; }
.uni-name { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.uni-degree { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ---------- Section Titles ---------- */
.section-title {
    font-size: 22px; font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 18px;
    letter-spacing: -0.3px;
    position: relative; display: inline-block;
}
.section-title::after {
    content: ''; position: absolute;
    bottom: -4px; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 2px;
}

/* ---------- About ---------- */
.about { margin-bottom: 44px; }
.about-text { font-size: 16px; color: var(--text-secondary); line-height: 1.9; }
.about-text strong { color: var(--text-primary); font-weight: 600; }

/* ---------- Skills ---------- */
.skills { margin-bottom: 52px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.skill-tag {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 26px;
    background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 16px; font-weight: 600;
    color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.skill-tag:hover {
    border-color: var(--accent);
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 10px 35px rgba(59,130,246,0.2);
    background: rgba(59,130,246,0.1);
}

/* ---------- Social Cards ---------- */
.connect { margin-bottom: 52px; }
.social-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }

.social-card {
    display: flex; align-items: center; gap: 18px;
    padding: 22px 28px;
    background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none; color: var(--text-primary);
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    cursor: pointer; position: relative; overflow: hidden;
}

/* Glow sweep effect */
.social-card::after {
    content: '';
    position: absolute;
    top: -50%; left: -100%;
    width: 60%; height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    transition: left 0.6s ease;
}
.social-card:hover::after { left: 150%; }

.social-card:hover {
    transform: translateX(10px) translateY(-3px) scale(1.02);
    box-shadow: 0 15px 50px rgba(0,0,0,0.35);
}

/* Platform-specific */
.social-card.linkedin:hover {
    border-color: var(--linkedin);
    box-shadow: 0 15px 50px rgba(10,102,194,0.2), inset 0 0 30px rgba(10,102,194,0.05);
}
.social-card.linkedin .social-icon { color: var(--linkedin); }
.social-card.linkedin:hover .social-icon {
    background: rgba(10,102,194,0.15);
    box-shadow: 0 0 25px rgba(10,102,194,0.3);
}

.social-card.github:hover {
    border-color: rgba(255,255,255,0.25);
    box-shadow: 0 15px 50px rgba(255,255,255,0.08), inset 0 0 30px rgba(255,255,255,0.02);
}
.social-card.github .social-icon { color: var(--github); }
.social-card.github:hover .social-icon {
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 25px rgba(255,255,255,0.15);
}

.social-card.telegram:hover {
    border-color: var(--telegram);
    box-shadow: 0 15px 50px rgba(38,165,228,0.2), inset 0 0 30px rgba(38,165,228,0.05);
}
.social-card.telegram .social-icon { color: var(--telegram); }
.social-card.telegram:hover .social-icon {
    background: rgba(38,165,228,0.15);
    box-shadow: 0 0 25px rgba(38,165,228,0.3);
}

.social-card.instagram:hover {
    border-color: var(--instagram);
    box-shadow: 0 15px 50px rgba(228,64,95,0.2), inset 0 0 30px rgba(228,64,95,0.05);
}
.social-card.instagram .social-icon { color: var(--instagram); }
.social-card.instagram:hover .social-icon {
    background: rgba(228,64,95,0.15);
    box-shadow: 0 0 25px rgba(228,64,95,0.3);
}

.social-icon {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    flex-shrink: 0;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
}
.social-card:hover .social-icon {
    transform: scale(1.2) rotate(-5deg);
}

.social-info { display: flex; flex-direction: column; flex: 1; }
.social-name { font-size: 18px; font-weight: 700; transition: letter-spacing 0.3s ease; }
.social-card:hover .social-name { letter-spacing: 0.5px; }
.social-handle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

.social-arrow {
    color: var(--text-muted);
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    flex-shrink: 0;
}
.social-card:hover .social-arrow {
    color: var(--text-primary);
    transform: translateX(8px) scale(1.15);
}

/* ---------- Footer ---------- */
.footer { text-align: center; padding-top: 36px; border-top: 1px solid var(--border); }
.footer p { font-size: 13px; color: var(--text-muted); }

/* ---------- Scroll Animations ---------- */
[data-animate] {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-animate].visible { opacity: 1; transform: translateY(0); }
.social-card[data-animate].visible { transition-delay: var(--delay, 0s); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .container { padding: 48px 20px 32px; max-width: 100%; }

    .hero { margin-bottom: 44px; }
    .avatar-wrapper { width: 150px; height: 150px; margin-bottom: 24px; }
    .avatar { width: 150px; height: 150px; box-shadow: 0 0 20px rgba(59,130,246,0.1); }

    .name { font-size: 30px; animation: none; background-size: 100% 100%; }
    .tagline { font-size: 16px; margin-top: 8px; }

    /* Light animations only — one slow orb + grid */
    .orb-1 { width: 300px; height: 300px; filter: blur(100px); opacity: 0.2; }
    .orb-2 { display: none; }
    .orb-3 { display: none; }
    .aurora { display: none; }
    .typing-bg { display: none; }
    .grid-overlay { opacity: 0.4; }

    /* Keep one ring spinning slowly */
    .avatar-ring { animation: spin-ring 8s linear infinite; }
    .avatar-ring.ring-2 { display: none; }

    /* University badge — logo bigger, card tighter */
    .uni-badge {
        flex-direction: column; text-align: center;
        gap: 4px; padding: 10px 16px 14px;
        backdrop-filter: none;
        width: 100%;
    }
    .uni-text { text-align: center; }
    .uni-logo { width: 140px; }
    .uni-name { font-size: 17px; }
    .uni-degree { font-size: 13px; }

    /* Section titles */
    .section-title { font-size: 22px; }
    .section-title::after { animation: none; }

    /* About */
    .about { margin-bottom: 36px; }
    .about-text { font-size: 15px; line-height: 1.8; }

    /* Skills */
    .skills { margin-bottom: 40px; }
    .skill-tag {
        padding: 12px 22px;
        font-size: 15px;
        backdrop-filter: none;
    }
    .skill-tag svg, .skill-tag img { width: 26px; height: 26px; }

    /* Social cards — big and clear */
    .connect { margin-bottom: 40px; }
    .social-grid { gap: 12px; }
    .social-card {
        padding: 18px 20px;
        backdrop-filter: none;
        border-radius: 16px;
    }
    .social-card::after { display: none; }
    .social-icon { width: 50px; height: 50px; border-radius: 10px; }
    .social-icon svg { width: 28px; height: 28px; }
    .social-name { font-size: 17px; }
    .social-handle { font-size: 12px; }
    .social-arrow { width: 22px; height: 22px; }

    /* INSTANT load — no fade-in animation on mobile */
    [data-animate] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

::selection { background: var(--accent); color: white; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(59,130,246,0.4); }
