/* -------------------------------------------------------------
   VARIABLES & THEMING
------------------------------------------------------------- */
:root {
    /* Color Palette - Dark Mode Default */
    --bg-color: #0d1117;
    --bg-alt-color: #161b22;
    --text-color: #c9d1d9;
    --text-muted: #8b949e;
    --primary-color: #58a6ff;
    --secondary-color: #3fb950;
    --border-color: #30363d;
    --card-bg: #21262d;
    --hover-bg: #30363d;

    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;

    /* Transition & Shadows */
    --transition: all 0.3s ease;
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.6);
}

.light-mode {
    --bg-color: #ffffff;
    --bg-alt-color: #f6f8fa;
    --text-color: #24292f;
    --text-muted: #57606a;
    --primary-color: #0969da;
    --secondary-color: #2da44e;
    --border-color: #d0d7de;
    --card-bg: #ffffff;
    --hover-bg: #f3f4f6;
    
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* -------------------------------------------------------------
   RESET & GLOBAL
------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-color);
    font-weight: 700;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    padding: 100px 0;
}

.bg-alt {
    background-color: var(--bg-alt-color);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--text-color);
}

.section-title h2 span {
    color: var(--primary-color);
}

.underline {
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* -------------------------------------------------------------
   BUTTONS
------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

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

.btn-secondary:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    transform: translateY(-3px);
}

.btn-block {
    display: block;
    width: 100%;
}

/* -------------------------------------------------------------
   ANIMATIONS
------------------------------------------------------------- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.appear {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* -------------------------------------------------------------
   NAVBAR
------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(var(--bg-color), 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: var(--shadow-soft);
}

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

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

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

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

@media (min-width: 769px) {
    .nav-links {
        margin-left: auto;
        margin-right: 30px;
    }
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.theme-toggle-btn:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

/* -------------------------------------------------------------
   HERO SECTION
------------------------------------------------------------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.hero-content {
    flex: 1;
}

.hero-greeting {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.name-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

@keyframes miniMorph {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

.mini-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid var(--primary-color);
    box-shadow: var(--shadow-soft);
    animation: miniMorph 5s ease-in-out infinite alternate;
}

.mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-name {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 0;
    white-space: nowrap;
}

.hero-name span {
    color: transparent;
    -webkit-text-stroke: 1px var(--text-color);
}

.hero-title {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 500;
}

.hero-intro {
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

@keyframes morphBlob {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

.image-wrapper {
    position: relative;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 6px;
    box-shadow: var(--shadow-hover);
    animation: morphBlob 8s ease-in-out infinite alternate;
}

.image-wrapper img {
    border-radius: inherit;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: var(--card-bg); /* fallback */
}

/* -------------------------------------------------------------
   ABOUT SECTION
------------------------------------------------------------- */
.about-container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-image {
    flex: 1;
}

.image-wrapper-square {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.image-wrapper-square::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    transform: translate(15px, 15px);
    z-index: -1;
}

.about-content {
    flex: 1.2;
}

.about-content h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.about-content p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.why-me-section {
    background-color: var(--card-bg);
    padding: 20px;
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    margin: 25px 0;
}

.why-me-section h4 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.why-me-list {
    list-style: none;
    padding-left: 0;
}

.why-me-list li {
    margin-bottom: 12px;
    color: var(--text-muted);
}

.why-me-list li strong {
    color: var(--text-color);
}

.about-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-title {
    font-weight: 600;
    color: var(--primary-color);
}

/* -------------------------------------------------------------
   SKILLS SECTION
------------------------------------------------------------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-category {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.skill-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.skill-category h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.skill-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.skill-list li::before {
    content: '→';
    color: var(--secondary-color);
    margin-right: 10px;
}

/* -------------------------------------------------------------
   PROJECTS SECTION
------------------------------------------------------------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.project-img {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(var(--bg-color), 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-link {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transform: translateY(20px);
    transition: var(--transition);
}

.project-card:hover .project-link {
    transform: translateY(0);
}

.project-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-tags span {
    background-color: var(--hover-bg);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* -------------------------------------------------------------
   EXPERIENCE SECTION (TIMELINE)
------------------------------------------------------------- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    top: 0;
    left: 11px;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border: 4px solid var(--bg-alt-color);
    border-radius: 50%;
    z-index: 10;
}

.timeline-content {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.timeline-date {
    display: inline-block;
    padding: 5px 15px;
    background-color: var(--hover-bg);
    color: var(--secondary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.timeline-title {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.timeline-company {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 500;
}

.timeline-content ul {
    list-style-type: disc;
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.timeline-content li {
    margin-bottom: 8px;
}

/* -------------------------------------------------------------
   SERVICES SECTION
------------------------------------------------------------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--card-bg);
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.service-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background-color: rgba(88, 166, 255, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background-color: var(--primary-color);
    color: #fff;
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* -------------------------------------------------------------
   CONTACT SECTION
------------------------------------------------------------- */
.contact-container {
    display: flex;
    gap: 50px;
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.contact-info {
    flex: 1;
    padding: 50px;
    background-color: var(--hover-bg);
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    color: var(--text-color);
    border-radius: 50%;
    font-size: 1.2rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.contact-form-wrapper {
    flex: 1;
    padding: 50px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

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

/* -------------------------------------------------------------
   FOOTER
------------------------------------------------------------- */
.footer {
    background-color: var(--bg-alt-color);
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.footer a {
    color: var(--primary-color);
}

.scroll-top {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: #fff !important;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.scroll-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* -------------------------------------------------------------
   RESPONSIVE DESIGN
------------------------------------------------------------- */
@media (max-width: 1024px) {
    .hero-name { font-size: 3rem; }
    .hero-container, .about-container, .contact-container { gap: 30px; }
}

@media (max-width: 768px) {
    .section { padding: 60px 0; }
    .section-title { margin-bottom: 40px; }
    .section-title h2 { font-size: 2.2rem; }

    .menu-toggle { display: block; }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--card-bg);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-bottom: 1px solid var(--border-color);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease;
    }

    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .hero-container, .about-container, .contact-container {
        flex-direction: column;
    }
    
    .hero-content {
        text-align: center;
        order: 2;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        order: 1;
        justify-content: center;
        margin-bottom: 30px;
    }
    
    .image-wrapper {
        width: 300px;
        height: 300px;
    }

    .about-details { grid-template-columns: 1fr; }
    .contact-info, .contact-form-wrapper { padding: 30px 20px; }
    .service-card { padding: 30px 20px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.2rem; }
    .hero-intro { font-size: 1rem; }
    .hero-name { font-size: 2.2rem; line-height: 1.2; }
    .section-title h2 { font-size: 1.8rem; }
    .image-wrapper { width: 250px; height: 250px; }
    .hero-buttons { flex-direction: column; gap: 15px; }
    .btn { padding: 10px 20px; width: 100%; display: block; }
    .timeline::before { left: 15px; }
    .timeline-dot { left: 6px; }
    .timeline-item { padding-left: 45px; }
    .project-img { height: 180px; }
    .projects-grid { grid-template-columns: 1fr; }
    .contact-info, .contact-form-wrapper { padding: 20px 15px; }
    .skill-category { padding: 20px; }
}
