:root {
  --cream: #fbf7ef;
  --cream-deep: #f2eadf;
  --paper: #fffdfa;
  --green: #0f332c;
  --green-soft: #21483f;
  --gold: #c89543;
  --gold-light: #e5c17b;
  --ink: #1d2320;
  --muted: #6c6b64;
  --shadow: 0 18px 45px rgba(32, 47, 40, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 10% 18%, rgba(201, 149, 67, 0.1), transparent 28%),
    linear-gradient(180deg, #fffdfa 0%, var(--cream) 48%, #fffdfa 100%);
}

body::before {
  position: fixed;
  inset: 0 auto auto 0;
  width: 48vw;
  max-width: 260px;
  height: 70vh;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(ellipse at 16% 22%, rgba(15, 51, 44, 0.08) 0 11%, transparent 12%),
    radial-gradient(ellipse at 24% 34%, rgba(15, 51, 44, 0.07) 0 10%, transparent 11%),
    radial-gradient(ellipse at 10% 45%, rgba(15, 51, 44, 0.06) 0 9%, transparent 10%);
  filter: blur(10px);
  opacity: 0.55;
}

.page {
  position: relative;
  width: min(100%, 920px);
  margin: 0 auto;
  overflow: hidden;
}

.hero {
  min-height: 100svh;
  padding: 52px 22px 58px;
  text-align: center;
}

.heart-pair {
  position: absolute;
  top: 34px;
  left: 24px;
  width: 72px;
  height: 50px;
}

.heart-pair span {
  position: absolute;
  width: 31px;
  height: 31px;
  border: 2px solid var(--gold);
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
  border-radius: 0 0 7px 0;
}

.heart-pair span::before,
.heart-pair span::after {
  position: absolute;
  content: "";
  border: 2px solid var(--gold);
  border-radius: 999px;
}

.heart-pair span::before {
  width: 17px;
  height: 31px;
  top: -14px;
  left: -2px;
  border-right: 0;
}

.heart-pair span::after {
  width: 31px;
  height: 17px;
  top: -2px;
  left: -14px;
  border-bottom: 0;
}

.heart-pair span + span {
  top: 14px;
  left: 30px;
}

.date-top {
  margin: 54px 0 18px;
  color: var(--green);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--green);
  font-size: clamp(4.5rem, 22vw, 7.5rem);
  font-weight: 500;
  line-height: 0.86;
}

h1 span {
  color: var(--gold);
  font-size: 0.54em;
  font-weight: 400;
  vertical-align: 0.12em;
}

.divider,
.mini-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 32px auto 28px;
  color: var(--gold);
}

.divider span,
.mini-divider span {
  width: 76px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.divider strong,
.mini-divider strong {
  font-size: 1.65rem;
  line-height: 1;
}

.hero h2,
.steps h2 {
  color: var(--green);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 500;
  line-height: 1.05;
}

.intro {
  max-width: 540px;
  margin: 20px auto 0;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.05rem, 4.7vw, 1.4rem);
  line-height: 1.55;
}

