@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

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

:root {
  --bg-gradient: linear-gradient(135deg, #fdf6f0 0%, #fce8e8 40%, #f0e8fd 100%);
  --card-bg: rgba(255, 255, 255, 0.75);
  --border: rgba(0, 0, 0, 0.10);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
  --btn-bg: rgba(255, 255, 255, 0.85);
  --btn-border: rgba(0, 0, 0, 0.15);
  --text-dark: #1a1a1a;
  --text-muted: rgba(80, 80, 80, 0.22);
  --accent: #e85d7a;
  --radius-btn: 18px;
  --radius-card: 24px;
}

html, body {
  min-height: 100%;
  font-family: 'Nunito', sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-dark);
  overflow-x: hidden;
}

/* ── PAGE 1 ───────────────────────────────────────────────── */

.page1-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 32px 16px 48px;
  text-align: center;
}

/* Floating background words */
.floating-words {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.word {
  position: absolute;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(22px, 4.5vw, 52px);
  color: var(--text-muted);
  letter-spacing: 0.12em;
  white-space: nowrap;
  user-select: none;
  will-change: transform, opacity;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.word-sorry    { animation: float1 14s infinite alternate ease-in-out; top: 8%; left: 5%; }
.word-forgive  { animation: float2 17s infinite alternate ease-in-out; top: 8%; right: 6%; }
.word-apology  { animation: float3 15s infinite alternate ease-in-out; top: 33%; left: 2%; }
.word-kshama   { animation: float4 18s infinite alternate ease-in-out; top: 33%; right: 3%; }
.word-maafi    { animation: float5 13s infinite alternate ease-in-out; top: 62%; left: 7%; }
.word-please   { animation: float6 16s infinite alternate ease-in-out; top: 62%; right: 5%; }

@keyframes float1 {
  0%   { transform: translate(0, 0) rotate(-4deg); }
  30%  { transform: translate(12px, 18px) rotate(3deg); }
  60%  { transform: translate(-8px, 10px) rotate(-8deg); }
  100% { transform: translate(6px, -14px) rotate(6deg); }
}
@keyframes float2 {
  0%   { transform: translate(0, 0) rotate(5deg); }
  40%  { transform: translate(-14px, 20px) rotate(-3deg); }
  70%  { transform: translate(10px, -8px) rotate(9deg); }
  100% { transform: translate(-6px, 12px) rotate(-6deg); }
}
@keyframes float3 {
  0%   { transform: translate(0, 0) rotate(2deg); }
  25%  { transform: translate(10px, -15px) rotate(-5deg); }
  55%  { transform: translate(-12px, 8px) rotate(4deg); }
  100% { transform: translate(8px, 18px) rotate(-3deg); }
}
@keyframes float4 {
  0%   { transform: translate(0, 0) rotate(-3deg); }
  35%  { transform: translate(-16px, 12px) rotate(6deg); }
  65%  { transform: translate(8px, -10px) rotate(-7deg); }
  100% { transform: translate(-4px, 16px) rotate(4deg); }
}
@keyframes float5 {
  0%   { transform: translate(0, 0) rotate(6deg); }
  30%  { transform: translate(14px, -18px) rotate(-4deg); }
  60%  { transform: translate(-10px, 12px) rotate(8deg); }
  100% { transform: translate(6px, -8px) rotate(-5deg); }
}
@keyframes float6 {
  0%   { transform: translate(0, 0) rotate(-5deg); }
  45%  { transform: translate(-12px, 16px) rotate(3deg); }
  75%  { transform: translate(10px, -12px) rotate(-8deg); }
  100% { transform: translate(-8px, 6px) rotate(5deg); }
}

/* Main content card */
.main-card {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow), 0 2px 8px rgba(232, 93, 122, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 36px 28px 40px;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: cardEntrance 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.face-image {
  width: 100%;
  max-width: 340px;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
  animation: imagePop 0.5s 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes imagePop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.tagline {
  font-size: clamp(20px, 5vw, 30px);
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.25;
  color: var(--text-dark);
  text-transform: uppercase;
  animation: fadeUp 0.5s 0.45s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.btn-pitai {
  display: inline-block;
  padding: 16px 44px;
  background: var(--btn-bg);
  border: 2px solid var(--btn-border);
  border-radius: var(--radius-btn);
  font-family: 'Nunito', sans-serif;
  font-size: clamp(16px, 3.5vw, 22px);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dark);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  animation: fadeUp 0.5s 0.6s both;
  -webkit-tap-highlight-color: transparent;
}

.btn-pitai:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 28px rgba(232, 93, 122, 0.18);
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(232, 93, 122, 0.35);
}

.btn-pitai:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ── PAGE 2 ───────────────────────────────────────────────── */

.page2-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 56px;
  position: relative;
  gap: 0;
}

.back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--btn-bg);
  border: 1.5px solid var(--btn-border);
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--text-dark);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  cursor: pointer;
}

.back-btn:hover {
  transform: translateX(-3px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.13);
}

.page2-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 500px;
  animation: cardEntrance 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page2-title {
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.3;
}

.pitai-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.btn-mode {
  width: 100%;
  padding: 22px 28px;
  background: var(--btn-bg);
  border: 2px solid var(--btn-border);
  border-radius: var(--radius-btn);
  font-family: 'Nunito', sans-serif;
  font-size: clamp(15px, 3.2vw, 20px);
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dark);
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(0,0,0,0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.btn-mode:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.13);
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(232, 93, 122, 0.30);
}

.btn-mode:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* stagger entrance for buttons */
.btn-mode:nth-child(1) { animation: fadeUp 0.5s 0.1s both; }
.btn-mode:nth-child(2) { animation: fadeUp 0.5s 0.2s both; }
.btn-mode:nth-child(3) { animation: fadeUp 0.5s 0.3s both; }
.btn-mode:nth-child(4) { animation: fadeUp 0.5s 0.4s both; }

/* ── MODAL ────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 10, 30, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: scale(0.88) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.modal-overlay.active .modal-box {
  transform: scale(1) translateY(0);
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dark);
  text-align: center;
}

.modal-gif {
  width: 100%;
  max-width: 420px;
  max-height: 60vh;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.07);
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(232, 93, 122, 0.15);
  transform: scale(1.1);
}

/* ── RESPONSIVE ───────────────────────────────────────────── */

@media (min-width: 640px) {
  .main-card {
    padding: 44px 44px 48px;
  }

  .page2-content {
    gap: 32px;
  }

  .btn-mode {
    padding: 24px 36px;
  }
}

@media (max-width: 400px) {
  .word {
    font-size: 18px;
  }

  .main-card {
    padding: 28px 16px 32px;
    gap: 18px;
  }

  .tagline {
    font-size: 20px;
  }

  .btn-pitai {
    padding: 14px 32px;
    font-size: 16px;
  }

  .back-btn {
    top: 12px;
    left: 12px;
    padding: 8px 14px;
    font-size: 12px;
  }
}
