:root {
  --deep-red: #a3233a;
  --deep-red-dark: #7a1a2b;
  --forest: #0f5132;
  --forest-dark: #0a3a24;
  --gold: #d4af37;
  --gold-dark: #b4912a;
  --cream: #fdf6e8;
  --ink: #2a1a12;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Georgia", "Palatino Linotype", serif;
  color: var(--ink);
  background: var(--forest-dark);
  position: relative;
  overflow-x: hidden;
}

/* Mosaic background: a diamond-tile pattern behind everything */
.mosaic-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--forest-dark);
  background-image:
    linear-gradient(135deg, var(--forest) 25%, transparent 25%),
    linear-gradient(225deg, var(--forest) 25%, transparent 25%),
    linear-gradient(45deg, var(--deep-red-dark) 25%, transparent 25%),
    linear-gradient(315deg, var(--deep-red-dark) 25%, transparent 25%);
  background-position: 40px 0, 40px 0, 0 0, 0 0;
  background-size: 80px 80px;
  opacity: 0.55;
}

.mosaic-grid {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 24px 72px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.tile {
  background: var(--cream);
  border-radius: 10px;
  padding: 28px 26px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  border: 3px solid rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.tile:hover {
  transform: translateY(-4px) rotate(0deg) !important;
}

.tile h1,
.tile h2 {
  margin: 0 0 8px;
  line-height: 1.15;
}

.tile p {
  margin: 0 0 6px;
}

.tile-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

/* --- Individual tile styling, mosaic colors + slight tilt --- */

.tile-title {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  text-align: center;
  transform: rotate(-0.4deg);
}
.tile-title h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--deep-red-dark);
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.25);
}
.tile-title .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.85rem;
  color: var(--forest-dark);
  margin-bottom: 4px;
}
.tile-title .tagline {
  font-size: 1.1rem;
  color: var(--ink);
}

.tile-date {
  background: var(--deep-red);
  color: var(--cream);
  transform: rotate(-1.2deg);
}
.tile-date h2 {
  color: #fff;
}

.tile-time {
  background: var(--forest);
  color: var(--cream);
  transform: rotate(1deg);
}
.tile-time h2 {
  color: #fff;
}

.tile-location {
  background: var(--gold);
  color: var(--ink);
  transform: rotate(-0.8deg);
}

.tile-desc {
  grid-column: 1 / -1;
  background: var(--cream);
  transform: rotate(0.3deg);
}
.tile-desc h2 {
  color: var(--deep-red-dark);
}

.tile-rsvp {
  grid-column: 1 / -1;
  background: var(--forest-dark);
  color: var(--cream);
  transform: rotate(-0.2deg);
}
.tile-rsvp h2 {
  color: var(--gold);
  text-align: center;
  font-size: 1.8rem;
}

/* --- RSVP form --- */

#rsvp-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
}

#rsvp-form label {
  font-size: 0.9rem;
  color: var(--gold);
}

#rsvp-form input {
  padding: 10px 12px;
  border-radius: 6px;
  border: 2px solid var(--gold-dark);
  font-size: 1rem;
  font-family: inherit;
}

#rsvp-form button {
  margin-top: 6px;
  padding: 12px;
  border: none;
  border-radius: 6px;
  background: var(--deep-red);
  color: #fff;
  font-size: 1.05rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s ease;
}
#rsvp-form button:hover {
  background: var(--deep-red-dark);
}
#rsvp-form button:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-message {
  min-height: 1.2em;
  font-size: 0.95rem;
}
.form-message.success {
  color: #8fd19e;
}
.form-message.error {
  color: #f08a8a;
}

/* --- RSVP list page --- */

body.list-page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
}
.tile-list {
  max-width: 720px;
  width: 100%;
  background: var(--cream);
  position: relative;
  z-index: 1;
  margin: 0 24px;
}
.tile-list h1 {
  color: var(--deep-red-dark);
}
.summary {
  color: var(--forest);
  font-weight: bold;
  margin-bottom: 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
th {
  color: var(--deep-red-dark);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.empty {
  text-align: center;
  color: #888;
  font-style: italic;
}
.error {
  color: var(--deep-red);
  font-weight: bold;
}
.back-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--forest);
  text-decoration: none;
  font-weight: bold;
}
.back-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .tile {
    transform: none !important;
  }
}
