:root {
  --maxw: 1640px;
  --gutter: max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Kanit", system-ui, sans-serif;
  --dock-h: 60px;
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.15);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--color-bg);
}

body {
  padding-bottom: calc(var(--dock-h) + var(--safe-bottom) + 30px);
  background: radial-gradient(120% 100% at 50% 0, var(--color-glow), var(--color-bg) 70%) 0 0 / 100% 560px no-repeat var(--color-bg);
  color: var(--color-text);
  font: 400 14px/1.35 var(--font);
}

main {
  max-width: var(--maxw);
  margin-inline: auto;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid var(--color-accent-light);
  outline-offset: 2px;
}

.sprite {
  display: none;
}

/* Header */

.top {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 58px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid rgba(255, 113, 10, 0.35);
  background: rgba(14, 12, 12, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.logo {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-right: auto;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.8px;
}

.logo b {
  display: inline-block;
  background-image: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  font-weight: 700;
  -webkit-text-fill-color: transparent;
}

/* Carousel */

.carousel {
  position: relative;
  margin: 2px var(--gutter) 0;
  animation: stage-in 0.3s ease-out both;
}

.slides {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border: 1px solid rgba(255, 113, 10, 0.45);
  border-radius: 20px;
  box-shadow: 0 16px 40px -14px rgba(255, 89, 0, 0.5);
  scrollbar-width: none;
}

.slides::-webkit-scrollbar {
  display: none;
}

.slide {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  justify-content: flex-end;
  height: 216px;
  overflow: hidden;
  background: linear-gradient(100deg, #2b1206, #1a0f0a 55%, #4a1c05);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.slide img {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 56%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  transform-origin: 50% 25%;
  -webkit-mask-image: linear-gradient(270deg, transparent 0, #000 42%);
  mask-image: linear-gradient(270deg, transparent 0, #000 42%);
}

.slide__text {
  width: 56%;
  padding: 0 14px 12px 0;
  text-align: center;
}

.slide__tag {
  display: inline-block;
  padding: 1px 9px;
  border: 1px solid rgba(255, 196, 33, 0.5);
  border-radius: var(--radius-pill);
  color: var(--color-star);
  font-size: 11.5px;
  font-weight: 500;
}

.slide h1,
.slide h2 {
  margin-top: 2px;
  color: var(--color-text);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1px;
}

.slide h2 {
  font-size: 28px;
  letter-spacing: -0.5px;
}

.slide p {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12.5px;
  line-height: 1.25;
}

.slide__cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  margin-top: 9px;
  padding: 0 16px;
  overflow: hidden;
  border-radius: 14px;
  background-image: var(--grad);
  box-shadow: 0 8px 20px rgba(255, 89, 0, 0.45);
  color: var(--color-on-accent);
  font-size: 15px;
  font-weight: 600;
  transition: transform 140ms ease-out;
}

.slide__cta:active {
  transform: scale(0.96);
}

.slide__cta svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.5;
}

.dots {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}

.dots i {
  position: relative;
  width: 18px;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
}

.dots i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--color-accent-light);
  transform: scaleX(0);
  transform-origin: left;
}

.dots i.is-done::after {
  transform: scaleX(1);
}

.dots i.is-on::after {
  animation: dot-fill 4.5s linear both;
}

/* Grid */

.popular {
  padding: 14px var(--gutter) 0;
}

.popular__head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
}

.popular__head > svg {
  width: 22px;
  height: 22px;
  color: var(--color-accent);
  fill: rgba(255, 113, 10, 0.3);
  transform-origin: 50% 90%;
}

.popular h2 {
  font-size: 19px;
  font-weight: 600;
}

.count {
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background-image: var(--grad);
  color: var(--color-on-accent);
  font-size: 14px;
  font-weight: 600;
  line-height: 24px;
}

/* Bottom dock */

.dock {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--dock-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  border-top: 1px solid var(--color-line);
  background: var(--color-bar);
}

.dock a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  color: var(--color-muted-2);
  font-size: 11px;
  transition: color 200ms ease;
}

.dock a[aria-current] {
  color: var(--color-accent-light);
}

.dock .dock__main {
  position: relative;
  justify-self: center;
  width: 58px;
  height: 58px;
  margin-top: -20px;
  border-radius: 50%;
  background-image: var(--grad);
  box-shadow: 0 0 0 5px var(--color-bg), 0 8px 22px rgba(255, 89, 0, 0.5);
  color: var(--color-on-accent);
  transition: transform 140ms ease-out;
}

.dock__main:active {
  transform: scale(0.94);
}

.dock__main svg {
  width: 25px;
  height: 25px;
}

@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}

@keyframes dot-fill {
  to {
    transform: scaleX(1);
  }
}

@media (max-width: 374px) {
  .logo {
    font-size: 24px;
  }

  .slide h1 {
    font-size: 32px;
  }

  .slide h2 {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .dots i.is-on::after {
    transform: scaleX(1);
  }
}
