/* Reset & Base Styles */
:root {
    --bg-color: #050505;
    --card-bg: rgba(23, 23, 23, 0.6);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --gradient-glow: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    --font-main: 'Outfit', sans-serif;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Particle Canvas Background */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* สำคัญมาก: สั่งให้อยู่หลังสุด */
    pointer-events: none;
    /* เพื่อให้คลิกปุ่มต่างๆ บนเว็บได้ปกติ */
    background: transparent;
    /* ให้มองทะลุเห็นสีพื้นหลังเดิม */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.08) 0%, transparent 25%);
    background-attachment: fixed;
}

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

ul {
    list-style: none;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 4rem;
    text-align: center;
    position: relative;
    display: inline-block;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 4px;
    background: var(--gradient-1);
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.section-title.active-line::after {
    width: 120px;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glassmorphism Utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 50%, #6366f1 100%);
    z-index: -1;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.btn-primary:hover::before {
    opacity: 1;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 1000;
    transition: var(--transition);
}

.header.scrolled {
    padding: 1rem 0;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.dot {
    color: var(--accent-color);
}

.nav-list {
    display: flex;
    gap: 2.5rem;
}

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

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

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

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

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 2px;
    margin: 6px auto;
    background-color: var(--text-primary);
    transition: var(--transition);
}

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

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 10s infinite ease-in-out;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: #6366f1;
    top: -150px;
    right: -150px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #ec4899;
    bottom: -100px;
    left: -100px;
    animation-delay: 5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 50px);
    }
}

/* Portfolio Section */
.portfolio {
    padding: 8rem 0;
}

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

.project-card {
    /* แก้ไขบรรทัด background: ปรับให้สีเข้มขึ้นและทึบขึ้น (จากเดิมอาจจะเป็น 0.6 ให้เพิ่มเป็น 0.85 หรือ 0.9) */
    background: rgba(23, 23, 23, 0.5);

    /* เพิ่มคำสั่งนี้เพื่อให้เส้นข้างหลังเบลอ (เหมือนกระจกฝ้า) */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    /* สำหรับ Safari */

    /* เพิ่ม z-index เพื่อยืนยันว่ากล่องต้องอยู่เหนือเส้นแน่นอน */
    position: relative;
    z-index: 1;

    /* ... ค่าอื่นๆ ของเดิมคงไว้เหมือนเดิม ... */
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    border: var(--card-border);
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* =========================================
   จัดการรูปภาพสไตล์ Modern Minimal + Glowing Line
   ========================================= */

/* 1. กล่องครอบรูปภาพ */
.project-image {
    height: 240px;
    position: relative;
    overflow: hidden;
    /* ทำมุมโค้งเฉพาะด้านบน ให้พอดีกับกรอบการ์ด */
    border-radius: 20px 20px 0 0; 
}

/* 2. รูปภาพจริง (ชัดเจน 100%) */
.project-img-real {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); /* ตั้งค่าให้ซูมแบบสมูทๆ */
}

/* 3. สร้างเส้นคั่นเรืองแสง (Glowing Line) คั่นระหว่างรูปกับข้อความ */
.project-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px; /* ความหนาของเส้น */
    
    /* ดึงสีจาก HTML มาไล่สี */
    background: linear-gradient(to right, var(--color1), var(--color2));
    
    /* ทำให้เส้นมีแสงเรืองรอง (Glow) ดันขึ้นไปบนรูปนิดๆ */
    box-shadow: 0 -4px 15px var(--color1);
    opacity: 0.8;
    transition: height 0.3s ease, opacity 0.3s ease;
    z-index: 2;
}

/* 4. ลูกเล่นเวลาเอาเมาส์ชี้ (Hover Effect) */
.project-card:hover .project-img-real {
    /* ซูมรูปภาพเข้าไป 8% */
    transform: scale(1.08); 
}

.project-card:hover .project-image::after {
    /* ตอนเอาเมาส์ชี้ ให้เส้นสว่างขึ้นและหนาขึ้นนิดนึง */
    height: 4px; 
    opacity: 1;
}
/* ========================================= */

.placeholder-img {
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
}

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

