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

:root {
    /* Space/Midnight Theme */
    --bg-dark: #05070f;
    --bg-card: rgba(10, 15, 35, 0.75);
    --border-color: rgba(100, 150, 255, 0.1);
    --text-primary: #e8eef8;
    --text-secondary: rgba(200, 210, 240, 0.6);
    --accent-primary: #4f7cff;
    --accent-secondary: #7c3aed;
    --accent-tertiary: #06b6d4;
    --accent-glow: rgba(79, 124, 255, 0.5);
    --star-color: rgba(255, 255, 255, 0.8);
    --nebula-1: rgba(79, 124, 255, 0.12);
    --nebula-2: rgba(124, 58, 237, 0.1);
    --nebula-3: rgba(6, 182, 212, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Starfield Background */
.bg-gradient {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 60% at 50% 0%, var(--nebula-1), transparent),
        radial-gradient(ellipse 80% 50% at 80% 50%, var(--nebula-2), transparent),
        radial-gradient(ellipse 60% 40% at 20% 80%, var(--nebula-3), transparent),
        linear-gradient(180deg, #05070f 0%, #0a1128 50%, #05070f 100%);
    z-index: -3;
}

/* Animated Stars */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.bg-grid::before,
.bg-grid::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--star-color);
    border-radius: 50%;
    box-shadow:
        /* Layer 1 - Small distant stars */
        100px 50px 0 0 rgba(255, 255, 255, 0.6),
        200px 150px 0 0 rgba(255, 255, 255, 0.4),
        350px 80px 0 0 rgba(255, 255, 255, 0.5),
        450px 200px 0 0 rgba(255, 255, 255, 0.3),
        600px 120px 0 0 rgba(255, 255, 255, 0.6),
        750px 300px 0 0 rgba(255, 255, 255, 0.4),
        850px 50px 0 0 rgba(255, 255, 255, 0.5),
        950px 180px 0 0 rgba(255, 255, 255, 0.3),
        1100px 250px 0 0 rgba(255, 255, 255, 0.6),
        1250px 100px 0 0 rgba(255, 255, 255, 0.4),
        /* Layer 2 */
        50px 300px 0 0 rgba(255, 255, 255, 0.5),
        180px 420px 0 0 rgba(255, 255, 255, 0.3),
        320px 350px 0 0 rgba(255, 255, 255, 0.6),
        480px 500px 0 0 rgba(255, 255, 255, 0.4),
        620px 380px 0 0 rgba(255, 255, 255, 0.5),
        780px 550px 0 0 rgba(255, 255, 255, 0.3),
        920px 400px 0 0 rgba(255, 255, 255, 0.6),
        1080px 480px 0 0 rgba(255, 255, 255, 0.4),
        /* Layer 3 */
        120px 600px 0 0 rgba(255, 255, 255, 0.4),
        280px 720px 0 0 rgba(255, 255, 255, 0.5),
        420px 650px 0 0 rgba(255, 255, 255, 0.3),
        580px 800px 0 0 rgba(255, 255, 255, 0.6),
        720px 700px 0 0 rgba(255, 255, 255, 0.4),
        880px 780px 0 0 rgba(255, 255, 255, 0.5),
        1020px 680px 0 0 rgba(255, 255, 255, 0.3),
        1180px 750px 0 0 rgba(255, 255, 255, 0.6);
    animation: twinkle 4s ease-in-out infinite;
}

.bg-grid::after {
    animation-delay: -2s;
    transform: translateX(50px) translateY(-30px);
    opacity: 0.7;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Shooting Stars */
.orb {
    position: fixed;
    z-index: -1;
}

.orb-1 {
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    top: 15%;
    left: -100px;
    animation: shootingStar 8s linear infinite;
    animation-delay: 0s;
    border-radius: 2px;
}

.orb-2 {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(100, 180, 255, 0.8), transparent);
    top: 40%;
    left: -80px;
    animation: shootingStar 12s linear infinite;
    animation-delay: -4s;
    border-radius: 2px;
}

