/* --- การตั้งค่าพื้นฐานและสี --- */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500&display=swap');

:root {
    --light-blue: #E0F7FA;
    --medium-blue: #B2EBF2;
    --dark-blue: #4DD0E1;
    --text-color: #9dc6c1;
    --heading-color: #00414d;
    --background-color: #F8FFFF;
    --white: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
}

/* --- ส่วนหัว (Hero Section) --- */
.hero {
    background-color: var(--heading-color);
    color: var(--white);
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.1) 1px, transparent 0);
    background-size: 25px 25px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    max-width: 1200px;
}

.hero-text {
    text-align: left;
}

.hero-text .intro-text {
    font-size: 1.5rem;
    font-weight: 300;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 500;
    letter-spacing: 2px;
    margin: 0;
    color: var(--white);
    border-bottom: 3px solid var(--dark-blue);
    padding-bottom: 10px;
}

.hero-image-container {
    flex-shrink: 0;
}

.hero-image {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--medium-blue);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* --- Section ทั่วไป --- */
section {
    padding: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

h2 {
    font-size: 2.5rem;
    color: var(--heading-color);
    margin-bottom: 15px;
}

.subtitle {
    color: var(--dark-blue);
    margin-bottom: 40px;
}


/* --- ส่วนแนะนำตัว (Introduction Section) --- */
.intro-container {
    display: flex;
    align-items: center;
    gap: 40px;
    text-align: left;
}

.intro-photo {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.intro-text-content h2 {
    text-align: left;
}

.intro-name {
    font-size: 2rem;
    font-weight: 500;
    color: var(--dark-blue);
}

/* --- ส่วนข้อมูลส่วนตัว (About Me) --- */
.about-me-section {
    background-color: var(--light-blue);
}

.about-me-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
}

.about-me-grid p {
    background-color: var(--white);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.about-me-grid strong {
    color: var(--heading-color);
}

/* --- ส่วนผลงาน (My Work) --- */
.portfolio-container {
    display: flex;
    overflow-x: auto;
    /* <--- ทำให้เลื่อนแนวนอนได้ */
    gap: 25px;
    padding: 20px;
    /* ซ่อน scrollbar แต่ยังเลื่อนได้ */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* ซ่อน scrollbar สำหรับ Chrome, Safari and Opera */
.portfolio-container::-webkit-scrollbar {
    display: none;
}


.project-card {
    flex: 0 0 320px;
    /* กำหนดขนาด card ไม่ให้หด */
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.project-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.project-info {
    padding: 20px;
    text-align: left;
}

.project-info h3 {
    margin: 0;
    color: var(--heading-color);
}

/* --- ส่วนติดต่อ (Contact) --- */
.contact-section {
    background-color: var(--heading-color);
    color: var(--white);
    padding: 50px 20px;
    text-align: center;
}

.contact-section h2 {
    color: var(--white);
}

.contact-links a {
    color: var(--medium-blue);
    text-decoration: none;
    font-size: 1.1rem;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.contact-links a:hover {
    color: var(--white);
}

.contact-links span {
    color: var(--dark-blue);
}


/* --- การแสดงผลบนมือถือ (Responsive) --- */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column-reverse;
        /* สลับรูปกับข้อความบนมือถือ */
        text-align: center;
    }

    .hero-text {
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .intro-container {
        flex-direction: column;
        text-align: center;
    }

    .intro-text-content h2,
    .intro-text-content {
        text-align: center;
    }

    section {
        padding: 40px 20px;
    }

    .project-card {
        flex: 0 0 280px;
        /* ลดขนาด card บนมือถือ */
    }
}