/* Variables & Reset */
:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --accent-color: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.5);
    --secondary-bg: #171717;
    --card-bg: #1f1f1f;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(45deg, var(--accent-color), #a855f7);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

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

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

.section {
    padding: 6rem 0;
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
}

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

/* Buttons */
.btn-primary {
    background-color: var(--accent-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    display: inline-block;
    border: 2px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    display: inline-block;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    border-color: white;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
}

.hero-content {
    max-width: 600px;
    z-index: 2;
}

.greeting {
    color: var(--accent-color);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: block;
}

.name {
    font-size: 4.5rem;
    margin-bottom: 0.5rem;
}

.title {
    font-size: 2.5rem;
    color: #a0a0a0;
    margin-bottom: 1.5rem;
}

.bio-short {
    font-size: 1.1rem;
    color: #888;
    margin-bottom: 2.5rem;
    max-width: 450px;
}

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

.hero-visual {
    position: absolute;
    right: -5%;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    height: 500px;
    z-index: 1;
    pointer-events: none;
}

.glowing-orb {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--accent-color), transparent 70%);
    filter: blur(60px);
    opacity: 0.4;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

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

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

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

.about-image {
    position: relative;
}

.about-image::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    width: auto;
    height: auto;
    border: 2px solid var(--accent-color);
    border-radius: 30px;
    z-index: 0;
    transition: var(--transition);
}

.about-image:hover::before {
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: 35px;
    transform: none;
}

.profile-img {
    width: 100%;
    display: block;
    border-radius: 20px;
    position: relative;
    z-index: 1;
    filter: grayscale(100%);
    transition: var(--transition);
}

.profile-img:hover {
    filter: grayscale(0%);
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #ccc;
}

