body {
  font-family: 'comfortaa';
  background-color: #f7f2ec;
  background-image: url(assets/bedge-grunge.png);
  color: #564336;
  margin: 0;
  padding: 0;
}

h2 {
  text-align: left;
  font-size: 2rem;
}

.richtext p {
  margin-bottom: 12px;
  line-height: 1.8;
}


.section-line {
  width: 100%;
  height: 2px;
  background-color: #bc3b45;
  margin-bottom: 50px; 
  transition: width 1s ease-out;
}

.section-line.active {
  width: 100%;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background-color: transparent;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  box-sizing: border-box;
  z-index: 2000;
}

.header.scrolled {
  background: rgba(215, 207, 200, 0.8);
  /* backdrop-filter: blur(6px); */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.logo {
  position: relative;
  display: inline-block;

}
.logo img {
  height: 20px;
}

.hamburger-container {
  display: flex;
  top: 20px;
  right: 20px;
  width: 30px;
  height: 30px;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1000;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  width: 30px;
  height: 22px;
  position: relative;
  cursor: pointer;
  z-index: 2001;
}

.hamburger span{
  display: block;
  position: absolute;
  width: 100%;
  height: 3px;
  background: #564336;
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: all 0.3s ease-in-out;
}

.hamburger span:nth-child(1) {
  top: 0;
}
.hamburger span:nth-child(2) {
  top: 9px;
}
.hamburger span:nth-child(3) {
  top: 18px;
}

/* ตอนเมนูเปิด */
.hamburger.active span:nth-child(1) {
  top: 9px;
  transform: rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  top: 9px;
  transform: rotate(-45deg);
}

.nav {
  display: flex;
  position: fixed;
  top: 0; right: 0;
  width: 33%;
  height: 100vh;
  background: rgba(215, 207, 200, 0.8);
  backdrop-filter: blur(4px);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform: translateX(100%);
  transition: 0.4s ease;
  z-index: 1000;
  overflow: hidden;
}


.nav.active {
  transform: translateX(0);
  position: fixed;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}



.nav ul {
  list-style: none;
  text-align: left;
  padding: 0;
  margin: 0;
}

.nav li {
  margin: 20px 0;
}

#nav ul li {
  opacity: 0;
  transform: translateX(50px);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #564336;
  font-size: 20px;
  text-decoration: none;
  transition: 0.2s;
}

.nav a:hover {
  transform: translateX(5px);
  opacity: 0.8;
}

.nav i {
  font-size: 18px;
  color: #564336;
  width: 30px;
  text-align: center;
}

/* สีแดงเฉพาะตัวอักษรใหญ่ */
.menu-accent {
  color: #bc3b45;
  font-weight: 600;
}

/* Copyright */
.copyright {
  position: absolute;
  bottom: 20px;
  font-size: 12px;
  color: #564336;
  opacity: 0.8;
}

/* Button */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-block;
  background: #bc3b45;
  color: #f7f2ec;
  padding: 20px 70px;
  margin: 20px;
  border-radius: 30px;
  box-shadow: 2px 3px 0 rgba(103,82,73,0.2);
  text-decoration: none;
  transition: all 0.4s ease;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: rgba(255,255,255,0.3);
  transform: skewX(-25deg);
  transition: 0.6s;
}

.btn:hover::before {
  left: 130%;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 4px 6px 0 rgba(103,82,73,0.25);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 1px 2px 0 rgba(103,82,73,0.15);
  background: #a9373f;
  transition: all 0.1s ease;
}

/* Home */
.home {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh; /* ให้เต็มหน้าจอ */
  text-align: center;
  padding: 0; /* เอา padding ออก */
  margin: 0;
  box-sizing: border-box;
  position: relative;
}

.intro{
  padding-bottom: 100px;
}

.home .hello{
  font-size: 24px;
}

.home h1 {
  font-size: 3rem;
}

.home .highlight {
  color: #bc3b45;
}

.home .sub {
  font-size: 16px;
  padding-bottom: 20px;

}

.illustration {
  position: absolute;
  margin-top: auto; /* ดันภาพไปด้านล่าง */
  display: flex;
  justify-content: center;
  width: 100%;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.illustration img {
  max-width: 220px;
  /* margin-bottom: 0; เอาช่องว่างล่างออก */
  display: block;
}

@media (max-height: 700px) {
  .intro {
    padding-bottom: 120px; /* ลดช่องว่างถ้าหน้าจอเตี้ย */
  }

  .illustration img {
    max-width: 180px;
  }
}

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

.hello, 
.home h1, 
.sub, 
.btn {
  opacity: 0;
  animation: fadeUp 1s ease forwards;
}

.hello {
  animation-delay: 0.2s;
}
.home h1 {
  animation-delay: 0.5s;
}
.sub {
  animation-delay: 0.8s;
}
.btn {
  animation-delay: 1.1s;
}


/* Works */
.works {
  padding: 80px 100px;
}

.works h2 {
  text-align: left;
  font-size: 2rem;
  margin-bottom: 30px;
}



.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px;
  max-width: 1100;
  margin: 0 auto;
}

