:root {
  --ink: #25201f;
  --cream: #fffaf1;
  --paper: #fffdf8;
  --pink: #f23b6d;
  --pink-dark: #cf174d;
  --yellow: #ffce4d;
  --mint: #bcebd7;
  --blue: #abc9ff;
  --purple: #d8c0ff;
  --line: #ddd5ca;
  --muted: #746d69;
  --shadow: 7px 7px 0 var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 18%, rgba(255, 206, 77, 0.18) 0 3px, transparent 4px),
    radial-gradient(circle at 91% 34%, rgba(242, 59, 109, 0.12) 0 3px, transparent 4px),
    var(--cream);
  background-size: 42px 42px, 52px 52px, auto;
  font-family: "IBM Plex Sans Thai", sans-serif;
  min-height: 100vh;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
}

.brand {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  width: clamp(150px, 18vw, 220px);
  height: auto;
  display: block;
  border-radius: 18px;
}

.hero-logo {
  width: min(500px, 100%);
  height: auto;
  display: block;
  margin: 0 0 22px;
  border-radius: 28px;
  filter: drop-shadow(5px 6px 0 rgba(37, 32, 31, 0.14));
}

.header-link,
.text-button {
  border: 0;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 138px);
  padding: 70px 2% 80px;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  align-items: center;
  gap: 70px;
}

