:root {
    --bg-dark: #050505;
    --bg-darker: #020202;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent-1: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    /* Hard lock horizontal axis for mobile devices */
}

@media (max-width: 680px) {
    html {
        font-size: 14px;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.logo,
.section-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Dynamic Background */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    background: var(--bg-darker);
}

.glow-orb {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.6;
    animation: drift 20s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%;
    left: 20%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(60, 60, 60, 0.5) 0%, rgba(0, 0, 0, 0) 70%);
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(40, 40, 40, 0.4) 0%, rgba(0, 0, 0, 0) 70%);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: -20%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(80, 80, 80, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
    animation-delay: -10s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(5%, 5%) scale(1.1);
    }
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.05;
    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='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Glassmorphism */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s, box-shadow 0.4s;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.glass-card:hover {
    border-color: var(--glass-highlight);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
}

.glass-card:hover::before {
    opacity: 1;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    transition: padding 0.3s ease;
}

.navbar.scrolled .nav-container {
    background: rgba(5, 5, 5, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    filter: grayscale(100%) contrast(1.1);
    transition: filter 0.3s ease, box-shadow 0.3s ease;
}

.brand-wrapper:hover .nav-avatar {
    filter: grayscale(0) contrast(1.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo span {
    color: var(--text-secondary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Sections */
section {
    padding: 5rem 0;
    min-height: auto;
}

.section-header {
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-subtitle::before {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--text-secondary);
}

.section-title {
    font-size: 3rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.section-title span {
    color: var(--text-secondary);
    font-style: italic;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 6rem;
    padding-bottom: 8rem;
    /* Creates safe space for the scroll indicator */
    position: relative;
}

.hero-content.centered {
    text-align: center;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-avatar.floating-avatar {
    position: absolute;
    right: 12%;
    top: 25%;
    display: inline-block;
    z-index: 10;
}

@keyframes ameba-morph {
    0% {
        border-radius: 41% 59% 43% 57% / 46% 38% 62% 54%;
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }

    25% {
        border-radius: 73% 27% 30% 70% / 54% 63% 37% 46%;
        transform: translate(-50%, -50%) rotate(2deg) scale(1.01);
    }

    50% {
        border-radius: 34% 66% 62% 38% / 31% 69% 31% 69%;
        transform: translate(-50%, -50%) rotate(5deg) scale(1.02);
    }

    75% {
        border-radius: 61% 39% 71% 29% / 57% 33% 67% 43%;
        transform: translate(-50%, -50%) rotate(2deg) scale(1.01);
    }

    100% {
        border-radius: 41% 59% 43% 57% / 46% 38% 62% 54%;
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
}

@keyframes ameba-morph-container {
    0% {
        border-radius: 41% 59% 43% 57% / 46% 38% 62% 54%;
    }

    25% {
        border-radius: 73% 27% 30% 70% / 54% 63% 37% 46%;
    }

    50% {
        border-radius: 34% 66% 62% 38% / 31% 69% 31% 69%;
    }

    75% {
        border-radius: 61% 39% 71% 29% / 57% 33% 67% 43%;
    }

    100% {
        border-radius: 41% 59% 43% 57% / 46% 38% 62% 54%;
    }
}

.avatar-container {
    width: 260px;
    height: 260px;
    border-radius: 41% 59% 43% 57% / 46% 38% 62% 54%;
    padding: 4px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.05));
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    overflow: hidden;
    animation: ameba-morph-container 8s ease-in-out infinite;
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 41% 59% 43% 57% / 46% 38% 62% 54%;
    background-color: #fff;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
    filter: grayscale(100%) contrast(1.05);
    animation: ameba-morph-container 8s ease-in-out infinite;
}

.hero-avatar:hover .profile-img {
    transform: scale(1.08);
    /* slightly higher scale when hovering huge ameba */
    filter: grayscale(0%) contrast(1.05);
}

.hero-avatar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 41% 59% 43% 57% / 46% 38% 62% 54%;
    filter: blur(20px);
    z-index: 1;
    animation: ameba-morph 8s ease-in-out infinite;
}

.hero-badge {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.name {
    font-size: clamp(4rem, 8vw, 7rem);
    line-height: 1;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0.6) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 4px 20px rgba(255, 255, 255, 0.1));
}

.role {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 400;
    height: 1.2em;
}

.typewriter {
    color: var(--text-primary);
}

.typewriter::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.summary {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 650px;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Scroll Indicator */
.scroll-indicator-container {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    gap: 0.8rem;
    transition: color 0.3s ease;
}

.scroll-indicator:hover {
    color: var(--text-primary);
}

.scroll-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 500;
}

.scroll-arrow-wrapper {
    height: 30px;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.scroll-arrow {
    font-size: 1.2rem;
    animation: elegant-scroll 2s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes elegant-scroll {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    70% {
        transform: translateY(100%);
        opacity: 0;
    }

    100% {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 3rem;
}

.about-text {
    padding: 3rem;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.skills-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

/* Work Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

.card-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.1s;
    opacity: 0;
    top: -100px;
    left: -100px;
    z-index: 0;
}

.project-card:hover .card-glow {
    opacity: 1;
}

.project-info {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.role-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.company {
    color: var(--text-primary);
    font-weight: 600;
}

.duration {
    color: var(--text-secondary);
    font-family: monospace;
}

.project-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.project-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    flex-grow: 1;
}

.project-info .deg {
    margin-bottom: 0.5rem;
}

.achievement {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.achievement i {
    color: #e0e0e0;
}

/* Contact Section */
.contact-card {
    padding: 5rem 3rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-desc {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Footer */
.glass-footer {
    border-top: 1px solid var(--glass-border);
    padding: 2.5rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.social-links a:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        background: rgba(5, 5, 5, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav-links.active {
        right: 0;
    }

    .hero {
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 8rem;
        padding-bottom: 6rem;
        /* Ensure safe overlap distance on mobile */
    }

    .scroll-indicator-container {
        bottom: 0.5rem;
        /* Placd explicitly lower for mobile devices */
    }

    .hero-avatar.floating-avatar {
        position: relative;
        right: auto;
        top: auto;
        margin-bottom: 2rem;
        display: block;
    }

    .avatar-container {
        width: 140px;
        height: 140px;
        border-radius: 50%;
        animation: none;
    }

    .profile-img {
        border-radius: 50%;
        animation: none;
    }

    .hero-avatar::before {
        width: 150px;
        height: 150px;
        border-radius: 50%;
        animation: none;
    }

    .hero-content.centered {
        padding: 0 20px;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .contact-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}