:root {
  --purple: #40208f;
  --purple-deep: #17072f;
  --violet: #7c4dff;
  --gold: #ffd15c;
  --orange: #f47a29;
  --green: #80c65a;
  --mint: #dbffce;
  --paper: #fff7e8;
  --white: #ffffff;
  --ink: #1b1530;
  --muted: rgba(255, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.18);
  --shadow: 0 28px 80px rgba(14, 5, 34, 0.42);
  --body: "Bai Jamjuree", system-ui, sans-serif;
  --display: "Chonburi", "Bai Jamjuree", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--white);
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 209, 92, 0.28), transparent 26rem),
    radial-gradient(circle at 90% 18%, rgba(128, 198, 90, 0.22), transparent 24rem),
    linear-gradient(135deg, #12051f 0%, #2e1164 48%, #111f19 100%);
  overflow-x: hidden;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

button {
  font: inherit;
}

.grain,
.court-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.grain {
  z-index: 4;
  opacity: 0.16;
  background-image:
    linear-gradient(115deg, transparent 0 46%, rgba(255, 255, 255, 0.08) 47% 48%, transparent 49% 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4px);
  mix-blend-mode: soft-light;
}

.court-lines {
  z-index: 0;
  opacity: 0.36;
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(255, 255, 255, 0.18) 49.8% 50.2%, transparent 50.3%),
    radial-gradient(circle at 50% 16%, transparent 0 8rem, rgba(255, 255, 255, 0.18) 8.1rem 8.25rem, transparent 8.35rem),
    radial-gradient(circle at 50% 100%, transparent 0 16rem, rgba(255, 255, 255, 0.12) 16.1rem 16.25rem, transparent 16.35rem);
}

.birthday-page {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(32px, 6vw, 76px) 0;
}

.hero__media {
  position: relative;
  aspect-ratio: 0.74;
  min-height: 520px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: rotate(-2.4deg);
}

.hero__media::before,
.hero__media::after {
  content: "";
  position: absolute;
  inset: 18px;
  z-index: 2;
  border: 1px solid rgba(255, 209, 92, 0.64);
  pointer-events: none;
}

.hero__media::after {
  inset: auto -20% 0;
  height: 46%;
  border: 0;
  background: linear-gradient(0deg, rgba(25, 8, 58, 0.7), transparent);
}

.jersey-badge {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 3;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(20, 8, 43, 0.72);
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__copy {
  position: relative;
  z-index: 2;
}

.kicker {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: clamp(12px, 1.6vw, 14px);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(58px, 10vw, 132px);
  line-height: 0.95;
  text-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

h1 span {
  display: inline-block;
  color: var(--gold);
}

.hero__message {
  max-width: 680px;
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(20px, 2.5vw, 30px);
  line-height: 1.65;
  font-weight: 600;
}

.sports-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ball {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.32));
}

.basketball {
  width: 72px;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 32% 25%, #ffbd70 0 14%, transparent 15%),
    linear-gradient(90deg, transparent 46%, rgba(75, 28, 17, 0.55) 47% 53%, transparent 54%),
    linear-gradient(0deg, transparent 46%, rgba(75, 28, 17, 0.55) 47% 53%, transparent 54%),
    radial-gradient(circle, transparent 0 58%, rgba(75, 28, 17, 0.6) 59% 61%, transparent 62%),
    var(--orange);
}

.ball--one {
  top: 13%;
  right: 4%;
  animation: floatBall 7s ease-in-out infinite;
}

.ball--two {
  left: 48%;
  bottom: 10%;
  transform: scale(0.72);
  animation: floatBall 8s ease-in-out infinite reverse;
}

.shot-trail {
  position: absolute;
  width: 180px;
  height: 180px;
  border-top: 2px solid rgba(255, 209, 92, 0.72);
  border-radius: 50%;
  filter: drop-shadow(0 0 18px rgba(255, 209, 92, 0.48));
  opacity: 0.9;
}

.shot-trail--one {
  right: 8%;
  top: 20%;
  rotate: -26deg;
  animation: trailPulse 2.8s ease-in-out infinite;
}

