:root {
  color-scheme: light;
  --pine: #0c392f;
  --pine-deep: #062720;
  --holly: #b72c38;
  --holly-deep: #8f202c;
  --gold: #d7aa48;
  --cream: #fff9ec;
  --paper: #fffdf7;
  --ink: #18312b;
  --muted: #66736e;
  --line: #d8e0da;
  --shadow: 0 30px 90px rgba(4, 35, 27, 0.2);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(215, 170, 72, 0.2), transparent 24rem),
    radial-gradient(circle at 88% 92%, rgba(183, 44, 56, 0.16), transparent 28rem),
    linear-gradient(145deg, #e5f0ea 0%, var(--cream) 52%, #f9e9e6 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.snow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.95) 0 2px, transparent 2.5px),
    radial-gradient(circle, rgba(255,255,255,.75) 0 1px, transparent 1.5px);
  background-size: 72px 72px, 43px 43px;
  background-position: 0 0, 18px 24px;
  opacity: .7;
}

.snow-two { transform: rotate(12deg) scale(1.1); opacity: .35; }

.page-shell {
  width: min(calc(100% - 32px), 720px);
  margin: 0 auto;
  padding: 32px 0 24px;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 4px 20px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--pine);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -.01em;
}

.seal {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 50%;
  outline: 2px solid var(--pine);
  background: var(--pine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}

.private-badge {
  margin-left: auto;
  padding: 7px 12px;
  border: 1px solid rgba(12,57,47,.16);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.62);
  font-size: .8125rem;
  font-weight: 700;
}

.card {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 7vw, 58px);
  border: 1px solid rgba(12,57,47,.12);
  border-radius: 30px;
  background: rgba(255,253,247,.96);
  box-shadow: var(--shadow);
}

.ribbon {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--holly) 0 35%, var(--gold) 35% 65%, var(--pine) 65%);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--holly-deep);
  font-size: .8125rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--pine-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.65rem, 9vw, 5rem);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.055em;
}

.lede {
  max-width: 560px;
  margin: 22px 0 32px;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.65;
}

label {
  display: block;
  margin: 0 0 9px;
  color: var(--pine-deep);
  font-size: .875rem;
  font-weight: 800;
}

.field-action { display: flex; gap: 10px; }

input, select {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid #c5d1ca;
  border-radius: 13px;
  outline: 0;
  color: var(--ink);
  background: white;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus, select:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 4px rgba(12,57,47,.12);
}

.select-wrap { position: relative; }
.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--pine);
  border-bottom: 2px solid var(--pine);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}
select { appearance: none; padding-right: 48px; }

button {
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 13px;
  color: white;
  background: var(--pine);
  font-weight: 800;
  transition: transform 140ms ease, background 140ms ease;
}

button:hover { background: var(--pine-deep); transform: translateY(-1px); }
button:focus-visible { outline: 4px solid rgba(215,170,72,.45); outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .62; transform: none; }
.primary { background: var(--holly); }
.primary:hover { background: var(--holly-deep); }
.wide { width: 100%; margin-top: 12px; }

.message {
  min-height: 24px;
  margin: 10px 2px 0;
  color: var(--holly-deep);
  font-size: .875rem;
  font-weight: 700;
}

.text-button {
  min-height: auto;
  margin-top: 18px;
  padding: 4px 0;
  color: var(--muted);
  border-radius: 0;
  background: transparent;
  font-size: .875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:hover { color: var(--pine); background: transparent; transform: none; }

.reveal-card { text-align: center; }
.reveal-card h1 { font-size: clamp(2rem, 7vw, 3.8rem); }
.centered { margin-right: auto; margin-left: auto; }
.match-grid {
  display: grid;
  gap: 14px;
  width: 100%;
  margin: 28px auto 18px;
}
.match-card {
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 22px;
  min-height: 116px;
  padding: 22px 28px;
  border: 2px dashed rgba(183,44,56,.38);
  border-radius: 20px;
  background: #fff4ef;
  text-align: left;
}
.reverse-match {
  border-color: rgba(12,57,47,.35);
  background: #edf5f0;
}
.match-label {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.recipient {
  margin: 0;
  min-width: 0;
  color: var(--holly-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 7vw, 4.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.05em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}
.reverse-match .recipient { color: var(--pine); }
.hidden { display: none; }

footer {
  padding: 22px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: .8125rem;
}

@media (max-width: 560px) {
  .page-shell { width: min(calc(100% - 20px), 720px); padding-top: 18px; }
  .masthead { margin-bottom: 14px; }
  .private-badge { display: none; }
  .card { border-radius: 23px; }
  .field-action { display: grid; }
  .field-action button { width: 100%; }
  .match-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 22px 18px;
    text-align: center;
  }
  .recipient {
    font-size: clamp(2.5rem, 15vw, 4rem);
    text-align: center;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .card:not(.hidden) { animation: arrive 360ms ease both; }
  @keyframes arrive {
    from { opacity: 0; transform: translateY(9px) scale(.995); }
    to { opacity: 1; transform: none; }
  }
}
