/* Wishes wall, shared by both sites. Uses each site's own tokens
   (--color-*, --font-*, --space-*), which both stylesheets define. */

:root {
  --color-wish-error: oklch(48% 0.18 25);
  --color-gold-1: oklch(70% 0.12 80);
  --color-gold-2: oklch(84% 0.11 90);
  --color-gold-3: oklch(60% 0.11 70);
  --color-rose-wash: oklch(91% 0.045 12);
  --color-string: oklch(62% 0.08 40);
  --color-bulb: oklch(88% 0.12 90);
}

/* a soft rose corner of the page, with tiny gold sparkles and a printed border */
.wishes {
  position: relative;
  width: min(100% - 2 * var(--space-md), 880px);
  margin: var(--space-xl) auto;
  padding: var(--space-2xl) var(--space-lg) var(--space-xl);
  text-align: center;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='%23d9b25c' fill-opacity='.55'%3E%3Cpath d='M18 14l1 3 3 1-3 1-1 3-1-3-3-1 3-1z'/%3E%3Cpath d='M84 40l.7 2 2 .7-2 .7-.7 2-.7-2-2-.7 2-.7z'/%3E%3Cpath d='M48 92l.8 2.4 2.4.8-2.4.8-.8 2.4-.8-2.4-2.4-.8 2.4-.8z'/%3E%3Ccircle cx='102' cy='98' r='1'/%3E%3Ccircle cx='60' cy='22' r='.8'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 120px 120px,
    radial-gradient(120% 80% at 50% 0%, var(--color-paper-2), transparent 70%),
    linear-gradient(180deg, var(--color-paper-2), var(--color-rose-wash));
  border: 1px solid var(--color-blush);
  border-radius: 18px;
  box-shadow: inset 0 0 0 6px var(--color-paper-2), inset 0 0 0 7px var(--color-blush), 0 18px 40px oklch(30% 0.09 16 / 0.08);
}

/* the engagement page already puts it in a card; keep its own frame there */
.card.wishes { margin: 0; box-shadow: inset 0 0 0 6px var(--color-paper-2), inset 0 0 0 7px var(--color-blush), 0 18px 40px oklch(30% 0.09 16 / 0.08); }

.rose-corner {
  position: absolute;
  width: 46px;
  height: 46px;
  pointer-events: none;
}

.rose-corner svg { display: block; width: 100%; height: 100%; }
.rose-corner.tl { top: -10px; left: -10px; }
.rose-corner.tr { top: -10px; right: -10px; transform: scaleX(-1); }
.rose-corner.bl { bottom: -10px; left: -10px; transform: scaleY(-1); }
.rose-corner.br { bottom: -10px; right: -10px; transform: scale(-1, -1); }

.wishes-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-accent);
}

.wish-total {
  margin: var(--space-xs) 0 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink-soft);
}

.wish-total[hidden], .wish-empty[hidden] { display: none; }

.wish-empty {
  margin: var(--space-lg) auto 0;
  max-width: 28ch;
  padding: var(--space-lg);
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-ink-soft);
  border: 1.5px dashed var(--color-blush);
  border-radius: 12px;
}

/* ---- the board: a string with wishes pinned to it ---- */

.wish-wall { position: relative; margin-top: var(--space-lg); }

.wish-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 0;
  text-align: start;
}

/* phones: the string runs down the start side, each wish pinned onto it,
   with a big soft heart behind them */
.wish-wall:not(.as-heart) { padding-inline-start: 26px; }

.wish-wall:not(.as-heart)::before {
  content: "";
  position: absolute;
  inset-block: -8px 0;
  inset-inline-start: 6px;
  width: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 60'%3E%3Cpath d='M5 0c4 10 4 20 0 30s-4 20 0 30' fill='none' stroke='%23a66d54' stroke-width='1.2'/%3E%3C/svg%3E") 0 0 / 10px 60px repeat-y;
  opacity: 0.7;
}

.wish-wall:not(.as-heart)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 28S3 20 3 11.5A6.5 6.5 0 0 1 16 8a6.5 6.5 0 0 1 13 3.5C29 20 16 28 16 28z' fill='%23f2a7b8' fill-opacity='.18'/%3E%3C/svg%3E") center / min(90%, 420px) no-repeat;
}

.wish-string { position: absolute; top: 0; left: 0; display: none; overflow: visible; pointer-events: none; }
.as-heart .wish-string { display: block; }

.wish-string .string-line {
  fill: none;
  stroke: var(--color-string);
  stroke-width: 1.4;
  stroke-linejoin: round;
  opacity: 0.75;
}

.wish-string .bulb {
  fill: var(--color-bulb);
  filter: drop-shadow(0 0 3px oklch(88% 0.14 90 / 0.9));
  animation: twinkle-bulb 2.8s var(--ease-in-out) infinite;
}

