@font-face {
  font-family: Autopia;
  src: url("font/Autopia-Bold copy.ttf") format('truetype');
}

@font-face {
  font-family: Graphik;
  src: url("font/Graphik-Regular.otf") format('opentype');
  font-weight: 400;
}

@font-face {
  font-family: GothamRnd;
  src: url("font/GothamRnd-MedItal.otf") format('opentype');
  font-weight: 500;
  font-style: italic;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input { font-family: inherit; font-size: inherit; }

:root {
  --bg: #f0ece4;
  --black: #000000;
  --border: #c8c3bb;
  --muted: #888;
  --card-radius: 50px;
  --card-padding: 10px;
}

html, body { height: 100%; }

body {
  background: var(--bg) url('images/bwbody.png') center center / cover no-repeat fixed;
  color: var(--black);
  font-family: Graphik, sans-serif;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes letterIn {
  from {
    opacity: 0;
    transform: rotate(var(--r)) translate(var(--tx), var(--ty)) scale(var(--sc)) skewX(var(--sk, 0deg));
  }
  to {
    opacity: 1;
    transform: rotate(0deg) translate(0px, 0px) scale(1) skewX(0deg);
  }
}

.char        { display: inline-block; }
.char-liquid { animation: letterIn var(--dur, 900ms) cubic-bezier(0.5, 0, 0.1, 1)   var(--d, 0ms) both; }
.char-slam   { animation: letterIn var(--dur, 500ms) cubic-bezier(0.86, 0, 0.07, 1) var(--d, 0ms) both; }

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 32px;
  position: relative;
}

.leaf-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 90vh;
  width: auto;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

.information-container {
  max-width: 80%;
  background-color: var(--bg);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  position: relative;
  z-index: 1;
}

.important-container {
  border: 1px black dashed;
  border-radius: calc(var(--card-radius) - var(--card-padding));
  padding: 6px 0;
}

.text {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--black);
  width: 100%;
  font-weight: 800;
  border-bottom: 1px black dashed;
  padding: 10px 0;
  text-align: justify;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

#last { border-bottom: none; }

.text-pill { font-size: 12px; }

a.address { text-decoration: none; color: inherit; }
a.address:hover { opacity: 0.6; }

.rsvp-btn {
  font-size: 1rem;
  background: var(--black);
  color: var(--bg);
  border: none;
  padding: 15px 44px;
  cursor: pointer;
  transition: opacity 0.2s;
  border-radius: 20px;
  font-weight: 800;
  position: relative;
  z-index: 1;
  animation: fadeUp 1s 1.1s cubic-bezier(0.16, 1, 0.3, 1) both,
             float 4s 2.2s ease-in-out infinite;
}

.rsvp-btn:hover { opacity: 0.7; }

/* ── inline rsvp block ── */

#rsvp-block {
  display: none;
  width: 100%;
  max-width: 80%;
  background: var(--bg);
  padding: 48px 36px;
  position: relative;
  border-radius: 50px;
  transform-origin: center top;
  z-index: 1;
}

.close-btn {
  position: absolute;
  top: 18px; right: 22px;
  background: none; border: none;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1; padding: 4px;
  border-radius: 20px;
  font-weight: 800;
}

/* ── form ── */

.form-title { font-size: 22px; margin-bottom: 36px; }

.field { margin-bottom: 28px; }

.field label {
  display: block;
  font-size: 14px;
  color: var(--black);
  margin-bottom: 10px;
}

.field input {
  width: 100%;
  border: none;
  border-bottom: 1px dashed var(--border);
  background: transparent;
  font-size: 14px;
  color: var(--black);
  padding: 8px 0;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus { border-bottom-color: var(--black); }
.field input::placeholder { color: var(--border); }

.btn-group { display: flex; gap: 8px; }

.opt-btn {
  flex: 1;
  font-size: 16px;
  padding: 13px 4px;
  background: transparent;
  border: 1px dashed var(--black);
  color: var(--black);
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 20px;
  font-weight: 800;
  -webkit-appearance: none;
  appearance: none;
}

.opt-btn:hover { border-color: var(--black); }
.opt-btn.active { background: var(--black); color: var(--bg); border-color: var(--black); }

.food-field {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin-bottom 0.3s ease;
  margin-bottom: 0;
}

.food-field.visible { max-height: 60px; margin-bottom: 28px; }

.veg-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.veg-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.veg-box {
  flex-shrink: 0;
  width: 16px; height: 16px;
  border: 2px solid var(--black);
  border-radius: 3px;
  position: relative;
  transition: background 0.15s;
}

.veg-label input:checked ~ .veg-box {
  background: var(--black);
}

.veg-label input:checked ~ .veg-box::after {
  content: '';
  position: absolute;
  left: 3px; top: 0px;
  width: 5px; height: 9px;
  border: 2px solid var(--bg);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.confirm-btn {
  width: 100%;
  font-size: 16px;
  padding: 17px;
  background: var(--black);
  color: var(--bg);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 4px;
  border-radius: 20px;
  font-weight: 800;
}

.confirm-btn:hover { opacity: 0.7; }
.confirm-btn:disabled { opacity: 0.3; cursor: default; }

/* ── success ── */

.success-view { display: none; text-align: center; padding: 16px 0; }
.success-view.visible { display: block; }
#success-line { font-size: 22px; margin-bottom: 12px; }
#success-sub  { font-size: 10px; color: var(--muted); }

@media (max-width: 480px) {
  body { background-attachment: scroll; }
  .page { padding: 20px 16px; gap: 14px; }
  .information-container { max-width: 95%; }
  .text { font-size: 1rem; padding: 7px 0; }
  #rsvp-block { max-width: 95%; padding: 28px 20px; border-radius: 40px; }
  .form-title { margin-bottom: 20px; }
  .field { margin-bottom: 16px; }
  .food-field.visible { margin-bottom: 16px; }
}
