.ibm-plex-sans-thai-looped-regular {
  font-family: "IBM Plex Sans Thai Looped", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.ibm-plex-sans-thai-looped-semibold {
  font-family: "IBM Plex Sans Thai Looped", sans-serif;
  font-weight: 600;
  font-style: normal;
}

.ibm-plex-sans-thai-looped-bold {
  font-family: "IBM Plex Sans Thai Looped", sans-serif;
  font-weight: 700;
  font-style: normal;
}

:root {
  --light-blue-color: #E9EFF1;
  --blue-color: #9DD6E8;
  --blue01-color: #0031CD;
  --red-color: #EA482B;
  --yellow-color: #F3EA55;
  --green-color: #7ECC14;
  --red02-color: #D80048;
  --blue-green-color: #18BFC0;
  --light-purple-color: #EB9AFC;
  --black-color: #000000;
  --white-color: #FFFFFF;
  --lh: 1.55em;
  --a_lh: calc(1rem * 1.55);
  --marg: calc(1.5rem / 2);
  --logo_height: calc((100vw - (var(--marg) * 4)) * 0.1573);
  --animation_duration: 3s;
}

* {
  margin: 0;
  padding: 0;

  list-style: none;
  text-decoration: none;

  position: relative;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Sans Thai Looped', sans-serif;
  font-weight: 400;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  background-color: var(--blue01-color)
}

h1 {
  font-family: 'IBM Plex Sans Thai Looped', sans-serif;
  font-weight: 700;
  font-size: 48px;
  color: var(--light-purple-color);
  text-align: center;
}

h2 {
  font-family: 'IBM Plex Sans Thai Looped', sans-serif;
  font-weight: 600;
  font-size: 32px;
  color: var(--white-color);
  text-align: center;
}

P {
  font-family: 'IBM Plex Sans Thai Looped', sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: var(--white-color);
  text-align: left;
  margin: 0.5rem 0;
}

.background {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
}

.headline {
  display: flex;
  justify-content: space-around;
  width: 100%;
  height: 50%;
  padding: calc(10px * 2);

}

.headline>div {
  height: var(--logo_height);
  width: 100%;
  animation: logoScaler 3s cubic-bezier(0.66, -0.01, 0.43, 1.01) infinite alternate forwards;
}

.headline>div svg {
  width: 100%;
  height: 100%;
}

.headline>div svg path {
  fill: var(--white-color);
}

.headline>div.group-1 {
  animation-name: logoScaler_largest;
}

.headline>div.group-2 {
  animation-name: logoScaler_larger;
  animation-delay: calc(3s / 5*1);
}

.headline>div.group-3 {
  animation-delay: calc(3s / 5 * 2);
}

.headline>div.group-4 {
  animation-delay: calc(3s / 5 * 3);
}

.headline>div.group-5 {
  animation-delay: calc(3s / 5 * 4);
}

.headline>div.group-6 {
  animation-delay: calc(3s / 5 * 5);
}

@keyframes logoScaler {
  0% {
    height: calc((100vw - (0.75rem * 4)) * 0.1573);
  }

  100% {
    height: 45%;
  }
}

@keyframes logoScaler_larger {
  0% {
    height: calc((100vw - (0.75rem * 4)) * 0.1573);
  }

  100% {
    height: 73%;
  }
}

@keyframes logoScaler_largest {
  0% {
    height: calc((100vw - (0.75rem * 4)) * 0.1573);
  }

  100% {
    height: 100%;
  }
}

.introduction {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  display: flex;
  justify-content: center;
  flex-direction: column;
}

.intro01 {
  color: var(--yellow-color);
  display: grid;
  margin-top: 40vh;
  justify-content: left;
  text-align: left;
  margin-left: 25vw;
}

.intro02 {
  color: var(--yellow-color);
  display: grid;
  justify-content: left;
  text-align: left;
  margin-left: 25vw;
}

.link-tree {}

li {
  display: flex;
  align-items: center;
  margin-bottom: 100px;
  margin-left: 60vw;

  font-size: 1.25rem;
}

a {
  color: var(--light-purple-color);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

a:hover {
  border-bottom: 3px solid var(--light-purple-color);
  color: var(--light-purple-color);
}

.section01 {
  height: 100vh;
  position: relative;

}

.section02 {
  height: 100vh;
  text-align: center;

}

.heading {
  margin-top: 15vh;

}


.content {
  display: grid;
  justify-content: left;
  width: 70%;
  /* ให้กว้างเต็ม container เพื่อ responsive */
  max-width: 600px;
  /* จำกัดความกว้างสูงสุด */
  padding: 1rem;
  /* เพิ่มระยะห่างด้านใน */
  word-wrap: break-word;
  /* ให้ตัดคำยาวๆ เช่น URL */
  overflow-wrap: break-word;
  /* สำหรับเบราว์เซอร์ใหม่ */
  white-space: normal;
  /* ให้ตัดบรรทัดอัตโนมัติ */
  flex: 1;
  min-width: 250px;
}



.scrolly-container {
  display: flex;
  flex-direction: row-reverse;
  position: relative;
  height: 100%;
}

/* viz fixed */
.viz {
  position: sticky;
  top: 5px;
  height: 100vh;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 4rem;

}


.story {
  width: 25vw;
  top: 0;
  margin-right: 5rem;

  ;
}

section {
  min-height: 100vh;
  padding: 3rem 0;
}

/* grid */
#mascotGrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.card {
  width: calc(vh-70)/6;
  height: 110px;
  background: #E9EFF14D;
  text-align: center;
  padding: 7px;
  color: #000000;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.card1963 {
  background: transparent;
  border-style: dashed;
  border-width: 1px;
  border-color: #bebeda;
}

.card .year {
  margin: 5px 0 0 5px;
  /* บน 5px ซ้าย 5px */
  font-weight: 700;
  font-size: 18px;
  text-align: left;
}

.card .country {
  font-weight: 500;
  font-size: 10px;
  opacity: 0.8;
  text-align: left;
}


.card .mascot-img {
  width: 100%;
  height: 45px;
  object-fit: contain;

}

.card .none {
  flex: 1;
  width: 100%;
  background: transparent;
  /* ให้ภาพไม่บาน */
  /* หรือใส่สีอ่อน debug ได้ เช่น #f0f0f0 */
}

/* tooltip */
.tooltip {
  position: absolute;
  bottom: 100%;
  /* ให้อยู่เหนือการ์ด */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

/* แสดงตอน hover */
.card:hover .tooltip {
  opacity: 1;
}

.storyh1 {
  font-size: 1.5rem;
  margin-top: 20%;
}

.storyh2 {
  font-size: 1.2rem;
  margin-bottom: 3rem;
}


.highlightyellow {
  background-color: var(--yellow-color);
  color: #000000;
  border-radius: 4px;
  font-weight: 600;
}

.highlightred {
  background-color: var(--red-color);
  color: #000000;
  border-radius: 4px;
  font-weight: 600;
}

.highlightpink {
  background-color: var(--light-purple-color);
  color: #000000;
  border-radius: 4px;
  font-weight: 600;
}

.highlightgreen {
  background-color: var(--green-color);
  color: #000000;
  border-radius: 4px;
  font-weight: 600;
}

.highlight-dashed {
  color: var(--blue-color);
  padding: 2px 4px;
  border-radius: 4px;
  border: 2px dashed var(--white-color);
}

.underline {
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 600;
}

.footer {
  width: 100%;
  background-color: var(--blue01-color);
  padding: 300px;
  text-align: center;

}

.footer-content {
  max-width: 50vw;
  margin: 0 auto;
  color: var(--white-color);
  font-size: 14px;
  line-height: 1.6;
}

/* -------- สำหรับแท็บเล็ต -------- */
@media (max-width: 1024px) {
  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 24px;
  }


  #mascotGrid {
    grid-template-columns: repeat(3, 1fr);
  }


  .story {
    width: 40vw;
    margin-right: 2rem;
  }
}