@keyframes twinkle-bulb {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* ---- each wish: a little note hanging from a heart pin ---- */

.wish {
  position: relative;
  margin: 0 0 var(--space-lg);
  padding: calc(var(--space-md) + 6px) var(--space-md) var(--space-sm);
  background: var(--color-paper-2);
  border-radius: 6px;
  box-shadow: 0 1px 2px oklch(30% 0.09 16 / 0.1), 0 8px 18px oklch(30% 0.09 16 / 0.08);
  rotate: -1.2deg;
  transform-origin: 50% 0;
  cursor: pointer;
}

.wish:nth-child(even) { rotate: 1.4deg; }
.wish:nth-child(3n) { rotate: -0.5deg; }

/* the pin: one to five tiny hearts, more for the earliest wishes */
.wish-pin {
  position: absolute;
  top: -9px;
  inset-inline-start: 50%;
  translate: 50% 0;
  padding: 1px 6px;
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 1px;
  white-space: nowrap;
  color: var(--color-accent);
  background: var(--color-paper-2);
  border: 1px solid var(--color-blush);
  border-radius: 999px;
  box-shadow: 0 1px 2px oklch(30% 0.09 16 / 0.15);
}

[dir="ltr"] .wish-pin { translate: -50% 0; }

/* on phones the pin sits on the side string */
.wish-wall:not(.as-heart) .wish-pin {
  top: 14px;
  inset-inline-start: -26px;
  translate: 0 0;
}

.wish-text {
  margin: 0;
  color: var(--color-ink);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* names in gold ink with a slow shimmer */
.wish-by {
  margin: var(--space-sm) 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
  color: var(--color-gold-3);
  background: linear-gradient(100deg, var(--color-gold-3) 20%, var(--color-gold-2) 40%, var(--color-gold-1) 60%, var(--color-gold-3) 80%) 0 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gold-shimmer 6s linear infinite;
}

@keyframes gold-shimmer {
  to { background-position: -250% 0; }
}

/* wide screens: the wishes hang around the heart-shaped string */
.as-heart .wish.on-heart {
  width: 176px;
  margin: 0;
  translate: -50% 0;
  font-size: 0.875rem;
  z-index: 1;
}

.as-heart .wish.on-heart .wish-text {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.as-heart .wish.on-heart.open { z-index: 3; width: 240px; }
.as-heart .wish.on-heart.open .wish-text { -webkit-line-clamp: unset; }
.as-heart .wish.on-heart .wish-by { font-size: 1.05rem; }

/* wishes after the first ten hang on a gentle row below the heart */
.as-heart .wish-list { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-lg) var(--space-md); }
.as-heart .wish:not(.on-heart) { width: 220px; margin: 0; }

/* ---- writing one: letter paper with a faint heart watermark ---- */

.wishes-lead {
  margin: var(--space-xl) 0 0;
  font-size: var(--text-sm);
  color: var(--color-ink-soft);
}

.wish-form {
  display: grid;
  gap: var(--space-sm);
  width: min(100%, 440px);
  margin: var(--space-md) auto 0;
  text-align: start;
}

.wish-form input,
.wish-form textarea {
  width: 100%;
  min-width: 0;
  padding: 0.6rem 0.8rem;
  font: 500 1rem/28px var(--font-body);
  color: var(--color-ink);
  background-color: var(--color-paper-2);
  border: 1.5px solid var(--color-blush);
  border-radius: 10px;
}

.wish-form textarea {
  min-height: 9.5rem;
  resize: vertical;
  padding-top: 0.55rem;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 28S3 20 3 11.5A6.5 6.5 0 0 1 16 8a6.5 6.5 0 0 1 13 3.5C29 20 16 28 16 28z' fill='%23e7a3ad' fill-opacity='.16'/%3E%3C/svg%3E") center / 110px no-repeat,
    repeating-linear-gradient(180deg, transparent 0 27px, oklch(85% 0.05 10 / 0.7) 27px 28px) 0 0.55rem / 100% 28px,
    var(--color-paper-2);
  background-attachment: local;
}

.wish-form input::placeholder, .wish-form textarea::placeholder { color: var(--color-ink-soft); opacity: 0.6; }
.wish-form input:focus-visible, .wish-form textarea:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; border-color: var(--color-accent); }
.wish-form [aria-invalid="true"] { border-color: var(--color-wish-error); }

.wish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.wish-count {
  font-size: 0.8125rem;
  color: var(--color-ink-soft);
  direction: ltr;
}

/* the send button as a wax seal */
.wish-form .seal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.6rem 1.4rem;
  font: 700 1rem/1.2 var(--font-body);
  white-space: nowrap;
  color: oklch(97% 0.02 20);
  background: radial-gradient(circle at 35% 30%, oklch(60% 0.19 22), oklch(42% 0.17 18) 70%);
  border: 0;
  border-radius: 999px 999px 999px 999px / 60% 60% 60% 60%;
  box-shadow: inset 0 0 0 3px oklch(48% 0.17 18), inset 0 2px 4px oklch(100% 0 0 / 0.25), 0 3px 8px oklch(30% 0.09 16 / 0.3);
  transition: transform 120ms var(--ease-out), filter 160ms var(--ease-out);
}

.wish-form .seal:hover { filter: brightness(1.08); }
.wish-form .seal:active { transform: translateY(1px) scale(0.98); }
.wish-form .seal:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 3px; }
.wish-form .seal:disabled { filter: grayscale(0.4); opacity: 0.6; }
.wish-form .seal[aria-busy="true"] { opacity: 0.75; }
.seal-heart { font-size: 0.9em; }

.wish-msg {
  min-height: 1.6em;
  margin: var(--space-sm) 0 0;
  font-size: var(--text-sm);
  color: var(--color-ink-soft);
}

.wish-msg.error { color: var(--color-wish-error); }

/* the envelope and hearts that fly off after sending */
.fly-envelope {
  position: fixed;
  z-index: 50;
  width: 60px;
  height: 42px;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px oklch(30% 0.09 16 / 0.25));
}

.fly-envelope svg { display: block; width: 100%; height: 100%; }

.fly-heart {
  position: fixed;
  z-index: 49;
  font-size: 14px;
  color: var(--color-accent);
  pointer-events: none;
}

@media (max-width: 480px) {
  .wishes { padding-inline: var(--space-md); }
  .rose-corner { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .wish-by, .wish-string .bulb { animation: none; }
  .fly-envelope, .fly-heart { display: none; }
}
