:root {
  --paper: #f7f1e5;
  --card: #fffdf8;
  --ink: #1f2a24;
  --muted: #66716a;
  --line: #e2d8c3;
  --pine: #1f5a41;
  --pine-dark: #17432f;
  --berry: #a8322d;
  --gold: #b98a2c;
  --radius: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141a17;
    --card: #1c2520;
    --ink: #ece6d8;
    --muted: #9aa69f;
    --line: #2f3b34;
    --pine: #5fae8a;
    --pine-dark: #7cc3a1;
    --berry: #e0756f;
    --gold: #d9ad55;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

h1, h2, .brand, .match {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 1.9rem; margin: 0.4rem 0 1.2rem; }
h2 { font-size: 1.2rem; margin: 0 0 0.6rem; }
p { margin: 0 0 0.8rem; }
a { color: var(--pine); }

header.site {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 16px;
  max-width: 720px;
  margin: 0 auto;
}

.brand { font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.star { color: var(--berry); }
.who { color: var(--muted); font-size: 0.9rem; margin-right: 0.6rem; }

main { max-width: 720px; margin: 0 auto; padding: 0.5rem 16px 4rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  margin: 0 0 1.1rem;
}
.card.narrow { max-width: 440px; margin: 8vh auto 0; }
.card.quiet { background: transparent; border-style: dashed; }
.card.cta { border-color: var(--pine); border-width: 2px; }

label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.8rem; }
.optional { font-weight: 400; color: var(--muted); }

input[type="text"], input[type="password"], textarea, select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}
textarea { resize: vertical; }
input[readonly] { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; color: var(--muted); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

button {
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
button:hover { border-color: var(--pine); }
button.primary { background: var(--pine); border-color: var(--pine); color: var(--card); }
button.primary:hover { background: var(--pine-dark); }
button.primary:disabled { opacity: 0.45; cursor: not-allowed; }
button.big { width: 100%; padding: 0.9rem 1rem; font-size: 1.1rem; }
button.danger { color: var(--berry); border-color: var(--berry); background: transparent; }
button.link {
  border: 0; background: none; padding: 0;
  color: var(--pine); font-weight: 400; text-decoration: underline;
}

form.inline { display: inline; margin: 0; }
.row { display: flex; gap: 0.5rem; align-items: center; }
.row input, .row select { margin-top: 0; min-width: 0; flex: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.hint, .empty, .crumb { color: var(--muted); font-size: 0.92rem; }
.crumb { margin-bottom: 0; }
.crumb a { text-decoration: none; }

.flash {
  background: color-mix(in srgb, var(--gold) 16%, var(--card));
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
}

.badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5rem;
  padding: 0.1rem 0.55rem;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 600 0.72rem/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge.drawn { color: var(--pine); border-color: var(--pine); }
.count { color: var(--muted); font-weight: 400; font-size: 1rem; }
.cross { color: var(--berry); }

ul.celebrations, ul.people, ul.links { list-style: none; padding: 0; margin: 0 0 1.1rem; }

ul.celebrations a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}
ul.celebrations a:hover { border-color: var(--pine); }
ul.celebrations .name { font-weight: 600; }
ul.celebrations .meta { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

ul.people li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

ul.links li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
ul.links li:last-child { border-bottom: 0; }
.linkhead { margin-bottom: 0.35rem; }
.linkhead .name { font-weight: 600; }

.reveal { text-align: center; padding: 2rem 1.5rem; }
.eyebrow {
  color: var(--berry);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.match {
  font-size: 2.6rem;
  color: var(--pine);
  margin: 0.2rem 0 1.4rem;
  overflow-wrap: anywhere;
}
.notes {
  text-align: left;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-bottom: 1rem;
}
.notes h2 { font-size: 0.95rem; }
.notes p { white-space: pre-wrap; }

@media (max-width: 480px) {
  .row { flex-wrap: wrap; }
  .row button { flex: 1; }
}
