:root {
  --cream: #fdf6e3;
  --parchment: #f6ecd2;
  --ink: #3a2a1a;
  --red: #8c1c1c;
  --red-deep: #6f1414;
  --green: #2f4a34;
  --gold: #c9a227;
  --gold-soft: #e6cf86;
  --shadow: 0 18px 40px -18px rgba(58, 42, 26, 0.45);
  --radius: 22px;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 15% 12%, rgba(201, 162, 39, 0.10), transparent 42%),
    radial-gradient(circle at 85% 88%, rgba(47, 74, 52, 0.09), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(140, 28, 28, 0.04), transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  line-height: 1.55;
}

.page {
  position: relative;
  width: 100%;
  max-width: 640px;
}

/* ─────────────── Card ─────────────── */
.card {
  position: relative;
  background: var(--cream);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.75rem, 5vw, 3.25rem) clamp(1.25rem, 5vw, 3rem);
  text-align: center;
  overflow: hidden;
}

/* thin double-frame inside the card */
.card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(140, 28, 28, 0.28);
  border-radius: calc(var(--radius) - 10px);
  pointer-events: none;
}

/* ─────────────── Folk-inspired corner motifs ─────────────── */
.corner {
  position: absolute;
  width: 40px;
  height: 40px;
  z-index: 1;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%238c1c1c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 20 V6 a2 2 0 0 1 2-2 H20'/%3E%3Cpath d='M10 20 Q10 10 20 10'/%3E%3C/g%3E%3Cpath d='M20 4 l2.2 4.4 4.8 .7-3.5 3.4 .8 4.8-4.3-2.3-4.3 2.3 .8-4.8-3.5-3.4 4.8-.7z' fill='%23c9a227'/%3E%3Ccircle cx='10.5' cy='20.5' r='2' fill='%232f4a34'/%3E%3C/svg%3E");
}
.corner--tl { top: 10px; left: 10px; }
.corner--tr { top: 10px; right: 10px; transform: scaleX(-1); }
.corner--bl { bottom: 10px; left: 10px; transform: scaleY(-1); }
.corner--br { bottom: 10px; right: 10px; transform: scale(-1, -1); }

/* ─────────────── Eyebrow ─────────────── */
.eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
  color: var(--green);
  letter-spacing: 0.02em;
  margin-bottom: 0.9rem;
}

/* ─────────────── Question ─────────────── */
.question {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--red);
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin-bottom: 1.6rem;
}

.names {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.name { color: var(--red-deep); }

.heart {
  display: inline-block;
  width: clamp(1.4rem, 5vw, 2.2rem);
  height: clamp(1.4rem, 5vw, 2.2rem);
  color: var(--red);
  animation: heartbeat 1.6s ease-in-out infinite;
  transform-origin: center;
}
.heart svg path { fill: currentColor; }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.22); }
  30% { transform: scale(1); }
  45% { transform: scale(1.16); }
}

/* ─────────────── Answer ─────────────── */
.answer-block {
  min-height: 6.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.5rem auto 1.75rem;
}

.answer {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(1.35rem, 5.5vw, 2.05rem);
  color: var(--ink);
  max-width: 22ch;
  text-wrap: balance;
}

.answer.animate-in {
  animation: pop-in 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

@keyframes pop-in {
  0% { opacity: 0; transform: translateY(10px) scale(0.9); }
  60% { opacity: 1; transform: translateY(0) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─────────────── Language badge ─────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(47, 74, 52, 0.08);
  border: 1px solid rgba(47, 74, 52, 0.2);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  opacity: 0.85;
}

/* ─────────────── Button ─────────────── */
.btn {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(1.05rem, 3.5vw, 1.3rem);
  color: var(--cream);
  background: linear-gradient(180deg, var(--red) 0%, var(--red-deep) 100%);
  border: none;
  border-radius: 999px;
  padding: 0.85rem 2.2rem;
  cursor: pointer;
  box-shadow: 0 10px 22px -10px rgba(140, 28, 28, 0.75), inset 0 -2px 0 rgba(0,0,0,0.15);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 16px 28px -12px rgba(140, 28, 28, 0.8), inset 0 -2px 0 rgba(0,0,0,0.15);
}
.btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 6px 14px -8px rgba(140, 28, 28, 0.8), inset 0 3px 6px rgba(0,0,0,0.25);
}
.btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* ─────────────── ASCII art ─────────────── */
.ascii-art {
  margin: 2rem auto 0;
  padding: 1rem;
  background: var(--parchment);
  border: 1px dashed rgba(140, 28, 28, 0.4);
  border-radius: 12px;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.5rem, 1.5vw, 0.72rem);
  line-height: 1.2;
  text-align: left;
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ascii-art {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

/* ─────────────── Footer ─────────────── */
.footer {
  margin-top: 2rem;
  font-size: 0.9rem;
  font-style: italic;
  color: rgba(58, 42, 26, 0.7);
}

/* ─────────────── Celebration layer ─────────────── */
.celebrate {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}
.confetti {
  position: absolute;
  top: -24px;
  will-change: transform, opacity;
  animation: fall linear forwards;
}
@keyframes fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(105vh) rotate(var(--spin, 360deg)); }
}

/* ─────────────── Reduced motion ─────────────── */
@media (prefers-reduced-motion: reduce) {
  .heart { animation: none; }
  .answer.animate-in { animation: none; }
  .btn { transition: none; }
  .confetti { display: none; }
}
