@font-face { font-family: "Instrument Serif"; src: url(lib/fonts/instrument-serif-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(lib/fonts/instrument-serif-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(lib/fonts/figtree-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(lib/fonts/figtree-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(lib/fonts/figtree-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --scarlet: #B3122E;
  --scarlet-deep: #8A0C22;
  --wine: #2E0811;
  --blush: #FCECEE;
  --rose: #F2B8C0;
  --white: #FFFFFF;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Figtree", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--blush);
  color: var(--wine);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  background: var(--scarlet);
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vh 6vw;
  position: relative;
  overflow: hidden;
}
.names {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4.5rem, 17vw, 15rem);
  line-height: 0.82;
  letter-spacing: -0.02em;
  margin: 0 0 6vh;
  display: grid;
}
.names .n1 { justify-self: start; }
.names .amp {
  font-style: italic;
  color: var(--rose);
  justify-self: center;
  font-size: 0.7em;
  line-height: 1;
}
.names .n2 { justify-self: end; }

.counter {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
  line-height: 1.25;
  max-width: 26ch;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.counter b { font-weight: 400; font-style: italic; color: var(--rose); }
.since {
  margin: 1rem 0 0;
  font-size: 0.95rem;
  opacity: 0.8;
}

/* one load sequence */
@media (prefers-reduced-motion: no-preference) {
  .names span { opacity: 0; transform: translateY(0.15em); animation: rise 1.1s cubic-bezier(.2,.7,.2,1) forwards; }
  .names .amp { animation-delay: .35s; }
  .names .n2 { animation-delay: .6s; }
  .counter, .since { opacity: 0; animation: fade 1s ease 1.2s forwards; }
  .hero .since { animation-delay: 1.5s; }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

/* ---------- shared ---------- */
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1;
  margin: 0 0 3.5rem;
  color: var(--scarlet);
}

/* ---------- timeline ---------- */
.timeline-wrap {
  padding: 7rem 6vw 5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--rose);
  transform: translateX(-1px);
}
.memory {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 5rem;
  position: relative;
}
.memory::after {           /* dot on the line */
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--scarlet);
  border: 3px solid var(--blush);
  transform: translate(-50%, -50%);
}
.memory:nth-child(even) .print { order: 2; }

.print {
  background: var(--white);
  padding: 12px 12px 14px;
  box-shadow: 0 1px 2px rgba(46, 8, 17, .12), 0 12px 30px -12px rgba(46, 8, 17, .35);
  transform: rotate(-2deg);
  margin: 0;
}
.memory:nth-child(even) .print { transform: rotate(1.6deg); }
.print img, .print .empty {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--blush);
}
.print .empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: var(--scarlet);
  font-size: 0.85rem;
  border: 1px dashed var(--rose);
}
.print figcaption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  padding-top: 10px;
  text-align: center;
}

.memory-text time {
  display: block;
  color: var(--scarlet);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.memory-text h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.05;
  margin: 0 0 0.75rem;
}
.memory-text p { margin: 0; max-width: 36ch; }
.memory:nth-child(odd) .memory-text { padding-left: 1rem; }
.memory:nth-child(even) .memory-text { text-align: right; padding-right: 1rem; }
.memory:nth-child(even) .memory-text p { margin-left: auto; }

/* ---------- reasons ---------- */
.reasons {
  background: var(--wine);
  color: var(--blush);
  padding: 7rem 6vw;
  text-align: center;
}
.reasons .section-title { color: var(--rose); }
.reason {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.12;
  max-width: 20ch;
  min-height: 3.4em;
  margin: 0 auto 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (prefers-reduced-motion: no-preference) {
  .reason.swap { animation: swap .5s ease; }
}
@keyframes swap { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

.btn {
  font: 600 1rem var(--sans);
  background: var(--scarlet);
  color: var(--white);
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.8rem;
  cursor: pointer;
}
.btn:hover { background: var(--scarlet-deep); }
.btn:active { transform: scale(.97); }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }

/* ---------- map ---------- */
.places {
  padding: 7rem 6vw 5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.map {
  height: 460px;
  border: 10px solid var(--white);
  box-shadow: 0 12px 30px -14px rgba(46, 8, 17, .4);
}
.place-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.place-list button {
  font: 500 0.95rem var(--sans);
  background: transparent;
  color: var(--wine);
  border: 1.5px solid var(--rose);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
}
.place-list button:hover { border-color: var(--scarlet); color: var(--scarlet); }
.leaflet-popup-content { font-family: var(--sans); color: var(--wine); }
.leaflet-popup-content strong { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; display: block; }

/* ---------- letter ---------- */
.letter {
  background: var(--scarlet);
  color: var(--white);
  padding: 8rem 6vw 9rem;
}
.letter-body {
  max-width: 34rem;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.5;
}
.letter-body p { margin: 0 0 1.2em; }
.letter-body .sign { font-style: italic; color: var(--rose); font-size: 1.3em; margin-top: 2rem; }

/* ---------- phone ---------- */
@media (max-width: 720px) {
  .hero { padding: 10vh 16px; }
  .timeline-wrap, .places { padding-left: 16px; padding-right: 16px; }
  .reasons, .letter { padding-left: 16px; padding-right: 16px; }
  .timeline::before { left: 7px; }
  .memory {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-left: 2.2rem;
    margin-bottom: 4rem;
  }
  .memory::after { left: 8px; top: 0.6rem; transform: translateX(-50%); }
  .memory:nth-child(even) .print { order: 0; }
  .memory .memory-text, .memory:nth-child(even) .memory-text { text-align: left; padding: 0; }
  .memory:nth-child(even) .memory-text p { margin-left: 0; }
  .map { height: 340px; border-width: 6px; }
}
