:root {
  --bg: #f7f2ea;
  --bg-soft: #fdfaf4;
  --surface: rgba(255, 251, 245, 0.92);
  --surface-strong: #fffdf9;
  --ink: #3f342c;
  --muted: #7a6c61;
  --accent: #b89b72;
  --accent-soft: rgba(184, 155, 114, 0.16);
  --line: rgba(97, 79, 62, 0.16);
  --line-strong: rgba(97, 79, 62, 0.26);
  --success-bg: rgba(128, 156, 118, 0.13);
  --success-text: #4f6a43;
  --error-bg: rgba(145, 92, 92, 0.12);
  --error-text: #7e4a4a;
  --shadow: 0 22px 60px rgba(80, 59, 41, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.8), transparent 34%),
    linear-gradient(180deg, #faf5ec 0%, #f5efe4 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(184, 155, 114, 0.08), transparent 18%),
    radial-gradient(circle at 80% 18%, rgba(184, 155, 114, 0.08), transparent 20%),
    radial-gradient(circle at 50% 100%, rgba(184, 155, 114, 0.06), transparent 30%);
}

img {
  display: block;
  max-width: 100%;
}

.wrap {
  width: min(100%, 760px);
  margin: 0 auto;
}

.memorial-page {
  padding: 2rem 1.1rem 4rem;
  position: relative;
}

.memorial-shell {
  margin-bottom: 2rem;
}

.memorial-card,
.support-card,
.message-shell,
.message-card,
.admin-row,
.admin-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  border-radius: 32px;
}

.memorial-card {
  position: relative;
  padding: 3.5rem 2.2rem 3rem;
  text-align: center;
  overflow: hidden;
}

.memorial-card::before,
.memorial-card::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(184, 155, 114, 0.18);
  border-radius: 28px;
  pointer-events: none;
}

.memorial-card::after {
  inset: 40px 32px 32px;
  border-color: rgba(184, 155, 114, 0.1);
}

.memorial-intro {
  position: relative;
}

.memorial-header {
  position: relative;
}

.title-image {
  margin: 0 auto;
  width: min(100%, 30rem);
}

.title-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1,
h2,
.admin-row h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(3.9rem, 12vw, 5.8rem);
  line-height: 0.92;
  color: #5a493c;
}

.memorial-title {
  font-family: "Joliet", "Parisienne", "Cormorant Garamond", serif;
  font-weight: 400;
  letter-spacing: 0;
}

h2,
.admin-row h2 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1;
}

.memorial-dates,
.memorial-subtitle,
.invitation-text p,
.practical-block p,
.dresscode-note,
.section-intro p,
.message-card__body,
.message-card__author,
.message-empty,
.support-form label,
.support-form input,
.support-form textarea,
.form-note,
.form-help,
.admin-row p {
  font-size: 1rem;
  line-height: 1.8;
}

.memorial-dates {
  margin: 0.85rem 0 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.memorial-subtitle {
  margin: 1rem auto 0;
  max-width: 32rem;
  color: var(--muted);
}

.invitation-text,
.practical-block,
.flower-note,
.family-block,
.poem-block {
  max-width: 33rem;
  margin: 2rem auto 0;
}

.invitation-text p,
.practical-block p,
.flower-note p,
.family-block p,
.poem-block p {
  margin: 0;
}

.practical-block,
.flower-note,
.family-block,
.poem-block {
  position: relative;
  padding-top: 1.8rem;
}

.practical-block::before,
.flower-note::before,
.family-block::before,
.poem-block::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 88px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  transform: translateX(-50%);
}

.family-block p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.family-block span {
  color: var(--muted);
  white-space: nowrap;
}

.poem-block {
  max-width: 27rem;
  color: #6c5a4d;
}

.dresscode-note {
  margin: 2rem 0 0;
  color: #6f5d50;
  font-weight: 600;
}

.support-section,
.messages-section {
  padding-top: 1rem;
}

.support-card,
.message-shell {
  padding: 2.2rem 1.6rem;
}

.section-intro {
  text-align: center;
  max-width: 34rem;
  margin: 0 auto 1.6rem;
}

.section-intro--compact {
  margin-bottom: 1.3rem;
}

.section-kicker {
  margin: 0 0 0.4rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
}

.section-intro p:last-child,
.message-count {
  color: var(--muted);
}

.support-form {
  display: grid;
  gap: 1rem;
  max-width: 34rem;
  margin: 0 auto;
}

.form-row {
  display: grid;
  gap: 1rem;
}

.field-group {
  display: grid;
  gap: 0.45rem;
}

.support-form label {
  color: #604f42;
  font-weight: 500;
}

.support-form input,
.support-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
}

.support-form textarea {
  min-height: 160px;
  resize: vertical;
}

.support-form input::placeholder,
.support-form textarea::placeholder,
.muted,
.form-help,
.message-empty {
  color: var(--muted);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.form-help {
  margin: 0;
  max-width: 24rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(80, 59, 41, 0.12);
}

.button--primary {
  background: #8d7359;
  color: #fffdf8;
}

.support-form input:focus-visible,
.support-form textarea:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(184, 155, 114, 0.28);
  outline-offset: 2px;
}

.form-note {
  margin: 0 auto 1rem;
  max-width: 34rem;
  border-radius: 18px;
  padding: 0.9rem 1rem;
}

.form-note.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.form-note.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.message-grid,
.admin-list {
  display: grid;
  gap: 1rem;
}

.message-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.message-card,
.admin-row,
.admin-card {
  padding: 1.4rem;
}

.message-card {
  background: rgba(255, 255, 255, 0.62);
  min-height: 184px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.message-card__body,
.message-card__author,
.message-empty {
  margin: 0;
}

.message-card__body {
  white-space: pre-line;
}

.message-card__author,
.admin-row__status {
  margin-top: 1rem;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.honeypot {
  position: absolute;
  left: -9999px;
}

.admin-page {
  min-height: 100vh;
}

.admin-shell {
  padding: 5rem 1.1rem;
}

.admin-shell--wide {
  max-width: 960px;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.admin-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .memorial-page {
    padding: 1rem 0.75rem 3rem;
  }

  .memorial-card,
  .support-card,
  .message-shell,
  .message-card,
  .admin-row,
  .admin-card {
    border-radius: 24px;
  }

  .memorial-card {
    padding: 2.4rem 1.2rem 2.2rem;
  }

  .memorial-card::before,
  .memorial-card::after {
    inset: 14px;
    border-radius: 20px;
  }

  .memorial-card::after {
    inset: 28px 20px 20px;
  }

  .title-image {
    width: min(100%, 22rem);
  }

  .memorial-subtitle,
  .invitation-text,
  .practical-block,
  .flower-note,
  .family-block,
  .poem-block {
    max-width: none;
  }

  .practical-block::before,
  .flower-note::before,
  .family-block::before,
  .poem-block::before {
    width: 76px;
  }

  .family-block p {
    flex-direction: column;
    gap: 0;
  }

  .family-block span {
    white-space: normal;
  }

  .support-card,
  .message-shell {
    padding: 1.5rem 1rem;
  }

  .form-actions,
  .admin-row {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
