/* Homepage hero (views/home-hero.ejs). Everything is scoped with the hh- prefix.
   Note: Bootstrap 3 is loaded on this page, so margins and link states are reset explicitly. */
.hh {
  position: relative;
  overflow: hidden;
  margin-top: 56px; /* fixed navigation bar */
  color: #fff;
  font-family: 'Sarabun', 'Noto Sans Thai', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  background: linear-gradient(125deg, #1597de 0%, #1ea2e6 55%, #24a8ea 100%);
}

/* ---------- background decoration ---------- */
.hh-ring,
.hh-blob {
  position: absolute;
  border-radius: 9999px;
}
.hh-ring {
  right: -260px;
  top: -320px;
  width: 900px;
  height: 900px;
  border: 1px dashed rgba(255, 255, 255, 0.32);
  animation: hh-spin 120s linear infinite;
}
.hh-blob {
  left: -200px;
  top: -220px;
  width: 520px;
  height: 520px;
  background: rgba(255, 255, 255, 0.14);
}
.hh-deco {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}
.hh-deco-ic {
  position: absolute;
  color: #fff;
  opacity: 0.16;
  animation: hh-drift 40s ease-in-out infinite;
}

/* ---------- point-of-sale effects (behind the content) ---------- */
.hh-fx {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}
.hh-dots {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1.2px, transparent 1.6px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 75% 45%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 75% 45%, #000, transparent 75%);
}
.hh-coin {
  position: absolute;
  bottom: -40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 236, 160, 0.9);
  border-radius: 9999px;
  background: linear-gradient(145deg, #ffe58a, #f5b700);
  color: #8a6100;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  animation: hh-coin 52s linear infinite;
}
.hh-sweep {
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: 0;
  width: 28%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0));
  transform: translateX(-150%) skewX(-18deg);
  animation: hh-sweep 18s ease-in-out 2s infinite;
}
.hh-sparkle {
  position: absolute;
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
  animation: hh-twinkle 10s ease-in-out infinite;
}

/* ---------- layout ---------- */
.hh-grid {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}
.hh-text {
  flex: 1 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

/* ---------- headline ---------- */
.hh .hh-title {
  margin: 0;
  font-family: inherit;
  font-size: clamp(32px, 3.4vw, 48px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.5px;
  color: #fff;
}
.hh-title-kicker {
  display: block;
  font-size: clamp(19px, 1.7vw, 25px);
  font-weight: 700;
  letter-spacing: 0;
  color: #dff3ff;
}
.hh-title-brand {
  display: block;
  margin: 2px 0 6px;
  font-size: clamp(52px, 5.8vw, 82px);
  line-height: 1.08;
  letter-spacing: -2px;
  text-shadow: 0 6px 24px rgba(0, 50, 100, 0.25);
}
.hh-words-window {
  display: inline-block;
  height: calc(1.55em - 3px);
  margin-top: -0.12em;
  overflow: hidden;
  vertical-align: bottom;
}
.hh-words {
  display: flex;
  flex-direction: column;
  color: #ffd23f;
  white-space: nowrap;
  animation: hh-words 7.5s cubic-bezier(0.7, 0, 0.2, 1) infinite;
}
.hh-words > span {
  height: 1.55em;
  line-height: 1.55em;
  overflow: hidden;
}
.hh-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.hh .hh-sub {
  max-width: 560px;
  margin: 4px 0 0;
  font-size: 19px;
  line-height: 1.65;
  color: #e8f6ff;
}
.hh-nowrap {
  white-space: nowrap;
}

/* ---------- call to action ---------- */
.hh-cta-row {
  display: flex;
}
.hh .hh-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 32px;
  border-radius: 9999px;
  background: #ffd23f;
  box-shadow: 0 18px 34px -14px rgba(255, 190, 0, 0.75);
  color: #1f2a37;
  font-size: 19px;
  font-weight: 800;
  text-decoration: none;
}
.hh-download {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 450px;
  margin-top: 6px;
}
.hh-stores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  width: 100%;
}
.hh .hh-store {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 24px -14px rgba(0, 40, 90, 0.5);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
}
.hh .hh-store--apple {
  color: #6b6b6b;
}
.hh .hh-store--google {
  color: #5f6368;
}
.hh .hh-store--windows {
  color: #1fa3ec;
}
.hh .hh-all {
  color: #e8f6ff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.hh .hh-all:hover,
.hh .hh-all:focus {
  color: #fff;
  text-decoration: underline;
}
@media (hover: hover) and (pointer: fine) {
  .hh .hh-store:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px -18px rgba(1, 114, 165, 0.45);
  }
  .hh .hh-cta:hover {
    background: #ffdb5c;
  }
}

