/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --background: #ffffff;
    --surface: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Header and Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
    width: 100%;
    box-sizing: border-box;
}

.nav-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #ffffff 0%, var(--surface) 100%);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-photo {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    border: 4px solid white;
}

/* Sections */
section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* About Section */
.about {
    background-color: var(--surface);
    padding: 5rem 0 6rem;
}

.about .section-title {
    margin-bottom: 2.5rem;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.about-content p {
    margin-bottom: 1.5rem;
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* Experience Section */
.experience {
    background-color: #ffffff;
}

.experience-timeline {
    max-width: 800px;
    margin: 0 auto;
}

.experience-item {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.experience-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.experience-header {
    margin-bottom: 1rem;
}

.experience-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.experience-company {
    font-weight: 500;
    color: var(--primary-color);
    margin-right: 1rem;
}

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

.experience-description p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.experience-description ul {
    margin-left: 1rem;
    color: var(--text-secondary);
}

.experience-description li {
    margin-bottom: 0.5rem;
}

.experience-summary {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.experience-details {
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-in-out;
}

.expand-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.expand-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.expand-btn:active {
    transform: scale(1);
}

.expand-btn[aria-expanded="true"] {
    background-color: var(--primary-color);
    color: white;
}

.experience-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Skills Section */
.skills {
    background-color: var(--surface);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-category {
    background: white;
    padding: 1.75rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-left-width 0.3s ease;
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
    position: relative;
}

.skill-category::after {
    content: '+';
    position: absolute;
    top: 1.75rem;
    right: 1.75rem;
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-left-width: 6px;
}

.skill-category:hover::after {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.skill-category h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--surface);
    padding-bottom: 0.75rem;
    padding-right: 3rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.skill-tag {
    background-color: var(--surface);
    color: var(--text-primary);
    padding: 0.5rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.skill-tag:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Education Section */
.education {
    background-color: #ffffff;
}

.education-note-box {
    background: white;
    padding: 1.75rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto 2rem;
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-left-width 0.3s ease;
}

.education-note-box::after {
    content: '+';
    position: absolute;
    top: 1.75rem;
    right: 1.75rem;
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.education-note-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-left-width: 6px;
}

.education-note-box:hover::after {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.education-note-box h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    padding-right: 3rem;
}

.education-note-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

.education-item {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.education-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.education-item h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.education-school {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.education-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.education-description {
    color: var(--text-secondary);
}

/* Contact Section */
.contact {
    background-color: var(--surface);
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

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

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    min-width: 250px;
}

.contact-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--primary-color);
}

.contact-icon {
    font-size: 1.2rem;
}

/* Skills Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.modal.show {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2.5rem;
    border-radius: 1rem;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--primary-color);
    background-color: var(--surface);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
    padding-right: 2rem;
}

.modal-body {
    color: var(--text-secondary);
    line-height: 1.8;
}

.modal-body p {
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.modal-body h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.modal-body h3:first-of-type {
    margin-top: 1rem;
}

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 4rem;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
        transform: translateY(0);
        opacity: 1;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Animation Classes */
.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Active Navigation Link */
.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Loading Animation */
body:not(.loaded) * {
    animation-play-state: paused !important;
}

.loaded {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scroll to Top Button Hover */
.scroll-to-top:hover {
    background: #1d4ed8 !important;
    transform: translateY(-2px);
}

/* Articles Section Styles */
.articles {
    background-color: var(--surface);
}

.articles-content {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.articles-content > p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.article-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.article-header {
    margin-bottom: 1rem;
}

.article-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.article-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-card h3 a:hover {
    color: var(--primary-color);
}

.article-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #1d4ed8;
}

.articles-cta {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }

    .hero-content {
        order: 2;
    }

    .hero-image {
        order: 1;
        margin-bottom: 1rem;
        padding-bottom: 0;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.4;
    }

    .hero-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.65rem 1.25rem;
    }

    .profile-photo {
        width: 200px;
        height: 200px;
        margin-bottom: 0;
    }
    
    .section-title {
        font-size: 2rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .skill-category {
        padding: 1.5rem;
    }

    .skill-category::after {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
        top: 1.5rem;
        right: 1.5rem;
    }

    .skill-category h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        padding-right: 2.75rem;
    }

    .skill-tags {
        gap: 0.5rem;
    }

    .skill-tag {
        font-size: 0.825rem;
        padding: 0.45rem 0.75rem;
    }

    .education-note-box {
        padding: 1.5rem;
    }

    .education-note-box::after {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
        top: 1.5rem;
        right: 1.5rem;
    }

    .education-note-box h3 {
        font-size: 1.1rem;
        padding-right: 2.75rem;
    }

    .education-note-subtitle {
        font-size: 0.85rem;
    }

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

    .about {
        padding: 2.5rem 0 5rem;
    }

    .contact-links {
        align-items: stretch;
    }

    .contact-link {
        min-width: auto;
        font-size: 0.9rem;
        padding: 0.85rem 1.25rem;
    }

    .contact-content p {
        font-size: 1rem;
    }

    .modal-content {
        margin: 10% auto;
        padding: 2rem;
        width: 95%;
        max-height: 85vh;
    }

    .modal-title {
        font-size: 1.5rem;
        padding-right: 2.5rem;
    }

    .modal-body p {
        font-size: 0.95rem;
    }

    .modal-body h3 {
        font-size: 1.1rem;
        margin-top: 1.5rem;
    }

    .modal-close {
        right: 1rem;
        top: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .nav-container {
        padding: 0 0.5rem;
    }
    
    .hero {
        padding: 6rem 0 1.5rem;
    }

    .hero-container {
        gap: 0.5rem;
    }

    .hero-content {
        order: 2;
    }

    .hero-image {
        order: 1;
        margin-bottom: 1rem;
        padding: 0;
    }

    .profile-photo {
        width: 180px;
        height: 180px;
        margin: 0;
    }

    .about {
        padding: 2rem 0 4rem;
    }

    section {
        padding: 4rem 0;
    }

    .experience-item,
    .skill-category,
    .education-item {
        padding: 1.25rem;
    }

    .education-note-box {
        padding: 1.25rem;
    }

    .education-note-box::after {
        width: 26px;
        height: 26px;
        font-size: 1rem;
        top: 1.25rem;
        right: 1.25rem;
    }

    .education-note-box h3 {
        font-size: 1rem;
        padding-right: 2.5rem;
    }

    .education-note-subtitle {
        font-size: 0.8rem;
    }

    .experience-header h3 {
        font-size: 1.2rem;
    }

    .experience-company,
    .experience-date {
        font-size: 0.85rem;
        display: block;
        margin-bottom: 0.25rem;
    }

    .experience-description {
        font-size: 0.9rem;
    }

    .skill-category {
        padding: 1.25rem;
    }

    .skill-category::after {
        width: 26px;
        height: 26px;
        font-size: 1rem;
        top: 1.25rem;
        right: 1.25rem;
    }

    .skill-category h3 {
        font-size: 1rem;
        margin-bottom: 0.875rem;
        padding-right: 2.5rem;
    }

    .skill-tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.7rem;
    }

    .expand-btn {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }

    .experience-summary {
        font-size: 0.95rem;
    }

    .experience-note {
        font-size: 0.85rem;
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.4;
    }

    .hero-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .section-title {
        font-size: 1.6rem;
        padding: 0 0.5rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
        width: 100%;
        max-width: 300px;
    }

    .hero-cta {
        width: 100%;
        flex-direction: column;
        align-items: center;
    }

    .about-content {
        font-size: 1rem;
    }

    .nav-logo h1 {
        font-size: 1.25rem;
    }

    .modal-content {
        margin: 5% auto;
        padding: 1.5rem;
        max-height: 90vh;
    }

    .modal-title {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }

    .modal-body p {
        font-size: 0.9rem;
    }

    .modal-body h3 {
        font-size: 1rem;
    }
}