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

body {
  font-family: 'Montserrat', sans-serif;
  background: linear-gradient(120deg, #2e2e2e, #1a1a1a);
  color: #fff;
  overflow-x: hidden;
}

.navbar {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.navbar .logo {
  font-weight: 600;
  font-size: 1.5rem;
  color: #fff;
}

.navbar ul {
  display: flex;
  list-style: none;
}

.navbar ul li {
  margin-left: 1.5rem;
}

.navbar ul li a {
  color: #ddd;
  text-decoration: none;
  font-weight: 300;
  transition: color 0.3s;
}

.navbar ul li a:hover {
  color: #fff;
}

.blob {
  position: absolute;
  width: 400px;
  height: 400px;
  background: linear-gradient(45deg, #000000, #ffffff);
  border-radius: 50%;
  filter: blur(120px);
  animation: float 10s ease-in-out infinite;
  z-index: 0;
}

.blob:nth-child(1) {
  top: -100px;
  left: -100px;
}

.blob:nth-child(2) {
  bottom: -100px;
  right: 30px;
  background: linear-gradient(45deg, #000000, #ffffff);
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) translateX(0);
  }

  50% {
    transform: translateY(30px) translateX(20px);
  }
}
.portfolio-section {
  position: relative;

}

.portfolio-section h1 {
  text-align: center;
  margin: 180px 0 50px 0;
  color: #fff;
  font-weight: 700;
  line-height: 1;
  font-size: 64px;
  letter-spacing: 1rem;
  text-shadow: #fff 0px 0px 10px;
  animation: focus-in-contract-bck 1s ease-in-out;
}

.view {
  background-color: black;
  position: relative;
  margin-left: auto;
  margin-right: 16%;
  padding: 8px;
  width: 95px;
  animation: bounce-in-top 2s ease-in-out;
    border: solid 1px #ffffff;
  
}

.view svg {
  cursor: pointer;
  transition: transform 0.3s ease-in-out;
}

.view svg:hover {
  color: #fff;
  transform: scale(1.2);
  transition: transform 0.3s ease-in-out;
}

.portfolio-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px 100px;
  animation: slide-in-elliptic-top-fwd 1s ease-in-out;


}

.portfolio-box .b1 {
  width: 413px;
  height: 300px;
  background-color: #000000;
  transition: transform 0.3s ease-in-out;
  position: relative;
  overflow: hidden;
  border: solid 1px #ffffff;
  scrollbar-color: white black;      
}
.portfolio-box .b1:hover {
  transform: scale(1.2);
  transition: transform 1s ease-in-out;
  z-index: 1;
}

.b1 .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transition: opacity 1s;
  z-index: 2;
  padding: 20px;
  text-align: center;
  overflow-y: auto;
  word-break: break-word;
  max-height: 100%;

}

.portfolio-box .b1 .overlay h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.portfolio-box .b1 .overlay p {
  font-size: 16px;
  line-height: 2;
  max-height: 150px;
  overflow-y: auto;
}

.portfolio-box .b1:hover .overlay {
  opacity: 1;

}



.portfolio-box .b1 img {
  width: 413px;
  height: 300px;
  object-fit: cover;
  opacity: 0.9;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  z-index: 0;
}

.portfolio-box .b1 .desc {
  display: none;
}

.portfolio-box.list-view {
  flex-direction: column;
  align-items: center;
}

/* โหมด list-view: รูปซ้าย ข้อความขวา */
.portfolio-box.list-view .b1 {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 86%;
  height: 320px;

  background: #111;
  box-shadow: 0 2px 12px #0006;
  position: relative;
  overflow: hidden;
  animation: slide-in-left 0.3s ease-in-out;
}

.portfolio-box.list-view .b1 img {
  width: 350px;
  height: 100%;
  object-fit: cover;
  margin-right: 5px;
  box-shadow: none;

}

.portfolio-box.list-view .b1 .desc {
  display: flex;
  color: #fff;

  padding: 24px 0;
  overflow: hidden;
}

.portfolio-box.list-view .b1 .desc img {
  width: 350px;
  height: 320px;
  object-fit: cover;
}

.portfolio-box.list-view .b1 .desc .hp {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-top: 20px;
  padding-left: 20px;
}

.portfolio-box.list-view .b1 .desc h2 {

  font-size: 1.5rem;
  margin-bottom: 10px;
}

.portfolio-box.list-view .b1 .desc p {

  font-size: 1rem;
  line-height: 1.7;
}

