:root {
  --ink: #1d1c18;
  --muted: #696358;
  --paper: #fffdf8;
  --ground: #f3eee4;
  --line: #d8cdb9;
  --accent: #7a342f;
  --accent-2: #2f6552;
  --error: #8b1f1f;
  --success: #246247;
  --shadow: 0 24px 80px rgba(34, 28, 18, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--ground);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.guest-page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--ground);
}

.guest-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: min(820px, 78vh);
  background:
    linear-gradient(
      to bottom,
      rgba(243, 238, 228, 0) 0%,
      rgba(243, 238, 228, 0.06) 48%,
      rgba(243, 238, 228, 0.68) 78%,
      var(--ground) 100%
    ),
    url("/photo.webp") center 68% / cover no-repeat;
}

.invitation-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  min-height: auto;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1fr);
  gap: 36px;
  align-items: start;
  padding: clamp(340px, 52vh, 560px) 0 72px;
}

.compact-shell {
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
}

.invitation-panel {
  position: relative;
  padding: 44px 0;
}

.invitation-panel::before {
  content: "";
  display: block;
  width: 88px;
  height: 5px;
  margin-bottom: 28px;
  background: var(--accent);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(42px, 5.6vw, 76px);
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
}

.message-heading {
  font-size: clamp(44px, 8vw, 82px);
  line-height: 0.95;
}

.lead {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.event-details {
  max-width: 600px;
  margin: 30px 0 0;
  padding: 0;
  border-top: 1px solid rgba(122, 52, 47, 0.22);
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.event-details div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(122, 52, 47, 0.16);
}

.event-details dt {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.event-details dd {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.event-details a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.event-details span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 500;
}

.prior-response {
  display: inline-block;
  margin: 24px 0 0;
  padding: 8px 12px;
  border: 1px solid rgba(47, 101, 82, 0.25);
  color: var(--accent-2);
  background: rgba(47, 101, 82, 0.08);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.rsvp-card {
  padding: 32px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.98);
  box-shadow: var(--shadow);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
label > span {
  display: block;
  margin-bottom: 10px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.choice-group {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.choice {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fffaf0;
  cursor: pointer;
}

.choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.choice span {
  margin: 0;
  color: var(--ink);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: block;
  margin-bottom: 20px;
}

label small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

input[type="number"],
input[type="email"],
input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fffaf0;
  color: var(--ink);
}

input[type="number"],
input[type="email"],
input[type="text"] {
  min-height: 44px;
  padding: 10px 12px;
}

input[type="file"] {
  width: 100%;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

input[type="file"]::file-selector-button {
  min-height: 42px;
  margin-right: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fffaf0;
  color: var(--ink);
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

.turnstile-wrap {
  min-height: 0;
  margin: 0;
}

.primary-button,
.secondary-button,
.table-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-button {
  width: 100%;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
}

.secondary-button,
.table-button {
  padding: 10px 14px;
  background: transparent;
  color: var(--ink);
}

.notice {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #fffaf0;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.notice ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.notice-error {
  border-color: rgba(139, 31, 31, 0.35);
  color: var(--error);
  background: #fff2ee;
}

.notice-success {
  border-color: rgba(36, 98, 71, 0.35);
  color: var(--success);
  background: #eef8f2;
}

.admin-page {
  background: #f7f5ef;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.admin-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.admin-header h1 {
  margin: 0;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 42px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.metric span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 400;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.admin-actions form,
.table-section {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 20px;
}

.admin-actions form {
  display: flex;
  min-height: 300px;
  flex-direction: column;
}

.admin-actions h2,
.table-section h2 {
  margin-bottom: 8px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 400;
}

.admin-actions p {
  color: var(--muted);
  line-height: 1.5;
}

.admin-actions label {
  margin-bottom: 16px;
}

.admin-actions .primary-button {
  margin-top: auto;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-cell {
  max-width: 240px;
  white-space: normal;
}

.link-cell {
  color: var(--accent);
  font-weight: 800;
}

@media (max-width: 920px) {
  .invitation-shell,
  .admin-actions {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .invitation-shell,
  .admin-shell {
    width: min(100% - 20px, 1280px);
  }

  .invitation-panel {
    padding: 20px 0 8px;
  }

  .guest-page::before {
    height: 520px;
    background:
      linear-gradient(
        to bottom,
        rgba(243, 238, 228, 0) 0%,
        rgba(243, 238, 228, 0.08) 48%,
        rgba(243, 238, 228, 0.72) 78%,
        var(--ground) 100%
      ),
      url("/photo.webp") center 84% / cover no-repeat;
  }

  .invitation-shell {
    padding-top: 390px;
  }

  h1 {
    font-size: 44px;
  }

  .lead {
    font-size: 17px;
  }

  .event-details div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .rsvp-card {
    padding: 20px;
  }

  .form-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .admin-header {
    display: grid;
  }
}