/* -------- สำหรับมือถือ -------- */
/* ---------- Mobile view ---------- */
@media (max-width: 768px) {

  /* จัด layout ใหม่ให้ viz อยู่ด้านหลัง */
  .scrolly-container {
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .viz {
    position: absolute;
    /* ซ้อนอยู่ด้านหลัง */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* ต่ำกว่าเนื้อหาอื่น */
    opacity: 0.3;
    /* ทำให้โปร่งใสเล็กน้อย จะเห็นการ์ดด้านหน้า */
    padding: 0;
  }

  /* ให้ story / เนื้อหาอยู่ด้านหน้า */
  .story {
    position: relative;
    z-index: 2;
    width: 90vw;
    margin: 2rem auto;
    text-align: center;
  }

  /* ให้การ์ดทั้งหมดเห็นในหน้าจอเดียว */
  #mascotGrid {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    /* ปรับขนาดการ์ดยืดหยุ่น */
    gap: 5px;
    width: 95vw;
    height: 100vh;
    /* ให้พอดีจอ */
    overflow: hidden;
    /* ไม่ให้มี scroll */
    align-content: center;
    /* จัดให้อยู่กลาง */
    justify-items: center;
  }

  .card {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 70px;
    /* ย่อขนาดเพื่อให้เห็นครบ */
    height: auto;
    font-size: 0.75rem;
  }

  .card .year {
    font-size: 0.7rem;
  }

  .card .country {
    font-size: 0.5rem;
  }
}


