        :root {
            --bg-color: #ffffff;
            --dot-color: rgba(15, 15, 15, 0.06); /* กำหนดค่าสีของลายจุดสำหรับโหมดสว่าง */
            --text-color: #0f0f0f;
            --border-color: #e5e5e5;
            --gray-text: #666666;
            --accent: #111111;
            --accent-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
            --card-bg: rgba(255, 255, 255, 0.6);
            --subtle-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
            --section-padding: clamp(60px, 10vw, 120px);
            --container-padding: clamp(20px, 5vw, 40px);
            --nav-height: 60px;
        }

        html {
            scroll-behavior: smooth;
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
            overflow-x: hidden;
        }

        /* สำหรับเบราว์เซอร์ตระกูล Chrome/Safari: ทำให้แถบ Scrollbar เนียนไปกับพื้นหลัง */
        html::-webkit-scrollbar {
            width: 8px;
        }

        html::-webkit-scrollbar-track {
            background: var(--bg-color);
        }

        html::-webkit-scrollbar-thumb {
            background: var(--border-color);
            border-radius: 10px;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-color);
            background-image: radial-gradient(var(--dot-color) 0.8px, transparent 0.8px); /* กำหนดลายจุดลงบน body โดยตรง ป้องกันเลย์เอาต์สั่นไหวและลดการโหลด GPU บนมือถือ */
            background-size: clamp(20px, 3vw, 24px) clamp(20px, 3vw, 24px);
            background-position: 0px 0px;
            color: var(--text-color);
            margin: 0;
            padding: 0;
            line-height: 1.6;
            overflow-x: hidden;
            width: 100%;
        }

        body.loading {
            overflow: hidden;
        }

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

        /* Scroll Reveal Base - Defined early so component transitions can override it */
        .reveal {
            opacity: 0;
            transform: translateY(30px);
            transition: opacity 0.8s cubic-bezier(0.5, 0, 0, 1), transform 0.8s cubic-bezier(0.5, 0, 0, 1);
            will-change: transform, opacity; /* ช่วยป้องกันรายงาน Layout Shift และทำให้เคลื่อนไหวลื่นขึ้นบนมือถือ */
        }

        .reveal.active {
            opacity: 1;
            transform: translateY(0);
        }

        /* ==========================================
           PRELOADER & SCROLL
           ========================================== */
        #preloader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: var(--bg-color);
            z-index: 9999999;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.8s ease, visibility 0.8s ease;
        }

        #preloader.loaded {
            opacity: 0;
            visibility: hidden;
        }

        .loader-content {
            text-align: center;
            width: clamp(200px, 50vw, 300px);
        }

        #loader-text {
            font-family: 'Space Grotesk', sans-serif;
            font-size: clamp(3rem, 8vw, 5rem);
            font-weight: 700;
            margin-bottom: 10px;
            letter-spacing: -2px;
        }

        .loader-bar-bg {
            width: 100%;
            height: 2px;
            background-color: var(--border-color);
            position: relative;
            overflow: hidden;
        }

        .loader-bar {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            width: 0%;
            background-color: var(--text-color);
            transition: width 0.1s ease-out;
        }

        .progress-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: transparent;
            z-index: 1000;
        }

        .progress-bar {
            height: 100%;
            background: var(--accent);
            width: 0%;
        }

        h1,
        h2,
        h3 {
            font-family: 'Space Grotesk', sans-serif;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 var(--container-padding);
        }

        /* ==========================================
           NAVIGATION
           ========================================== */
        header {
            position: fixed;
            top: clamp(10px, 2vw, 20px);
            left: 0;
            right: 0;
            margin: 0 auto;
            width: calc(100% - var(--container-padding) * 2);
            max-width: 800px;
            z-index: 1000;
            transition: transform 0.3s ease, opacity 0.3s ease; /* ป้องกันไม่ให้ transition บน top ซึ่งจะทำให้สั่นไหวเวลาเลื่อนเบราว์เซอร์ */
            transform: translate3d(0, 0, 0); /* บังคับการวาดด้วย GPU Layer ป้องกันการกระตุกกึกกักบนโมบายล์ */
            will-change: transform;
        }

        nav {
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid var(--border-color);
            border-radius: 50px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 30px;
            height: var(--nav-height);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
            position: relative;
        }

        .logo {
            font-family: 'Space Grotesk', sans-serif;
            font-weight: 700;
            letter-spacing: 1px;
            font-size: 1.2rem;
        }

        .nav-links {
            display: flex;
            gap: 25px;
            align-items: center;
            justify-content: flex-end;
        }

        .nav-links a {
            text-decoration: none;
            color: var(--text-color);
            font-size: 0.85em;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            transition: color 0.3s;
        }

        .nav-links a:hover {
            color: #a0a0a0;
        }

        .menu-toggle {
            display: none;
            flex-direction: column;
            justify-content: space-between;
            width: 24px;
            height: 16px;
            cursor: pointer;
            z-index: 1001;
        }

        .menu-toggle span {
            display: block;
            height: 2px;
            width: 100%;
            background-color: var(--text-color);
            transition: all 0.3s ease;
            border-radius: 2px;
        }

        @media (max-width: 768px) {
            header {
                top: max(15px, env(safe-area-inset-top));
            }

            nav {
                padding: 0 20px;
            }

            .menu-toggle {
                display: flex;
            }

            .nav-links {
                position: absolute;
                top: calc(var(--nav-height) + 10px);
                left: 0;
                width: 100%;
                background: rgba(255, 255, 255, 0.95);
                backdrop-filter: blur(15px);
                -webkit-backdrop-filter: blur(15px);
                border: 1px solid var(--border-color);
                border-radius: 20px;
                flex-direction: column;
                padding: 20px 0;
                gap: 20px;
                align-items: center;
                box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
                opacity: 0;
                visibility: hidden;
                transform: translateY(-10px);
                transition: all 0.3s ease;
            }

            .nav-links.active {
                opacity: 1;
                visibility: visible;
                transform: translateY(0);
            }

            .menu-toggle.active span:nth-child(1) {
                transform: translateY(7px) rotate(45deg);
            }

            .menu-toggle.active span:nth-child(2) {
                opacity: 0;
            }

            .menu-toggle.active span:nth-child(3) {
                transform: translateY(-7px) rotate(-45deg);
            }
        }

        /* ==========================================
           HERO SECTION
           ========================================== */
        .hero {
            position: relative;
            min-height: 100vh;
            min-height: 100lvh; /* ใช้ lvh เพื่อคงขนาดความสูงไว้บนอุปกรณ์เคลื่อนที่แม้บาร์เบราว์เซอร์จะเลื่อนซ่อน/แสดง */
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: calc(var(--nav-height) + 40px);
            padding-bottom: 120px;
            /* 🟢 เพิ่มพื้นที่ว่างด้านล่าง 120px */
            gap: clamp(40px, 8vw, 80px);
        }

        .hero-text {
            flex: 1.2;
        }

        .hero-tag {
            font-family: 'Space Grotesk', sans-serif;
            text-transform: uppercase;
            letter-spacing: 3px;
            color: var(--gray-text);
            font-weight: 600;
            display: block;
            margin-bottom: 15px;
            font-size: clamp(0.75rem, 2vw, 0.85rem);
        }

        .hero h1 {
            font-size: clamp(3rem, 7vw, 5.5rem);
            line-height: 1;
            margin-bottom: 25px;
            letter-spacing: -1px;
        }

        .hero p {
            font-size: clamp(1rem, 2vw, 1.15rem);
            color: var(--gray-text);
            max-width: 600px;
            margin-bottom: 40px;
            line-height: 1.8;
        }

        .hero-actions {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
        }



        .btn-resume {
            border-color: var(--text-color);
            font-weight: 700;
        }

        /* ย้ายจาก inline style */

        .profile-photo {
            flex: 0.8;
            max-width: 320px;
            min-width: 0;
            width: 100%;
            aspect-ratio: 3 / 4;
            object-fit: cover;
            object-position: top;
            border-radius: 24px;
            border: 1px solid var(--border-color);
            transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1),
                box-shadow 0.5s cubic-bezier(0.165, 0.84, 0.44, 1),
                filter 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
            box-shadow: -15px 15px 0px rgba(17, 17, 17, 0.05);
            filter: grayscale(30%);
        }

        @media (hover: hover) {
            .profile-photo:hover {
                transform: translateY(-10px);
                box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
                filter: grayscale(0%);
            }
        }

        /* SCROLL INDICATOR */
        .scroll-indicator {
            position: absolute;
            bottom: clamp(20px, 5vh, 40px);
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            color: var(--gray-text);
            text-decoration: none;
            font-family: 'Space Grotesk', sans-serif;
            font-size: 0.75em;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 2px;
            opacity: 0.7;
            animation: floatDown 2s infinite ease-in-out;
            transition: color 0.3s, opacity 0.3s;
            z-index: 10;
        }

        .scroll-indicator i {
            font-size: 1.2rem;
        }

        @media (hover: hover) {
            .scroll-indicator:hover {
                color: var(--text-color);
                opacity: 1;
            }
        }

        @keyframes floatDown {
            0% {
                transform: translate(-50%, 0);
            }

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

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

        /* ==========================================
           SECTIONS & FILTER
           ========================================== */
        section {
            padding: var(--section-padding) 0;
            border-top: 1px solid var(--border-color);
        }



        .section-title {
            font-size: clamp(2rem, 5vw, 3rem);
            margin-bottom: clamp(30px, 5vw, 50px);
            display: flex;
            align-items: center;
            gap: 20px;
            line-height: 1.2;
        }

        .section-title::after {
            content: '';
            height: 2px;
            flex-grow: 1;
            background-color: var(--text-color);
            max-width: 150px;
        }

        .filter-container {
            display: flex;
            gap: clamp(10px, 2vw, 15px);
            margin-bottom: 40px;
            flex-wrap: wrap;
        }

        .filter-btn {
            background: transparent;
            border: 1px solid var(--border-color);
            padding: 8px 20px;
            border-radius: 30px;
            font-family: 'Space Grotesk', sans-serif;
            font-weight: 600;
            font-size: clamp(0.8em, 1.5vw, 0.9em);
            cursor: pointer;
            transition: all 0.3s;
            color: var(--gray-text);
        }

        .filter-btn.active {
            background: var(--text-color);
            color: var(--bg-color);
            border-color: var(--text-color);
        }

        @media (hover: hover) {
            .filter-btn:hover {
                background: var(--text-color);
                color: var(--bg-color);
                transform: translateY(-2px);
            }
        }

        /* ==========================================
           PORTFOLIO GALLERY
           ========================================== */
        .projects-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 30px;
        }

        .project-card {
            background: #111;
            border-radius: 16px;
            overflow: hidden;
            transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
            position: relative;
            aspect-ratio: 4 / 3;
            cursor: pointer;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
            will-change: transform, opacity;
        }

        /* Smooth filter animation states */
        .project-card.filter-hiding {
            opacity: 0;
            transform: scale(0.92) translateY(8px);
            pointer-events: none;
        }

        .project-card.filter-showing {
            opacity: 1;
            transform: scale(1) translateY(0);
        }

        .project-badge {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(255, 255, 255, 0.95);
            color: var(--text-color);
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.75em;
            font-weight: 600;
            z-index: 10;
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            transition: all 0.4s ease;
        }

        .project-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.7s ease, opacity 0.5s ease, filter 0.5s ease;
            opacity: 0.85;
        }

        .project-content {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
            color: white;
            opacity: 1;
            transform: translateY(0);
            transition: all 0.4s ease;
            box-sizing: border-box;
            z-index: 5;
            padding: 24px 20px;
        }

        .project-brand-logo {
            position: absolute;
            top: 15px;
            left: 15px;
            height: 28px;
            width: auto;
            max-width: 90px;
            object-fit: contain;
            display: inline-block;
            z-index: 15;
            transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
        }

        .project-card:has(.project-brand-logo) .highlight-badge {
            top: 50px;
            left: 15px;
        }

        .modal-brand-logo {
            height: 36px;
            width: auto;
            max-width: 120px;
            object-fit: contain;
            margin-bottom: 12px;
            display: block;
        }

        .modal-watermark-logo {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 85%;
            height: 85%;
            object-fit: contain;
            opacity: 0.05;
            pointer-events: none;
            z-index: 0;
            transition: all 0.5s ease;
        }

        [data-theme="dark"] .modal-watermark-logo {
            opacity: 0.03;
        }

        .project-content h3 {
            margin-top: 0;
            font-size: 1.5rem;
            margin-bottom: 5px;
            color: white;
            transition: all 0.4s ease;
        }

        .click-hint {
            color: #fff;
            font-size: 0.75em;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 10px;
            display: inline-block;
            opacity: 0.8;
            transition: all 0.3s ease;
        }

        .project-content p {
            color: #d0d0d0;
            font-size: 0.9em;
            margin-bottom: 0;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            transition: all 0.4s ease;
        }

        .project-card:hover .project-image {
            transform: scale(1.08);
            opacity: 0.55;
            filter: blur(5px);
        }

        .project-card:hover .click-hint {
            color: #a0a0a0;
            transform: translateX(5px);
        }

        .project-card:hover .project-brand-logo {
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            height: 90%;
            width: 90%;
            max-width: none;
            max-height: 90%;
            opacity: 1.0;
            z-index: 20;
            filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.7)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
        }

        .project-card:hover .project-content {
            background: radial-gradient(circle, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 80%);
        }

        .project-card:hover .project-badge,
        .project-card:hover .project-content h3,
        .project-card:hover .project-content p,
        .project-card:hover .click-hint,
        .project-card:hover .highlight-badge {
            opacity: 0.0;
        }

        /* ==========================================
           EXPERIENCE & SKILLS
           ========================================== */
        .resume-layout {
            display: grid;
            grid-template-columns: 1fr;
            gap: clamp(40px, 6vw, 80px);
        }

        @media (min-width: 992px) {
            .resume-layout {
                grid-template-columns: 1fr 1fr;
            }
        }

        .timeline {
            border-left: 2px solid var(--border-color);
            margin-left: 10px;
            padding-left: clamp(25px, 4vw, 40px);
        }

        .timeline-item {
            position: relative;
            margin-bottom: 40px;
            cursor: pointer;
            padding: clamp(15px, 3vw, 25px);
            border-radius: 12px;
            transition: background 0.3s;
        }

        .timeline-item::before {
            content: '';
            position: absolute;
            left: calc(clamp(-25px, -4vw, -40px) - 7px);
            top: 30px;
            width: 12px;
            height: 12px;
            background: var(--bg-color);
            border: 2px solid var(--text-color);
            border-radius: 50%;
            transition: all 0.3s;
        }

        @media (hover: hover) {
            .timeline-item:hover {
                background: #f9f9f9;
            }

            .timeline-item:hover::before {
                background: var(--text-color);
                transform: scale(1.3);
            }
        }

        .timeline-meta {
            font-family: 'Space Grotesk', sans-serif;
            color: var(--gray-text);
            font-size: 0.85em;
            text-transform: uppercase;
            letter-spacing: 1px;
            display: block;
            margin-bottom: 8px;
        }

        .timeline-title {
            margin: 0 0 5px 0;
            font-size: clamp(1.1rem, 2vw, 1.3rem);
        }

        .timeline-desc {
            margin: 0;
            color: var(--gray-text);
            font-size: 0.95em;
        }

        .timeline-hint {
            font-size: 0.8em;
            color: var(--accent);
            text-decoration: underline;
            margin-top: 10px;
            display: inline-block;
            font-weight: 600;
        }

        .skills-wrapper {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 30px;
        }

        .skill-tag {
            background-color: transparent;
            border: 1px solid var(--border-color);
            padding: 8px 18px;
            border-radius: 30px;
            font-size: clamp(0.75em, 1.5vw, 0.9em);
            font-weight: 600;
            transition: all 0.3s;
        }

        @media (hover: hover) {
            .skill-tag:hover {
                border-color: var(--text-color);
                transform: translateY(-2px);
                box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            }
        }

        /* ==========================================
           CERTIFICATES
           ========================================== */
        #cert-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
        }

        .cert-card {
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            aspect-ratio: 1.414 / 1;
            background-color: #f5f5f5;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
            transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
            border: 1px solid var(--border-color);
            will-change: transform, opacity;
        }

        /* Smooth filter animation for cert cards and skill boxes */
        .cert-card.filter-hiding,
        .skill-box.filter-hiding {
            opacity: 0;
            transform: scale(0.92) translateY(8px);
            pointer-events: none;
        }

        .cert-card.filter-showing,
        .skill-box.filter-showing {
            opacity: 1;
            transform: scale(1) translateY(0);
        }

        .cert-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        .cert-caption {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            padding: 20px 15px 15px 15px;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
            color: white;
            box-sizing: border-box;
            pointer-events: none;
            transition: padding-bottom 0.4s ease;
            z-index: 5;
        }

        .cert-caption h3 {
            margin: 0;
            font-size: clamp(0.9rem, 2vw, 1.1rem);
            color: #ffffff;
            line-height: 1.2;
        }

        .cert-caption p {
            margin: 4px 0 0;
            font-size: 0.75em;
            color: #d0d0d0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* ==========================================
           CONTACT, FOOTER & MODAL
           ========================================== */
        .contact-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: clamp(15px, 3vw, 25px);
        }

        .contact-item {
            display: flex;
            align-items: center;
            gap: 20px;
            padding: clamp(20px, 3vw, 30px);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            text-decoration: none;
            color: var(--text-color);
            transition: all 0.3s;
        }

        .contact-item i {
            font-size: clamp(1.5rem, 3vw, 1.8rem);
        }

        .contact-info {
            min-width: 0;
        }

        .contact-info strong {
            display: block;
            font-family: 'Space Grotesk', sans-serif;
            font-size: 1.1em;
        }

        .contact-info span {
            font-size: 0.9em;
            opacity: 0.8;
            word-break: break-all;
            overflow-wrap: anywhere;
        }

        @media (hover: hover) {
            .contact-item:hover {
                background: var(--text-color);
                color: var(--bg-color);
                transform: translateY(-5px);
            }
        }

        .site-footer {
            text-align: center;
            padding: 40px 20px;
            border-top: 1px solid var(--border-color);
            margin-top: 60px;
            color: var(--gray-text);
            font-size: 0.85em;
            font-family: 'Space Grotesk', sans-serif;
        }

        .site-footer .sub-text {
            font-size: 0.8em;
            opacity: 0.7;
            margin-top: 5px;
        }

        .modal {
            position: fixed;
            z-index: 10000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            opacity: 0;
            padding: 20px;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: center;
            visibility: hidden;
            transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.4s;
            will-change: opacity;
        }

        .modal.show {
            opacity: 1;
            visibility: visible;
            transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
        }

        .modal-content {
            background-color: var(--bg-color);
            padding: 0;
            border: 1px solid var(--border-color);
            border-radius: 24px;
            width: 100%;
            max-width: 680px;
            position: relative;
            transform: scale(0.93) translateY(24px);
            transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            max-height: 90vh;
            max-height: 90dvh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
            box-sizing: border-box;
            opacity: 0;
            will-change: transform, opacity;
            overflow: hidden;
        }

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

        .close-modal {
            position: absolute;
            top: clamp(15px, 3vw, 25px);
            right: clamp(15px, 3vw, 25px);
            font-size: 24px;
            font-weight: bold;
            cursor: pointer;
            color: var(--text-color);
            transition: transform 0.3s;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-color);
            border-radius: 50%;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            z-index: 20;
        }

        .modal-body {
            display: flex;
            flex-direction: column;
            gap: 24px;
            padding: 50px 40px 40px 40px;
            overflow-y: auto;
            max-height: calc(90vh - 10px);
            max-height: calc(90dvh - 10px);
            box-sizing: border-box;
            scrollbar-width: thin;
            scrollbar-color: var(--border-color) transparent;
        }

        .modal-body::-webkit-scrollbar {
            width: 8px;
        }

        .modal-body::-webkit-scrollbar-track {
            background: transparent;
        }

        .modal-body::-webkit-scrollbar-thumb {
            background-color: var(--border-color);
            border-radius: 10px;
            border: 2px solid transparent;
            background-clip: padding-box;
        }

        .modal-slider {
            position: relative;
            width: 100%;
            aspect-ratio: 16/9;
            overflow: hidden;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            background: #f9f9f9;
        }

        .modal-slide {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            opacity: 0;
            transition: opacity 0.5s ease-in-out;
        }

        .modal-slide.active {
            opacity: 1;
            z-index: 1;
        }

        .modal-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: var(--bg-color);
            color: var(--text-color);
            border: 1px solid var(--border-color);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            cursor: pointer;
            z-index: 10;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            transition: all 0.3s;
        }

        .modal-nav.prev {
            left: 15px;
        }

        .modal-nav.next {
            right: 15px;
        }

        .modal-info h2 {
            margin-top: 0;
            font-size: clamp(1.5rem, 4vw, 2.5rem);
            margin-bottom: 10px;
            line-height: 1.2;
        }

        .modal-info .meta {
            color: var(--gray-text);
            font-family: 'Space Grotesk', sans-serif;
            margin-bottom: 20px;
            display: block;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-size: 0.85em;
        }

        .modal-info .content {
            line-height: 1.8;
            color: #444;
        }

        .modal-info ul {
            padding-left: 20px;
        }

        .modal-info li {
            margin-bottom: 10px;
        }

        @media (min-width: 800px) {
            .modal-slider-wrapper {
                width: 100%;
                max-width: 600px;
                margin: 0 auto;
            }

            .close-modal:hover {
                transform: rotate(90deg);
            }
        }

        /* ==========================================
           RESPONSIVE (MOBILE)
           ========================================== */
        @media (max-width: 768px) {

            /* Lightbox full-screen layout on mobile */
            .lightbox-zoom-container {
                max-width: 100% !important;
                max-height: 100% !important;
                width: 100vw;
                height: 100vh;
                height: 100dvh;
            }

            .lightbox-img-content {
                max-height: 100vh !important;
                max-height: 100dvh !important;
                border-radius: 0;
                box-shadow: none;
            }

            .hero {
                flex-direction: column-reverse;
                text-align: center;
                justify-content: center;
                padding-top: 140px;
                padding-bottom: 80px;
            }

            .hero-text {
                flex: none;
            }

            .hero-actions {
                justify-content: center;
                width: 100%;
            }

            .hero p {
                margin: 0 auto 30px auto;
            }

            /* 🟢 ซ่อนปุ่มเลื่อนลงบนมือถือ เพื่อความคลีนและกันบั๊ก */
            .scroll-indicator {
                display: none;
            }

            .profile-photo {
                flex: none;
                max-width: 80%;
                aspect-ratio: 1 / 1;
                border-radius: 50%;
                box-shadow: none;
                filter: grayscale(0%);
            }

            .section-title {
                justify-content: center;
                text-align: center;
            }

            .section-title::after {
                display: none;
            }

            .filter-container {
                justify-content: center;
                flex-wrap: wrap;
                overflow-x: visible;
                padding-bottom: 0;
                gap: 10px;
            }

            .filter-container::-webkit-scrollbar {
                display: none;
            }

            .filter-btn {
                white-space: normal;
                font-size: 0.75em;
                padding: 6px 16px;
            }

            .projects-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 12px;
            }

            .project-card {
                aspect-ratio: 4 / 5;
                border-radius: 12px;
            }

            .project-badge {
                top: 10px;
                right: 10px;
                padding: 4px 8px;
                font-size: 0.6em;
            }

            .project-image {
                opacity: 0.8;
            }

            .project-content {
                padding: 15px 12px;
                background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
            }

            .project-content h3 {
                font-size: clamp(0.85rem, 3.5vw, 1.1rem);
                line-height: 1.3;
                margin-bottom: 4px;
            }

            .project-content p {
                font-size: 0.75em;
                opacity: 0.9;
                -webkit-line-clamp: 2;
                line-clamp: 2;
            }

            .click-hint {
                display: none;
            }

            #cert-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 12px;
            }

            .cert-card {
                border-radius: 6px;
            }

            .cert-caption {
                padding: 12px 10px 10px 10px;
            }

            .cert-caption h3,
            .cert-caption p {
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                font-size: 0.8rem;
            }

            .cert-caption p {
                font-size: 0.65em;
            }

            .modal {
                padding: 0;
                align-items: flex-end;
            }

            .modal-content {
                border-radius: 20px 20px 0 0;
                max-height: 90dvh;
                height: auto;
                border-bottom: none;
                padding: 0 !important;
                transform: scale(1) translateY(100%);
            }

            .modal-body {
                padding: 60px 20px 30px 20px;
                max-height: 90dvh;
            }

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

            .close-modal {
                position: fixed;
                top: 15px;
                right: 15px;
                background: #fff;
                border: 1px solid #eee;
            }


        }

        /* ==========================================
           EFFECTS & FLOATING BUTTONS
           ========================================== */
        .hero h1 {
            background: linear-gradient(to right, var(--text-color) 20%, #777777 40%, #777777 60%, var(--text-color) 80%);
            background-size: 200% auto;
            color: #000;
            background-clip: text;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: shineText 8s linear infinite;
        }

        @keyframes shineText {
            to {
                background-position: 200% center;
            }
        }

        .project-card::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 50%;
            height: 100%;
            background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%);
            transform: translateX(-150%) skewX(-25deg);
            transition: all 0.75s ease;
            z-index: 2;
            pointer-events: none;
        }

        .project-card:hover::after {
            animation: shineCard 0.8s forwards;
        }

        @keyframes shineCard {
            0% {
                transform: translateX(-150%) skewX(-25deg);
            }

            100% {
                transform: translateX(300%) skewX(-25deg);
            }
        }

        #floating-assistant {
            position: fixed;
            bottom: 30px;
            right: 30px;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
        }

        .assistant-wrapper {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
        }

        .contact-menu {
            position: absolute;
            bottom: 70px;
            right: 5px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(20px) scale(0.8);
            transform-origin: bottom center;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            pointer-events: none;
        }

        .contact-menu.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0) scale(1);
            pointer-events: auto;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 14px 32px;
            font-size: 1rem;
            font-weight: 600;
            border-radius: 50px;
            text-decoration: none;
            transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
            position: relative;
            overflow: hidden;
            font-family: 'Space Grotesk', sans-serif;
            z-index: 1;
        }

        .btn::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 50px;
            z-index: -2;
        }

        .btn::before {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0%;
            height: 100%;
            background-color: rgba(255, 255, 255, 0.2);
            transition: all 0.3s;
            border-radius: 50px;
            z-index: -1;
        }

        .btn:hover::before {
            width: 100%;
        }

        .btn:active {
            transform: scale(0.96) translateY(0) !important;
            transition: transform 0.1s ease;
        }

        .primary-btn {
            background: var(--text-color);
            color: var(--bg-color) !important;
            border: 1px solid var(--text-color);
        }

        .primary-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
            color: var(--bg-color) !important;
        }

        .secondary-btn {
            background: transparent;
            color: var(--text-color) !important;
            border: 1px solid var(--border-color);
        }

        .secondary-btn:hover {
            border-color: var(--text-color);
            transform: translateY(-2px);
            background: var(--text-color);
            color: var(--bg-color) !important;
        }

        .contact-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: var(--bg-color);
            color: var(--text-color);
            border: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            font-size: 20px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            transition: all 0.3s;
            position: relative;
        }

        .contact-btn::before {
            content: attr(data-tooltip);
            position: absolute;
            right: 60px;
            background: var(--text-color);
            color: var(--bg-color);
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 13px;
            font-family: 'Space Grotesk', 'Inter', sans-serif;
            font-weight: 600;
            opacity: 0;
            visibility: hidden;
            transition: 0.3s;
            white-space: nowrap;
            pointer-events: none;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        @media (hover: hover) {
            .contact-btn:hover {
                transform: scale(1.1);
                border-color: transparent;
            }

            .contact-btn:hover::before {
                opacity: 1;
                visibility: visible;
                transform: translateX(-5px);
            }

            .btn-line:hover {
                background-color: #00B900;
                color: white;
                border-color: #00B900;
            }

            .btn-phone:hover {
                background-color: #007AFF;
                color: white;
                border-color: #007AFF;
            }

            .btn-email:hover {
                background-color: #EA4335;
                color: white;
                border-color: #EA4335;
            }


            .btn-github:hover {
                background-color: #333333;
                color: white;
                border-color: #333333;
            }
        }

        .assistant-btn {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background-color: var(--text-color);
            color: var(--bg-color);
            border: none;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
            font-size: 24px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .assistant-btn.active {
            transform: rotate(45deg);
            background-color: #EA4335;
            animation: none;
            box-shadow: 0 5px 15px rgba(234, 67, 53, 0.4);
        }

        .assistant-btn:hover:not(.active) {
            transform: scale(1.1);
        }

        @media (max-width: 768px) {
            #floating-assistant {
                bottom: 20px;
                right: 20px;
            }

            .assistant-btn {
                width: 50px;
                height: 50px;
                font-size: 20px;
            }

            .contact-btn {
                width: 45px;
                height: 45px;
                font-size: 18px;
            }

            .contact-menu {
                bottom: 60px;
                right: 2px;
            }

            .contact-btn::before {
                display: none;
            }
        }

        /* DARK MODE */
        [data-theme="dark"] {
            --bg-color: #121212;
            --dot-color: rgba(255, 255, 255, 0.06); /* กำหนดค่าสีของลายจุดสำหรับโหมดมืด */
            --text-color: #ffffff;
            --border-color: #2a2a2a;
            --gray-text: #a0a0a0;
            --accent: #ffffff;
        }

        [data-theme="dark"] nav,
        [data-theme="dark"] .close-modal {
            background: rgba(18, 18, 18, 0.85);
        }

        [data-theme="dark"] .nav-links {
            background: rgba(18, 18, 18, 0.95);
        }

        [data-theme="dark"] .modal {
            background-color: rgba(18, 18, 18, 0.95);
        }

        [data-theme="dark"] .modal-info .content {
            color: #d1d5db;
        }

        [data-theme="dark"] .project-badge {
            background: rgba(30, 30, 30, 0.95);
            color: #fff;
        }

        [data-theme="dark"] .cert-card {
            background-color: #1a1a1a;
        }

        [data-theme="dark"] .timeline-item:hover {
            background: #1a1a1a;
        }

        [data-theme="dark"] .stats-grid {
            background: #151515;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        }

        .theme-toggle-btn {
            background: transparent;
            color: var(--text-color);
            border: 1px solid var(--border-color);
            border-radius: 50%;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s;
            margin-left: 10px;
        }

        @media (hover: hover) {
            .theme-toggle-btn:hover {
                background: var(--text-color);
                color: var(--bg-color);
                transform: rotate(30deg);
            }
        }

        @media (max-width: 768px) {
            .theme-toggle-btn {
                margin-left: 0;
                width: 40px;
                height: 40px;
            }
        }

        /* TYPEWRITER & SCROLLBAR */
        .typewriter-container {
            font-family: 'Space Grotesk', 'Inter', sans-serif;
            font-size: clamp(1rem, 3vw, 1.8rem);
            /* 🟢 ปรับขนาดเริ่มต้นให้เล็กลงนิดหน่อยเพื่อความปลอดภัย */
            font-weight: 600;
            margin-bottom: 25px;
            margin-top: -10px;
            color: var(--text-color);
            display: flex;
            align-items: center;
            white-space: nowrap;
            /* 🟢 บังคับให้อยู่บรรทัดเดียวเท่านั้น */
            overflow: hidden;
            /* 🟢 ป้องกันข้อความแลบออกนอกขอบ */
            height: 2em; /* เปลี่ยนเป็นความสูงคงที่ เพื่อล็อกเลย์เอาต์ไม่ให้ขยับขึ้นลงขณะตัวหนังสือพิมพ์ดีด */
        }

        .typewriter-prefix {
            margin-right: 8px;
        }

        .typewriter-wrapper {
            display: inline-flex;
            align-items: center;
            text-align: left;
            width: 26ch; /* เปลี่ยนจาก min-width เป็น width คงที่ เพื่อล็อกความกว้างไว้ไม่ให้ข้อความ "I am a" ขยับซ้ายขวาขณะพิมพ์ */
            justify-content: flex-start;
        }

        .typewriter-text {
            color: var(--gray-text);
            background: linear-gradient(120deg, transparent 0%, rgba(150, 150, 150, 0.1) 100%);
            padding: 2px 8px;
            border-radius: 4px;
        }

        .typewriter-cursor {
            display: inline-block;
            width: 3px;
            height: 1.2em;
            background-color: var(--text-color);
            margin-left: 5px;
            animation: blink 0.8s step-end infinite;
        }

        @keyframes blink {
            50% {
                opacity: 0;
            }
        }

        @media (max-width: 768px) {
            .typewriter-container {
                justify-content: center;
                /* 🟢 ปรับขนาดฟอนต์บนมือถือให้เล็กลงพอที่จะจุข้อความยาวๆ ได้ในบรรทัดเดียว */
                font-size: clamp(0.85rem, 4vw, 1.1rem) !important;
            }
        }

        ::-webkit-scrollbar {
            width: 8px;
        }

        ::-webkit-scrollbar-track {
            background: var(--bg-color);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border-color);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--gray-text);
        }

        ::selection {
            background-color: var(--text-color);
            color: var(--bg-color);
        }

        ::-moz-selection {
            background-color: var(--text-color);
            color: var(--bg-color);
        }

        /* SPOTLIGHT & STATS */
        [data-theme="dark"] .project-card::before,
        [data-theme="dark"] .cert-card::before {
            content: "";
            position: absolute;
            top: var(--mouse-y, 0);
            left: var(--mouse-x, 0);
            width: 400px;
            height: 400px;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
            transform: translate(-50%, -50%);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.4s ease;
            z-index: 10;
        }

        [data-theme="dark"] .project-card:hover::before,
        [data-theme="dark"] .cert-card:hover::before {
            opacity: 1;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            text-align: center;
            background: transparent;
            border: 1px solid var(--border-color);
            border-radius: 24px;
            padding: clamp(30px, 4vw, 50px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
        }

        .stat-item {
            padding: 10px;
            transition: transform 0.3s;
        }

        @media (hover: hover) {
            .stat-item:hover {
                transform: translateY(-5px);
            }
        }

        .stat-number {
            font-size: clamp(2.5rem, 5vw, 3.5rem);
            font-family: 'Space Grotesk', sans-serif;
            margin: 0 0 5px 0;
            color: var(--text-color);
            font-weight: 700;
            line-height: 1;
        }

        .stat-label {
            margin: 0;
            color: var(--gray-text);
            font-size: 0.85em;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            font-weight: 600;
        }

        .timeline-item::before {
            animation: pulseNode 2.5s infinite;
        }

        @keyframes pulseNode {
            0% {
                box-shadow: 0 0 0 0 rgba(17, 17, 17, 0.4);
            }

            70% {
                box-shadow: 0 0 0 10px rgba(17, 17, 17, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(17, 17, 17, 0);
            }
        }

        [data-theme="dark"] .timeline-item::before {
            animation: pulseNodeDark 2.5s infinite;
        }

        @keyframes pulseNodeDark {
            0% {
                box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
            }

            70% {
                box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
            }
        }

        /* ==========================================
           🌟 HIGHLIGHT ITEM (ไอเทมที่ต้องการเน้นพิเศษ)
           ========================================== */
        /* กรอบและแสงเรืองรองสีทอง */
        .highlight-item {
            border: 2px solid #D4AF37 !important;
            box-shadow: 0 5px 25px rgba(212, 175, 55, 0.25) !important;
        }

        /* ปรับแสงสำหรับโหมดกลางคืน (Dark Mode) */
        [data-theme="dark"] .highlight-item {
            box-shadow: 0 5px 25px rgba(212, 175, 55, 0.15) !important;
        }

        /* ป้าย Badge รูปดาว */
        .highlight-badge {
            position: absolute;
            background: linear-gradient(135deg, #D4AF37, #AA8C2C);
            color: #111;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.75em;
            font-weight: 700;
            z-index: 20;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            font-family: 'Space Grotesk', sans-serif;
            letter-spacing: 0.5px;
            transition: all 0.4s ease;
        }

        /* ปรับตำแหน่งป้ายให้พอดีกับส่วน 'ประสบการณ์' */
        .timeline-item .highlight-badge {
            top: -12px;
            right: 20px;
        }

        /* ปรับตำแหน่งป้ายให้พอดีกับส่วน 'ใบรับรอง' */
        .cert-card .highlight-badge {
            top: 15px;
            left: 15px;
        }

        /* ปรับตำแหน่งป้ายให้พอดีกับการ์ด 'ผลงานที่โดดเด่น' (ให้อยู่มุมบนซ้าย) */
        .project-card .highlight-badge {
            top: 15px;
            left: 15px;
        }

        /* ==========================================
           🌟 ปรับตำแหน่งป้าย (Highlight ซ้ายบน / หมวดหมู่ ขวาบน)
           ========================================== */

        /* 1. ย้ายป้าย Highlight (สีทอง) ไปไว้มุมซ้ายบน */
        .project-card .highlight-badge,
        .cert-card .highlight-badge {
            top: 15px;
            left: 15px;
            right: auto;
        }

        /* (ป้ายหมวดหมู่สีขาวจะกลับไปอยู่ขวาบนตามค่าเริ่มต้นเดิมโดยอัตโนมัติ) */

        /* 2. จัดระเบียบขนาดบนจอมือถือให้เล็กลง */
        @media (max-width: 768px) {

            /* ย่อขนาดป้ายสีทองบนมือถือและชิดซ้าย */
            .project-card .highlight-badge,
            .cert-card .highlight-badge {
                top: 10px;
                left: 10px;
                right: auto;
                padding: 4px 8px;
                font-size: 0.6em;
            }

            .project-brand-logo {
                top: 10px;
                left: 10px;
                height: 20px;
                max-width: 70px;
            }

            .project-card:has(.project-brand-logo) .highlight-badge {
                top: 36px;
                left: 10px;
            }

            /* ปรับป้ายของส่วน 'ประสบการณ์' ให้อยู่ขวาบนตามเดิม */
            .timeline-item .highlight-badge {
                font-size: 0.65em;
                padding: 4px 10px;
                top: -10px;
                right: 15px;
                left: auto;
            }
        }

        .nowrap-name {
            white-space: nowrap;
            /* บังคับให้ข้อความอยู่บรรทัดเดียว */
            font-size: clamp(2rem, 6vw, 5.5rem) !important;
            /* ปรับขนาดฟอนต์ให้ยืดหยุ่นตามหน้าจอ */
        }

        .gradient-text {
            background: linear-gradient(270deg, #111111, #666666, #111111);
            background-size: 200% auto;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: gradientAnim 5s ease infinite;
        }

        [data-theme="dark"] .gradient-text {
            background: linear-gradient(270deg, #ffffff, #aaaaaa, #ffffff);
            background-size: 200% auto;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        @keyframes gradientAnim {
            0% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }

            100% {
                background-position: 0% 50%;
            }
        }

        @media (max-width: 768px) {
            .nowrap-name {
                font-size: clamp(1.8rem, 8vw, 2.5rem) !important;
                /* ปรับขนาดให้เล็กลงพอดีกับจอมือถือ */
            }
        }

        /* ป้องกัน Navigation ขยับเวลาเปิด Modal */
        body.hidden-scroll header {
            padding-right: var(--scrollbar-width, 0px);
        }

        /* เส้นแบ่งภายใน Stat Item */
        .stat-divider {
            display: block;
            width: 25px;
            /* ความยาวของขีด */
            height: 1.5px;
            /* ความหนาของขีด */
            background-color: var(--border-color);
            /* สีเดียวกับเส้นขอบเว็บ */
            margin: 12px auto;
            /* ระยะห่างบน-ล่าง */
            opacity: 0.6;
        }

        /* ปรับสไตล์ตัวอักษรให้แยกแยะง่ายขึ้น */
        .stat-label strong {
            display: block;
            color: var(--text-color);
            margin-bottom: 2px;
            font-size: 1.05em;
        }

        /* Animation สำหรับการเด้งไฮไลท์ผลงาน */
        @keyframes highlightBounce {

            0%,
            100% {
                transform: scale(1);
            }

            30% {
                transform: scale(1.08);
                box-shadow: 0 0 40px rgba(212, 175, 55, 0.8);
                border-color: #D4AF37;
            }

            50% {
                transform: scale(1.03);
            }

            80% {
                transform: scale(1.05);
            }
        }

        .target-bounce {
            animation: highlightBounce 3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            z-index: 100 !important;
            position: relative;
        }

        /* การจัดโครงสร้างกล่อง List */
        /* Container รวมของส่วนทักษะเพิ่มเติม */
        .additional-certs-section {
            margin-top: 50px;
            padding: 40px;
            background: #ffffff;
            /* พื้นหลังสีขาวสะอาด */
            border: 1px solid #eaeaea;
            /* กรอบบางๆ เพิ่มมิติ */
            border-radius: 16px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
        }

        /* หัวข้อหลัก พร้อมขีดเส้นใต้ขนาดเล็ก (Accent Line) */
        .subsection-title {
            text-align: center;
            font-size: 1.5rem;
            font-weight: 600;
            color: #1a1a1a;
            margin-bottom: 35px;
            position: relative;
        }

        .subsection-title::after {
            content: '';
            display: block;
            width: 60px;
            height: 3px;
            background: var(--text-color);
            /* สีหลักของเว็บคุณ เปลี่ยนได้ครับ */
            margin: 12px auto 0;
            border-radius: 3px;
        }

        /* กล่องจัดหมวดหมู่ทักษะ */
        .skill-box {
            background: #fcfcfc;
            padding: 24px;
            border-radius: 12px;
            border: 1px solid #f0f0f0;
            transition: background 0.3s ease, box-shadow 0.3s ease;
        }

        .skill-box:hover {
            background: #ffffff;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
            border-color: #e2e8f0;
        }

        /* สไตล์ของหัวข้อในแต่ละกล่อง */
        .skill-box-title {
            font-size: 1.1rem;
            color: #2d3748;
            margin-bottom: 20px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 12px;
            padding-bottom: 12px;
            border-bottom: 1px solid #edf2f7;
        }

        .icon-wrapper {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            background: #edf2f7;
            /* สีพื้นหลังไอคอน */
            color: #4a5568;
            /* สีไอคอน */
            border-radius: 8px;
            font-size: 0.9rem;
        }

        /* โครงสร้าง List ภาพและข้อความ */
        .skill-list-with-img {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        /* สไตล์แต่ละไอเทมแบบไร้กรอบ (ดูหรูหรากว่า) */
        .skill-item {
            display: flex;
            align-items: center;
            padding: 10px 12px;
            background: transparent;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .skill-item:hover {
            background: #f8f9fa;
            /* สีเทาอ่อนตอนชี้เมาส์ */
            transform: translateX(4px);
            /* ขยับขวาเบาๆ */
        }

        /* รูปขนาดย่อ */
        .skill-mini-cert {
            width: 46px;
            height: 32px;
            object-fit: cover;
            border-radius: 4px;
            border: 1px solid #e2e8f0;
            flex-shrink: 0;
            margin-right: 15px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            transition: border-color 0.3s ease;
        }

        .skill-item:hover .skill-mini-cert {
            border-color: var(--text-color);
            /* ไฮไลต์กรอบรูปตอนชี้เมาส์ */
        }

        /* ข้อความ */
        .skill-item-text {
            font-size: 0.95rem;
            color: #4a5568;
            font-weight: 500;
            flex-grow: 1;
            /* ดันลูกศรให้ชิดขวาสุด */
            line-height: 1.4;
            transition: color 0.2s ease;
        }

        .skill-item:hover .skill-item-text {
            color: #1a202c;
            /* ตัวหนังสือเข้มขึ้นตอนชี้เมาส์ */
        }

        /* ลูกศรชี้ (ซ่อนไว้ก่อน และจะแสดงเมื่อโฮเวอร์) */
        .skill-item-arrow {
            font-size: 0.8rem;
            color: #cbd5e0;
            opacity: 0;
            transform: translateX(-10px);
            transition: all 0.3s ease;
        }

        .skill-item:hover .skill-item-arrow {
            opacity: 1;
            transform: translateX(0);
            color: var(--text-color);
            /* เปลี่ยนลูกศรเป็นสีหลัก */
        }

        /* จัดการฉากหลังสีดำโปร่งแสง */
        .lightbox-overlay {
            position: fixed;
            z-index: 20000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.85);
            justify-content: center;
            align-items: center;
            cursor: zoom-out;
            opacity: 0;
            visibility: hidden;
            display: flex;
            transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.35s;
        }

        .lightbox-overlay.active {
            opacity: 1;
            visibility: visible;
            transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
        }

        /* Container สำหรับ zoom/pan ภาพใน Lightbox */
        .lightbox-zoom-container {
            position: relative;
            max-width: 90%;
            max-height: 85vh;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            cursor: grab;
            touch-action: none;
            /* ป้องกัน browser จัดการ gesture เอง */
        }

        .lightbox-zoom-container.is-dragging {
            cursor: grabbing;
        }

        .lightbox-zoom-container.is-zoomed-out {
            cursor: zoom-out;
        }

        /* จัดการรูปภาพที่ขยายใหญ่ */
        .lightbox-img-content {
            max-width: 100%;
            max-height: 85vh;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
            transform-origin: center center;
            transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            user-select: none;
            -webkit-user-select: none;
            pointer-events: none;
            /* ป้องกันภาพถูก drag ด้วย browser default */
        }

        .lightbox-overlay.active .lightbox-img-content {
            animation: lightboxZoomIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }

        /* Zoom Info Hint */
        .lightbox-zoom-hint {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            color: rgba(255, 255, 255, 0.85);
            padding: 8px 18px;
            border-radius: 30px;
            font-size: 0.8em;
            font-family: 'Space Grotesk', sans-serif;
            font-weight: 600;
            letter-spacing: 0.5px;
            z-index: 20200;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.4s ease;
            white-space: nowrap;
        }

        .lightbox-overlay.active .lightbox-zoom-hint {
            animation: hintFadeInOut 3.5s ease 0.5s forwards;
        }

        @keyframes hintFadeInOut {
            0% {
                opacity: 0;
                transform: translateX(-50%) translateY(5px);
            }

            15% {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }

            75% {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }

            100% {
                opacity: 0;
                transform: translateX(-50%) translateY(-5px);
            }
        }

        /* Zoom Level Indicator */
        .lightbox-zoom-level {
            position: absolute;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.55);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            color: white;
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 0.8em;
            font-family: 'Space Grotesk', sans-serif;
            font-weight: 600;
            z-index: 20200;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .lightbox-zoom-level.visible {
            opacity: 1;
        }

        /* ปุ่มกากบาทปิด */
        .lightbox-close-btn {
            position: absolute;
            top: 20px;
            right: 40px;
            color: white;
            font-size: 24px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.25s ease;
            z-index: 20100;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.5);
            border-radius: 50%;
            border: 1px solid rgba(255, 255, 255, 0.25);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
        }

        .lightbox-close-btn:hover {
            color: white;
            background: rgba(0, 0, 0, 0.8);
            transform: scale(1.1) rotate(90deg);
        }

        /* ปุ่มเลื่อนนำทางซ้าย-ขวาบน Lightbox */
        .lightbox-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: white;
            font-size: 24px;
            width: 55px;
            height: 55px;
            border-radius: 50%;
            cursor: pointer;
            z-index: 20100;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .lightbox-nav:hover {
            background: rgba(0, 0, 0, 0.8);
            border-color: rgba(255, 255, 255, 0.4);
            transform: translateY(-50%) scale(1.1);
        }

        .lightbox-nav:active {
            transform: translateY(-50%) scale(0.95);
        }

        .lightbox-nav.prev {
            left: 30px;
        }

        .lightbox-nav.next {
            right: 30px;
        }

        /* Reset Zoom Button */
        .lightbox-reset-zoom {
            position: absolute;
            bottom: 25px;
            right: 30px;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.25);
            color: white;
            padding: 8px 18px;
            border-radius: 30px;
            font-size: 0.85em;
            font-family: 'Space Grotesk', sans-serif;
            font-weight: 600;
            cursor: pointer;
            z-index: 20100;
            display: none;
            align-items: center;
            gap: 6px;
            transition: all 0.3s ease;
        }

        .lightbox-reset-zoom:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .lightbox-reset-zoom.visible {
            display: inline-flex;
        }

        /* Responsive สำหรับมือถือ */
        @media (max-width: 768px) {
            .lightbox-nav {
                width: 44px;
                height: 44px;
                font-size: 18px;
            }

            .lightbox-nav.prev {
                left: 15px;
            }

            .lightbox-nav.next {
                right: 15px;
            }

            .lightbox-close-btn {
                top: 15px;
                right: 25px;
                width: 40px;
                height: 40px;
                font-size: 20px;
            }

            .lightbox-reset-zoom {
                bottom: 20px;
                right: 15px;
                font-size: 0.75em;
                padding: 6px 14px;
            }

            .lightbox-zoom-hint {
                font-size: 0.7em;
                padding: 6px 14px;
            }
        }

        /* เอฟเฟกต์เด้งขยาย */
        @keyframes lightboxZoomIn {
            from {
                transform: scale(0.85);
                opacity: 0;
            }

            to {
                transform: scale(1);
                opacity: 1;
            }
        }



        /* การจัดวางกลุ่ม (สำหรับแบบที่ 2) */
        .categorized-skills {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .skill-group-title {
            font-size: 0.95rem;
            font-weight: 600;
            color: #6c757d;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 10px;
            display: block;
            border-bottom: 1px solid #eee;
            padding-bottom: 5px;
        }

        /* สไตล์กล่องรองรับ Tag */
        .skills-wrapper,
        .skill-tag-container {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        /* ดีไซน์ของ Tag */
        .skill-tag {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            /* ระยะห่างระหว่างไอคอนกับข้อความ */
            padding: 8px 16px;
            background-color: #f8f9fa;
            /* พื้นหลังสีเทาอ่อน สไตล์มินิมอล */
            color: #333;
            font-size: 0.9rem;
            font-weight: 500;
            border: 1px solid #e9ecef;
            border-radius: 50px;
            /* ขอบมนเป็นแคปซูล */
            transition: all 0.3s ease;
            cursor: default;
        }

        /* ปรับสีไอคอนใน Tag ให้ดูโดดเด่นแต่ไม่ฉูดฉาด */
        .skill-tag i {
            color: #000000;
            /* ใช้สีหลักของเว็บคุณ */
            font-size: 0.95rem;
        }

        /* เอฟเฟกต์ตอนชี้เมาส์ */
        .skill-tag:hover {
            background-color: #ffffff;
            border-color: var(--text-color);
            color: var(--text-color);
            box-shadow: 0 4px 10px rgba(17, 17, 17, 0.05);
            transform: translateY(-2px);
        }

        /* ======================================================
   🌙 Dark Mode Overrides (สำหรับทักษะและสกิลเพิ่มเติม)
   ====================================================== */

        /* เมื่อเปิด Dark Mode (อ้างอิงจาก data-theme="dark" บน html/body) */
        [data-theme="dark"] .additional-certs-section {
            background: #1a1a1a;
            /* พื้นหลังกล่องใหญ่สีเข้ม */
            border-color: #2d2d2d;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        }

        [data-theme="dark"] .subsection-title {
            color: #f5f5f5;
            /* หัวข้อสีสว่าง */
        }

        [data-theme="dark"] .skill-box {
            background: #222222;
            /* พื้นหลังกล่องย่อย */
            border-color: #333333;
        }

        [data-theme="dark"] .skill-box:hover {
            background: #2a2a2a;
            border-color: #444444;
        }

        [data-theme="dark"] .skill-box-title {
            color: #e0e0e0;
            border-bottom-color: #333333;
        }

        [data-theme="dark"] .icon-wrapper {
            background: #333333;
            /* กรอบไอคอนสีเทาเข้ม */
            color: #d1d5db;
        }

        [data-theme="dark"] .skill-item:hover {
            background: #333333;
        }

        [data-theme="dark"] .skill-item-text {
            color: #cbd5e0;
            /* ข้อความใบประกาศสีเทาสว่าง */
        }

        [data-theme="dark"] .skill-item:hover .skill-item-text {
            color: #ffffff;
            /* ชี้แล้วสว่างสุด */
        }

        [data-theme="dark"] .skill-mini-cert {
            border-color: #444444;
        }

        /* ======================================================
   🌙 Dark Mode สำหรับ Tag ทักษะความเชี่ยวชาญ
   ====================================================== */

        [data-theme="dark"] .skill-group-title {
            color: #9ca3af;
            border-bottom-color: #333333;
        }

        [data-theme="dark"] .skill-tag {
            background-color: #222222;
            /* พื้นหลัง Tag สีเทาเข้ม */
            border-color: #333333;
            color: #e0e0e0;
            /* ตัวหนังสือสีเทาสว่าง */
        }

        [data-theme="dark"] .skill-tag i {
            color: #e0e0e0;
            /* ให้ไอคอนเป็นสีสว่างในโหมดมืด */
        }

        [data-theme="dark"] .skill-tag:hover {
            background-color: #333333;
            border-color: #555555;
            color: #ffffff;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        }

        [data-theme="dark"] .skill-tag:hover i {
            color: #ffffff;
        }

        /* ปุ่มซูมรูปภาพใน Modal */
        .modal-slider-wrapper {
            position: relative;
        }

        .modal-zoom-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid var(--border-color);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 15;
            color: #111111;
            font-size: 16px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
        }

        .modal-zoom-btn:hover {
            transform: scale(1.1);
            background: #ffffff;
            color: #000000;
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
        }

        [data-theme="dark"] .modal-zoom-btn {
            background: rgba(30, 30, 30, 0.85);
            color: #ffffff;
        }

        [data-theme="dark"] .modal-zoom-btn:hover {
            background: #2a2a2a;
            color: #ffffff;
        }