:root {
  --emerald-950: #032b24;
  --emerald-900: #073b31;
  --emerald-800: #0a4b3e;
  --emerald-700: #0d5f4e;
  --gold: #c9a35d;
  --gold-pale: #ecd8aa;
  --ivory: #fbf8ef;
  --ink: #17362f;
  --muted: #6b7974;
  --shadow: 0 24px 70px rgba(2, 43, 36, .18);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ivory); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  background:
    radial-gradient(circle at 50% 10%, rgba(201,163,93,.13), transparent 28rem),
    linear-gradient(180deg, #fffdf7 0%, #f6f1e4 100%);
  overflow-x: hidden;
  position: relative;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; opacity: .16; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

.botanical {
  position: fixed; width: min(25vw, 260px); z-index: 0; opacity: .16;
  stroke: var(--emerald-700); fill: none; stroke-width: 1.4;
}
.botanical path:not(:first-child) { fill: rgba(13,95,78,.17); }
.botanical-left { left: -40px; bottom: -35px; }
.botanical-right { right: -40px; top: -50px; transform: rotate(180deg); }

main { position: relative; z-index: 1; min-height: calc(100vh - 92px); display: grid; place-items: center; padding: 0 20px 36px; }
.hero { width: min(780px, 100%); text-align: center; }
.couple-photo {
  position: relative; width: min(100vw, 1000px); height: clamp(400px, 48vw, 520px);
  margin: 0 0 30px 50%; transform: translateX(-50%); overflow: hidden;
  border: 0; border-radius: 0 0 34px 34px;
  background: var(--emerald-950); box-shadow: 0 18px 48px rgba(3,43,36,.18);
}
.couple-photo img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%;
}
.eyebrow { margin: 0 0 12px; color: var(--emerald-700); font-size: .78rem; letter-spacing: .24em; text-transform: uppercase; font-weight: 600; }
h1 { margin: 0; color: var(--emerald-950); font-family: "Italiana", Georgia, serif; font-weight: 400; font-size: clamp(3rem, 8vw, 5.8rem); line-height: .96; letter-spacing: -.025em; }
.intro { max-width: 560px; margin: 28px auto 34px; color: #536963; font-family: Georgia, serif; font-size: 1.08rem; line-height: 1.75; }

.search-card {
  background: rgba(255,255,255,.82); border: 1px solid rgba(201,163,93,.35); border-radius: 22px;
  padding: 26px; text-align: left; box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
label { display: block; margin: 0 0 10px 4px; color: var(--emerald-900); font-size: .88rem; font-weight: 600; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; width: 21px; left: 18px; top: 50%; transform: translateY(-50%); fill: none; stroke: #71837d; stroke-width: 1.8; }
input {
  width: 100%; min-height: 58px; border: 1px solid #d5ded9; border-radius: 13px; padding: 0 18px 0 52px;
  background: #fff; color: var(--ink); font: inherit; font-size: 1rem; outline: none; transition: .2s ease;
}
input:focus { border-color: var(--emerald-700); box-shadow: 0 0 0 4px rgba(13,95,78,.1); }
input::placeholder { color: #99a59f; }
button {
  min-height: 58px; border: 0; border-radius: 13px; padding: 0 28px; color: #fff;
  background: var(--emerald-900); font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 10px 25px rgba(7,59,49,.24); transition: transform .18s ease, background .18s ease;
}
button:hover { background: var(--emerald-800); transform: translateY(-1px); }
button:active { transform: translateY(0); }
.hint { margin: 10px 4px 0; color: #7c8984; font-size: .82rem; }

.results { margin-top: 20px; display: grid; gap: 12px; }
.result-card, .empty-state {
  animation: rise .35s ease both; border-radius: 18px; padding: 22px 24px; text-align: left;
  background: var(--emerald-900); color: white; box-shadow: 0 16px 40px rgba(3,43,36,.2);
}
.result-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; border: 1px solid rgba(236,216,170,.28); }
.result-kicker { margin: 0 0 5px; color: var(--gold-pale); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; }
.result-card h2 { margin: 0; font-family: "Italiana", Georgia, serif; font-size: clamp(1.45rem, 4vw, 2rem); font-weight: 400; }
.table-badge { min-width: 122px; border-left: 1px solid rgba(236,216,170,.28); padding-left: 22px; text-align: center; }
.table-badge strong { display: block; color: var(--gold-pale); font-family: "Italiana", Georgia, serif; font-size: 2rem; font-weight: 400; line-height: 1; }
.table-badge span { display: block; margin-top: 7px; color: rgba(255,255,255,.72); font-size: .78rem; }
.empty-state { background: white; color: var(--ink); border: 1px solid #e6ddd0; }
.empty-state strong { display: block; color: var(--emerald-900); font-family: "Italiana", Georgia, serif; font-size: 1.45rem; font-weight: 400; }
.empty-state p { margin: 7px 0 0; color: var(--muted); line-height: 1.55; }
.match-note { margin: 2px 0 0; color: #6f7d78; font-size: .85rem; text-align: center; }

footer { position: relative; z-index: 1; min-height: 92px; padding: 22px; display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--emerald-800); }
footer p { margin: 0; font-family: Georgia, serif; font-style: italic; font-size: .9rem; text-align: center; }
footer span { width: 36px; height: 1px; background: var(--gold); opacity: .6; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 620px) {
  main { padding-top: 0; }
  .couple-photo { width: 100vw; height: 420px; margin-bottom: 28px; border-radius: 0 0 26px 26px; }
  .couple-photo img { object-position: 50% 44%; }
  .search-card { padding: 18px; border-radius: 18px; }
  .search-row { grid-template-columns: 1fr; }
  button { width: 100%; }
  .result-card { grid-template-columns: 1fr; }
  .table-badge { border-left: 0; border-top: 1px solid rgba(236,216,170,.28); padding: 17px 0 0; text-align: left; }
  .table-badge strong { display: inline; font-size: 1.6rem; }
  .table-badge span { display: inline; margin-left: 6px; }
  .botanical { width: 190px; opacity: .1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