/* ซ่อน .overlay ในโหมด list-view */
.portfolio-box.list-view .b1 .overlay {
  display: none !important;
}

.icon{
  margin-top: 10px;
}
.slide-in-elliptic-top-fwd {
  -webkit-animation: slide-in-elliptic-top-fwd 0.7s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
  animation: slide-in-elliptic-top-fwd 0.7s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

@-webkit-keyframes slide-in-elliptic-top-fwd {
  0% {
    -webkit-transform: translateY(-600px) rotateX(-30deg) scale(0);
    transform: translateY(-600px) rotateX(-30deg) scale(0);
    -webkit-transform-origin: 50% 100%;
    transform-origin: 50% 100%;
    opacity: 0;
  }

  100% {
    -webkit-transform: translateY(0) rotateX(0) scale(1);
    transform: translateY(0) rotateX(0) scale(1);
    -webkit-transform-origin: 50% 1400px;
    transform-origin: 50% 1400px;
    opacity: 1;
  }
}

@keyframes slide-in-elliptic-top-fwd {
  0% {
    -webkit-transform: translateY(-600px) rotateX(-30deg) scale(0);
    transform: translateY(-600px) rotateX(-30deg) scale(0);
    -webkit-transform-origin: 50% 100%;
    transform-origin: 50% 100%;
    opacity: 0;
  }

  100% {
    -webkit-transform: translateY(0) rotateX(0) scale(1);
    transform: translateY(0) rotateX(0) scale(1);
    -webkit-transform-origin: 50% 1400px;
    transform-origin: 50% 1400px;
    opacity: 1;
  }
}

.bounce-in-top {
  -webkit-animation: bounce-in-top 1.1s both;
  animation: bounce-in-top 1.1s both;
}

@-webkit-keyframes bounce-in-top {
  0% {
    -webkit-transform: translateY(-500px);
    transform: translateY(-500px);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
    opacity: 0;
  }

  38% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
    opacity: 1;
  }

  55% {
    -webkit-transform: translateY(-65px);
    transform: translateY(-65px);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  72% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }

  81% {
    -webkit-transform: translateY(-28px);
    transform: translateY(-28px);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  90% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }

  95% {
    -webkit-transform: translateY(-8px);
    transform: translateY(-8px);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }
}

@keyframes bounce-in-top {
  0% {
    -webkit-transform: translateY(-500px);
    transform: translateY(-500px);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
    opacity: 0;
  }

  38% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
    opacity: 1;
  }

  55% {
    -webkit-transform: translateY(-65px);
    transform: translateY(-65px);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  72% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }

  81% {
    -webkit-transform: translateY(-28px);
    transform: translateY(-28px);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  90% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }

  95% {
    -webkit-transform: translateY(-8px);
    transform: translateY(-8px);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }
}

@-webkit-keyframes focus-in-contract-bck {
  0% {
    letter-spacing: 1em;
    -webkit-transform: translateZ(300px);
    transform: translateZ(300px);
    -webkit-filter: blur(12px);
    filter: blur(12px);
    opacity: 0;
  }

  100% {
    -webkit-transform: translateZ(12px);
    transform: translateZ(12px);
    -webkit-filter: blur(0);
    filter: blur(0);
    opacity: 1;
  }
}

@keyframes focus-in-contract-bck {
  0% {
    letter-spacing: 1em;
    -webkit-transform: translateZ(300px);
    transform: translateZ(300px);
    -webkit-filter: blur(12px);
    filter: blur(12px);
    opacity: 0;
  }

  100% {
    -webkit-transform: translateZ(12px);
    transform: translateZ(12px);
    -webkit-filter: blur(0);
    filter: blur(0);
    opacity: 1;
  }
}

.slide-in-left {
  -webkit-animation: slide-in-left 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
  animation: slide-in-left 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

@-webkit-keyframes slide-in-left {
  0% {
    -webkit-transform: translateX(-1000px);
    transform: translateX(-1000px);
    opacity: 0;
  }

  100% {
    -webkit-transform: translateX(0);
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-in-left {
  0% {
    -webkit-transform: translateX(-1000px);
    transform: translateX(-1000px);
    opacity: 0;
  }

  100% {
    -webkit-transform: translateX(0);
    transform: translateX(0);
    opacity: 1;
  }
}

footer {
  background: #000;
  padding: 1rem;
  text-align: center;
  color: #aaa;
  margin-top: 50px;
}


.social-icons a {
  margin: 0 1rem;
  color: #aaa;
  font-size: 1rem;
  transition: color 0.3s;
}

.social-icons a:hover {
  color: #fff;
}