:root {
  --bg: #f7f0ee;
  --fg: #2a2226;
  --muted: #8a747c;
  --line: rgba(42, 34, 38, 0.09);
  --accent: #c4788a;
  --accent-2: #d4a5a5;
  --glass: rgba(255, 252, 250, 0.72);
  --radius: 32px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: Manrope, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

.mesh {
  pointer-events: none;
  position: fixed;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(52% 42% at 18% 12%, rgba(212, 165, 165, 0.28), transparent 58%),
    radial-gradient(44% 38% at 86% 18%, rgba(196, 120, 138, 0.16), transparent 52%),
    radial-gradient(40% 48% at 70% 90%, rgba(180, 200, 190, 0.18), transparent 55%),
    #f7f0ee;
  filter: blur(8px);
  animation: meshShift 18s ease-in-out infinite alternate;
}

@keyframes meshShift {
  to { transform: translate3d(-4%, 3%, 0) scale(1.06); }
}

#gold-dust {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.cover, .invite, .scene-evening {
  position: relative;
  z-index: 2;
}

.cover {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: max(28px, env(safe-area-inset-top)) 20px max(36px, env(safe-area-inset-bottom));
  gap: 8px;
  transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
}

.cover.is-open {
  opacity: 0;
  transform: scale(1.08);
  filter: blur(12px);
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  animation: rise 0.9s ease both;
}

.cover-date {
  font-family: Unbounded, sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 4vw, 22px);
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-top: 18px;
  animation: rise 1s 0.08s ease both;
}

.cover-title {
  font-family: Unbounded, sans-serif;
  font-weight: 800;
  font-size: clamp(56px, 16vw, 120px);
  line-height: 0.9;
  letter-spacing: -0.05em;
  animation: rise 1s 0.16s ease both;
}

.cover-title--long {
  font-size: clamp(42px, 12vw, 88px);
  line-height: 0.94;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.cover-name {
  font-size: clamp(18px, 4vw, 24px);
  color: var(--muted);
  margin: 8px 0 36px;
  animation: rise 1s 0.24s ease both;
}

.orb {
  position: relative;
  width: 132px;
  height: 132px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  animation: rise 1s 0.32s ease both;
}

.orb .ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.track, .progress {
  fill: none;
  stroke-width: 3;
}

.track { stroke: rgba(26, 23, 20, 0.14); }
.progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  filter: drop-shadow(0 0 8px rgba(196, 120, 138, 0.45));
  transition: stroke 0.2s;
}

.orb-txt {
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(26, 23, 20, 0.12);
  font-family: Unbounded, sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(16px);
}

.orb.heating .orb-txt {
  background: rgba(196, 120, 138, 0.16);
  box-shadow: 0 0 36px rgba(196, 120, 138, 0.22);
}

.instruction {
  margin-top: 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  animation: rise 1s 0.4s ease both;
}

.hold-progress {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.invite {
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: safe center;
  padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.invite[hidden] { display: none !important; }

.invite.show .card {
  animation: cardIn 0.85s cubic-bezier(.16,1,.3,1) both;
}

.card {
  width: min(440px, 100%);
  padding: 28px 24px 26px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,248,246,.78));
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(120, 70, 85, 0.10);
  backdrop-filter: blur(24px);
}

.card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.pill {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  font-weight: 700;
}

.pill.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
}

