html {
  scroll-behavior: smooth;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
   background-color: #000000f0; /* สีดำล้วน */
  color: #e0e0e0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  padding-bottom: 300px; /* หรือ margin-bottom */
}
canvas {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: -1 !important;
  display: block;
}
section {
  scroll-margin-top: 70px; /* ระยะชดเชยความสูงของ navbar */
}
@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
/* ====== Gradient + Wave ====== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes pulseGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
}

.wave {
  display: inline-block;
  animation: wave-animation 2s infinite;
  transform-origin: 70% 70%;
}
@keyframes wave-animation {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60%,100% { transform: rotate(0deg); }
}

/* ================= Cutscene Background ================= */
#cutscene {
  position: fixed;
  inset: 0;
  background: linear-gradient(270deg, #ff4b1f, #1fddff, #ff4b1f);
  background-size: 600% 600%;
  animation: gradientShift 15s ease infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
  color: white;
  overflow: hidden;
}

#lightTextCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5; /* วางเหนือ background แต่ใต้ logo/skip */
  pointer-events: none;
}

/* ตัวอักษร canvas จะอยู่กลางจอ */
.cutscene-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* ================= Gradient Movement ================= */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ================= Content Animation ================= */
.cutscene-content {
  text-align: center;
  animation: fadeScaleIn 2s ease forwards; /* เล่นแค่ครั้งเดียว */
  opacity: 0;
  transform: scale(0.8);
}

@keyframes fadeScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ================= Logo ================= */
.cutscene-logo {
  width: 180px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.8));
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255,255,255,0.7)); }
  50% { filter: drop-shadow(0 0 20px rgba(255,255,255,1)); }
}

/* ================= Title ================= */
.cutscene-content h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(255,255,255,0.8);
  margin-bottom: 20px;
}

/* ================= Skip Button ================= */
#skip-btn {
  margin-top: 30px;
  padding: 10px 25px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  border-radius: 30px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#skip-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

/* ================= Fade Out Effect ================= */
.cutscene-fade-out {
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

/* ================= Main Content Transition ================= */
#main-content {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
}

body.show-main #main-content {
  opacity: 1;
  transform: translateY(0);
}

/*              end                */

.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px; /* เพิ่มช่องว่างระหว่างรูปกับข้อความ */
  position: relative;
  z-index: 10;
}

/* profile-section ตั้งค่ากว้าง */
.profile-section {
  flex: 0 0 auto;
  margin-left: 40px;
  margin-right: 40px; /* ✅ เพิ่มระยะห่างด้านขวารูป */
}