.work-item {
  text-decoration: none;
  color: inherit;
  text-align: left;
}

.work-item p{
  font-family: 'Zen Maru Gothic';
  
}


.thumb {
  width: 100%;
  aspect-ratio: 4 / 3;     /* หรือ 3 / 4 ถ้าอยากแนวตั้ง */
  background: #c0bab5;     /* สีพื้นเดียวกันทุกงาน */
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;   
}


.image-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #c0bab5;
  border-radius: 12px;
  overflow: hidden;
}

.image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
}

.tag {
  background: #bc3b45;
  color: #fff;
  border-radius: 20px;
  padding: 2px 12px;
  font-size: 0.8rem;
  margin-top: 15px;
  display: inline-block;
}

/* ===== Works list skeleton ===== */
.work-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.work-skeleton .thumb {
  height: 200px;
}

.work-skeleton .line {
  height: 14px;
  width: 90%;
}

.work-skeleton .line.short {
  width: 60%;
}

/* ===== Works animation ===== */
.work-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.work-item.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Works hover effect ===== */

.work-item {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.work-item:hover {
  transform: translateY(-6px);
}

.work-item .thumb {
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.work-item:hover .thumb {
  transform: scale(1.05);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.thumb {
  overflow: hidden;
}

.tag {
  transition: background 0.3s ease, transform 0.3s ease;
}

.work-item:hover .tag {
  background: #e05b5b;
  /* transform: translateY(-2px); */
}


/* Detail */
.work-detail {
  padding: 80px 100px;
  font-family: 'zen maru gothic';
  font-weight: lighter;

}

.detail-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
}

.detail-body {
  margin-top: 60px;
  max-width: 100%;
}

.detail-body .info p {
  display: grid;
  /* grid-template-columns: 6em 1fr; */
  margin-bottom: 16px;
}

.detail-body .info span {
  display: block;
}

.detail-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px 0;
}


/* ===== Design Gallery ===== */
.detail-gallery {
  margin-top: 80px;
}

.gallery-section {
  margin-bottom: 100px;
}

.gallery-section h3 {
  font-size: 18px;
  margin-bottom: 24px;
}

/* grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 0 60px;
}

/* ===== auto layout by category ===== */
.gallery-item[data-category="web"] {
  grid-column: span 2;
}

.gallery-item[data-category="illustration"] {
  grid-column: span 4;
}

.gallery-item[data-category="banner"] {
  grid-column: span 2;
}

.gallery-item[data-category="logo"],
.gallery-item[data-category="poster"] {
  grid-column: span 4;
}


.gallery-grid.is-sp {
  grid-template-columns: repeat(4, 1fr);
  padding: 0 60px;
}

/* item */
.gallery-item {
  overflow: visible;   /* ✅ ให้ภาพยาวไหลลงได้ */
  background: none;    /* ไม่จำเป็นต้องมีพื้นหลัง */
}


.gallery-item img {
  width: 100%;        /* คุมแค่ความกว้าง */
  height: auto;       /* ✅ ให้สูงตามภาพจริง */
  aspect-ratio: auto; /* ✅ ยกเลิกบังคับสัดส่วน */
  object-fit: contain;/* หรือเอาออกไปเลยก็ได้ */
  display: block;

  transition: transform 0.4s ease;
}


/* ===== Scroll animation ===== */
.gallery-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ===== Detail animation ===== */
.detail-header,
.detail-body,
.detail-gallery {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* delay แยกแต่ละส่วน */
.detail-body {
  transition-delay: 0.15s;
}
.detail-gallery {
  transition-delay: 0.3s;
}

.detail-header.is-visible,
.detail-body.is-visible,
.detail-gallery.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.back-btn-area {
  text-align: center;
  margin-top: 60px;
}

/* ===== Skeleton ===== */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #e2ddd8;
  border-radius: 6px;
}

/* shimmer animation */
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.5),
    transparent
  );
  animation: skeleton-loading 1.2s infinite;
}

@keyframes skeleton-loading {
  100% {
    transform: translateX(100%);
  }
}

/* size helpers */
.skeleton-title {
  height: 32px;
  width: 70%;
  margin-bottom: 20px;
}

.skeleton-line {
  height: 14px;
  margin: 10px 0;
}

.skeleton-image {
  height: 220px;
  border-radius: 12px;
}


/* Profile Section */

.profile{
  padding: 80px 100px;
}

