@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

/* CSS VARIABLES & THEMES */
:root {
    /* Color Palette */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-rgb: 59, 130, 246;
    --primary-grad: linear-gradient(135deg, #3b82f6, #6366f1);
    --secondary-grad: linear-gradient(135deg, #10b981, #059669);
    
    /* Light Theme (Default) */
    --bg-app: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-nav: rgba(248, 250, 252, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
    --glow-color: rgba(59, 130, 246, 0.15);
    --glass-blur: 12px;
}

body.dark {
    /* Dark Theme */
    --bg-app: #090d16;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-nav: rgba(9, 13, 22, 0.85);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-main: 0 15px 35px -12px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 25px 45px -15px rgba(59, 130, 246, 0.15);
    --glow-color: rgba(99, 102, 241, 0.25);
    --glass-blur: 16px;
}

/* BASE RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', 'Kantumruy Pro', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
    overflow-x: hidden;
    line-height: 1.6;
}

/* LAYOUT CONTAINER */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* DYNAMIC SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* GLASSMORPHIC UTILITY */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main);
    border-radius: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.glass-panel:hover {
    box-shadow: var(--shadow-hover);
}

/* HEADER & NAVIGATION */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-nav);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.3s ease;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-grad);
    transition: width 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* BUTTONS */
.btn-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background-color: var(--bg-card);
}
.btn-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-lang {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-lang:hover {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white;
}

.btn-lang.active {
    background: var(--primary-grad);
    color: white;
    border-color: transparent;
}

/* MOBILE NAV MENU TOGGLE */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
}
.menu-toggle span {
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

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

.hero-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-greet {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hero-name {
    font-size: 4rem;
    font-weight: 850;
    line-height: 1.1;
    letter-spacing: -2px;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title-container {
    height: 45px;
    overflow: hidden;
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    border-right: 3px solid var(--primary);
    white-space: nowrap;
    width: max-content;
    animation: blink 0.75s step-end infinite;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--primary-grad);
    color: white;
    padding: 0.9rem 1.8rem;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 15px var(--glow-color);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--glow-color);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.9rem 1.8rem;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    background-color: rgba(var(--primary-rgb), 0.05);
}

/* HERO IMAGE */
.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-container {
    width: 340px;
    height: 340px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: var(--primary-grad);
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px var(--glow-color);
    animation: morphing 8s ease-in-out infinite;
    border: 6px solid var(--bg-card);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.hero-image-container:hover .hero-image {
    transform: scale(1.1);
}

/* SECTION COMMON STYLES */
.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-grad);
    margin: 0.75rem auto 0;
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

/* ABOUT SECTION */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.about-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-card {
    padding: 2.5rem;
}

.about-card p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-box {
    padding: 1.5rem;
    text-align: center;
    border-radius: 16px;
    background-color: rgba(var(--primary-rgb), 0.03);
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* TIMELINE (EDUCATION & EXPERIENCE) */
.timeline-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: 750;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.timeline {
    border-left: 2px solid var(--border-color);
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
}

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -29.5px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-app);
    border: 3px solid var(--primary);
    z-index: 5;
    transition: background-color 0.3s ease;
}
.timeline-item:hover .timeline-dot {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.timeline-content {
    padding: 1.5rem;
    border-radius: 16px;
}

.timeline-year {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.timeline-item-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-institution {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

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

/* SKILLS SECTION */
.skills-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.skills-wrapper {
    padding: 2.5rem;
}

.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    margin-top: 1.5rem;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.skill-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

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

.skill-percent {
    color: var(--primary);
}

.skill-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    border-radius: 10px;
    background: var(--primary-grad);
    width: 0;
    transition: width 1.5s cubic-bezier(0.1, 0.8, 0.3, 1);
}

/* SOFT SKILLS BADGES */
.soft-skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.soft-skill-tag {
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}
.soft-skill-tag i {
    color: var(--primary);
}
.soft-skill-tag:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

/* PORTFOLIO SECTION */
.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--primary-grad);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--glow-color);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.portfolio-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.portfolio-card.hidden {
    display: none;
}

.portfolio-img-container {
    height: 200px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.portfolio-card:hover .portfolio-img {
    transform: scale(1.08);
}

.portfolio-details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
}

.portfolio-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.portfolio-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.portfolio-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-grow: 1;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.portfolio-tag {
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

/* CONTACT SECTION */
.contact-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 3rem;
}

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

.contact-info-card {
    padding: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.contact-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-info-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-info-value {
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-all;
}

/* CONTACT FORM */
.contact-form-panel {
    padding: 2.5rem;
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-input, .form-textarea {
    width: 100%;
    background: rgba(var(--primary-rgb), 0.02);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 10px var(--glow-color);
}

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

.form-alert {
    grid-column: span 2;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    display: none;
}
.form-alert.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
    color: #10b981;
    display: block;
}
.form-alert.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
    display: block;
}

.contact-submit-btn {
    grid-column: span 2;
    background: var(--primary-grad);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 15px var(--glow-color);
    transition: all 0.3s ease;
    font-size: 1rem;
}
.contact-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--glow-color);
}
.contact-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* FOOTER */
footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    background-color: var(--bg-nav);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
}

.social-link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    background-color: var(--bg-card);
    font-size: 1.1rem;
}
.social-link:hover {
    color: white;
    background: var(--primary-grad);
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--glow-color);
}

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

/* FLOATING CONTROLS */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 999;
}

.btn-top {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary-grad);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--glow-color);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}
.btn-top.visible {
    opacity: 1;
    transform: translateY(0);
}
.btn-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--glow-color);
}

/* ANIMATIONS KEYFRAMES */
@keyframes blink {
    from, to { border-color: transparent }
    50% { border-color: var(--primary); }
}

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

/* RESPONSIVE DESIGN (MEDIA QUERIES) */
@media (max-width: 992px) {
    .hero-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .hero-text {
        align-items: center;
    }
    
    .hero-title {
        margin: 0 auto;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .skills-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--bg-nav);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        gap: 2.5rem;
        transition: left 0.4s ease;
        border-top: 1px solid var(--border-color);
    }
    
    .nav-menu.open {
        left: 0;
    }
    
    .nav-link {
        font-size: 1.2rem;
    }
    
    .hero-name {
        font-size: 3rem;
    }
    
    .hero-title {
        font-size: 1.4rem;
    }
    
    .hero-image-container {
        width: 280px;
        height: 280px;
    }
    
    .contact-form {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
}