/* profile-wrapper ทำกรอบวงกลม และเงา */
.profile-wrapper {
  width: 400px;
  height: 400px;
  border-radius: 50%; /* วงกลม */
  border: 4px solid #d46aff; /* ขอบสีม่วงชมพู */
  box-shadow: 0 0 20px 6px #ff42b8; /* เรืองแสง */
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}
@keyframes blink-caret {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* เอฟเฟคท์ hover */
.profile-wrapper:hover {
  box-shadow: 0 0 30px 10px #ff42b8;
}

/* รูปภาพใน wrapper */
.profile-wrapper img.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* intro-section กว้างอัตโนมัติ */
.intro-section {
   flex: 1 1 auto;
  min-width: 280px;
  padding-left: 20px; /* ✅ ช่วยกันชนจากรูป */
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
#typing-container {
  font-size: 1.4rem !important;             /* ปรับขนาดข้อความ */
  color: #ffffff;             /* สีข้อความ (ม่วง) */
  font-weight: bold;          /* ตัวหนา */
  font-family: 'Courier New', Courier, monospace; /* ฟอนต์แบบเครื่องพิมพ์ */
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

#cursor {
  animation: blink-caret 1s step-start infinite;
}

.site-footer {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: #f0f0f5;
  padding: 30px 20px;
  text-align: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 -3px 10px rgba(37, 117, 252, 0.5);
  margin-top: 80px;
  border-radius: 12px 12px 0 0;
}

.footer-content p {
  margin: 0 0 15px 0;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.05em;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 25px;
}

.footer-socials a {
  color: #f0f0f5;
  font-size: 24px;
  transition: transform 0.3s ease, color 0.3s ease;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
}

.footer-socials a:hover {
  color: #ff4de1; /* สีชมพูม่วงเวลาชี้ */
  transform: scale(1.2);
  filter: drop-shadow(0 0 8px #ff4de1);
  cursor: pointer;
}


/* Animation กระพริบขีดพิมพ์ */
@keyframes blink {
  50% {
    opacity: 0;
  }
}
@keyframes blink-caret {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
.subtitle {
  font-size: 2rem !important;
  color: #666;
  font-weight: 500;
  margin: 0.2rem 0;
  animation: fadeInUp 3s ease-out forwards;
  opacity: 0;
}
.subtitle2 {
  font-size: 2.5rem !important;
  color: #666;
  font-weight: 500;
  margin: 0.2rem 0;
  animation: fadeInUp 3s ease-out forwards;
  opacity: 0;
}
/* Navigation */
nav {
  position: fixed;
      top: 0;
      width: 100%;
      background: rgba(0, 0, 0, 0.55);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
      z-index: 10000;
      transition:
        background 0.4s ease,
        box-shadow 0.4s ease,
        transform 0.5s ease-in-out,
        opacity 0.4s ease;
}
.nav-container.hidden {
  display: none;
}
/* container ให้ nav กว้างและจัด layout */
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* โลโก้ */
.logo {
  color: #61dafb;
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: 1.2px;
  user-select: none;
  transition: transform 0.4s cubic-bezier(0.25, 1.25, 0.5, 1), color 0.3s;
}
.logo:hover {
  transform: scale(1.1) rotate(-2deg);
  color: #fff;
}
/* เมนูหลัก */
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: left;
}

/* ลิงก์เมนู */
.nav-links li a {
       color: #e0e0e0;
      font-weight: 600;
      font-size: 1.05rem;
      padding: 8px 16px;
      border-radius: 10px;
      text-decoration: none;
      display: flex;
      align-items: center;
      gap: 8px;
      transition:
        transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
        background 0.3s ease,
        box-shadow 0.3s ease,
        color 0.25s ease;
}

.nav-links li a:hover {
  background: linear-gradient(90deg, #61dafb 0%, #21a1f1 100%);
  color: #000;
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 6px 14px rgba(97, 218, 251, 0.4);
}

/* active */
.nav-links li a.active {
  background: linear-gradient(90deg, #21a1f1, #1479c9);
  color: #fff;
  box-shadow: 0 0 12px rgba(33, 161, 241, 0.7);
}

/* icon hover */
.nav-links li a i {
  font-size: 1.2rem;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.nav-links li a:hover i {
  transform: rotate(12deg);
}

/* ==== MOBILE MENU ==== */
.menu-toggle {
  display: none;
  font-size: 1.6rem;
  color: #61dafb;
  cursor: pointer;
  transition: transform 0.3s ease;

}
.menu-toggle:hover {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 70px;
    right: 0;
    flex-direction: column;
    background: rgba(10,10,15,0.95);
    width: 220px;
    padding: 20px;
    border-radius: 0 0 0 20px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
    transition: all 0.4s ease;
    
  }

  .nav-links.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .menu-toggle {
    display: block;
  }
}
/* ===== Scroll Spy Highlight ===== */
.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  position: relative;
  color: #aaa;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.4s ease, transform 0.3s ease;
}

.nav-links a:hover {
  color: #fff;
  transform: scale(1.05);
}

/* เอฟเฟกต์ underline แบบนุ่ม */
.nav-links a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, #00e0ff, #ff00cc);
  border-radius: 4px;
  transition: all 0.4s ease;
  transform: translateX(-50%);
}

/* เมื่อ active */
.nav-links a.active {
  color: #fff;
  text-shadow: 0 0 10px #00e0ff, 0 0 20px #ff00cc;
}

.nav-links a.active::after {
  width: 100%;
  box-shadow: 0 0 8px #00e0ff, 0 0 15px #ff00cc;
}

/* Hero Section */
.hero .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 40px 20px;
  max-width: 1000px;
  margin: 0 auto;
  flex-wrap: wrap; 
  top: 150px;
}
/* ส่วนข้อความ intro ให้อยู่ซ้าย */
.intro-section {
  flex: 1;
  order: 1;
  color: #e0e0e0;
}

/* ปรับ h1 ให้ใหญ่ขึ้น */
.intro-section h1 {
  font-size: 3.8rem;
  margin-bottom: 15px;
  font-weight: 700;
}

/* ปรับ p ให้อ่านง่าย */
.intro-section p {
  font-size: 1.3rem;
  line-height: 1.6;
  opacity: 0.85;
  color: #ccc;
}

/* Skills Section */
#skills {
  margin-top: 700px; /* ปรับเลขตามที่ต้องการ */
  text-align: center;
}

