:root {
  --cream: #fff8ec;
  --paper: #fffdf8;
  --ink: #382820;
  --muted: #79665c;
  --orange: #ee704a;
  --orange-dark: #d75333;
  --orange-pale: #ffe2c9;
  --pink: #f7b6aa;
  --yellow: #ffd66b;
  --green: #1fad67;
  --line: rgba(94, 59, 40, 0.13);
  --shadow: 0 24px 70px rgba(121, 68, 35, 0.14);
  --radius-lg: 36px;
  --radius-md: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 9%, rgba(255, 214, 107, 0.25), transparent 22rem),
    radial-gradient(circle at 90% 20%, rgba(247, 182, 170, 0.25), transparent 24rem),
    var(--cream);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(238, 112, 74, 0.45);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 15px;
  border-radius: 12px;
  color: white;
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(238, 112, 74, 0.25);
  border-radius: 50%;
  color: var(--orange);
  background: white;
  font-size: 21px;
}

.family-only {
  padding: 9px 14px;
  border: 1px solid rgba(238, 112, 74, 0.2);
  border-radius: 99px;
  color: var(--orange-dark);
  background: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(380px, 0.97fr);
  gap: clamp(28px, 6vw, 92px);
  align-items: center;
  min-height: 710px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 55px 0 100px;
}

.eyebrow {
  margin: 0 0 17px;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.eyebrow span {
  margin-right: 6px;
  color: var(--orange);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 5.3vw, 76px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.055em;
}

h1 span {
  position: relative;
  color: var(--orange);
}

h1 span::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 7px;
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 10c55-7 142-8 234-5' fill='none' stroke='%23f4ad8d' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
  content: "";
}

.intro {
  max-width: 600px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  margin-top: 36px;
}

.primary-button,
.secondary-button,
.thanks-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  gap: 12px;
  padding: 16px 22px;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, #f3845c, #e6603d);
  box-shadow: 0 12px 28px rgba(222, 85, 46, 0.27);
  font-weight: 800;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.primary-button:hover {
  box-shadow: 0 16px 32px rgba(222, 85, 46, 0.34);
  transform: translateY(-2px);
}

.primary-button .arrow {
  margin-left: 9px;
  font-size: 20px;
}

.text-link {
  padding: 8px 0;
  border-bottom: 1px solid currentColor;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 35px;
  color: var(--muted);
  font-size: 12px;
}

.trust-row span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.trust-row i {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #78a78b;
  font-size: 10px;
  font-style: normal;
}

.hero-visual {
  position: relative;
  min-height: 570px;
}

.hero-blob {
  position: absolute;
  inset: 3% 0 5% 3%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(232, 113, 77, 0.12);
  border-radius: 46% 54% 49% 51% / 43% 40% 60% 57%;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.95) 0 7%, transparent 7.5%),
    radial-gradient(circle at 74% 28%, rgba(255, 255, 255, 0.8) 0 3.6%, transparent 4%),
    linear-gradient(150deg, #ffe6ba 0%, #f9c4af 48%, #f3ab9e 100%);
  box-shadow: var(--shadow);
}

.cartoon-hero {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: drop-shadow(0 18px 25px rgba(111, 57, 35, 0.12));
}

.cartoon-hero.is-missing {
  display: none;
}

.hero-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  color: #9c523e;
}

.cartoon-hero.is-missing + .hero-fallback {
  display: flex;
}

.hero-fallback span {
  margin-bottom: 12px;
  font-size: 92px;
}

.hero-fallback strong {
  font-size: 18px;
}

.doodle {
  position: absolute;
  z-index: 3;
  color: var(--orange);
  font-family: "Ma Shan Zheng", cursive;
}

.doodle-heart {
  top: 1%;
  right: 5%;
  font-size: 62px;
  transform: rotate(14deg);
}

.doodle-spark {
  bottom: 7%;
  left: -3%;
  font-size: 37px;
}

.floating-note {
  position: absolute;
  z-index: 4;
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 13px 17px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.89);
  box-shadow: 0 12px 30px rgba(93, 56, 36, 0.14);
  backdrop-filter: blur(12px);
}

.floating-note > span {
  font-size: 24px;
}

.floating-note p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.floating-note b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 12px;
}

.note-left {
  bottom: 3%;
  left: -8%;
}

.note-right {
  top: 22%;
  right: -6%;
}

.letter-section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 105px 0 120px;
}

.section-heading {
  margin-bottom: 44px;
  text-align: center;
}

.section-heading h2,
.thanks-section h2 {
  margin: 0;
  font-size: clamp(29px, 4vw, 46px);
  line-height: 1.3;
}