.hh-store svg {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
}

/* ---------- device photo + floating cards ---------- */
.hh-visual {
  position: relative;
  flex: 1 1 560px;
  min-width: 0;
  max-width: 530px;
  margin: 0 auto;
  padding: 24px 0 8px;
}
.hh-glow {
  position: absolute;
  right: -20px;
  top: -10px;
  width: 300px;
  height: 300px;
  border-radius: 9999px;
  background: #3ab6f2;
  filter: blur(60px);
  opacity: 0.6;
}
.hh-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 8%;
  height: 18%;
  border-radius: 9999px;
  background: radial-gradient(ellipse, rgba(0, 40, 90, 0.35), rgba(0, 40, 90, 0) 70%);
  filter: blur(8px);
}
.hh-ripple {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 0;
  height: 0;
}
.hh-ripple span {
  position: absolute;
  left: -130px;
  top: -130px;
  width: 260px;
  height: 260px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 9999px;
  opacity: 0;
  animation: hh-ripple 12s ease-out infinite;
}
.hh-ripple span:nth-child(2) {
  animation-delay: 0.7s;
}
.hh-ripple span:nth-child(3) {
  animation-delay: 1.4s;
}
.hh-device {
  position: relative;
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 30px 34px rgba(0, 30, 80, 0.38));
  animation: hh-float-device 8s ease-in-out infinite;
}
.hh-card {
  position: absolute;
  z-index: 2;
}
.hh-card--tl {
  left: -16px;
  top: 0;
}
.hh-card--tr {
  right: -16px;
  top: 0;
}
.hh-card--bl {
  left: -16px;
  bottom: 12px;
}
.hh-card--br {
  right: -16px;
  bottom: 12px;
}
.hh-card-box {
  display: grid;
  overflow: hidden;
  padding: 10px 20px 10px 10px;
  border-radius: 22px;
  background: linear-gradient(160deg, #fff, #f1f6ff);
  box-shadow: 0 22px 36px -16px rgba(16, 52, 140, 0.55);
  line-height: 1.3;
  animation: hh-card-in 0.7s cubic-bezier(0.34, 1.3, 0.64, 1) 0.5s both, hh-float-card 6s ease-in-out infinite;
}
.hh-card--tl .hh-card-box {
  rotate: -4deg;
}
.hh-card--tr .hh-card-box {
  rotate: 4deg;
  animation-delay: 0.62s, -1s;
  animation-duration: 0.7s, 7s;
}
.hh-card--bl .hh-card-box {
  rotate: -3deg;
  animation-delay: 0.74s, -2.2s;
  animation-duration: 0.7s, 6.5s;
}
.hh-card--br .hh-card-box {
  rotate: 3deg;
  animation-delay: 0.86s, -3.1s;
  animation-duration: 0.7s, 7.5s;
}
.hh-swap {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: hh-swap 18s cubic-bezier(0.2, 0.8, 0.2, 1) infinite both;
}
.hh-swap-ic {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  color: #fff;
}
.hh-swap-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}
.hh-swap-text strong {
  color: #1f2a37;
  font-size: 13px;
  font-weight: 800;
}
.hh-swap-text small {
  color: #566476;
  font-size: 11px;
}

/* ---------- waves ---------- */
.hh-waves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 64px;
  overflow: hidden;
  pointer-events: none;
}
.hh-waves svg {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 200%;
  height: 100%;
}
.hh-wave-front {
  animation: hh-wave 36s linear infinite;
}
.hh-wave-back {
  animation: hh-wave 56s linear infinite reverse;
}

