:root {
  color-scheme: light;
  --paper: #f7f2ec;
  --ink: #75463d;
  --accent: #b96557;
  --accent-dark: #934a40;
  --line: rgba(135, 81, 70, 0.24);
  --shadow: 0 24px 70px rgba(68, 42, 36, 0.16);
  font-family: "Songti SC", "STSong", "Noto Serif SC", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { background: #e9e0d7; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.85), transparent 30%),
    linear-gradient(150deg, #eee7df 0%, #ded1c6 100%);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.invite-shell {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 0 0 calc(22px + env(safe-area-inset-bottom));
}

.invitation {
  position: relative;
  container-type: inline-size;
  width: 100%;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.invitation picture,
.invitation img {
  display: block;
  width: 100%;
  height: auto;
}

.invitation img {
  user-select: none;
  -webkit-user-drag: none;
}

.guest-mark {
  position: absolute;
  top: 7.2%;
  right: 4.7%;
  z-index: 2;
  width: 40%;
  text-align: right;
  color: #985348;
  text-shadow: 0 1px 12px rgba(255,255,255,.95);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .7s ease .2s, transform .7s ease .2s;
}

.guest-mark.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.guest-kicker {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5cqw;
  margin-bottom: 1.4cqw;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.8cqw;
  font-style: italic;
  letter-spacing: .22em;
}

.guest-kicker::before {
  content: "";
  width: 8cqw;
  height: 1px;
  background: currentColor;
  opacity: .55;
}

.guest-name {
  display: inline-block;
  max-width: 100%;
  padding: 0 0 1.1cqw;
  border-bottom: 1px solid rgba(152,83,72,.48);
  font-size: var(--guest-size, 4.3cqw);
  line-height: 1.35;
  letter-spacing: .1em;
  overflow-wrap: anywhere;
}

.invite-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px 16px 0;
}

.action-button {
  min-height: 48px;
  border: 1px solid rgba(151,78,66,.25);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--accent-dark);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  letter-spacing: .08em;
  box-shadow: 0 8px 24px rgba(73,42,35,.08);
  backdrop-filter: blur(12px);
}

.action-button.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #bd7062, #9d5146);
}

.action-button:active { transform: translateY(1px); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  z-index: 20;
  transform: translate(-50%, 12px);
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(54,39,35,.9);
  font-family: system-ui, sans-serif;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  white-space: nowrap;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.maker-page {
  min-height: 100vh;
  padding: 30px 18px max(30px, env(safe-area-inset-bottom));
}

.maker-layout {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(320px, 500px);
  justify-content: center;
  align-items: start;
  gap: clamp(28px, 6vw, 76px);
}

.maker-panel {
  position: sticky;
  top: 30px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(133,78,67,.16);
  border-radius: 28px;
  background: rgba(255,252,248,.78);
  box-shadow: 0 28px 80px rgba(73,43,36,.12);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 12px;
  font-family: Georgia, serif;
  font-size: 12px;
  letter-spacing: .28em;
  color: var(--accent);
}

.maker-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 500;
  letter-spacing: .06em;
}

.maker-intro {
  margin: 15px 0 30px;
  color: #876b65;
  font-family: system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.8;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #684c46;
}

.guest-input {
  width: 100%;
  min-height: 54px;
  padding: 0 17px;
  border: 1px solid rgba(133,78,67,.25);
  border-radius: 14px;
  outline: none;
  background: rgba(255,255,255,.92);
  color: #583a34;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}

.guest-input:focus {
  border-color: #b76759;
  box-shadow: 0 0 0 4px rgba(183,103,89,.1);
}

.field-help {
  margin: 9px 2px 22px;
  color: #9b827c;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.6;
}

.maker-buttons { display: grid; gap: 11px; }

.maker-button {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  font-weight: 650;
}

.maker-button.primary {
  color: #fff;
  background: linear-gradient(135deg, #bd7062, #995044);
  box-shadow: 0 12px 28px rgba(157,81,70,.24);
}

.maker-button.secondary {
  color: #845047;
  border: 1px solid rgba(151,78,66,.2);
  background: rgba(255,255,255,.7);
}

.generated-link {
  display: none;
  margin-top: 18px;
  padding: 14px 15px;
  border-radius: 12px;
  background: rgba(151,78,66,.07);
  color: #73554f;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-all;
}

.generated-link.visible { display: block; }

.preview-label {
  margin: 0 0 12px;
  text-align: center;
  color: #8b716b;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: .12em;
}

.maker-preview .invitation {
  border-radius: 12px;
  box-shadow: 0 30px 90px rgba(69,42,36,.2);
}

@media (max-width: 780px) {
  .maker-page { padding-top: 18px; }
  .maker-layout { grid-template-columns: 1fr; }
  .maker-panel { position: static; }
  .maker-preview { width: min(100%, 520px); margin: 0 auto; }
}

@media (min-width: 641px) {
  .invite-shell { padding-top: 24px; }
  .invitation { border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
