body {
    font-family: 'IBM Plex Sans Thai', sans-serif;
    scroll-behavior: smooth;
}

.background-fader {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    overflow: hidden;
}

/* แต่ละเลเยอร์ของภาพพื้นหลัง */
.fade-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: imageFade 18s linear infinite;
}

/* ภาพแต่ละชุดพร้อม delay ต่างกัน */
.bg-1 {
    background-image: url('../assets/banner-2.jpg');
    animation-delay: 0s;
}
.bg-2 {
    background-image: url('../assets/banner-3.jpg');
    animation-delay: 6s;
}
.bg-3 {
    background-image: url('../assets/banner.jpg');
    animation-delay: 12s;
}

/* animation เดิม */
@keyframes imageFade {
    0%   { opacity: 0; }
    10%  { opacity: 0.2; }
    40%  { opacity: 0.2; }
    50%  { opacity: 0; }
    100% { opacity: 0; }
}

.wheel-container {
    width: 350px;
    height: 350px;
    cursor: grab; /* เปลี่ยนเมาส์เป็นรูปมือเมื่อชี้ */
}

.wheel-container.dragging {
    cursor: grabbing; /* เปลี่ยนเมาส์เป็นรูปมือกำลังจับขณะลาก */
}

#wheel {
    border-width: 20px;
}

.mission-icon {
    width: 80px;
    height: 80px;
    transform: rotate(var(--un-rotate, 0deg));
    /* ป้องกันไม่ให้ไอคอนภารกิจมารบกวนการลาก */
    pointer-events: none;
}

/* ตำแหน่งไอคอนภารกิจ */
#icon-1 { transform: rotate(0deg)   translate(175px) rotate(0deg); }
#icon-2 { transform: rotate(90deg)  translate(175px) rotate(-90deg); }
#icon-3 { transform: rotate(180deg) translate(175px) rotate(-180deg); }
#icon-4 { transform: rotate(270deg) translate(175px) rotate(-270deg); }

/* --- START: Scroll Down Arrow Animation --- */
@keyframes fade-down {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* ===== NEW STYLES FOR TEXT SHADOW ===== */
.text-shadow-lg {
    text-shadow: 0 4px 6px rgba(0,0,0,0.4);
}
.text-shadow-md {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.animate-fade-down {
  animation: fade-down 2s ease-in-out infinite;
}
/* --- END: Scroll Down Arrow Animation --- */

/* --- Image Slider Styles --- */
.slider-container {
    position: relative;
    width: 100%;
    padding-top: 66.66%; /* Aspect ratio 3:2 */
    border-radius: 0.5rem; /* rounded-lg */
    overflow: hidden; /* Hide overflowing parts of the image */
}
.slider-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.slider-image.active {
    opacity: 1;
}

/* --- START: Scroll Animation Styles --- */
/* List Animation */
.animate-list-on-scroll li {
    opacity: 0;
    transform: translateX(-25px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.animate-list-on-scroll.in-view li {
    opacity: 1;
    transform: translateX(0);
}
/* Stagger the animation for each list item */
.animate-list-on-scroll.in-view li:nth-child(1) { transition-delay: 0.1s; }
.animate-list-on-scroll.in-view li:nth-child(2) { transition-delay: 1.2s; }
.animate-list-on-scroll.in-view li:nth-child(3) { transition-delay: 2.3s; }
.animate-list-on-scroll.in-view li:nth-child(4) { transition-delay: 3.4s; }

/* Typing Animation */
.about-quote p {
    visibility: show; /* Hide text initially */
}
.about-quote p.is-typing {
    visibility: visible;
    position: relative;
    border-right: 3px solid transparent; /* Initially transparent cursor */
    animation: blinkCursor 700ms infinite;
}

@keyframes blinkCursor {
    0%, 100% { border-right-color: transparent; }
    50% { border-right-color: #4a5568; } /* gray-700 */
}

/* --- START: Word Fade-In Animation --- */
.word-fade-in span {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    display: inline-block; /* Make spans behave for transform */
    margin-right: 0.25em; /* Add space between spans */
}
.word-fade-in.is-visible span {
    opacity: 1;
    transform: translateY(0);
}
/* --- END: Word Fade-In Animation --- */

/* --- START: Pixel Reveal Animation --- */
.pixel-reveal-container {
    position: relative;
    aspect-ratio: 4 / 3; /* Maintain aspect ratio */
}
.pixel-reveal-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.pixel-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(var(--grid-size, 10), 1fr);
    grid-template-rows: repeat(var(--grid-size, 10), 1fr);
}
.pixel {
    background-color: #f3f4f6; /* bg-gray-100 */
    transform: scale(1);
    transition: transform 0.3s ease;
}
.pixel.is-hidden {
    transform: scale(0);
}
/* --- END: Pixel Reveal Animation --- */

/* --- END: Scroll Animation Styles --- */
#portfolio-flters li {
    cursor: pointer;
    display: inline-block;
    padding: 8px 20px 10px 20px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: #444444;
    margin: 0 5px 10px 5px;
    transition: all 0.3s ease-in-out;
    border-radius: 50px;
    font-family: 'IBM Plex Sans Thai', sans-serif;
}

#portfolio-flters li:hover,
#portfolio-flters li.filter-active {
    background: #3498db;
    color: #fff;
}

.portfolio-item {
    overflow: hidden;
    margin-bottom: 0;
}

.portfolio-wrap {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.portfolio-wrap img {
    transition: all 0.3s ease-in-out;
    width: 100%;
    height: auto;
    display: block;
}

.portfolio-wrap .portfolio-info {
    opacity: 0;
    position: absolute;
    left: 0;
    right: 0;
    bottom: -60px;
    background: rgba(255, 255, 255, 0.9);
    z-index: 3;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.portfolio-wrap .portfolio-info h4 {
    font-size: 1.1rem;
    color: #444444;
    font-weight: 600;
    margin:0;
}

.portfolio-wrap .portfolio-info p {
    color: #777;
    font-size: 0.9rem;
    margin:0;
}

.portfolio-wrap .portfolio-links {
    text-align: center;
}

.portfolio-wrap .portfolio-links a {
    color: #3498db;
    margin: 0 0.25rem;
    font-size: 1.25rem;
    transition: 0.3s;
}

.portfolio-wrap .portfolio-links a:hover {
    color: #5faee3;
}

.portfolio-wrap:hover .portfolio-info {
    bottom: 0;
    opacity: 1;
}

.portfolio-wrap:hover img {
    transform: scale(1.1);
}

/* --- END: Gallery/Portfolio Styles --- */

/* --- START: GLightbox Custom Styles --- */
.gslide-title {
    font-family: 'IBM Plex Sans Thai', sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    color: #333 !important;
}

.gslide-description {
    font-family: 'IBM Plex Sans Thai', sans-serif !important;
    font-size: 1rem !important;
    color: #666 !important;
}
/* --- END: GLightbox Custom Styles --- */


/* Responsive สำหรับจอเล็ก */
@media (max-width: 768px) {
    .wheel-container { width: 280px; height: 280px; }
    #wheel { border-width: 15px; }
    .mission-icon { width: 60px; height: 60px; }
    #icon-1 { transform: rotate(0deg)   translate(140px) rotate(0deg); }
    #icon-2 { transform: rotate(90deg)  translate(140px) rotate(-90deg); }
    #icon-3 { transform: rotate(180deg) translate(140px) rotate(-180deg); }
    #icon-4 { transform: rotate(270deg) translate(140px) rotate(-270deg); }
    .slider-container {
            padding-top: 56.25%; /* Aspect ratio 16:9 for smaller screens */
    }

}