.eyebrow,
.question-kicker {
  margin: 0 0 18px;
  color: var(--pink-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

h1,
h2 {
  margin: 0;
  font-family: "Kanit", sans-serif;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 650px;
  font-size: clamp(3.4rem, 7vw, 6.5rem);
}

h1 span,
.results-heading h2 span {
  position: relative;
  color: var(--pink);
  white-space: nowrap;
}

h1 span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 12px;
  z-index: -1;
  background: var(--yellow);
  transform: rotate(-1deg);
}

.hero-description {
  max-width: 570px;
  margin: 28px 0 32px;
  color: #504a47;
  font-size: 1.15rem;
  line-height: 1.75;
}

.primary-button,
.secondary-button {
  min-height: 56px;
  padding: 0 26px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  color: white;
  background: var(--pink);
  box-shadow: 5px 5px 0 var(--ink);
}

.secondary-button {
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.tiny-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-art {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
}

.sun-shape {
  position: absolute;
  width: min(440px, 80vw);
  aspect-ratio: 1;
  border-radius: 46% 54% 58% 42% / 52% 42% 58% 48%;
  background: var(--yellow);
  border: 3px solid var(--ink);
  transform: rotate(8deg);
}

.gift-box {
  position: relative;
  width: 270px;
  height: 235px;
  margin-top: 76px;
  z-index: 2;
  background: var(--pink);
  border: 4px solid var(--ink);
  border-radius: 7px 7px 18px 18px;
  box-shadow: 11px 12px 0 rgba(37, 32, 31, 0.18);
  transform: rotate(-4deg);
}

.gift-lid {
  position: absolute;
  width: 300px;
  height: 58px;
  top: -45px;
  left: -19px;
  background: #ff5b84;
  border: 4px solid var(--ink);
  border-radius: 8px;
}

.gift-ribbon {
  position: absolute;
  z-index: 2;
  background: var(--mint);
  border: 4px solid var(--ink);
}

.ribbon-vertical {
  width: 62px;
  top: -45px;
  bottom: -4px;
  left: 101px;
}

.ribbon-horizontal {
  height: 45px;
  left: -4px;
  right: -4px;
  top: 76px;
}

.gift-bow {
  position: absolute;
  width: 112px;
  height: 74px;
  top: -116px;
  z-index: 4;
  background: var(--mint);
  border: 4px solid var(--ink);
}

.bow-left {
  left: 33px;
  border-radius: 80% 18% 76% 20%;
  transform: rotate(19deg);
}

.bow-right {
  right: 36px;
  border-radius: 18% 80% 20% 76%;
  transform: rotate(-19deg);
}

.gift-face {
  position: absolute;
  z-index: 4;
  top: 145px;
  left: 102px;
  padding: 4px 10px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-family: sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.floating-tag {
  position: absolute;
  z-index: 5;
  padding: 10px 15px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--ink);
  font-family: "Kanit", sans-serif;
  font-weight: 600;
}

.tag-one {
  left: 2%;
  top: 24%;
  transform: rotate(-8deg);
}

.tag-two {
  right: -1%;
  bottom: 19%;
  transform: rotate(7deg);
}

.spark {
  position: absolute;
  z-index: 4;
  font-size: 2rem;
}

.spark-one { right: 8%; top: 15%; color: var(--pink); }
.spark-two { left: 7%; bottom: 14%; color: var(--pink); }
.spark-three { right: 16%; bottom: 6%; color: var(--ink); font-size: 1.2rem; }

.quiz {
  width: min(860px, 100%);
  min-height: calc(100vh - 140px);
  margin: 0 auto;
  padding: 58px 0 90px;
}

.progress-wrap {
  margin-bottom: 32px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 0.82rem;
  font-weight: 700;
}

.progress-track {
  height: 13px;
  overflow: hidden;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
}

.progress-bar {
  width: 25%;
  height: 100%;
  background: var(--pink);
  border-right: 2px solid var(--ink);
  transition: width 260ms ease;
}

.quiz-card {
  padding: clamp(28px, 6vw, 56px);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.quiz-card h2 {
  max-width: 660px;
  font-size: clamp(2.1rem, 5vw, 3.5rem);
}

.question-help {
  margin: 14px 0 30px;
  color: var(--muted);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.compact-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.option-button {
  min-height: 88px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  background: white;
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border 140ms ease, background 140ms ease, transform 140ms ease;
}

.compact-option {
  min-height: 66px;
  padding: 10px 12px;
  gap: 10px;
}

.option-button:hover,
.option-button.selected {
  border-color: var(--ink);
  background: #fff3b7;
  transform: translateY(-2px);
}

.option-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 1.5rem;
}

.compact-option .option-icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  font-size: 1.05rem;
  border-width: 1.5px;
}

.option-label {
  display: block;
  font-weight: 700;
  font-size: 1.03rem;
}

.compact-option .option-label {
  font-size: 0.9rem;
}

.option-note {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}

.compact-option .option-note {
  font-size: 0.68rem;
  line-height: 1.35;
}

.multi-next {
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: 6px;
}

.slider-panel {
  padding: 8px 0 0;
}

.age-readout {
  width: 142px;
  height: 142px;
  margin: 0 auto 28px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 5px 5px 0 var(--ink);
  font-family: "Kanit", sans-serif;
  line-height: 0.9;
}

.age-readout span {
  display: block;
  font-size: 3.7rem;
}

.age-readout small {
  margin-top: -16px;
  font-size: 1rem;
  font-weight: 700;
}

.age-slider {
  width: 100%;
  accent-color: var(--pink);
  cursor: pointer;
}

.age-marks {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.slider-next {
  width: min(280px, 100%);
  margin: 34px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-actions {
  margin-top: 31px;
  display: flex;
  justify-content: space-between;
}

.results {
  padding: 65px 0 90px;
}

.results-heading {
  max-width: 700px;
  margin: 0 auto 45px;
  text-align: center;
}

.results-heading h2 {
  font-size: clamp(2.7rem, 6vw, 5.3rem);
}

.results-heading > p:last-child {
  color: var(--muted);
  font-size: 1.05rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.gift-card {
  min-width: 0;
  overflow: hidden;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 13px;
  box-shadow: 5px 5px 0 var(--ink);
}

.empty-card {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 13px;
  box-shadow: 5px 5px 0 var(--ink);
}

.empty-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.gift-visual {
  position: relative;
  min-height: 205px;
  display: grid;
  place-items: center;
  border-bottom: 2px solid var(--ink);
  font-size: 5.6rem;
}

.gift-visual.has-image {
  min-height: 0;
  aspect-ratio: 1 / 0.78;
  overflow: hidden;
  background: #f5f1ea;
  font-size: 0;
}

.gift-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}

.gift-number {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.82rem;
}

.gift-details {
  padding: 21px;
}

.gift-details h3 {
  margin: 0 0 8px;
  font-family: "Kanit", sans-serif;
  font-size: 1.25rem;
}

.gift-details p {
  min-height: 48px;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
}

.gift-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
}

.gift-meta.no-price {
  justify-content: flex-end;
}

.shop-button {
  min-height: 44px;
  margin-top: 17px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: white;
  background: var(--pink);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.shop-button:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}

.price-pill {
  padding: 6px 10px;
  background: var(--mint);
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  font-weight: 700;
}

.why-text {
  color: var(--pink-dark);
  font-weight: 700;
}

.result-actions {
  margin: 45px 0;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.tip-card {
  max-width: 780px;
  margin: 0 auto;
  padding: 22px 25px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: #fff3b7;
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.tip-icon {
  font-size: 1.6rem;
}

.tip-card p {
  margin: 4px 0 0;
  color: #5d554e;
  line-height: 1.55;
}

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 38px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 2px solid var(--ink);
  color: var(--muted);
  font-size: 0.82rem;
}

footer p {
  margin: 0;
}

@media (max-width: 850px) {
  .hero {
    padding-top: 52px;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-art {
    min-height: 440px;
  }

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

  .gift-card:last-child {
    width: 100%;
  }
}

@media (max-width: 590px) {
  .site-header,
  main,
  footer {
    width: min(100% - 26px, 1180px);
  }

  .site-header {
    min-height: 70px;
  }

  .brand {
    max-width: 58vw;
  }

  .brand-logo {
    width: min(170px, 58vw);
    border-radius: 14px;
  }

  .hero-logo {
    margin-left: auto;
    margin-right: auto;
    width: min(360px, 100%);
  }

  h1 {
    font-size: clamp(2.75rem, 14vw, 4rem);
  }

  .hero {
    padding: 45px 0 60px;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-art {
    min-height: 365px;
  }

  .sun-shape {
    width: 310px;
  }

  .gift-box {
    width: 198px;
    height: 172px;
  }

  .gift-lid {
    width: 220px;
    height: 47px;
    left: -15px;
    top: -37px;
  }

  .ribbon-vertical {
    width: 48px;
    left: 73px;
    top: -37px;
  }

  .ribbon-horizontal {
    top: 54px;
    height: 37px;
  }

  .gift-bow {
    width: 82px;
    height: 57px;
    top: -91px;
  }

  .bow-left { left: 23px; }
  .bow-right { right: 25px; }
  .gift-face { top: 105px; left: 69px; }
  .tag-one { left: -1%; top: 21%; }
  .tag-two { right: -2%; bottom: 12%; }

  .quiz {
    padding-top: 36px;
  }

  .quiz-card {
    box-shadow: 5px 5px 0 var(--ink);
  }

  .options-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .compact-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .option-button {
    min-height: 78px;
  }

  .compact-option {
    min-height: 60px;
    padding: 9px 10px;
  }

  .gift-card:last-child {
    grid-column: auto;
    width: 100%;
  }

  .gift-visual {
    min-height: 180px;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .result-actions button {
    width: 100%;
  }

  footer {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