.letter-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 0.82fr;
  gap: clamp(35px, 7vw, 100px);
  padding: clamp(32px, 6vw, 76px);
  border: 1px solid rgba(111, 73, 52, 0.09);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(rgba(120, 86, 62, 0.045) 1px, transparent 1px) 0 67px / 100% 34px,
    var(--paper);
  box-shadow: var(--shadow);
}

.letter-card::before {
  position: absolute;
  top: -13px;
  left: 10%;
  width: 90px;
  height: 30px;
  background: rgba(255, 212, 136, 0.62);
  content: "";
  transform: rotate(-3deg);
}

.letter-copy {
  color: #6f5b50;
  font-family: "Ma Shan Zheng", "Noto Sans SC", cursive;
  font-size: 20px;
  line-height: 1.85;
}

.letter-copy p {
  margin: 0 0 20px;
}

.letter-copy p:first-child {
  color: var(--ink);
  font-size: 25px;
}

.letter-copy .signature {
  margin: 22px 4px 0 0;
  color: var(--orange-dark);
  font-size: 22px;
  text-align: right;
}

.promise-grid {
  display: grid;
  gap: 14px;
  align-content: center;
}

.promise-grid article {
  display: grid;
  grid-template-columns: 46px 1fr;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 248, 236, 0.6);
}

.promise-grid article > span {
  grid-row: 1 / 3;
  font-size: 27px;
}

.promise-grid h3 {
  margin: 0 0 3px;
  font-size: 15px;
}

.promise-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.pay-section {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: clamp(45px, 9vw, 125px);
  align-items: center;
  width: min(1270px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(55px, 8vw, 105px);
  border-radius: 48px;
  color: white;
  background:
    radial-gradient(circle at 12% 15%, rgba(255, 224, 164, 0.26), transparent 24%),
    radial-gradient(circle at 88% 83%, rgba(255, 161, 140, 0.25), transparent 26%),
    #dd6949;
  box-shadow: 0 30px 80px rgba(141, 58, 34, 0.23);
}

.pay-copy .eyebrow {
  color: white;
  opacity: 0.78;
}

.pay-copy h2 {
  margin: 0;
  font-size: clamp(37px, 5vw, 61px);
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.pay-copy > p:not(.eyebrow, .amount-disclaimer) {
  max-width: 500px;
  margin: 25px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  line-height: 1.9;
}

.amount-picker {
  margin: 38px 0 0;
  padding: 0;
  border: 0;
}

.amount-picker legend {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.amount-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.amount-options button {
  padding: 11px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 13px;
  color: white;
  background: rgba(255, 255, 255, 0.09);
  cursor: pointer;
  font-weight: 800;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.amount-options button:hover,
.amount-options button.is-selected {
  border-color: white;
  color: var(--orange-dark);
  background: white;
  transform: translateY(-2px);
}

.amount-options small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 500;
  opacity: 0.72;
}

.amount-disclaimer {
  max-width: 500px;
  margin: 11px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  line-height: 1.6;
}

.qr-card {
  width: min(100%, 405px);
  justify-self: end;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 30px;
  color: var(--ink);
  background: white;
  box-shadow: 0 25px 50px rgba(83, 37, 25, 0.2);
}

.qr-label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.qr-label span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 173, 103, 0.1);
}

.qr-preview {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #f8f8f8;
  cursor: zoom-in;
}

.qr-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 0.735;
  object-fit: contain;
}

.zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 99px;
  color: white;
  background: rgba(41, 32, 28, 0.76);
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 180ms ease;
}

.qr-preview:hover .zoom-hint,
.qr-preview:focus-visible .zoom-hint {
  opacity: 1;
}

