:root {
    --bg-color: #0a192f;
    --text-color: #ccd6f6;
    --text-secondary: #8892b0;
    --accent-color: #64ffda;
    --card-bg-color: #112240;
    --header-bg-color: rgba(10, 25, 47, 0.85);
}

html {
    font-size: 19px;
    scroll-behavior: smooth;
    max-width: 100%;
    overflow-x: clip;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

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

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 0;
    background-color: var(--header-bg-color);
    backdrop-filter: blur(10px);
    transition: top 0.3s;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--text-color);
    text-decoration: none;
}

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

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

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

.nav-links a.active::after {
    transform: scaleX(1);
}

.nav-links a::after {
    content: '';
    display: block;
    height: 2px;
    background: var(--accent-color);
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.25s ease;
    transform-origin: left;
}

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    /* Above mobile nav bg */
}

main {
    padding-top: 80px;
    /* Header height */
}

section {
    padding: 100px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50%;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Hero */
#home {
    min-height: calc(100vh - 80px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    align-items: center;
    gap: 4rem;
}
.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.1;
}

.hero-content h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--accent-color);
    margin-top: 1rem;
}

.hero-content p {
    margin-top: 1.5rem;
    max-width: 600px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

.hero-buttons {
    margin-top: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.hero-visual {
    position: relative;
    width: min(100%, 420px);
    aspect-ratio: 1;
    margin-left: auto;
    display: grid;
    place-items: center;
}

.hero-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(100, 255, 218, 0.09) 1px, transparent 1px);
    background-size: 28px 28px;
    border-radius: 50%;
    opacity: 0.7;
    z-index: 0;
}

.hero-orbit {
    position: absolute;
    border-radius: 50%;
}

/* Static outer boundary ring */
.hero-orbit-one {
    width: 88%;
    height: 88%;
    border: 1px solid rgba(100, 255, 218, 0.12);
}

/* Radar sweep using rotating conic-gradient */
.hero-orbit-two {
    width: 88%;
    height: 88%;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(100, 255, 218, 0.03) 20deg,
        rgba(100, 255, 218, 0.14) 50deg,
        transparent 52deg
    );
    animation: radarSweep 6s linear infinite;
}

.hero-core {
    position: relative;
    z-index: 3;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(17, 34, 64, 0.92);
    border: 1px solid rgba(100, 255, 218, 0.45);
    animation: corePulse 3.5s ease-in-out infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-core span {
    color: var(--accent-color);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.hero-core i {
    color: var(--accent-color);
    font-size: 2.8rem;
    line-height: 1;
}

.hero-core small {
    margin-top: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.35;
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-chip {
    position: absolute;
    z-index: 4;
    translate: -50% -50%;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(17, 34, 64, 0.92);
    border: 1px solid rgba(100, 255, 218, 0.22);
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: chipFloat 3.2s ease-in-out infinite;
    /* backwards: applies the from-keyframe during delay, preventing position flash on load */
    animation-fill-mode: backwards;
    font-family: inherit;
    user-select: none;
}

.hero-chip i {
    color: var(--accent-color);
}

@keyframes radarSweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes corePulse {
    0%, 100% {
        box-shadow:
            0 0 0 0 rgba(100, 255, 218, 0.2),
            0 0 30px rgba(100, 255, 218, 0.1),
            inset 0 0 20px rgba(100, 255, 218, 0.06);
    }
    50% {
        box-shadow:
            0 0 0 14px rgba(100, 255, 218, 0),
            0 0 40px rgba(100, 255, 218, 0.18),
            inset 0 0 28px rgba(100, 255, 218, 0.1);
    }
}

@keyframes chipFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-7px); }
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: var(--bg-color);
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid var(--accent-color);
    transition: all 0.3s;
    transform-origin: center;
}

.btn-outline {
    background-color: transparent;
    color: var(--accent-color);
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent-color);
}

.social-icons {
    display: flex;
    gap: 1.5rem;
}

