:root {
  --bg: #0e0d12;
  --ink: #f4ecd8;
  --muted: #b9ad8e;
  --gold: #c9a24b;
  --gold-soft: #8a6f2e;
  --card: #181620;
  --line: #2a2632;
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(ellipse at top, #1b1828 0%, var(--bg) 60%) fixed;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 32px 20px 80px; }

header.hero { text-align: center; padding: 24px 8px 8px; }
.eyebrow {
  letter-spacing: 0.4em; text-transform: uppercase; color: var(--gold);
  font-size: 12px; margin-bottom: 14px;
}
h1.name {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 7vw, 64px); line-height: 1.05;
  margin: 0 0 8px; letter-spacing: 0.5px;
}
.dates {
  font-family: var(--serif); font-style: italic; color: var(--muted);
  font-size: 18px; margin-bottom: 22px;
}
.portrait {
  width: min(360px, 80%); aspect-ratio: 1 / 1; margin: 0 auto 18px;
  border: 1px solid var(--gold-soft); border-radius: 4px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(201,162,75,0.15), 0 30px 80px -30px rgba(201,162,75,0.35);
  background: #000;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.epitaph {
  font-family: var(--serif); font-style: italic; font-size: 19px;
  color: var(--muted); max-width: 540px; margin: 0 auto 28px;
}
hr.rule {
  border: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  margin: 8px auto 36px; max-width: 480px;
}

section.leave {
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 22px; margin-bottom: 36px;
}
section.leave h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0 0 6px; }
section.leave p.lede { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.field { display: block; margin-bottom: 12px; }
.field label {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--muted); margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%; background: #0f0e16; color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 10px 12px; font-family: inherit; font-size: 15px; resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(201,162,75,0.12);
}
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.counter { font-size: 12px; color: var(--muted); }
.counter.warn { color: #d99a4a; }
.counter.over { color: #c45c5c; }
.submit {
  display: inline-block; text-decoration: none;
  background: var(--gold); color: #1a1409; border: 0;
  padding: 10px 18px; border-radius: 4px; font-weight: 600; font-size: 14px;
  letter-spacing: 0.05em; cursor: pointer;
  transition: transform 0.05s ease, filter 0.15s ease;
}
.submit:hover { filter: brightness(1.08); }
.submit:active { transform: translateY(1px); }
.submit:disabled { opacity: 0.5; cursor: not-allowed; }
.submit:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(201,162,75,0.35); }
/* the link version sits under the portrait — give it a little breathing room */
a.submit { margin: 6px 0 22px; }

/* Honeypot: hidden from real users, available to bots. */
.hp {
  position: absolute; left: -9999px; top: -9999px;
  width: 1px; height: 1px; overflow: hidden;
}

h2.wall-title { font-family: var(--serif); font-weight: 500; font-size: 28px; margin: 0 0 18px; text-align: center; }
.count { text-align: center; color: var(--muted); font-size: 13px; margin: -8px 0 22px; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-left: 2px solid var(--gold-soft); border-radius: 4px;
  padding: 16px 16px 14px; position: relative;
  animation: fadeIn 0.4s ease both;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.card .who { font-family: var(--serif); font-size: 17px; color: var(--gold); margin-bottom: 6px; }
.card .what { color: var(--ink); font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.card .when { margin-top: 10px; font-size: 11px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.empty { text-align: center; color: var(--muted); font-style: italic; padding: 30px 0; }

footer { margin-top: 60px; text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 0.1em; }
footer .heart { color: var(--gold); }

.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--card); color: var(--ink);
  border: 1px solid var(--gold-soft);
  padding: 10px 16px; border-radius: 4px; font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
