* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

/* ซ่อน Scrollbar สำหรับ Chrome, Safari, Edge */
::-webkit-scrollbar {
    display: none;
}

/* ซ่อน Scrollbar สำหรับ Firefox */
html {
    scroll-behavior: smooth;
    /* <--- เพิ่มบรรทัดนี้ครับ */
    scrollbar-width: none;
}

/* 1. แก้ไข body เดิม ให้เอา background-image ออก */
body {
    /* ลบ background-image เดิมออกเลย */
    background-color: #121212;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
    /* ป้องกันไม่ให้มีแถบเลื่อนแนวนอน */
}

/* 2. เพิ่ม CSS สำหรับวิดีโอ */
#myVideo {
    position: absolute;
    /* <--- เปลี่ยนจาก fixed เป็น absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    /* อยู่ชั้นล่างสุดของ Hero */
}

/* 3. เพิ่ม CSS สำหรับเงาดำทับวิดีโอ (Overlay) */
.video-overlay {
    position: absolute;
    /* <--- เปลี่ยนจาก fixed เป็น absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: rgba(0, 0, 0, 0.6); */
    z-index: 1;
    /* ทับวิดีโอ */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* --- แก้ตรงนี้ครับ --- */
    /* 1. ใช้ padding ปกติ */
    padding: 20px 5%;
    /* 2. สั่งบวกเพิ่มเฉพาะขอบบน "ถ้ามีติ่งหน้าจอ" (Safe Area) */
    /* ใน Chrome คอมฯ ค่า env จะเป็น 0 --> ผลลัพธ์คือ 20px เท่าเดิมเป๊ะ! */
    /* ใน iPhone มีติ่ง --> มันจะบวกเพิ่มให้เอง อัตโนมัติ */
    padding-top: calc(20px + env(safe-area-inset-top));
    /* 3. ลบคำสั่ง height ที่ผมเคยให้ใส่ออกไปเลยครับ (ให้มันยืดหดเองตามธรรมชาติ) */
    /* ------------------ */
    /* background-color: rgba(18, 18, 18, 0.8); */
    -webkit-backdrop-filter: blur(10px);
    /* สั่งเบลอให้ Safari */
    backdrop-filter: blur(10px);
    /* สั่งเบลอให้ Chrome/Edge */

    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}


.logo-container img {
    height: 50px;
    border-radius: 5px;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    display: inline-block;
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #ccc;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    font-weight: 600;
}

.hero {
    height: 110vh;
    /* สำหรับ Browser เก่า */
    height: 110dvh;
    /* (Dynamic Viewport Height) สำหรับมือถือใหม่ๆ แก้ปัญหาแถบบัง */
    min-height: 600px;
    /* กันไม่ให้หดจนเละเวลานอนตะแคง */
    /* height: 110vh; */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;

    position: relative;
    /* <--- สำคัญ! เป็นจุดอ้างอิงให้วิดีโอ */
    overflow: hidden;
    /* ตัดวิดีโอส่วนที่เกินกรอบทิ้ง */
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 20px;
    letter-spacing: -1px;
    font-weight: 700;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.hero span {
    color: #ddd;
    font-weight: 300;
}

.hero p {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 40px;
    max-width: 600px;
    font-weight: 300;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

.hero h1,
.hero p,
.hero .btn,
.hero span {
    position: relative;
    z-index: 2;
    /* อยู่ชั้นบนสุด */
}

.btn {
    padding: 12px 30px;
    border: 1px solid #fff;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border-radius: 4px;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.btn:hover {
    background: #fff;
    color: #121212;
}

.featured {
    position: relative;
    /* สำคัญมาก ต้องมีบรรทัดนี้ */
    background-color: #121212;
    z-index: 10;
    padding: 125px 10%;

    /* ถ้ามี border-top หรือเส้นขอบเดิม ให้ลบออกนะครับ */
}

/* 2. เพิ่มโค้ดชุดนี้ต่อท้ายลงไป เพื่อทำเงาไล่ระดับด้านบน */
.featured::before {
    content: '';
    position: absolute;
    top: -100px;
    /* ดึงเงาขึ้นไปข้างบน 100px */
    left: 0;
    width: 100%;
    height: 100px;
    /* ความสูงของรอยต่อเฟด */

    /* ไล่สีจาก "ใส" (บน) ลงมาเป็น "ดำ" (ล่าง) */
    background: linear-gradient(to bottom, transparent, #121212);

    z-index: 10;
    pointer-events: none;
    /* เพื่อให้คลิกทะลุเงาได้ */
}

.featured h2 {
    margin-bottom: 40px;
    font-size: 2rem;
    border-left: 4px solid #fff;
    padding-left: 15px;
    font-weight: 700;
}

.grid {
    display: grid;

    /* เปลี่ยนจาก 300px เป็น 500px (หรือมากกว่า) เพื่อให้รูปใหญ่สะใจสมสัดส่วน */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));

    gap: 30px;
}

.card {
    /* ลบ height: 250px; ของเดิมทิ้งไปเลยครับ */

    width: 100%;
    /* ให้กว้างเต็มช่อง Grid */

    /* ใส่ขนาดรูปลงไปเลย เดี๋ยวคอมมันหารสัดส่วนให้เอง */
    aspect-ratio: 1192 / 609;

    /* ... (ค่าอื่นๆ เหมือนเดิม) ... */
    background-color: rgba(30, 30, 30, 0.8);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
    cursor: pointer;
    border: 1px solid #333;
    background-size: cover;
    background-position: center;
}

.card h3 {
    font-weight: 500;
    letter-spacing: -0.5px;
}

.card:hover {
    transform: translateY(-5px);
    border-color: #555;
    background-color: rgba(40, 40, 40, 1);
}

#alert-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.alert-box {
    background: #222;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.alert-box h3 {
    margin-bottom: 15px;
    color: #fff;
    font-weight: 600;
}