.social-icons a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: var(--accent-color);
}

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

.about-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

.about-image-wrapper {
    position: relative;
    width: min(90vw, 320px);
    aspect-ratio: 4 / 5;
    margin: auto;
    overflow: hidden;
    --frame-offset: clamp(8px, 2.5vw, 20px);
}

.about-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    z-index: 2;
}

.about-image-wrapper::after {
    content: '';
    position: absolute;
    top: var(--frame-offset);
    left: var(--frame-offset);
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    z-index: 1;
    transition: transform 0.3s;
    transform: translate(0, 0);
}

.about-image-wrapper:hover::after {
    transform: translate(calc(var(--frame-offset) * -0.5),
            calc(var(--frame-offset) * -0.5));
}

/* Experience Timeline */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    border-left: 2px solid var(--card-bg-color);
    padding-left: 2rem;
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -43px;
    top: 5px;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: 3px solid var(--bg-color);
}

.timeline-card,
.skill-category,
.project-card {
    border: 1px solid transparent;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.timeline-card:hover,
.skill-category:hover,
.project-card:hover {
    transform: translateY(-5px);
    border-color: rgba(100, 255, 218, 0.4);
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.15);
}

.timeline-card {
    background-color: var(--card-bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.timeline-card .company-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-color);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.timeline-card h3 {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-color);
}

.timeline-card .duration {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.timeline-card ul {
    list-style: none;
    margin-top: 1rem;
    padding-left: 0;
}

.timeline-card ul li {
    position: relative;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.timeline-card ul li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* Skills & Projects */
.skills-container,
.projects-grid {
    display: grid;
    gap: 1.5rem;
}

/* Skills */
.skills-container {
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
}

.skill-category {
    background-color: var(--card-bg-color);
    padding: 1.5rem;
    border-radius: 8px;
}

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

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-item {
    background-color: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Projects */
.projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.project-card {
    background-color: var(--card-bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    height: 100%;
}

.stat-number {
    color: var(--accent-color);
    font-weight: 700;
}

.project-card:hover h3 {
    color: var(--accent-color);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-header h3 {
    color: var(--text-color);
    font-size: 1.25rem;
    transition: color 0.3s;
}

.project-header i {
    color: var(--text-secondary);
    font-size: 1.25rem;
}

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

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent-color);
    opacity: 0.8;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 0 2rem;
}

footer h2 {
    font-size: 2rem;
}

footer p {
    max-width: 500px;
    margin: 1rem auto;
    color: var(--text-secondary);
}

.footer-socials {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

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

@media (max-width: 768px) {

    .container {
        padding: 0 1rem;
    }

    /* #home {
        min-height: calc(100vh - 80px);
        align-items: center;
    } */
    #home {
        min-height: calc(100vh - 80px);
        grid-template-columns: 1fr;
        gap: 3rem;
        align-items: center;
    }

    .hero-visual {
        width: min(100%, 340px);
        margin: 0 auto;
    }

    .hero-core {
        width: 125px;
        height: 125px;
    }

    .hero-core span {
        font-size: 2.4rem;
    }

    .hero-chip {
        font-size: 0.75rem;
        padding: 0.45rem 0.65rem;
    }
    .nav-links {
        position: fixed;
        top: 0;
        right: -100vw;
        width: min(75vw, 300px);
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background-color: var(--card-bg-color);
        box-shadow: -10px 0px 30px -15px rgba(2, 12, 27, 0.7);
        transition: right 0.3s ease-in-out;
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger-menu {
        display: block;
    }

    .hero-buttons {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-content {
        width: 100%;
        max-width: 100%;
    }

    .about-content {
        /* grid-template-columns: 3fr 1fr; */
        grid-template-columns: 1fr;
    }

    .about-image-wrapper {
        order: -1;
        /* Move image to top on mobile */
        margin-bottom: 1rem;
    }
    
    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-item::before {
        left: -35px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }
}