#skills-cursor {
  display: inline-block;
  animation: blink-caret 1s step-start infinite;
  color: #ffffff;
  font-weight: bold;
}

.skills-section {
   margin-bottom: 100px; /* เว้นระยะห่างจากด้านล่างของ Skills */
}

.skills-section {
  background-color: rgba(255, 255, 255, 0.1); /* โปร่งแสง 10% */
  padding: 40px 20px;
  margin: 40px auto;
  border-radius: 16px;
  max-width: 900px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  color: #e0e0e0;
  text-align: center;
}

.skills-section h2 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  font-weight: 700;
  background: linear-gradient(45deg, #ff4b1f, #1fddff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 5px #fff, 0 0 10px #1fddff;
  position: relative;
}

.skills-container {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.skill-box {
  width: 140px;
  height: 140px; /* กำหนดความสูงเท่ากันให้กล่อง */
  border-radius: 12px;
  cursor: default;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 8px rgb(0 0 0 / 0.3);
  transition: transform 0.4s cubic-bezier(0.28, 1.4, 0.36, 1.0),
              box-shadow 0.3s ease,
              background-color 0.3s ease;
  will-change: transform;
  color: #e0e0e0;

  /* จัดตำแหน่งตรงกลาง */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0; /* เอา padding เดิมออก */
}

.skill-box:hover {
  transform: translateY(-20px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.6);
  background-color: rgba(0, 0, 0, 0.15);
  color: #ffffff;
}
.skill-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  padding: 20px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgb(0 0 0 / 0.3);
  color: #e0e0e0;
  transition: transform 0.4s cubic-bezier(0.28, 1.4, 0.36, 1.0),
              background-color 0.3s ease,
              box-shadow 0.3s ease;
  will-change: transform;
}

.skill-box:hover .skill-inner {
   transform: translateY(-12px) scale(1.05);
  background-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 12px 20px rgb(0 0 0 / 0.5);
  color: #ffffff;
}

.skill-icon {
  font-size: 80px;
  margin-bottom: 10px;
  display: block;
  color: inherit;
}

.skill-box p {
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0;
  color: inherit;
}

/* Projects Section */
.projects {
  background: rgba(255, 255, 255, 0.1);  /* โปร่งแสงแบบ glassmorphism */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 15px;
  padding: 30px 25px;
  max-width: 1000px;
  margin: 30px auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  color: #ddd;
  margin-top: 300px;
  margin-bottom: 200px;
  padding-bottom: 100px;
}