/* -------- สำหรับจอเล็กมาก (มือถือแนวตั้ง) -------- */
@media (max-width: 480px) {
  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 20px;
  }

  #mascotGrid {
    grid-template-columns: 1fr;
  }

  .intro01,
  .intro02 {
    margin-left: 5vw;
  }
}

@keyframes firework {
  0% {
    transform: translate(-50%, 60vh);
    width: 0.5vmin;
    opacity: 1;
  }

  50% {
    width: 0.5vmin;
    opacity: 1;
  }

  100% {
    width: 45vmin;
    opacity: 0;
  }
}

.firework,
.firework::before,
.firework::after {
  --top: 60vh;
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.5vmin;
  aspect-ratio: 1;
  background:
    /* random backgrounds */
    radial-gradient(circle, var(--green-color) 0.2vmin, #0000 0) 50% 00%,
    radial-gradient(circle, var(--green-color) 0.3vmin, #0000 0) 00% 50%,
    radial-gradient(circle, var(--green-color) 0.5vmin, #0000 0) 50% 99%,
    radial-gradient(circle, var(--green-color) 0.2vmin, #0000 0) 99% 50%,
    radial-gradient(circle, var(--green-color) 0.3vmin, #0000 0) 80% 90%,
    radial-gradient(circle, var(--green-color) 0.5vmin, #0000 0) 95% 90%,
    radial-gradient(circle, var(--green-color) 0.5vmin, #0000 0) 10% 60%,
    radial-gradient(circle, var(--green-color) 0.2vmin, #0000 0) 31% 80%,
    radial-gradient(circle, var(--green-color) 0.3vmin, #0000 0) 80% 10%,
    radial-gradient(circle, var(--green-color) 0.2vmin, #0000 0) 90% 23%,
    radial-gradient(circle, var(--green-color) 0.3vmin, #0000 0) 45% 20%,
    radial-gradient(circle, var(--green-color) 0.5vmin, #0000 0) 13% 24%;
  background-size: 0.5vmin 0.5vmin;
  background-repeat: no-repeat;
  animation: firework 2s infinite;
}

.firework::before {
  transform: translate(-50%, -50%) rotate(25deg) !important;
}

.firework::after {
  transform: translate(-50%, -50%) rotate(-37deg) !important;
}