.project-info {
    padding: 2rem;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.project-tags span {
    font-size: 0.8rem;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.project-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.project-link i {
    transition: transform 0.3s ease;
    color: var(--accent-color);
}

.project-link:hover i {
    transform: translateX(5px);
}

/* Skills Section */
.skills {
    padding: 6rem 0;
    position: relative;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    padding: 2.5rem;
    border-radius: 20px;
    transition: var(--transition);
}

.skill-category:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--accent-color);
}

.skill-list li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-list li::before {
    content: '▹';
    color: var(--accent-color);
}

/* About Section */
.about {
    padding: 8rem 0;
    background: linear-gradient(to bottom, #050505, #0a0a0a);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

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

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

.stat-item {
    background: var(--glass-bg);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    border: var(--glass-border);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.stat-number {
    display: block;
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

/* Contact Section */
.contact {
    padding: 8rem 0;
    text-align: center;
    position: relative;
}

.contact-wrapper {
    max-width: 700px;
    margin: 0 auto;
    background: var(--glass-bg);
    padding: 4rem 2rem;
    border-radius: 30px;
    border: var(--glass-border);
    backdrop-filter: blur(10px);
}

.contact-text {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1.2rem;
}

.social-links {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 2.5rem;
}

.social-links a {
    font-size: 1.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    color: white;
    background: var(--accent-color);
    transform: translateY(-5px) rotate(10deg);
}

/* Footer */
.footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: #050505;
}

/* 1. แก้ไขปัญหา Header ทับเนื้อหา และจัด Hero Section */
.project-hero {
    /* เพิ่ม padding-top เพื่อดันเนื้อหาลงมาไม่ให้โดน Navbar ทับ */
    padding-top: 160px;
    padding-bottom: 6rem;
    position: relative;
    overflow: hidden;
    min-height: 80vh;
    /* ให้ความสูงเต็มตา */
    display: flex;
    align-items: center;
}

.project-hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

/* 2. ตกแต่ง Title ให้ดูอลังการ */
.project-hero-title {
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #ffffff, #a3a3a3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.project-hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 300;
    max-width: 600px;
}

/* 3. ตกแต่งส่วนข้อมูล Meta (Role, Date, Stack) ให้เป็นกรอบสวยๆ */
.project-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    font-weight: 600;
}

.meta-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ปุ่ม Actions */
.project-actions {
    display: flex;
    gap: 1.5rem;
}

.btn-secondary {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Background Blobs สำหรับหน้านี้ */
.project-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}


.project-details {
    padding: 6rem 0;
    background: linear-gradient(to bottom, #050505, #0a0a0a);
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 0.8fr;
    /* แบ่งซ้ายขวา เนื้อหา 1 ส่วน รูปภาพ 0.8 ส่วน */
    gap: 5rem;
    align-items: start;
}

.project-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: inline-block;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 3rem;
}

.feature-list li {
    position: relative;
    padding-left: 40px; /* เว้นพื้นที่ด้านซ้าย 40px ไว้ให้เครื่องหมายถูก (ขนาด 24px + ช่องว่าง 16px) */
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    display: block; /* ยกเลิก Flexbox เพื่อให้ข้อความที่มี <strong> และ <em> ไหลตามธรรมชาติ */
}

.feature-list li::before {
    content: '✓';
    position: absolute; /* ลอยเครื่องหมายถูกตรึงไว้ที่มุมซ้ายสุดเสมอ */
    left: 0;
    top: 4px; /* ปรับขยับขึ้นลงให้ตรงกับกึ่งกลางของข้อความบรรทัดแรก */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-color);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
}

/* =========================================
   Gallery สไตล์ 3D Floating Perspective (ล้ำๆ)
   ========================================= */

.project-gallery {
    display: flex;
    flex-direction: column;
    gap: 4rem; /* เพิ่มระยะห่างให้รูปดูเด่น */
    position: sticky;
    top: 120px;
    /* สร้างมิติความลึกให้กับพื้นที่ Gallery */
    perspective: 1500px; 
}

.gallery-item {
    position: relative;
    width: 100%;
    height: 320px;
    background: transparent;
    border-radius: 15px;
    /* เอียงรูปในมิติที่ 3 */
    transform: rotateY(-15deg) rotateX(5deg) scale(0.95);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
}

/* แสงเรืองแสงด้านหลัง (Backlight Glow) */
.gallery-item::before {
    content: '';
    position: absolute;
    inset: 10px;
    /* ใช้สีจากตัวแปรสร้างแสงฟุ้ง */
    background: var(--gallery-color1);
    filter: blur(40px);
    opacity: 0.3;
    transition: all 0.6s ease;
    z-index: -1;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    border-radius: 15px;
    /* ใส่ขอบบางๆ แบบโปร่งแสงเพื่อให้ดูเหมือนกระจก */
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
    box-shadow: 20px 20px 50px rgba(0, 0, 0, 0.5);
}

/* -----------------------------------------
   ลูกเล่นเวลา Hover (ดึงรูปกลับมาตรงๆ และเพิ่มแสง)
   ----------------------------------------- */
.gallery-item:hover {
    /* ดึงรูปกลับมาตรงหน้าผู้ใช้ และขยายขึ้นนิดนึง */
    transform: rotateY(0deg) rotateX(0deg) scale(1.05) translateY(-10px);
}

.gallery-item:hover::before {
    /* เมื่อ Hover ให้แสงหลังรูปสว่างขึ้น */
    opacity: 0.6;
    filter: blur(50px);
    transform: scale(1.1);
}

/* เพิ่มความเงาบนผิวรูป (Reflection Effect) */
.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    border-radius: 15px;
    pointer-events: none;
    opacity: 0.5;
}