.projects h2 {
  font-size: 2rem;
  color: #ffffff;
  margin-bottom: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.project-list {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.project-card {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  flex: 1 1 300px;
  text-decoration: none;
  transition: transform 0.3s ease, background-color 0.3s ease;
  color: #ddd;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.6);
  background-color: rgba(0, 0, 0, 0.15);
  color: #61dafb;
}

.project-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-weight: 700;
  color: inherit;
}

.project-card p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  color: inherit;
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

/* container หลักสำหรับเนื้อหา about */
.about-content {
  background: rgba(255, 255, 255, 0.1); /* โปร่งแสง */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 40px 30px;
  border-radius: 16px;
  max-width: 800px;
  margin: 40px auto;
  color: #e0e0e0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  font-size: 1.15rem;
}

/* หัวเรื่อง */
.about-content h1 {
  color: #61dafb;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 25px;
  text-align: center;
}

/* ย่อหน้า */
.about-content p {
  margin-bottom: 20px;
  color: #ccc;
}

/* ปรับ footer section */
.footer {
  padding: 20px;
}
.intro-section {
  position: relative;       /* ทำให้ .social-icons ถือว่า absolute ภายใน intro-section */
  padding-bottom: 80px;     /* เว้นพื้นที่ด้านล่าง ให้ absolute block ไม่ทับ */
}
.social-icons {
  display: flex;
  justify-content: flex-start;
  gap: 20px;
  padding-left: 20px;
  margin-top: 30px;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;               /* กำหนดขนาดกล่องให้เป็นรูปวงกลม */
  height: 50px;
  border: 2px solid #fff;    /* สีขอบวงกลม */
  border-radius: 50%;        /* ทำให้เป็นวงกลม */
  color: #fff;               /* สีไอคอน */
  font-size: 24px;           /* ขนาดไอคอน */
  transition: transform 0.3s ease, background 0.3s ease;
  text-decoration: none;
}

.social-icons a:hover {
  color: #ff00ff;
  transform: scale(1.2);
}
/* ลิงก์ใน footer */
footer#contact a {
  color: #61dafb;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

footer#contact a:hover,
footer#contact a:focus {
  color: #21a1f1;
  outline: none;
}
html, body {
  position: relative;
  height: 100%;
  margin: 0;
  padding: 0;
}

/* เส้นขอบบน */
html::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px; /* ความหนา */
  background: linear-gradient(90deg, #ff0080, #7928ca);
  z-index: 9999;
}

/* เส้นขอบล่าง */
html::after {
  content: "";
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #7928ca, #ff0080);
  z-index: 9999;
}

/* เส้นขอบซ้าย */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #ff0080, #7928ca);
  z-index: 9999;
}

/* เส้นขอบขวา */
body::after {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #7928ca, #ff0080);
  z-index: 9999;
}

/* เพิ่ม glow effect เล็กน้อย */
html::before,
html::after,
body::before,
body::after {
  box-shadow: 0 0 8px rgba(255, 0, 128, 0.6), 0 0 12px rgba(121, 40, 202, 0.6);
}
.inner-corners {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 10000;
}

/* กรอบมุมทั่วไป */
.inner-corners .corner {
  position: absolute;
  width: 100px;  
  height: 100px;
  border: 4px solid rgb(255, 255, 255);
  box-sizing: border-box;
}

/* มุมบนซ้าย – เลื่อนเข้า 20px จากบนและซ้าย */
.inner-corners .top-left {
  top: 80px; 
  left: 80px;
  border-right: none;
  border-bottom: none;
}

/* มุมบนขวา – เลื่อนเข้า 20px จากบนและขวา */
.inner-corners .top-right {
  top: 80px; 
  right: 80px;
  border-left: none;
  border-bottom: none;
}

/* มุมล่างซ้าย – เลื่อนเข้า 20px จากล่างและซ้าย */
.inner-corners .bottom-left {
  bottom: 80px; 
  left: 80px;
  border-right: none;
  border-top: none;
}