.shot-trail--two {
  left: 44%;
  bottom: 16%;
  rotate: -18deg;
  scale: 0.72;
  animation: trailPulse 2.8s ease-in-out infinite 0.8s;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: -22px 0 96px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.scoreboard div {
  padding: clamp(20px, 4vw, 34px);
  background: rgba(10, 5, 25, 0.62);
}

.scoreboard__num,
.scoreboard__label {
  display: block;
}

.scoreboard__num {
  color: var(--gold);
  font-family: var(--display);
  font-size: clamp(42px, 6vw, 74px);
  line-height: 1;
}

.scoreboard__label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.letter {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: start;
  margin-bottom: 112px;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid rgba(255, 209, 92, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 209, 92, 0.14), rgba(128, 198, 90, 0.09)),
    rgba(255, 255, 255, 0.08);
}

.letter h2,
.section-head h2,
.final-wish h2 {
  font-size: clamp(34px, 6vw, 74px);
  line-height: 1.1;
}

.letter p:last-child {
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(19px, 2.2vw, 26px);
  line-height: 1.85;
}

.shooting-show {
  position: relative;
  min-height: 78svh;
  display: grid;
  align-items: center;
  margin: -20px 0 110px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 6, 22, 0.72);
  box-shadow: var(--shadow);
}

.arena-photo {
  position: absolute;
  inset: 0;
}

.arena-photo img {
  filter: saturate(1.1) contrast(1.08) brightness(0.74);
}

.arena-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 5, 30, 0.78), transparent 52%, rgba(12, 5, 30, 0.45)),
    radial-gradient(circle at 74% 33%, rgba(255, 209, 92, 0.22), transparent 24rem);
}

.hoop-stage {
  position: relative;
  width: min(720px, 92%);
  min-height: 520px;
  margin-left: auto;
}

.backboard {
  position: absolute;
  top: 70px;
  right: 8%;
  width: 180px;
  height: 126px;
  border: 7px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 34px rgba(255, 255, 255, 0.2);
}

.backboard::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 58px;
  height: 44px;
  translate: -50% 0;
  border: 4px solid rgba(255, 255, 255, 0.74);
}

.rim {
  position: absolute;
  top: 183px;
  right: calc(8% + 54px);
  width: 72px;
  height: 14px;
  border: 5px solid var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(244, 122, 41, 0.7);
}

.net {
  position: absolute;
  top: 198px;
  right: calc(8% + 67px);
  width: 46px;
  height: 62px;
  background:
    repeating-linear-gradient(70deg, transparent 0 11px, rgba(255, 255, 255, 0.72) 12px 14px),
    repeating-linear-gradient(110deg, transparent 0 11px, rgba(255, 255, 255, 0.72) 12px 14px);
  clip-path: polygon(0 0, 100% 0, 72% 100%, 28% 100%);
  opacity: 0.82;
  transform-origin: top;
  animation: netSnap 2.8s ease-in-out infinite;
}

.shoot-ball {
  position: absolute;
  left: 4%;
  bottom: 52px;
  width: 64px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 25%, #ffbd70 0 14%, transparent 15%),
    linear-gradient(90deg, transparent 46%, rgba(75, 28, 17, 0.58) 47% 53%, transparent 54%),
    linear-gradient(0deg, transparent 46%, rgba(75, 28, 17, 0.58) 47% 53%, transparent 54%),
    radial-gradient(circle, transparent 0 58%, rgba(75, 28, 17, 0.62) 59% 61%, transparent 62%),
    var(--orange);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.38), 0 0 28px rgba(255, 209, 92, 0.34);
  animation: shootArc 2.8s cubic-bezier(0.18, 0.76, 0.24, 1) infinite;
}

.shoot-ball::after {
  content: "";
  position: absolute;
  inset: 50% 80% auto auto;
  width: 220px;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 209, 92, 0.72));
  transform-origin: right;
  rotate: -16deg;
}

.swish {
  position: absolute;
  top: 265px;
  right: calc(8% + 20px);
  color: var(--gold);
  font-family: var(--display);
  font-size: clamp(34px, 7vw, 78px);
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
  animation: swishPop 2.8s ease-in-out infinite;
}