.about-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.stat-item {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tech Stack Section (Stacked Bars) */
.skills-container {
    position: relative;
    width: 90vw;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.skill-category {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    /* Added spacing */
}

.skill-category h3 {
    color: white;
    font-size: 1rem;
    width: 30%;
    flex-shrink: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.skill-category h3 span {
    font-size: 0.8rem;
    color: #888;
    font-weight: 400;
    margin-top: 0.2rem;
}

.skill-bar-container {
    flex: 1;
    height: 50px;
    /* Slightly taller */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    display: flex;
    /* Enable Flexbox */
    position: relative;
    overflow: visible;
    /* Allow timeline to show */
}

.skill-bar-segment {
    height: 100%;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    /* Slower, smoother */
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    /* Slower, smoother */
    cursor: pointer;
    /* position: relative; Removed for smart positioning */
    display: flex;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 60px;
    /* Ensure icon always has space */
}

/* Hover Effects: Visual Pop (No Layout Shift) */
.skill-bar-segment:hover {
    transform: scale(1.05);
    /* Visual expansion */
    z-index: 10;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    /* Slight rounding when popped */
}

/* Dim others slightly */
.skill-bar-container:hover .skill-bar-segment:not(:hover) {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.skill-bar-segment:first-child {
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
}

.skill-bar-segment:last-child {
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
}

.skill-bar-segment img,
.skill-bar-segment i {
    width: 24px;
    height: 24px;
    object-fit: contain;
    font-size: 1.2rem;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    pointer-events: none;
}

/* Expanded Timeline View (Magnifying Glass) */
.skill-timeline-expanded {
    position: absolute;
    top: -20px;
    /* Overlay the bar */
    left: 0;
    /* Set by JS */
    width: 400px;
    /* Fixed width for consistent reading */
    max-width: 90vw;
    /* Mobile safety */
    height: auto;
    background: rgba(31, 31, 31, 0.95);
    /* Semi-transparent */
    backdrop-filter: blur(12px);
    /* Glass effect */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    transform-origin: center center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Pop effect */
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.skill-bar-segment:hover .skill-timeline-expanded {
    opacity: 1;
    transform: scale(1);
    /* pointer-events: all; Removed to allow mouse pass-through for switching */
}

/* Remove old connector */
.skill-timeline-expanded::before {
    display: none;
}

/* Row 1: Logo & Total */
.timeline-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.timeline-header img,
.timeline-header i {
    width: 40px;
    height: 40px;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.timeline-header h4 {
    color: white;
    font-size: 1.2rem;
    margin: 0;
}

.timeline-header span {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Row 2: Companies */
.timeline-companies {
    position: relative;
    height: 30px;
    width: 100%;
    margin-bottom: 0.5rem;
}

.timeline-company-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #ccc;
    white-space: nowrap;
}

/* Row 3: Timeline Visual */
.timeline-visual {
    position: relative;
    height: 20px;
    width: 100%;
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.timeline-base-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-active-segment {
    position: absolute;
    height: 6px;
    background: var(--accent-color);
    border-radius: 3px;
    top: 50%;
    transform: translateY(-50%);
}

.timeline-tick {
    position: absolute;
    width: 1px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    top: 50%;
    transform: translateY(-50%);
}

/* Row 4: Years */
.timeline-years {
    position: relative;
    height: 20px;
    width: 100%;
}

.timeline-year-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #666;
}

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

.skill-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.skill-card h3 {
    margin-bottom: 1.5rem;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #ccc;
    transition: var(--transition);
}

.skill-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.skill-item i {
    font-size: 1.2rem;
    color: var(--accent-color);
}

.skill-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

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

.project-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-image {
    height: 200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1rem;
    text-align: center;
}

.project-overlay-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    font-family: var(--font-heading);
    line-height: 1.2;
}

.placeholder-gradient-1 {
    background: linear-gradient(135deg, #FF6B6B, #556270);
}

.placeholder-gradient-2 {
    background: linear-gradient(135deg, #4ECDC4, #556270);
}

.project-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.project-info p {
    color: #aaa;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.tags {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: auto;
    align-content: flex-end;
}

.tags span {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #ddd;
}

.tag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    position: relative;
}

/* Custom Tooltip */
.tag-icon[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s forwards;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.tag-icon[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
    z-index: 10;
    opacity: 0;
    animation: tooltipFadeIn 0.2s forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(-8px);
    }
}

.tag-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.tag-icon img,
.tag-icon i {
    width: 20px;
    height: 20px;
    object-fit: contain;
    font-size: 1.2rem;
    color: var(--accent-color);
}


/* Sandbox Section (3D Orbit) */
.sandbox-section {
    overflow: hidden;
    perspective: 1000px;
}

.orbit-container {
    position: relative;
    height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.orbit-scene {
    width: 300px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-10deg);
    /* Slight tilt for better view */
}

.orbit-ring {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.orbit-item {
    position: absolute;
    width: 300px;
    height: 200px;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* Backface visibility hidden if you want items to disappear when behind */
    /* backface-visibility: hidden; */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: opacity 0.5s;
}

.orbit-item h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.orbit-item p {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.orbit-controls {
    margin-top: 3rem;
    display: flex;
    gap: 1rem;
    z-index: 10;
}

/* Contact Section */
.contact-section {
    text-align: center;
    padding-bottom: 2rem;
}

.contact-text {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto 4rem auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
}

.big-btn {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    align-self: center;
    cursor: pointer;
}

.footer {
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    font-family: var(--font-main);
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-button:hover {
    transform: scale(1.1);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-header {
    background: var(--accent-color);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.chat-header h3 {
    font-size: 1rem;
    margin: 0;
}

#close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.message {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.bot {
    background: rgba(255, 255, 255, 0.1);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.message.user {
    background: var(--accent-color);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
    padding: 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-family: var(--font-main);
}

#chat-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

#send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links {
    display: flex;
    gap: 2rem;
}

.social-links a {
    color: #888;
}

.social-links a:hover {
    color: white;
}

.footer p {
    color: #666;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding-top: 80px;
    }

    .hero-visual {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-top: 2rem;
        width: 300px;
        height: 300px;
    }

    .name {
        font-size: 3rem;
    }

    .title {
        font-size: 1.5rem;
    }

    .cta-group {
        justify-content: center;
    }

    .nav-links {
        display: none;
        /* Add JS toggle later */
    }

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