.orb-3 {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 150, 255, 0.7), transparent);
    top: 70%;
    left: -60px;
    animation: shootingStar 10s linear infinite;
    animation-delay: -7s;
    border-radius: 2px;
}

@keyframes shootingStar {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateX(calc(100vw + 200px)) translateY(100px);
        opacity: 0;
    }
}

/* Main Container */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 2rem;
}

/* Main Card */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: floatIn 1s ease-out;
    box-shadow:
        0 0 60px -20px var(--accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(79, 124, 255, 0.03) 0%, transparent 50%);
    animation: cardGlow 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cardGlow {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(0, 0);
    }

    50% {
        opacity: 1;
        transform: translate(10%, 10%);
    }
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

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

/* Avatar */
.avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 40px -5px var(--accent-glow);
}

.avatar-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.avatar-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
            var(--accent-tertiary),
            var(--accent-primary),
            var(--accent-secondary),
            var(--accent-tertiary));
    animation: orbitRing 6s linear infinite;
    opacity: 0.6;
}

@keyframes orbitRing {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.status-dot {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #22c55e;
    border: 3px solid var(--bg-dark);
    border-radius: 50%;
    z-index: 2;
    animation: stellarPulse 2s infinite;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

@keyframes stellarPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5), 0 0 10px rgba(34, 197, 94, 0.5);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0), 0 0 20px rgba(34, 197, 94, 0.3);
    }
}

/* Typography */
.name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    background-size: 200% 200%;
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 2rem;
}

/* Link Buttons */
.links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.link-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(79, 124, 255, 0.05);
    border: 1px solid rgba(79, 124, 255, 0.15);
    border-radius: 14px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.link-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.link-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow:
        0 10px 40px -10px var(--accent-glow),
        0 0 20px -5px var(--accent-glow);
}

.link-btn:hover::before {
    opacity: 0.1;
}

.link-btn .icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.link-btn span {
    flex: 1;
    text-align: left;
    position: relative;
    z-index: 1;
}

.link-btn .arrow {
    width: 18px;
    height: 18px;
    opacity: 0;
    transform: translate(-5px, 5px);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.link-btn:hover .arrow {
    opacity: 1;
    transform: translate(0, 0);
}

/* Tech Stack Pills */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.pill {
    padding: 0.4rem 0.9rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-tertiary);
    transition: all 0.3s ease;
}

.pill:hover {
    background: rgba(6, 182, 212, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 15px -3px rgba(6, 182, 212, 0.4);
}

/* Footer */
.footer {
    animation: floatIn 1s ease-out 0.3s both;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 480px) {
    .card {
        padding: 2rem 1.5rem;
    }

    .name {
        font-size: 1.75rem;
    }

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

    .avatar-text {
        font-size: 2rem;
    }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 15, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal */
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 450px;
    width: 100%;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 0 80px -20px var(--accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(79, 124, 255, 0.1);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(79, 124, 255, 0.2);
    color: var(--text-primary);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    padding: 0.875rem 1rem;
    background: rgba(79, 124, 255, 0.05);
    border: 1px solid rgba(79, 124, 255, 0.15);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(200, 210, 240, 0.3);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.15), 0 0 20px -5px var(--accent-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    box-shadow: 0 0 30px -10px var(--accent-glow);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px -10px var(--accent-glow), 0 0 40px -10px var(--accent-glow);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn svg {
    width: 18px;
    height: 18px;
}

/* Button styling for link-btn that is a button element */
button.link-btn {
    cursor: pointer;
    font-family: inherit;
}

/* Skills Section */
.skills-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 900px;
    margin-top: 1rem;
    animation: floatIn 1s ease-out 0.2s both;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    background: rgba(10, 15, 35, 0.85);
    box-shadow: 0 10px 40px -10px rgba(79, 124, 255, 0.2);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(79, 124, 255, 0.3));
    transition: transform 0.3s ease;
}

.skill-card:hover .skill-icon {
    transform: scale(1.1);
}

.skill-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skill-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Gradient border effect on hover */
.skill-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(79, 124, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

@media (max-width: 768px) {
    .skills-section {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
}