.selected-wish {
  margin: 13px 0;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.qr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.secondary-button {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  font-size: 11px;
  font-weight: 700;
}

.secondary-button:hover {
  border-color: rgba(238, 112, 74, 0.45);
  background: var(--cream);
}

.copy-note {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 9px;
  padding: 10px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.thanks-section {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 30px;
  align-items: center;
  width: min(1050px, calc(100% - 40px));
  margin: 0 auto;
  padding: 120px 0;
}

.thanks-section .eyebrow {
  margin-bottom: 10px;
}

.thanks-section p:last-child {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.thanks-icon {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange-pale);
  box-shadow: inset 0 0 0 12px rgba(255, 255, 255, 0.35);
  font-size: 42px;
}

.thanks-button {
  gap: 7px;
  padding: 14px 18px;
  border: 1px solid rgba(238, 112, 74, 0.28);
  border-radius: 14px;
  color: var(--orange-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.thanks-button:hover,
.thanks-button.is-done {
  color: white;
  background: var(--orange);
}

footer {
  padding: 0 20px 45px;
  color: #a18d82;
  font-size: 11px;
  text-align: center;
}

footer p {
  margin: 4px;
}

.footer-heart {
  color: var(--orange);
  font-size: 20px;
}

.pay-dialog {
  width: min(92vw, 480px);
  max-height: 92vh;
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 30px 100px rgba(45, 27, 19, 0.3);
}

.pay-dialog::backdrop {
  background: rgba(54, 37, 29, 0.68);
  backdrop-filter: blur(5px);
}

.dialog-inner {
  position: relative;
  padding: 34px;
  text-align: center;
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 14px;
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: white;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.dialog-inner .eyebrow {
  margin-top: 5px;
}

.dialog-inner h2 {
  margin: 0;
  font-size: 28px;
}

.dialog-subtitle {
  margin: 10px 0 19px;
  color: var(--muted);
  font-size: 12px;
}

.dialog-inner > img {
  display: block;
  width: min(100%, 340px);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.dialog-wish {
  margin: 13px 0;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 800;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.dialog-actions .primary-button,
.dialog-actions .secondary-button {
  min-height: 46px;
  margin: 0;
  font-size: 12px;
}

.dialog-disclaimer {
  margin: 14px 0 0;
  color: #9f8f87;
  font-size: 9px;
}

.toast {
  position: fixed;
  z-index: 1001;
  bottom: 24px;
  left: 50%;
  padding: 12px 18px;
  border-radius: 99px;
  color: white;
  background: rgba(50, 37, 30, 0.92);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: 200ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.confetti-layer {
  position: fixed;
  z-index: 1002;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 15px;
  animation: confetti-fall var(--duration) ease-in forwards;
  transform: rotate(var(--rotate));
}

@keyframes confetti-fall {
  to {
    opacity: 0.2;
    transform: translate3d(var(--drift), 105vh, 0) rotate(720deg);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 30px;
  }

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

  .intro {
    margin-right: auto;
    margin-left: auto;
  }

  .hero-actions,
  .trust-row {
    justify-content: center;
  }

  .hero-visual {
    width: min(100%, 570px);
    min-height: 560px;
    margin: 5px auto 0;
  }

  .letter-card,
  .pay-section {
    grid-template-columns: 1fr;
  }

  .qr-card {
    width: min(100%, 430px);
    justify-self: center;
  }

  .thanks-section {
    grid-template-columns: auto 1fr;
  }

  .thanks-button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 600px) {
  .topbar {
    width: calc(100% - 32px);
    padding: 18px 0;
  }

  .family-only {
    padding: 7px 10px;
    font-size: 9px;
  }

  .hero {
    width: calc(100% - 32px);
    gap: 30px;
    padding: 47px 0 68px;
  }

  h1 {
    font-size: clamp(40px, 12vw, 56px);
  }

  .intro {
    font-size: 14px;
    line-height: 1.9;
  }

  .hero-actions {
    flex-direction: column;
    gap: 13px;
  }

  .primary-button {
    width: 100%;
  }

  .trust-row {
    gap: 10px 15px;
  }

  .hero-visual {
    min-height: 420px;
  }

  .hero-blob {
    inset: 3% 2% 4%;
  }

  .note-left {
    bottom: 0;
    left: 0;
  }

  .note-right {
    top: 16%;
    right: -3%;
  }

  .doodle-heart {
    font-size: 45px;
  }

  .letter-section {
    width: calc(100% - 32px);
    padding: 75px 0 80px;
  }

  .section-heading {
    margin-bottom: 30px;
  }

  .letter-card {
    gap: 30px;
    padding: 37px 24px 26px;
    border-radius: 27px;
  }

  .letter-copy {
    font-size: 18px;
  }

  .pay-section {
    width: calc(100% - 20px);
    gap: 37px;
    padding: 48px 18px 18px;
    border-radius: 31px;
  }

  .pay-copy {
    padding: 0 7px;
  }

  .pay-copy h2 {
    font-size: 40px;
  }

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

  .qr-card {
    padding: 15px;
    border-radius: 24px;
  }

  .thanks-section {
    grid-template-columns: 1fr;
    gap: 19px;
    width: calc(100% - 40px);
    padding: 85px 0;
    text-align: center;
  }

  .thanks-icon {
    width: 75px;
    height: 75px;
    justify-self: center;
    font-size: 34px;
  }

  .thanks-button {
    grid-column: auto;
    justify-self: center;
  }

  .dialog-inner {
    padding: 34px 19px 24px;
  }

  .dialog-inner h2 {
    font-size: 24px;
  }
}

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