/* ─────────────────────────────────────────────────────────────
   for Mila — palette notes
   background  #f7efe5   warm cream, old letter paper
   paper       #fffbf5   slightly brighter cream
   ink         #3a1f26   deep aubergine, main text
   wine        #8b3a4b   accent — dusty burgundy
   blush       #d4a5a8   soft pink for highlights
   gold        #b08b3a   muted antique gold for small details
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #f7efe5;
  --paper: #fffbf5;
  --ink: #3a1f26;
  --ink-soft: #5c3f46;
  --wine: #8b3a4b;
  --blush: #d4a5a8;
  --gold: #b08b3a;
  --line: rgba(58, 31, 38, 0.12);

  --font-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-body: "EB Garamond", Georgia, serif;

  --radius: 2px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper-like background with very subtle grain and a soft vignette */
body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 700px at 50% -10%, rgba(212, 165, 168, 0.25), transparent 60%),
    radial-gradient(1000px 700px at 50% 110%, rgba(176, 139, 58, 0.10), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.23  0 0 0 0 0.12  0 0 0 0 0.15  0 0 0 0.035 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
}

/* ─── Stage ───────────────────────────────────────────────── */
.stage {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5.5rem) 1.5rem 4rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* ─── Ornaments ───────────────────────────────────────────── */
.ornament {
  width: 120px;
  color: var(--gold);
  opacity: 0.7;
  display: block;
  flex: 0 0 auto;
}
.ornament.top { margin-bottom: 0.5rem; }
.ornament.bottom { margin-top: 1.25rem; }
.ornament svg { width: 100%; height: auto; display: block; }

/* ─── Intro ───────────────────────────────────────────────── */
.intro {
  text-align: center;
  margin-bottom: 1.25rem;
}
.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: var(--wine);
  margin: 0 0 0.75rem;
  opacity: 0.85;
}
.title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.1rem, 5.5vw, 3rem);
  line-height: 1.05;
  color: var(--ink);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1em;
}
.title .line-1 { font-style: italic; color: var(--ink-soft); }
.title .line-2 { font-weight: 500; }

/* ─── Card ────────────────────────────────────────────────── */
.card {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1.5rem, 4vw, 2.75rem);
  position: relative;
  box-shadow:
    0 1px 0 rgba(58, 31, 38, 0.03),
    0 20px 60px -30px rgba(58, 31, 38, 0.25),
    0 4px 18px -8px rgba(176, 139, 58, 0.08);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px solid var(--gold);
  opacity: 0.35;
}
.card::before {
  top: 10px; left: 10px;
  border-right: none; border-bottom: none;
}
.card::after {
  bottom: 10px; right: 10px;
  border-left: none; border-top: none;
}

.card.is-fading { opacity: 0; transform: translateY(6px); }

/* ─── Tag (category chip) ─────────────────────────────────── */
.tag {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--wine);
  text-transform: lowercase;
  padding: 0 0 0.1em;
  border-bottom: 1px solid var(--blush);
  margin-bottom: 1.5rem;
}

/* ─── Photo (optional) ────────────────────────────────────── */
.photo {
  margin: 0 0 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: rgba(58, 31, 38, 0.04);
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(0.06) saturate(0.95);
}

/* ─── Message ─────────────────────────────────────────────── */
.message {
  margin: 0;
  padding: 0;
  border: none;
  quotes: none;
}
.message p {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.35rem, 3.2vw, 1.7rem);
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
  text-wrap: pretty;
}
.message p + p {
  margin-top: 0.9rem;
}
.translation {
  font-family: var(--font-body) !important;
  font-style: italic !important;
  font-size: 0.95rem !important;
  color: var(--ink-soft) !important;
  line-height: 1.55 !important;
  padding-top: 0.35rem !important;
  border-top: 1px dotted var(--line);
}

/* When a Bulgarian (or other lang) quote is primary, keep the
   original in the display serif; translation is quieter below. */
.message[data-lang="bg"] p:first-child,
.message[data-lang="pl"] p:first-child {
  font-style: italic;
  color: var(--wine);
}

/* ─── Attribution ─────────────────────────────────────────── */
.attribution {
  margin-top: 1.5rem;
  text-align: right;
}
.attribution span {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-soft);
  opacity: 0.75;
}
.attribution span:empty { display: none; }

/* ─── Actions ─────────────────────────────────────────────── */
.actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: var(--wine);
  border: 1px solid var(--wine);
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  box-shadow: 0 2px 8px -3px rgba(139, 58, 75, 0.35);
}
.btn:hover {
  transform: translateY(-1px);
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 6px 18px -6px rgba(58, 31, 38, 0.4);
}
.btn:active {
  transform: translateY(0);
}
.btn.ghost {
  color: var(--wine);
  background: transparent;
  border-color: var(--blush);
  box-shadow: none;
}
.btn.ghost:hover {
  color: var(--paper);
  background: var(--wine);
  border-color: var(--wine);
}

/* Copy-confirm micro state */
.btn.copied {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--paper);
}

/* ─── Signoff ─────────────────────────────────────────────── */
.signoff {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--wine);
  letter-spacing: 0.2em;
  margin: 2rem 0 0;
  opacity: 0.8;
}

/* ─── Small entrance ──────────────────────────────────────── */
.intro, .card, .actions, .signoff, .ornament {
  animation: rise 0.9s var(--ease) both;
}
.intro { animation-delay: 0.05s; }
.card { animation-delay: 0.22s; }
.actions { animation-delay: 0.38s; }
.signoff { animation-delay: 0.55s; }

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

@media (prefers-reduced-motion: reduce) {
  .intro, .card, .actions, .signoff, .ornament { animation: none; }
  .card.is-fading { opacity: 1; transform: none; }
}

/* ─── Mobile nudges ───────────────────────────────────────── */
@media (max-width: 480px) {
  .stage { padding-top: 2.5rem; }
  .card { padding: 1.75rem 1.5rem; }
  .card::before, .card::after { width: 20px; height: 20px; }
  .message p { font-size: 1.22rem; }
}