/* มุมล่างขวา – เลื่อนเข้า 20px จากล่างและขวา */
.inner-corners .bottom-right {
  bottom: 80px; 
  right: 80px;
  border-left: none;
  border-top: none;
}
.intro-section .more-about {
  margin-top: 40px;
  text-align: left;         /* จัดให้ปุ่มชิดซ้าย */
  padding-left: 20px;       /* ระยะห่างจากขอบซ้าย */
}
/* จัดส่วนปุ่มให้อยู่กึ่งกลางใต้ไอคอน */
.more-about {
  margin-top: 24px;
  text-align: center;
}

/* สไตล์ปุ่ม */
.btn {
  display: inline-block;
  padding: 12px 28px;
  background: linear-gradient(135deg, #61dafb, #21a1f1);
  color: #000000;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(33, 161, 241, 0.5);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover effect */
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(33, 161, 241, 0.7);
}

.certificates-section {
  padding: 50px 20px;
  text-align: center;
  color: white;
}

.certificates-section h2 {
  font-size: 2.8rem;
  margin-bottom: 40px;
  font-weight: 700;
}

.certificates-container {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.certificate-card {
  position: relative;
  width: 240px;
  background: #222;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 249, 236, 0.4);
  cursor: pointer;
  transition: all 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  padding-bottom: 20px;
  transform: translateY(0);
}

.certificate-card:hover {
  transform: scale(1.07);
  box-shadow: 0 10px 30px rgba(255, 213, 0, 0.6);
}

.certificate-card img {
  width: 100%;
  height: 160px;  /* เพิ่มความสูงรูป */
  object-fit: cover;
  border-bottom: 2px solid #ffe100;
}

.cert-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 12px 10px 4px;
  color: #00ffff;
  user-select: none;
}

.cert-desc {
  font-size: 0.9rem;
  margin: 0 15px 8px;
  padding-top: 15px; /* ขยับลง */
  color: #ccc;
  user-select: none;
}

/* ตัวหนังสือ typing */
.typing-text {
  font-family: monospace;
  font-size: 0.85rem;
  color: #80fff7;
  height: 22px; /* fix height เท่ากับบรรทัดเดียว */
  margin: 0 15px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid #00ffff;
  animation: blinkCursor 0.75s step-end infinite;
}

/* กระพริบเคอร์เซอร์ */
@keyframes blinkCursor {
  from, to { border-color: transparent }
  50% { border-color: #5d00ff }
}

/* Lightbox เหมือนเดิม */
#lightbox {
   position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 99999;
  overflow: hidden; /* ป้องกันเลื่อน */
  pointer-events: none;
}

#lightbox.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 85%;
  max-height: 85%;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: zoomIn 0.4s ease;
  transform: translateY(0); /* รีเซ็ตตำแหน่งแนวตั้ง */
}

.lightbox-content img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 16px;
  margin: 0;
  transition: transform 0.4s ease;
  animation: zoomIn 0.4s ease, neonPulse 2s ease-in-out infinite alternate;
  border: 2px solid #ffe066; /* เหลืองอ่อนลงแต่สว่างขึ้น */
}

/* เอฟเฟกต์นีออนสีเหลืองทองสว่างขึ้น */
@keyframes neonPulse {
  from {
    box-shadow:
      0 0 10px rgba(255, 224, 102, 0.8),
      0 0 25px rgba(255, 224, 102, 0.6),
      0 0 50px rgba(255, 224, 102, 0.4),
      0 0 80px rgba(255, 224, 102, 0.25);
  }
  to {
    box-shadow:
      0 0 18px rgba(255, 224, 102, 1),
      0 0 45px rgba(255, 224, 102, 0.8),
      0 0 90px rgba(255, 224, 102, 0.6),
      0 0 130px rgba(255, 224, 102, 0.4);
  }
}

.lightbox-content img:hover {
  transform: scale(1.02);
}