.next-project {
    padding: 6rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.next-project-wrapper p {
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.next-project-title {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #fff, #a3a3a3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =========================================
   Video Modal Popup
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* พื้นหลังสีดำโปร่งแสง */
    backdrop-filter: blur(8px); /* เบลอฉากหลังนิดๆ */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none; /* ปิดการคลิกตอนซ่อนอยู่ */
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto; /* เปิดให้คลิกได้ตอนโชว์ */
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px; /* ขนาดกว้างสุดของวิดีโอ */
    background: #000;
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    padding: 10px;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-modal:hover { 
    color: var(--accent-color); 
}

/* ทำให้วิดีโอคงสัดส่วน 16:9 เสมอ */
.video-container {
    position: relative;
    padding-bottom: 56.25%; 
    height: 0;
    overflow: hidden;
    border-radius: 10px;
}

.video-container iframe, 
.video-container video {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}


/* Responsive Design */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 4rem;
    }

    .about-content {
        gap: 3rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
        /* จอเล็กให้เรียงลงมา */
        gap: 3rem;
    }

    .project-gallery {
        position: static;
        /* ยกเลิก sticky บนมือถือ */
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 1rem;
    }

    .gallery-item {
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    .nav-list {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition);
        z-index: 999;
    }

    .nav-list.active {
        right: 0;
    }

    .hamburger {
        display: block;
        z-index: 1001;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-text {
        text-align: center;
    }

    .hero {
        text-align: center;
        justify-content: center;
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .project-hero {
        padding-top: 140px;
        /* ปรับ padding มือถือ */
        text-align: center;
    }

    .project-meta {
        text-align: left;
        justify-content: center;
    }

    .project-actions {
        justify-content: center;
    }

    .project-hero-subtitle {
        margin: 0 auto 3rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
        /* เหลือคอลัมน์เดียว เต็มความกว้าง */
        gap: 4rem;
        /* เพิ่มระยะห่างระหว่าง Text กับ Gallery */
    }

    /* จัดการส่วน Text ให้เต็มความกว้าง */
    .project-content {
        width: 100%;
        padding-right: 0;
        /* เอา padding ที่อาจจะมีออก */
    }

    /* จัดการส่วน Gallery (รูปภาพ) */
    .project-gallery {
        position: static;
        /* ยกเลิกการลอยตัว (sticky) ถ้ามี */
        width: 100%;
        /* บน Tablet ให้แสดงรูปเรียงกัน 2 รูปต่อแถว จะดูสวยงามพอดี */
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        /* ถ้ามีโค้ด flex หรือ overflow เดิม ให้ reset ทิ้ง */
        flex-direction: unset;
        overflow-x: unset;
    }

    /* ปรับขนาดกล่องรูปภาพ */
    .gallery-item {
        height: 300px;
        /* ความสูงที่เหมาะสมบน Tablet */
        min-width: auto;
        /* ยกเลิกการบังคับความกว้างขั้นต่ำ */
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2rem;
    }

    .skill-list li::before {
        content: '▹';
        color: var(--accent-color);
    }

    /* Contact Section */
    .contact {
        padding: 8rem 0;
        text-align: center;
        position: relative;
    }

    .contact-wrapper {
        max-width: 700px;
        margin: 0 auto;
        background: var(--glass-bg);
        padding: 4rem 2rem;
        border-radius: 30px;
        border: var(--glass-border);
        backdrop-filter: blur(10px);
    }

    .contact-text {
        color: var(--text-secondary);
        margin-bottom: 2.5rem;
        font-size: 1.2rem;
    }

    .social-links {
        margin-top: 3rem;
        display: flex;
        justify-content: center;
        gap: 2.5rem;
    }

    .social-links a {
        font-size: 1.8rem;
        color: var(--text-secondary);
        background: rgba(255, 255, 255, 0.05);
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: var(--transition);
    }

    .social-links a:hover {
        color: white;
        background: var(--accent-color);
        transform: translateY(-5px) rotate(10deg);
    }

    /* Footer */
    .footer {
        padding: 3rem 0;
        text-align: center;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        color: var(--text-secondary);
        font-size: 0.9rem;
        background: #050505;
    }


    /* 1. ปรับส่วน Hero (หัวข้อโปรเจกต์) */
    .project-hero {
        padding-top: 120px;
        /* ลดระยะห่างด้านบนลงเล็กน้อย */
        padding-bottom: 3rem;
        min-height: auto;
        /* ไม่บังคับความสูงเต็มจอ เพื่อไม่ให้กินพื้นที่เกินไป */
        text-align: center;
    }

    .project-hero-content {
        width: 100%;
    }

    .project-hero-title {
        font-size: 2.5rem;
        /* ลดขนาดฟอนต์ให้พอดีจอ */
        margin-bottom: 1rem;
    }

    .project-hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
        /* กันข้อความชิดขอบจอเกินไป */
    }

    /* 2. ปรับกล่องข้อมูล (Meta Data) */
    .project-meta {
        grid-template-columns: 1fr;
        /* บังคับเรียงลงมาทีละแถว */
        gap: 1.5rem;
        padding: 1.5rem;
        text-align: center;
        /* จัดกึ่งกลาง */
    }

    .meta-item {
        align-items: center;
        /* จัดให้อยู่ตรงกลาง */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        /* เพิ่มเส้นคั่นบางๆ */
        padding-bottom: 1rem;
    }

    .meta-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* 3. ปรับปุ่มกด (Actions) */
    .project-actions {
        flex-direction: column;
        /* เรียงปุ่มลงมาแนวตั้ง */
        gap: 1rem;
        width: 100%;
    }

    .btn {
        width: 100%;
        /* ขยายปุ่มให้เต็มความกว้าง กดง่ายบนมือถือ */
        text-align: center;
        padding: 0.8rem 1.5rem;
        /* ปรับความหนาปุ่มให้พอดี */
    }

    /* 4. ปรับเนื้อหา (Details & Gallery) */
    .project-details {
        padding: 3rem 0;
    }

    .project-grid {
        gap: 3rem;
    }

    .project-content h2 {
        font-size: 1.75rem;
    }

    .feature-list li {
        font-size: 1rem;
        align-items: flex-start;
        /* ถ้าข้อความยาว ให้ไอคอนอยู่บรรทัดแรก */
    }

    /* 5. ปรับรูปภาพ Gallery */
    .project-gallery {
        grid-template-columns: 1fr;
        /* 1 คอลัมน์เต็มๆ */
        gap: 1rem;
    }

    /* ปรับความสูงรูปบนมือถือให้เล็กลงหน่อย */
    .gallery-item {
        height: 240px;
    }

    /* 6. ปรับส่วน Next Project */
    .next-project {
        padding: 4rem 0;
    }

    .next-project-title {
        font-size: 2rem;
        line-height: 1.2;
    }
}