.profile-container {
  display: flex;
  align-items: center;
  gap: 60px;
  max-width: 900px;   /* คุมความกว้างทั้งก้อน */
  margin: 0 auto;     /* ดันให้อยู่กลางหน้า */
}


.profile-img img {
  width: 180px;
  height: auto;
}

.profile-text {
  max-width: 600px;
  line-height: 1.9;
}

.profile-text h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.profile-text .jp-name {
  color: #c3463a;
  margin-left: 6px;
  font-family: 'zen maru gothic';
  white-space: nowrap; 
}


.profile-text p {
  font-family: 'zen maru gothic';
}


/* Skill Section */
.skill-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px;
  max-width: 900px;
  margin: 0 auto;
  margin-bottom: 60px;
}

.skill-card {
  background-color: rgba(215, 207, 200, 0.6); ;
  border-left: 10px solid #c3463a;
  border-radius: 0px 40px 40px 0px;
  padding: 20px;
  max-width: 250px;
  min-width: 180px;
  text-align: center;
}

.skill-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  font-family: 'zen maru gothic';
}

.skill-card p {
  font-family: 'zen maru gothic';
  text-align: left;
}

.skill-card .tags {
  color: #c3463a;
  font-size: 0.85rem;
  margin-top: 10px;
}

/* Likes Section */
.likes-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.like-item {
  max-width: 240px;
  margin: 0 auto;
}

.like-item h3 {
  margin-bottom: 12px;
  font-family: 'zen maru gothic';
}

.like-item p {
  font-family: 'zen maru gothic';
}

.like-icon {
  width: 120px;
  height: 120px;
  background-color: #c2b8b2;
  border-radius: 50%;
  margin: 0 auto 20px;
}

.like-circle {
  width: 180px;
  height: 180px;
  margin: 0 auto 24px;
  background: rgba(215, 207, 200, 0.6); 
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden; 
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.like-circle img {
  width: 50%;
  height: 50%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.like-item:hover .like-circle {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.like-item:hover .like-circle img {
  transform: scale(1.05);
}



/* Footer */
footer {
  background: #d8d2cc;
  text-align: center;
  padding: 40px 20px;
}

.footer-logo {
  height: 30px;
}

.footer-nav {
  margin: 30px 0;
}

.footer-nav a {
  color: #4a2f25;
  margin: 0 12px;
  text-decoration: none;
  font-size: 0.9rem;
}

.copy {
  font-size: 0.7rem;
  color: #6d5b50;
}

.footer-logo-link {
  display: inline-block;
}

.footer-logo {
  height: 30px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-logo-link:hover .footer-logo {
  opacity: 0.75;
  transform: translateY(-2px);
}

.footer-nav a {
  position: relative;
  color: #4a2f25;
  margin: 0 12px;
  text-decoration: none;
  font-size: 0.9rem;
  padding-bottom: 4px;

  transition: color 0.3s ease, transform 0.3s ease;
}

.footer-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: #bc3b45;

  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.footer-nav a:hover {
  color: #bc3b45;
  transform: translateY(-2px);
}

.footer-nav a:hover::after {
  transform: scaleX(1);
}

/* =====================
   Tablet (<=1024px)
===================== */

@media (max-width: 1024px) {
  .nav {
    width: 100%; 
    background: rgba(215, 207, 200, 0.8);
  }

   .nav a {
    font-size: 22px;
  }

  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 0;
  }
  
  .detail-header {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .detail-body {
    margin-top: 40px;
  }
}

/* =====================
   Mobile (<=768px)
===================== */
@media (max-width: 768px) {
  .works {
    padding: 80px 40px;
  }

  .works h2 {
    font-size: 1.6rem;
  }

  .work-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .work-item {
    max-width: 420px;
    margin: 0 auto;
  }

  .tag {
    font-size: 0.75rem;
  }

  .gallery-grid.is-sp {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .detail-gallery {
    margin-top: 64px;
  }

  .gallery-section {
    margin-bottom: 64px;
  }

  .gallery-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0;
  }

  .work-detail {
    padding: 80px 40px;
  }

  .detail-title h2 {
    font-size: 1.5rem;
    line-height: 1.4;
  }

  .detail-image .image-box {
    border-radius: 10px;
  }

  .detail-body {
    font-size: 0.95rem;
  }

  .detail-body .info p {
    margin-bottom: 12px;
  }

  .back-btn-area {
    margin-top: 48px;
  }

  .profile-container {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }

  .profile-img img {
    margin: 0 auto;
  }

  .profile {
    padding: 80px 40px;
  }

  .profile h2 {
    font-size: 1.6rem;
  }

  .profile-text h3 {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .profile-text .jp-name {
    margin-left: 0;
    margin-top: 4px;
  }

  .skill-container {
    grid-template-columns: 1fr;
    gap: 24px;
    justify-items: center;
  }

  .likes-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}