/* ---------- entrance ---------- */
.hh-rise {
  animation: hh-rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hh-d2 {
  animation-delay: 0.05s;
}
.hh-d3 {
  animation-delay: 0.1s;
}
.hh-d4 {
  animation-delay: 0.15s;
}

/* ---------- responsive ---------- */
@media (min-width: 900px) {
  .hh-visual {
    padding: 20px 0 48px;
  }
}
@media (min-width: 1024px) {
  .hh-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
  }
  .hh-text,
  .hh-visual {
    max-width: none;
    margin: 0;
  }
}
@media (max-width: 1023.98px) {
  .hh-deco {
    display: none;
  }
}
@media (max-width: 639.98px) {
  .hh-coin:nth-of-type(even),
  .hh-sparkle:nth-of-type(odd) {
    display: none;
  }
}
@media (max-width: 899.98px) {
  .hh-card {
    display: none;
  }
}
/* tablet and below: single column, everything centred */
@media (max-width: 1023.98px) {
  .hh-grid {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 24px;
  }
  .hh-text {
    flex: none;
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .hh .hh-sub {
    margin-left: auto;
    margin-right: auto;
  }
  .hh-download {
    align-items: center;
  }
  .hh-visual {
    flex: none;
    width: 100%;
  }
}
/* tablet portrait/landscape such as iPad mini */
@media (min-width: 640px) and (max-width: 1023.98px) {
  .hh-title-kicker {
    font-size: 24px;
  }
  .hh .hh-title {
    font-size: 40px;
  }
  .hh-title-brand {
    font-size: 70px;
  }
  .hh-visual {
    max-width: 580px;
    padding: 24px 0 56px;
  }
  .hh-device {
    max-width: 480px;
  }
}
/* narrow two-column desktop / iPad mini landscape */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .hh-grid {
    gap: 32px;
  }
}
@media (max-width: 639.98px) {
  .hh-grid {
    gap: 20px;
    padding-top: 28px;
  }
  .hh-cta-row,
  .hh .hh-cta {
    width: 100%;
  }
  .hh-stores {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .hh .hh-store {
    gap: 6px;
    height: 36px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 13.5px;
  }
  .hh-store svg {
    width: 17px;
    height: 17px;
  }
  .hh-visual {
    padding: 0;
  }
}

/* ---------- keyframes ---------- */
@keyframes hh-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes hh-spin {
  to { transform: rotate(360deg); }
}
@keyframes hh-drift {
  /* moves for the first 40%, then rests until the next loop */
  0%, 40%, 100% { translate: 0 0; rotate: var(--r, 0deg); }
  20% { translate: 0 -6px; rotate: calc(var(--r, 0deg) + 3deg); }
}
@keyframes hh-words {
  0%, 22% { transform: translateY(0); }
  33%, 55% { transform: translateY(-25%); }
  66%, 88% { transform: translateY(-50%); }
  100% { transform: translateY(-75%); }
}
@keyframes hh-float-device {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 8px; }
}
@keyframes hh-float-card {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}
@keyframes hh-card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes hh-swap {
  0%, 1% { opacity: 0; transform: translateY(12px); }
  3.4%, 33.3% { opacity: 1; transform: none; }
  34.6%, 100% { opacity: 0; transform: translateY(-12px); }
}
@keyframes hh-coin {
  /* rises during the first half, then stays hidden until the next loop */
  0% { opacity: 0; transform: translateY(0); }
  8% { opacity: 0.3; }
  35% { opacity: 0.22; }
  50%, 100% { opacity: 0; transform: translateY(-520px); }
}
@keyframes hh-wave {
  to { transform: translateX(-50%); }
}

@keyframes hh-sweep {
  /* one pass across the hero, then a long pause */
  0% { transform: translateX(-150%) skewX(-18deg); }
  25%, 100% { transform: translateX(450%) skewX(-18deg); }
}
@keyframes hh-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  6% { opacity: 0.85; transform: scale(1) rotate(45deg); }
  14%, 99% { opacity: 0; transform: scale(0.3) rotate(90deg); }
}
@keyframes hh-ripple {
  0% { opacity: 0; transform: scale(0.4); }
  4% { opacity: 0.45; }
  30%, 100% { opacity: 0; transform: scale(2); }
}

@media (prefers-reduced-motion: reduce) {
  .hh *,
  .hh-card-box {
    animation: none !important;
  }
  .hh-swap:first-child {
    opacity: 1;
  }
}
