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

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border: #30363d;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --success: #3fb950;
    --danger: #f85149;
    --warning: #d29922;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background-image: linear-gradient(180deg, #0d1117 0%, #201f1f 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(13, 17, 23, 0.4) 0%, rgba(1, 4, 9, 0.6) 100%);
    overflow: hidden;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

.star:nth-child(odd) {
    animation-delay: 1s;
}

.star:nth-child(3n) {
    animation-delay: 2s;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.earth-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    transform: translate(-50%, -50%);
    animation: earthOrbit 120s linear infinite;
}

.earth {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 30% 30%, #4a90e2, #2c5aa0, #1a365d);
    border-radius: 50%;
    position: relative;
    animation: earthSpin 20s linear infinite;
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

.earth::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 10%;
    width: 30%;
    height: 40%;
    background: #2d5a27;
    border-radius: 50% 30% 60% 40%;
    transform: rotate(-20deg);
}

.earth::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20%;
    width: 25%;
    height: 35%;
    background: #2d5a27;
    border-radius: 40% 60% 30% 50%;
    transform: rotate(30deg);
}

@keyframes earthOrbit {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes earthSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

/* Header */
header {
    background: rgba(22, 27, 34, 0.85);
    border-bottom: 1px solid var(--border);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(80x);
    transition: all 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    height: 70px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1005;
}

.menu-line {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 14rem;
    align-items: center;
    animation: fadeInUp 0.8s ease-out;
    z-index: 2;
}

/* Blobby Frame Container */
.profile-frame-css {
    position: relative;
    width: clamp(220px, 30vw, 300px);
    height: clamp(220px, 30vw, 300px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: floatFrame 20s ease-in-out infinite;
    margin: 0 auto;
}

/* Profile Image */
.profile-img {
    width: 65%;
    height: 65%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--accent, #fff);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 10;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 32px rgba(88, 166, 255, 0.3);
}

/* Abstract animated blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    z-index: 1;
    opacity: 0.8;
}

.blob-1 {
    width: 100%;
    height: 100%;
    background: #ff9f43;
    top: 0;
    left: 0;
    animation: blobOrbit1 10s linear infinite;
}

.blob-2 {
    width: 90%;
    height: 90%;
    background: #00cec9;
    bottom: 0;
    right: 0;
    animation: blobOrbit2 12s linear infinite;
}

.blob-3 {
    width: 80%;
    height: 80%;
    background: #a29bfe;
    top: 0;
    right: 0;
    animation: blobOrbit3 14s linear infinite;
}

.blob-4 {
    width: 70%;
    height: 70%;
    background: #fdcb6e;
    bottom: 0;
    left: 0;
    animation: blobOrbit4 16s linear infinite;
}

/* Orbit animations */
@keyframes blobOrbit1 {
    0% {
        transform: rotate(0deg) translate(10px) rotate(0deg);
    }

    100% {
        transform: rotate(360deg) translate(10px) rotate(-360deg);
    }
}

@keyframes blobOrbit2 {
    0% {
        transform: rotate(0deg) translate(8px) rotate(0deg);
    }

    100% {
        transform: rotate(360deg) translate(8px) rotate(-360deg);
    }
}

@keyframes blobOrbit3 {
    0% {
        transform: rotate(0deg) translate(6px) rotate(0deg);
    }

    100% {
        transform: rotate(360deg) translate(6px) rotate(-360deg);
    }
}

@keyframes blobOrbit4 {
    0% {
        transform: rotate(0deg) translate(4px) rotate(0deg);
    }

    100% {
        transform: rotate(360deg) translate(4px) rotate(-360deg);
    }
}

/* Floating animation for the whole frame */
@keyframes floatFrame {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* RESPONSIVE — Mobile Fix */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .profile-frame-css {
        margin-bottom: 2rem;
    }
}

.hero-text h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero-text .subtitle {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    min-height: 1.5rem;
    font-weight: 500;
}

.hero-text .subtitle .cursor {
    display: inline-block;
    width: 10px;
    height: 1.2rem;
    background-color: var(--accent);
    animation: blink 0.7s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero-text p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    border-color: var(--accent);
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.status-dot {
    width: 18px;
    height: 18px;
    background: radial-gradient(circle at 30% 30%, #4ae257, #00ffcc, #09182d);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

/* Section Styling */
section {
    padding: 4rem 0;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-primary);
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tech-tag {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.stat:hover {
    transform: translateY(-5px);
}

.stat h3 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

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

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.skill-category h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-item {
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.skill-item:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: scale(1.05);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(88, 166, 255, 0.1), transparent);
    transition: left 0.5s;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.project-card h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.project-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.project-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-form {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

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

.social-links-contact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--bg-tertiary);
    transform: translateX(5px);
    border-color: var(--accent);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
}

/* Scroll to Top */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: var(--bg-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background: var(--accent-hover);
    transform: translateY(-5px);
}

/* Notification */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    transform: translateX(calc(100% + 20px));
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
}

.notification.success {
    background: var(--success);
}

.notification.error {
    background: var(--danger);
}

.notification.show {
    transform: translateX(0);
}

/* ===== MOON ANIMATION (ADD THIS) ===== */

/* This is the container for the moon's path. It rotates. */
.moon-orbit {
    position: absolute;
    /* The earth is 100px, so we make the orbit path larger */
    width: 150px;
    height: 150px;
    /* This calculation centers the orbit around the 100x100px earth */
    top: -25px;
    /* (100px - 150px) / 2 */
    left: -25px;
    /* (100px - 150px) / 2 */
    animation: moonOrbit 27s linear infinite;
    /* A different duration makes the cycles look less repetitive */
}

/* The moon element itself */
.moon {
    position: absolute;
    /* Position the moon at the top of its rotating orbit container */
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #e0e0e0;
    /* A light grey color */
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    /* A soft white glow */
}

.moon::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 10%;
    width: 30%;
    height: 40%;
    background: #807f7f;
    border-radius: 50% 30% 60% 40%;
    transform: rotate(-20deg);
}

.moon::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20%;
    width: 25%;
    height: 35%;
    background: #807f7f;
    border-radius: 40% 60% 30% 50%;
    transform: rotate(30deg);
}

/* The keyframe animation that makes the orbit container spin */
@keyframes moonOrbit {
    from {
        transform: rotate(0deg);
    }

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Responsive Design */
@media (max-width: 992px) {

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        justify-items: center;
    }

    .hero-text p,
    .cta-buttons,
    .status-indicator {
        justify-content: center;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(22, 27, 34, 0.98);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        padding: 1rem 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        text-align: center;
        padding: 0.5rem 0;
    }

    .mobile-menu {
        display: flex;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .cta-buttons .btn {
        width: 80%;
    }

    .earth-container {
        width: 400px;
        height: 400px;
    }

    .earth {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 6rem 0 3rem;
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}