/* EB Garamond, OFL (fonts/OFL-eb-garamond.txt) — the invitations' own body face. */
@font-face {
  font-family: "Maker Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/eb-garamond-latin-var.woff2") format("woff2");
}

@font-face {
  font-family: "Maker Garamond";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/eb-garamond-latin-italic-var.woff2") format("woff2");
}

:root {
  --ivory: #fffbf3;
  --paper: #f6f0e4;
  --rose: #c4476e;
  --rose-deep: #a8365a;
  --olive: #6c7034;
  --leaf: #2d4a1f;
  --ink: #2b2a24;
  --muted: #6d6a5f;
  --line: rgba(108, 112, 52, 0.32);
  --error: #b3261e;
  --whatsapp: #1f8f4e;
  --focus: 0 0 0 3px rgba(196, 71, 110, 0.35);
  --serif: "Maker Garamond", Garamond, Georgia, "Times New Roman", serif;
  --radius: 10px;
  --motion-fast: 180ms;
  --motion-medium: 320ms;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

p,
h1,
h2 {
  margin: 0;
}

.maker {
  width: min(100% - 32px, 520px);
  margin: 0 auto;
  padding: 40px 0 32px;
}

.maker__head {
  margin-bottom: 26px;
  text-align: center;
}

.maker__eyebrow,
.result__eyebrow,
.preview__title {
  color: var(--olive);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.maker__title {
  margin-top: 8px;
  color: var(--leaf);
  font-size: clamp(1.9rem, 7vw, 2.4rem);
  font-weight: 500;
  line-height: 1.12;
}

.maker__intro {
  margin-top: 10px;
  color: var(--muted);
}

.maker__form {
  display: grid;
  gap: 20px;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--ivory);
  box-shadow: 0 14px 40px rgba(60, 52, 30, 0.08);
}

.field {
  display: grid;
  gap: 6px;
}

.field[hidden] {
  display: none;
}

.field__label {
  color: var(--leaf);
  font-size: 1rem;
  font-weight: 600;
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid rgba(43, 42, 36, 0.22);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.field__input::placeholder {
  color: #a39f92;
}

.field__input:focus {
  border-color: var(--rose);
  outline: none;
  box-shadow: var(--focus);
}

.field__input[aria-invalid="true"] {
  border-color: var(--error);
}

.field__select {
  appearance: none;
  padding-right: 42px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236c7034' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E")
      right 16px center / 12px 8px no-repeat,
    #fff;
  cursor: pointer;
}

.field__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 1.2em;
}

.field__count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.field__error {
  color: var(--error);
  font-size: 0.92rem;
}

.field__error[hidden] {
  display: none;
}

/* Live preview, styled like the greeting card on the invitation. */
.preview {
  display: grid;
  gap: 8px;
}

.preview__card {
  padding: 22px 16px;
  border: 1px solid rgba(108, 112, 52, 0.45);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: inset 0 0 0 5px #fffdf8, inset 0 0 0 6px rgba(196, 71, 110, 0.3);
  text-align: center;
}

.preview__prefix {
  color: var(--olive);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  margin-right: -0.3em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.preview__name {
  margin-top: 4px;
  color: var(--rose);
  font-size: clamp(1.8rem, 8vw, 2.3rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.preview__name.is-placeholder {
  color: rgba(196, 71, 110, 0.38);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.button:active {
  transform: scale(0.98);
}

.button--primary {
  background: var(--rose);
  color: #fff;
}

.button--primary:hover {
  background: var(--rose-deep);
}

.button--whatsapp {
  background: var(--whatsapp);
  color: #fff;
}

.button--whatsapp:hover {
  background: #187a41;
}

.button--quiet {
  width: 100%;
  background: transparent;
  border-color: var(--line);
  color: var(--leaf);
}

.button--quiet:hover {
  background: rgba(108, 112, 52, 0.08);
}

.maker__foot {
  margin-top: 24px;
  text-align: center;
  font-size: 0.9rem;
}

.maker__foot a {
  color: var(--muted);
}

/* ---- Result popup ---- */
.result {
  width: min(100% - 32px, 460px);
  max-height: calc(100% - 32px);
  padding: 0; /* padding lives on .result__body so backdrop clicks are unambiguous */
  border: 0;
  border-radius: 16px;
  background: var(--ivory);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(30, 26, 14, 0.35);
}

.result[open] {
  animation: result-in var(--motion-medium) var(--ease-standard);
}

.result::backdrop {
  background: rgba(30, 28, 18, 0.55);
}

.result__body {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 28px 22px 22px;
}

.result__close-form {
  position: absolute;
  top: 8px;
  right: 8px;
}

.result__close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.result__close:hover {
  background: rgba(43, 42, 36, 0.06);
}

.result__close:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.result__title {
  padding-right: 36px;
  color: var(--rose);
  font-size: clamp(1.6rem, 6.5vw, 2rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.result__link {
  font-size: 0.95rem;
  color: var(--muted);
  text-overflow: ellipsis;
}

.result__actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

@media (min-width: 520px) {
  .result__actions {
    grid-template-columns: 1fr 1fr;
  }
}

.result__status {
  min-height: 1.3em;
  color: var(--leaf);
  font-size: 0.92rem;
  text-align: center;
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .result[open] {
    animation: none;
  }

  .button,
  .field__input {
    transition: none;
  }
}