.upload-card {
  width: min(100%, 640px);
  margin: 58px auto 0;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.upload-button {
  position: relative;
  display: grid;
  min-height: 164px;
  padding: 54px 20px 24px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  color: #fffaf2;
  background:
    radial-gradient(circle at 72% 28%, rgba(229, 193, 123, 0.2), transparent 28%),
    linear-gradient(135deg, var(--green-soft), #0d3029 72%);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  touch-action: manipulation;
}

.upload-button:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 10px 28px rgba(32, 47, 40, 0.18);
}

.upload-button:focus-within,
.file-input:focus + .upload-button {
  outline: 3px solid rgba(201, 149, 67, 0.34);
  outline-offset: 4px;
}

.upload-button > span:not(.camera-badge) {
  max-width: 100%;
  font-size: clamp(1.85rem, 8vw, 2.8rem);
  line-height: 1.08;
}

.upload-button small {
  margin-top: 16px;
  color: rgba(255, 250, 242, 0.78);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
}

.camera-badge {
  position: absolute;
  top: -38px;
  left: 50%;
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #f6eee4, #fffdfa);
  box-shadow: 0 10px 26px rgba(32, 47, 40, 0.13);
  transform: translateX(-50%);
}

.camera-badge svg {
  width: 48px;
  height: 48px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.camera-badge svg {
  color: var(--green);
}

.camera-badge path:last-child {
  color: var(--gold);
  fill: rgba(201, 149, 67, 0.18);
}

.hint {
  margin-top: 18px;
  color: var(--muted);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.98rem;
  line-height: 1.45;
}

.steps {
  padding: 48px 22px 58px;
  border-top: 1px solid rgba(201, 149, 67, 0.16);
  border-bottom: 1px solid rgba(201, 149, 67, 0.16);
  background: rgba(255, 253, 250, 0.54);
  text-align: center;
}

.steps h2 {
  font-size: clamp(2rem, 7.5vw, 2.8rem);
}

.mini-divider {
  margin: 22px auto 28px;
  gap: 12px;
}

.mini-divider span {
  width: 46px;
}

.mini-divider strong {
  font-size: 1.25rem;
}

.step-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  max-width: 760px;
  margin: 0 auto;
}

.step-grid article {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 178px;
}

.icon-circle {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 999px;
  color: var(--green);
  background: linear-gradient(180deg, #f8f2ea, #fffdfa);
  box-shadow: inset 0 0 0 1px rgba(201, 149, 67, 0.08);
}

.icon-circle svg {
  width: 48px;
  height: 48px;
}

.step-grid h3 {
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.04rem;
  font-weight: 700;
}

.step-grid p,
.thanks p:not(.script) {
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

.thanks {
  padding: 42px 22px 58px;
  text-align: center;
}

.script {
  color: var(--gold);
  font-size: clamp(3.3rem, 15vw, 5rem);
  font-style: italic;
  line-height: 0.98;
}

.leaf-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
  color: var(--gold);
}

.leaf-line span {
  width: 86px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
}

.leaf-line strong {
  font-size: 1.25rem;
}

.result-page {
  display: grid;
  min-height: 100svh;
  padding: 24px;
  place-items: center;
}

.result-card {
  width: min(100%, 620px);
  padding: 42px 24px 36px;
  border: 1px solid rgba(201, 149, 67, 0.2);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}

.result-card .date-top {
  margin: 0 0 18px;
  letter-spacing: 0;
}

.result-card h1 {
  margin-bottom: 18px;
  color: var(--green);
  font-size: clamp(3.2rem, 15vw, 5.2rem);
  line-height: 0.95;
}

.result-card p:not(.date-top) {
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.12rem;
  line-height: 1.55;
}

.result-card.error h1 {
  font-size: clamp(2.7rem, 13vw, 4.4rem);
}

.back-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  padding: 0 22px;
  border: 1px solid rgba(201, 149, 67, 0.45);
  border-radius: 999px;
  color: var(--green);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(251, 247, 239, 0.88);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(8px);
}

.upload-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.upload-overlay-card {
  width: min(100%, 360px);
  padding: 32px 24px 28px;
  border: 1px solid rgba(201, 149, 67, 0.24);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.96);
  box-shadow: var(--shadow);
  text-align: center;
}

.upload-spinner {
  width: 58px;
  height: 58px;
  margin: 0 auto 22px;
  border: 4px solid rgba(201, 149, 67, 0.24);
  border-top-color: var(--green);
  border-radius: 999px;
  animation: upload-spin 900ms linear infinite;
}

.upload-overlay-title {
  color: var(--green);
  font-size: clamp(1.65rem, 7vw, 2.1rem);
  line-height: 1.08;
}

.upload-overlay-text {
  margin-top: 14px;
  color: var(--muted);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.45;
}

@keyframes upload-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 720px) {
  .hero {
    padding-top: 78px;
  }

  .date-top {
    margin-top: 36px;
  }

  .step-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
  }

  .step-grid article {
    padding: 0 28px;
  }

  .step-grid article + article {
    border-left: 1px solid rgba(201, 149, 67, 0.34);
  }
}