.alert-box button {
    margin-top: 20px;
    padding: 10px 24px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.alert-box button:hover {
    background: #ddd;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .nav-links {
        display: none;
    }
}

.about {
    padding: 350px 10%;
    background-color: #161616;
    /* สีพื้นหลังให้อ่อนกว่าส่วน Featured นิดนึง */
    color: #fff;
    position: relative;
    z-index: 10;
}

.about::before {
    content: '';
    position: absolute;
    top: 0px;
    /* ดึงเงาขึ้นไปข้างบน 100px */
    left: 0;
    width: 100%;
    height: 100px;
    /* ความสูงของรอยต่อเฟด */

    /* ไล่สีจาก "ใส" (บน) ลงมาเป็น "ดำ" (ล่าง) */
    background: linear-gradient(to top, transparent, #121212);

    z-index: 10;
    pointer-events: none;
    /* เพื่อให้คลิกทะลุเงาได้ */
}

.about-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;
    /* ระยะห่างระหว่างรูปกับตัวหนังสือ */
}

/* รูปโปรไฟล์ */
.about-img img {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 50%;
    /* ทำรูปเป็นวงกลม */
    border: 3px solid #333;
    /* ขอบรูป */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    /* เงารูป */
    transition: transform 0.3s ease;
}

.about-img img:hover {
    transform: scale(1.05);
    /* เมาส์ชี้แล้วขยาย */
    border-color: #fff;
}

/* เนื้อหา */
.about-text h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);

}

.about-text h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 20px;
    font-weight: 500;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);

}

.about-text p {
    color: #ccc;
    margin-bottom: 30px;
    max-width: 500px;
    line-height: 1.8;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);

}

/* รายการสกิล (Tags) */
.skills-list {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.skills-list span {
    padding: 8px 20px;
    background: #222;
    border: 1px solid #444;
    border-radius: 50px;
    /* ทรงแคปซูล */
    font-size: 0.9rem;
    color: #fff;
    transition: all 0.3s ease;
}

.skills-list span:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.skills-list2 {
    display: flex;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.skills-list2 span {
    padding: 8px 20px;
    background: #222;
    border: 1px solid #444;
    border-radius: 50px;
    /* ทรงแคปซูล */
    font-size: 0.9rem;
    color: #fff;
    transition: all 0.3s ease;
}

.skills-list2 span:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* ปุ่มรอง (Secondary Button) */
.btn-secondary {

    padding: 12px 30px;
    background: #fff;
    color: #000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: 0.3s;
}

.btn-secondary:hover {
    background: #ccc;
}

/* Responsive: มือถือให้เรียงแนวตั้ง */
@media (max-width: 900px) {
    .about-container {
        flex-direction: column;
        /* เรียงลงมาแนวตั้ง */
        text-align: center;
    }

    .skills-list {
        justify-content: center;
    }

    .about-img img {
        width: 200px;
        height: 200px;
    }
}

#myVideo_about {
    position: absolute;
    /* <--- เปลี่ยนจาก fixed เป็น absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -99;
    /* อยู่ชั้นล่างสุดของ Hero */
}

.video-overlay-about {
    position: absolute;
    /* <--- เปลี่ยนจาก fixed เป็น absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: -98;
    /* ทับวิดีโอ */
}