.video-section {
  margin: 0 0 110px;
  padding: clamp(10px, 2vw, 18px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 209, 92, 0.16), rgba(124, 77, 255, 0.1)),
    rgba(8, 6, 22, 0.72);
  box-shadow: var(--shadow);
}

.birthday-video {
  display: block;
  width: 100%;
  max-height: 78svh;
  border: 0;
  border-radius: 8px;
  background: #07030f;
}

.gallery {
  margin-bottom: 110px;
}

.section-head {
  max-width: 780px;
  margin-bottom: 32px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 245px;
  gap: 14px;
}

.photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 55px rgba(9, 4, 24, 0.3);
}

.photo--wide {
  grid-column: span 2;
}

.photo--tall {
  grid-row: span 2;
}

.photo--wide.photo--tall {
  grid-column: span 2;
  grid-row: span 2;
}

.photo--porsche {
  grid-column: span 2;
  background: var(--paper);
}

.photo--porsche img {
  object-fit: contain;
  padding: 14px;
  background: var(--paper);
}

.photo img {
  transition: transform 0.7s ease, filter 0.7s ease;
}

.photo:hover img {
  transform: scale(1.045);
  filter: saturate(1.1) contrast(1.04);
}

.photo figcaption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(14, 6, 34, 0.68);
  color: var(--white);
  font-weight: 600;
  backdrop-filter: blur(12px);
}

.final-wish {
  min-height: 72svh;
  display: grid;
  place-items: center;
  justify-items: center;
  text-align: center;
  padding: 70px 0 92px;
}

.final-wish p {
  color: var(--gold);
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 700;
}

.final-wish h2 {
  max-width: 980px;
  margin-top: 12px;
}

.replay-button {
  margin-top: 32px;
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.replay-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.28);
}

#shoot-effects {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes floatBall {
  0%,
  100% {
    translate: 0 0;
    rotate: 0deg;
  }
  50% {
    translate: -18px 28px;
    rotate: 24deg;
  }
}

@keyframes trailPulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.86);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shootArc {
  0% {
    translate: 0 0;
    rotate: 0deg;
    scale: 0.92;
  }
  58% {
    translate: min(430px, 58vw) -260px;
    rotate: 560deg;
    scale: 1;
  }
  72% {
    translate: min(505px, 67vw) -205px;
    rotate: 720deg;
    scale: 0.82;
  }
  100% {
    translate: min(505px, 67vw) 80px;
    rotate: 850deg;
    scale: 0.7;
    opacity: 0;
  }
}

@keyframes netSnap {
  0%,
  52%,
  100% {
    transform: skewX(0deg) scaleY(1);
  }
  70% {
    transform: skewX(-8deg) scaleY(1.14);
  }
}

@keyframes swishPop {
  0%,
  52%,
  100% {
    opacity: 0;
    transform: translateY(14px) scale(0.86);
  }
  66%,
  78% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 28px;
  }

  .hero__media {
    width: min(420px, 88vw);
    min-height: auto;
    margin: 0 auto;
  }

  .scoreboard,
  .letter {
    grid-template-columns: 1fr;
  }

  .shooting-show {
    min-height: 620px;
  }

  .video-section {
    margin-bottom: 78px;
  }

  .hoop-stage {
    width: 100%;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .birthday-page {
    width: min(100% - 22px, 1180px);
  }

  .hero {
    min-height: auto;
  }

  .hero__message {
    font-size: 19px;
  }

  .scoreboard {
    margin-bottom: 70px;
  }

  .scoreboard div {
    padding: 18px 14px;
  }

  .photo-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 280px;
  }

  .photo--wide,
  .photo--tall,
  .photo--porsche {
    grid-column: auto;
    grid-row: auto;
  }

  .backboard {
    right: 3%;
    width: 136px;
    height: 96px;
  }

  .rim {
    top: 166px;
    right: calc(3% + 38px);
  }

  .net {
    top: 181px;
    right: calc(3% + 51px);
  }

  .swish {
    right: 4%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