.kicker {
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.card h2 {
  font-family: Unbounded, sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 8vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin: 10px 0 28px;
}

.card h2 em {
  font-style: normal;
  color: transparent;
  background: linear-gradient(120deg, #5a3a44 10%, var(--accent) 50%, #d4a5a5 92%);
  -webkit-background-clip: text;
  background-clip: text;
}

.time-block {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
}

.time {
  font-family: Unbounded, sans-serif;
  font-weight: 800;
  font-size: 64px;
  letter-spacing: -0.06em;
  line-height: 1;
}

.time-label {
  font-size: 14px;
  color: var(--muted);
}

.place-name {
  font-weight: 700;
  font-size: 18px;
}

.place-addr { color: var(--muted); margin-top: 4px; }

.map {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 28px 0 22px;
}

.countdown div {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 4px 10px;
  text-align: center;
}

.countdown b {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.countdown span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
}

.actions .btn {
  width: auto;
  min-width: 200px;
  padding: 14px 40px;
}

.card-note {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
    padding: 14px 16px;
  min-height: 48px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn.fill {
  background: var(--fg);
  color: var(--bg);
  border-color: transparent;
}

.btn.ghost { background: rgba(26, 23, 20, .04); }

.scene-evening {
  min-height: 100svh;
  padding: 20px 20px 64px;
  max-width: 980px;
  margin: 0 auto;
}

.eve-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 28px;
}

.eve-header p {
  font-family: Unbounded, sans-serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  }

.back {
  justify-self: start;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  min-height: 44px;
  padding: 8px 0;
}

.eve-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  backdrop-filter: blur(18px);
}

.panel h3 {
  font-family: Unbounded, sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.panel-lead {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

#sky {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background: #f3e8e6;
  border: 1px solid var(--line);
}

.star-caption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

form label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

input, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  outline: none;
}

input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
.form-hint {
  margin: -4px 0 12px;
  font-size: 13px;
  color: var(--accent);
}
form .btn { width: 100%; margin-top: 4px; }

.candelabra {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.candle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

.wishes {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.wish-card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  font-size: 15px;
}

.wish-card b {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.eve-foot {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.modal, .toast-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden], .toast-overlay[hidden], [hidden] { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 30, 18, 0.32);
}

.ticket-wrap { position: relative; z-index: 1; }

.ticket {
  display: flex;
  width: min(560px, 92vw);
  min-height: 200px;
  background: #fffaf3;
  color: var(--fg);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.ticket.for-pdf {
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 40;
  width: 720px !important;
  min-height: 280px;
  flex-direction: row !important;
  border-radius: 0;
  opacity: 1;
}

.ticket.for-pdf .stub {
  width: 140px !important;
  min-height: 280px;
  flex-direction: column !important;
}

.ticket.for-pdf .ticket-body {
  padding: 28px 32px;
}

.stub {
  width: 128px;
  background: var(--accent);
  color: #111;
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.stub-kicker {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 700;
}

.stub-mono {
  font-family: Unbounded, sans-serif;
  font-size: 28px;
  font-weight: 800;
}

.serial { font-size: 11px; font-weight: 700; }

.barcode {
  width: 80%;
  height: 28px;
  background: repeating-linear-gradient(90deg, #1a1714 0 2px, transparent 2px 4px, #1a1714 4px 5px, transparent 5px 8px);
}

.ticket-body { padding: 22px 24px; flex: 1; }

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

.ticket-body h3 {
  font-family: Unbounded, sans-serif;
  font-size: 40px;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.tk-name { font-size: 22px; font-weight: 700; margin: 4px 0 12px; }
.ticket-body ul { list-style: none; color: var(--muted); font-size: 15px; line-height: 1.6; }
.tk-guest { margin-top: 12px; font-size: 13px; color: var(--accent); }

.ticket-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.toast-overlay { background: rgba(40, 30, 18, 0.38); }

.toast-card {
  max-width: 420px;
  text-align: center;
  padding: 32px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fffaf3;
}

.toast-kicker {
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 14px;
}

.toast-text { font-size: 18px; line-height: 1.5; margin-bottom: 22px; }

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

@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
  50% { transform: scale(0.75); opacity: 0.6; }
}

@media (max-width: 780px) {
  .mesh { filter: blur(14px); animation: none; }

  .eyebrow {
    font-size: 11px;
    letter-spacing: 0.22em;
  }

  .cover-date {
    margin-top: 10px;
    letter-spacing: 0.18em;
  }

  .cover-title {
    font-size: clamp(44px, 18vw, 72px);
  }

  .cover-name { margin: 6px 0 22px; }

  .orb {
    width: 120px;
    height: 120px;
  }

  .instruction {
    margin-top: 18px;
    font-size: 14px;
  }

  .card {
    width: 100%;
    padding: 22px 18px 20px;
    border-radius: 24px;
  }

  .card-top { margin-bottom: 18px; }

  .card h2 {
    font-size: clamp(24px, 7.2vw, 32px);
    margin: 8px 0 20px;
  }

  .time { font-size: 48px; }
  .time-block { margin-bottom: 16px; }

  .countdown {
    margin: 20px 0 16px;
    gap: 6px;
  }

  .countdown div {
    padding: 10px 2px 8px;
    border-radius: 12px;
  }

  .countdown b { font-size: 18px; }
  .countdown span {
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .actions {
    gap: 8px;
    justify-content: center;
  }

  .actions .btn {
    min-width: 180px;
  }

  .eve-grid { grid-template-columns: 1fr; }
  .scene-evening {
    padding: max(16px, env(safe-area-inset-top)) 14px max(40px, env(safe-area-inset-bottom));
  }

  .eve-header {
    grid-template-columns: auto 1fr;
    gap: 10px;
  }
  .eve-header span { display: none; }

  .ticket { flex-direction: column; width: 100%; }
  .stub {
    width: 100%;
    flex-direction: row;
    min-height: 56px;
    gap: 10px;
  }

  .ticket-body { padding: 18px 16px; }
  .ticket-body h3 { font-size: 32px; }

  .modal, .toast-overlay {
    padding: 12px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    align-items: end;
  }

  .toast-card { width: 100%; padding: 24px 18px; }
  .ticket-actions { width: 100%; }
  .ticket-actions .btn { flex: 1; }
}

@media (max-width: 380px) {
  .actions { grid-template-columns: 1fr; }
  .time { font-size: 44px; }
}

@media (max-height: 720px) {
  .cover { gap: 4px; }
  .cover-title { font-size: clamp(40px, 12vh, 64px); }
  .cover-name { margin-bottom: 14px; }
  .orb { width: 104px; height: 104px; }
  .instruction { margin-top: 12px; }
}

@media (pointer: coarse) {
  .btn { min-height: 52px; }
  .map { padding: 8px 0; display: inline-block; }
}

@media print {
  body * { visibility: hidden; }
  .ticket, .ticket * { visibility: visible; }
  .ticket { position: absolute; left: 0; top: 0; }
  .ticket-actions, .modal-backdrop { display: none !important; }
}

.credit {
  margin-top: 18px;
  width: 100%;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.06em;
    color: rgba(58, 50, 46, 0.28);
  font-weight: 400;
  user-select: none;
}
.eve-foot .credit {
  margin-top: 8px;
  flex-basis: 100%;
  order: 3;
}

