:root {
  --bg-top: #ece2d9;
  --bg-bottom: #d8ccc0;
  --paper: #efe7df;
  --text-main: #634d3a;
  --text-soft: #8a7562;
  --gold-1: #f6dd98;
  --gold-2: #d9b65b;
  --gold-3: #b9892c;
  --line: rgba(170, 139, 84, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Cormorant Garamond", serif;
  color: var(--text-main);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -16%;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.66), transparent 42%),
    radial-gradient(circle at 83% 16%, rgba(255, 255, 255, 0.42), transparent 41%),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.24), transparent 42%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0));
}

body::after {
  opacity: 0.46;
  background-image:
    radial-gradient(circle at 11% 18%, rgba(255, 255, 255, 0.52) 0 1px, transparent 1px),
    radial-gradient(circle at 77% 38%, rgba(255, 244, 225, 0.47) 0 1.2px, transparent 1.2px),
    radial-gradient(circle at 35% 75%, rgba(255, 255, 255, 0.32) 0 1px, transparent 1px),
    radial-gradient(circle at 63% 66%, rgba(248, 228, 181, 0.32) 0 1.2px, transparent 1.2px);
  background-size: 180px 180px, 220px 220px, 150px 150px, 240px 240px;
}

.page {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(26px, 5vw, 54px) 16px;
}

.invite {
  width: min(100%, 760px);
  text-align: center;
  padding: clamp(14px, 1.4vw, 20px) clamp(12px, 2.6vw, 24px) clamp(10px, 2.4vw, 20px);
  position: relative;
}

.flourish {
  margin: 0 auto;
  color: rgba(178, 135, 67, 0.9);
}

.flourish svg {
  width: 100%;
  height: auto;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.flourish.top {
  width: 105px;
  margin-bottom: 22px;
}

.kicker {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  font-size: clamp(0.84rem, 1.5vw, 1rem);
}

.names {
  margin: 16px 0 2px;
  font-size: clamp(2.7rem, 7.4vw, 5.1rem);
  line-height: 0.95;
  font-weight: 500;
}

.script {
  margin: 4px 0 8px;
  font-family: "Great Vibes", cursive;
  font-size: clamp(3rem, 8.5vw, 5.2rem);
  line-height: 0.95;
  font-weight: 400;
  color: rgba(150, 116, 73, 0.93);
}

.subhead {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6f533d;
  font-size: clamp(1.2rem, 2.7vw, 2.1rem);
}

.divider {
  width: min(64%, 470px);
  height: 1px;
  margin: clamp(24px, 3vw, 34px) auto clamp(20px, 2.7vw, 30px);
  background: linear-gradient(90deg, transparent, rgba(170, 139, 84, 0.38), transparent);
}

.scratch-wrap {
  position: relative;
  width: min(100%, 620px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  isolation: isolate;
}

.monogram {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: start center;
  padding-top: 7%;
  font-size: clamp(8.5rem, 18.2vw, 12.6rem);
  color: rgba(180, 155, 127, 0.26);
  line-height: 1;
  user-select: none;
}

.reveal {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 52%;
  height: 34%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  gap: clamp(2px, 0.7vw, 8px);
  text-align: center;
  z-index: 0;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.reveal p {
  margin: 0;
}

.reveal-date {
  font-size: clamp(1.2rem, 2.9vw, 2.45rem);
  line-height: 1.05;
}

.reveal-city {
  font-size: clamp(1.05rem, 2.5vw, 2.1rem);
}

.reveal-tag {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: clamp(0.96rem, 2.1vw, 1.66rem);
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  z-index: 2;
}

.start-forever {
  margin: clamp(2px, 0.7vw, 10px) auto 0;
  width: min(84%, 620px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(8px, 1.4vw, 14px);
  color: #7e644e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(1.05rem, 2.2vw, 2rem);
}

.start-forever .line {
  height: 3px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 88% 50%, rgba(255, 240, 171, 1), rgba(255, 240, 171, 0.2) 12px, transparent 20px),
    linear-gradient(90deg, rgba(189, 152, 73, 0.3), rgba(201, 163, 75, 1), rgba(189, 152, 73, 0.32));
}

.instruction {
  margin: clamp(16px, 2.6vw, 30px) 0 0;
  font-size: clamp(2.1rem, 5.4vw, 4.1rem);
  line-height: 1.05;
  font-weight: 400;
}

.closing {
  margin: clamp(20px, 2.9vw, 34px) 0 0;
  color: #7f6651;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.1;
}

.flourish.bottom {
  margin-top: clamp(16px, 2.2vw, 26px);
  width: min(160px, 35%);
}

.progress {
  margin: 12px auto 0;
  width: min(240px, 78%);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
}

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(170, 139, 84, 0.2);
}

.progress-fill {
  height: 100%;
  width: 0;
  transition: width 170ms linear;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2), var(--gold-3));
}

#progress-text {
  font-family: "Montserrat", sans-serif;
  color: var(--text-soft);
  font-size: 0.7rem;
}

.revealed .instruction {
  color: #7f6247;
}

@media (max-width: 820px) {
  .scratch-wrap {
    width: min(100%, 560px);
  }
}

@media (max-width: 640px) {
  .invite {
    width: min(100%, 420px);
    padding-top: 10px;
  }

  .kicker {
    letter-spacing: 0.11em;
  }

  .names {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
    margin-top: 12px;
  }

  .script {
    font-size: clamp(2.35rem, 10.4vw, 3.5rem);
  }

  .subhead {
    font-size: clamp(1rem, 4.7vw, 1.45rem);
    letter-spacing: 0.08em;
  }

  .divider {
    width: 84%;
    margin-top: 18px;
    margin-bottom: 14px;
  }

  .scratch-wrap {
    width: min(100%, 350px);
  }

  .monogram {
    font-size: clamp(5.8rem, 30vw, 7.6rem);
  }

  .reveal {
    top: 58%;
    width: 56%;
    height: 35%;
  }

  .reveal-date {
    font-size: clamp(1.18rem, 6vw, 1.55rem);
  }

  .reveal-city {
    font-size: clamp(1rem, 4.8vw, 1.3rem);
  }

  .reveal-tag {
    font-size: clamp(0.9rem, 4vw, 1.14rem);
  }

  .start-forever {
    width: 94%;
    font-size: clamp(0.98rem, 4vw, 1.18rem);
    gap: 7px;
    margin-top: 1px;
  }

  .start-forever .line {
    height: 2px;
  }

  .instruction {
    font-size: clamp(1.55rem, 8.5vw, 2.25rem);
    margin-top: 16px;
  }

  .closing {
    font-size: clamp(1.2rem, 6.2vw, 1.7rem);
    margin-top: 15px;
  }

  .flourish.bottom {
    margin-top: 12px;
    width: min(128px, 44%);
  }
}