.close-btn {
  position: absolute;
  top: -60px; /* ✅ ขยับขึ้นให้ห่างจากภาพมากขึ้น */
  right: -40px; /* ✅ ขยับออกจากภาพด้านขวา */
  font-size: 3.2rem;
  color: #ffe066;
  cursor: pointer;
  text-shadow:
    0 0 6px rgba(255, 224, 102, 0.8),
    0 0 12px rgba(255, 224, 102, 0.6),
    0 0 20px rgba(255, 224, 102, 0.4);
  transition: 
    transform 0.3s ease,
    color 0.3s ease,
    text-shadow 0.3s ease;
  z-index: 100000;
}

/* เอฟเฟกต์ตอน hover */
.close-btn:hover {
  color: #fff59d; /* เหลืองนวลขึ้นตอน hover */
  transform: scale(1.3) rotate(10deg);
  text-shadow:
    0 0 12px rgba(255, 255, 150, 0.9),
    0 0 24px rgba(255, 224, 102, 0.7),
    0 0 40px rgba(255, 200, 0, 0.5);
}

/* เอฟเฟกต์ pulse เบาๆ ให้นีออนเต้นแสง */
@keyframes closeBtnPulse {
  0% {
    text-shadow:
      0 0 6px rgba(255, 224, 102, 0.7),
      0 0 14px rgba(255, 224, 102, 0.4);
  }
  100% {
    text-shadow:
      0 0 12px rgba(255, 224, 102, 1),
      0 0 24px rgba(255, 224, 102, 0.8);
  }
}

.close-btn {
  animation: closeBtnPulse 2.2s ease-in-out infinite alternate;
}

/* Zoom animation */
@keyframes zoomIn {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
/* หัวข้อ h2 cer */
.certificates-section h2 {
  font-size: 3rem;
  font-weight: 900;
  color: #ffffff;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
  user-select: none;
  text-shadow: 2px 2px 8px rgba(255, 255, 255, 0.6);
  padding-bottom: 12px;
}

.certificates-section h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 120px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ffffff, #ffffff, #ffffff);
  box-shadow: 0 0 8px #ffffff;
}

/* Throphy */

.trophy-section {
  padding: 50px 0;
  text-align: center;
  background-color: #111;
}

.trophy-section h2 {
  color: #fff;
  font-size: 2.5em;
  margin-bottom: 30px;
}

.trophy-swiper {
  width: 90%;
  margin: auto;
}

.trophy-img {
  width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  transition: transform 0.3s ease;
}

.trophy-img:hover {
  transform: scale(1.05);
}

/* CSS about me */

.about-typing {
  padding: 400px 10px 80px; /* ✅ ระยะห่างด้านบนเพิ่มขึ้น */
  background: transparent;  /* ✅ เอาพื้นหลังดำออก */
  font-family: 'Courier New', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.about-typing .container {
  max-width: 1000px; /* ✅ ขยายได้กว้างขึ้น */
  width: 100%;
  text-align: left;
  position: relative;
}

.about-typing h2 {
  font-size: 2.8rem;
  color: #ffffff;
  margin-bottom: 40px;
  text-align: left;
  padding-left: 10px;
}

.typing-box {
  background-color: #000000; /* ✅ กล่องดำสนิท */
  color: #ffffff;            /* ✅ สีข้อความ */
  padding: 40px;
  border-radius: 12px;
  font-size: 1.1rem;
  line-height: 1.8;
  white-space: pre-wrap;
  position: relative;
  width: 100%;
  box-shadow:
    0 0 10px #ff42b8,
    0 0 20px #ff42b8,
    0 0 40px #ff42b8; /* ✅ ขอบเรืองแสง */
  border: 1px solid #00ffff50; /* ✅ ขอบบางสีฟ้า */
  font-family: 'Courier New', monospace;
  backdrop-filter: blur(4px); /* optional เพิ่มลุคโปร */
}
#typingCursor {
  color: #61dafb;
  animation: blink 1s infinite;
  position: absolute;
  bottom: 40px;
  left: 25px;
  font-size: 1.2rem;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}