@import url("https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  font-family: "Hind Siliguri", "Noto Sans Bengali", sans-serif;
  color: #292044;
  background: #fff36a;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, #ff91c8 0 8%, transparent 8.2%),
    radial-gradient(circle at 88% 78%, #a6f1d2 0 11%, transparent 11.2%),
    radial-gradient(circle at 84% 12%, #ff9b70 0 5%, transparent 5.2%),
    #fff36a;
}

button,
input {
  font: inherit;
}

.page-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 32px 18px 64px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.page-shell::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(circle at 14% 18%, #ffd6e5 0 9%, transparent 9.2%),
    radial-gradient(circle at 88% 78%, #ffe2ed 0 12%, transparent 12.2%),
    linear-gradient(135deg, #fff4f7, #f9dce8);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 1100ms ease;
}

.gate-card,
.welcome-card {
  z-index: 1;
  width: min(100%, 460px);
  padding: 48px 46px 35px;
  position: relative;
  border: 3px solid #292044;
  border-radius: 30px 25px 32px 24px;
  background: #fffdf5;
  box-shadow: 9px 10px 0 #292044;
  text-align: center;
  animation: arrive 520ms cubic-bezier(.2, 1.4, .5, 1) both;
}

.gate-card::before,
.welcome-card::before {
  content: "HA!";
  position: absolute;
  top: -23px;
  right: 21px;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 3px solid #292044;
  border-radius: 50%;
  background: #ff91c8;
  color: #292044;
  font-size: 16px;
  font-weight: 800;
  transform: rotate(12deg);
}

.sparkle {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 22px;
  place-items: center;
  border: 2px solid #292044;
  border-radius: 18px 15px 19px 14px;
  background: #a6f1d2;
  color: #292044;
  font-size: 27px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8a3f8f;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

h1 {
  margin: 0;
  color: #292044;
  font-size: clamp(34px, 8vw, 43px);
  font-weight: 800;
  line-height: 1.35;
}

h1 span {
  display: inline-block;
  color: #f04491;
  transform: rotate(12deg);
}

.intro {
  margin: 15px 0 28px;
  color: #655970;
  font-size: 15px;
  line-height: 1.9;
}

form {
  text-align: left;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #514463;
  font-size: 14px;
  font-weight: 600;
}

.input-wrap {
  position: relative;
}

input {
  width: 100%;
  height: 54px;
  padding: 0 44px 0 16px;
  border: 2px solid #292044;
  border-radius: 13px;
  outline: none;
  background: white;
  color: #292044;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input::placeholder {
  color: #9488a0;
}

input:focus {
  border-color: #8a3f8f;
  box-shadow: 0 0 0 4px rgb(138 63 143 / 16%);
  transform: rotate(-1deg);
}

.input-heart {
  position: absolute;
  top: 50%;
  right: 16px;
  color: #f04491;
  font-size: 21px;
  transform: translateY(-54%);
}

.error-message {
  min-height: 24px;
  margin: 5px 0 4px;
  color: #b52d56;
  font-size: 13px;
}

button[type="submit"],
.next-button {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  border: 0;
  border: 2px solid #292044;
  border-radius: 13px 16px 12px 16px;
  background: #ff91c8;
  box-shadow: 4px 5px 0 #292044;
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

button[type="submit"]:hover,
.next-button:hover {
  box-shadow: 2px 3px 0 #292044;
  transform: translate(2px, 2px) rotate(-1deg);
}

button:focus-visible,
.back-button:focus-visible {
  outline: 3px solid #8a3f8f;
  outline-offset: 3px;
}

button[type="submit"] span {
  margin-left: 5px;
  font-size: 20px;
  vertical-align: -1px;
}

.footer-note {
  margin: 27px 0 0;
  color: #8f8299;
  font-size: 13px;
}

.welcome-card {
  padding-top: 42px;
}

.welcome-flower {
  display: inline-grid;
  width: 70px;
  height: 70px;
  margin-bottom: 15px;
  place-items: center;
  border: 2px solid #292044;
  border-radius: 50%;
  background: #fff36a;
  font-size: 39px;
  transform: rotate(-8deg);
}

.message {
  margin: 25px 0 19px;
  padding: 20px 19px;
  border: 2px dashed #8a3f8f;
  border-radius: 18px 13px 20px 14px;
  background: #fff0f8;
  color: #554766;
  font-size: 15px;
  line-height: 1.9;
  text-align: left;
}

.message p {
  margin: 0;
}

.message p + p {
  margin-top: 12px;
}

.signature {
  color: #766882;
  font-size: 14px;
  line-height: 1.8;
  text-align: right;
}

.signature strong {
  color: #8a3f8f;
  font-weight: 700;
}

.back-button {
  display: block;
  margin-right: auto;
  margin-left: auto;
  margin-top: 22px;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #76557f;
  cursor: pointer;
  font-size: 13px;
}

.back-button:hover {
  background: #fff0f8;
}

.bottom-decoration {
  z-index: 1;
  position: absolute;
  bottom: 25px;
  color: #8a3f8f;
  font-size: 16px;
  letter-spacing: 0.14em;
}

.romantic-mode::before {
  opacity: 1;
}

.romantic-card {
  overflow: hidden;
}

.sister-photo {
  display: block;
  width: min(100%, 280px);
  max-height: 340px;
  margin: 22px auto;
  border: 5px solid #fff;
  border-radius: 48% 48% 22px 22px;
  box-shadow: 0 8px 24px rgb(166 74 111 / 20%);
  object-fit: cover;
  object-position: center 28%;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.romantic-mode .sister-photo {
  animation: photo-reveal 850ms 260ms cubic-bezier(.2, 1.25, .45, 1) both;
}

.romantic-mode .sister-photo:hover {
  box-shadow: 0 13px 30px rgb(166 74 111 / 28%);
  transform: translateY(-5px) scale(1.015);
}

.romantic-mode .romantic-card {
  border: 2px solid #e8a9be;
  border-radius: 34px;
  background: rgb(255 253 253 / 94%);
  box-shadow: 0 22px 70px rgb(166 74 111 / 20%);
  animation: romantic-arrive 1100ms cubic-bezier(.18, .85, .3, 1) both;
  transform-origin: center 65%;
  transition: border 800ms ease, border-radius 800ms ease, box-shadow 800ms ease;
}

.romantic-mode .romantic-card::before {
  border-color: #e8a9be;
  background: #ffe6ee;
  color: #c85f82;
  content: "♡";
  animation: heart-stamp 720ms 420ms cubic-bezier(.2, 1.5, .5, 1) both;
  transition: background 800ms ease, color 800ms ease, border-color 800ms ease;
}

.romantic-mode .romantic-card .eyebrow {
  color: #b85f7f;
}

.romantic-mode .romantic-card h1 {
  color: #6d3e50;
}

.romantic-mode .romantic-card h1 span {
  color: #df789b;
}

.romantic-mode .romantic-card .welcome-flower {
  border-color: #e8a9be;
  background: #fff0f4;
  transform: rotate(0);
  transition: background 800ms ease, border-color 800ms ease, transform 800ms ease;
}

.romantic-mode .romantic-card .message {
  border: 1px solid #f2d2de;
  background: #fff5f8;
  color: #765766;
  transition: background 800ms ease, border-color 800ms ease, color 800ms ease;
}

.romantic-mode .romantic-card .next-button {
  border-color: #c9718e;
  background: #d985a0;
  box-shadow: 4px 5px 0 #a85574;
  transition: background 800ms ease, border-color 800ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.romantic-mode .romantic-card .back-button {
  color: #a7607a;
}

.romantic-hearts {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.romantic-hearts span {
  position: absolute;
  bottom: -30px;
  color: #e795af;
  font-size: 24px;
  opacity: 0;
  animation: float-heart 5s ease-in infinite;
}

.romantic-hearts span:nth-child(1) {
  left: 12%;
}

.romantic-hearts span:nth-child(2) {
  left: 78%;
  animation-delay: 1.4s;
}

.romantic-hearts span:nth-child(3) {
  left: 48%;
  animation-delay: 2.8s;
}

[hidden] {
  display: none !important;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes romantic-arrive {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(34px) scale(.84) rotateX(12deg);
    box-shadow: 0 0 0 rgb(166 74 111 / 0%);
  }
  70% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-5px) scale(1.015) rotateX(0);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1) rotateX(0);
    box-shadow: 0 22px 70px rgb(166 74 111 / 20%);
  }
}

@keyframes heart-stamp {
  from {
    opacity: 0;
    transform: scale(0) rotate(-30deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(12deg);
  }
}

@keyframes float-heart {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(-15deg) scale(.75);
  }
  20% {
    opacity: .7;
  }
  100% {
    opacity: 0;
    transform: translateY(-430px) rotate(18deg) scale(1.15);
  }
}

@keyframes photo-reveal {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  .page-shell {
    align-content: start;
    padding:
      max(42px, env(safe-area-inset-top) + 24px)
      max(16px, env(safe-area-inset-right))
      max(28px, env(safe-area-inset-bottom) + 16px)
      max(16px, env(safe-area-inset-left));
  }

  .gate-card,
  .welcome-card {
    width: 100%;
    padding-top: 39px;
    padding-right: 25px;
    padding-left: 25px;
  }

  h1 {
    font-size: clamp(28px, 9vw, 36px);
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .intro {
    font-size: 14px;
  }

  .message {
    padding: 17px 15px;
    font-size: 14px;
  }

  .sister-photo {
    width: min(100%, 240px);
    max-height: min(60svh, 320px);
    margin: 18px auto;
  }

  .bottom-decoration {
    position: static;
    margin-top: 22px;
    padding-bottom: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
