:root {
  color-scheme: light;
  --ink: #221716;
  --paper: #fff8ed;
  --paper-deep: #f1e8d8;
  --red: #a9070b;
  --rose: #d64562;
  --blue: #315f72;
  --green: #38664f;
  --gold: #c09037;
  --shadow: 0 18px 50px rgba(54, 22, 20, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(214, 69, 98, 0.12), transparent 28rem),
    linear-gradient(135deg, #fffaf0 0%, #f5ead9 42%, #fdf6ec 100%);
  font-family: Georgia, "Times New Roman", serif;
  overflow-x: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: 4px;
  background: rgba(255, 255, 255, 0.24);
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--rose), var(--gold));
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 22px;
  isolation: isolate;
  background: #750006;
}

.hero__video,
.hero__poster,
.hero__veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__video {
  object-fit: cover;
  opacity: 0.22;
  filter: saturate(1.2) contrast(1.1);
}

.hero__poster {
  object-fit: contain;
  object-position: center;
  transform: scale(1);
}

.hero__veil {
  background:
    linear-gradient(to bottom, rgba(35, 0, 0, 0.03), rgba(255, 248, 237, 0.02) 46%, rgba(55, 0, 0, 0.62)),
    radial-gradient(circle at 50% 52%, rgba(255, 248, 237, 0.02), rgba(80, 0, 0, 0.22) 70%);
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  width: min(100%, 440px);
  margin-top: auto;
  padding: 54svh 6px 58px;
  color: #fffdf7;
  text-align: center;
  text-shadow: 0 2px 18px rgba(62, 0, 0, 0.58);
}

.eyebrow {
  margin: 0 0 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1,
h2 {
  margin: 0;
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.65rem, 12.2vw, 5.6rem);
  text-wrap: balance;
}

.hero__note {
  max-width: 25rem;
  margin: 18px auto 22px;
  font-size: 1.05rem;
  line-height: 1.4;
}

.start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  backdrop-filter: blur(10px);
}

.scroll-cue {
  position: absolute;
  z-index: 3;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.month-rail {
  position: sticky;
  top: 4px;
  z-index: 15;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 12px;
  background: rgba(255, 248, 237, 0.84);
  border-bottom: 1px solid rgba(169, 7, 11, 0.14);
  backdrop-filter: blur(18px);
  scrollbar-width: none;
}

.month-rail::-webkit-scrollbar {
  display: none;
}

.month-rail a {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(34, 23, 22, 0.2);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  font: 700 0.75rem/1 ui-sans-serif, system-ui, sans-serif;
}

.month-rail a.is-active {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

#timeline {
  width: min(100%, 720px);
  margin: 0 auto;
}

.month {
  min-height: 100svh;
  position: relative;
  display: grid;
  align-content: center;
  gap: 22px;
  padding: 44px 18px 64px;
  border-bottom: 1px dashed rgba(34, 23, 22, 0.18);
}

.month__head {
  display: grid;
  gap: 8px;
}

.month__count {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--red);
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 1.35rem;
}

.month h2 {
  font-size: clamp(3rem, 16vw, 5.5rem);
}

.month__copy {
  margin: 0;
  max-width: 28rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.98rem;
  line-height: 1.55;
}

.layout {
  min-height: 520px;
  position: relative;
  border-radius: 4px;
}

.photo {
  position: absolute;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 2px;
  transform: rotate(var(--tilt));
  cursor: zoom-in;
  border: 9px solid #fff;
}

.photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.photo:active img {
  transform: scale(1.04);
}

.photo::after {
  content: attr(data-label);
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: 1.15rem;
  color: var(--red);
}

.style-polaroid .photo:nth-child(1) {
  width: 72%;
  height: 58%;
  left: 4%;
  top: 6%;
}

.style-polaroid .photo:nth-child(2) {
  width: 62%;
  height: 44%;
  right: 1%;
  bottom: 13%;
}

.style-polaroid .photo:nth-child(3) {
  width: 46%;
  height: 34%;
  left: 2%;
  bottom: 2%;
}

.style-stamp {
  background: linear-gradient(135deg, #eef0eb, #fffaf2);
}

.style-stamp .photo {
  border: 12px solid #fff;
  clip-path: polygon(0 4%, 4% 4%, 4% 0, 8% 0, 8% 4%, 12% 4%, 12% 0, 16% 0, 16% 4%, 20% 4%, 20% 0, 24% 0, 24% 4%, 28% 4%, 28% 0, 32% 0, 32% 4%, 36% 4%, 36% 0, 40% 0, 40% 4%, 44% 4%, 44% 0, 48% 0, 48% 4%, 52% 4%, 52% 0, 56% 0, 56% 4%, 60% 4%, 60% 0, 64% 0, 64% 4%, 68% 4%, 68% 0, 72% 0, 72% 4%, 76% 4%, 76% 0, 80% 0, 80% 4%, 84% 4%, 84% 0, 88% 0, 88% 4%, 92% 4%, 92% 0, 96% 0, 96% 4%, 100% 4%, 100% 96%, 96% 96%, 96% 100%, 92% 100%, 92% 96%, 88% 96%, 88% 100%, 84% 100%, 84% 96%, 80% 96%, 80% 100%, 76% 100%, 76% 96%, 72% 96%, 72% 100%, 68% 100%, 68% 96%, 64% 96%, 64% 100%, 60% 100%, 60% 96%, 56% 96%, 56% 100%, 52% 100%, 52% 96%, 48% 96%, 48% 100%, 44% 100%, 44% 96%, 40% 96%, 40% 100%, 36% 100%, 36% 96%, 32% 96%, 32% 100%, 28% 100%, 28% 96%, 24% 96%, 24% 100%, 20% 100%, 20% 96%, 16% 96%, 16% 100%, 12% 100%, 12% 96%, 8% 96%, 8% 100%, 4% 100%, 4% 96%, 0 96%);
}

.style-stamp .photo img,
.style-editorial .photo img {
  filter: grayscale(1) contrast(1.05);
}

.style-stamp .photo:nth-child(1),
.style-editorial .photo:nth-child(1) {
  width: 74%;
  height: 33%;
  left: 12%;
  top: 4%;
}

.style-stamp .photo:nth-child(2),
.style-editorial .photo:nth-child(2) {
  width: 82%;
  height: 34%;
  left: 5%;
  top: 34%;
}

.style-stamp .photo:nth-child(3),
.style-editorial .photo:nth-child(3) {
  width: 70%;
  height: 32%;
  right: 6%;
  bottom: 2%;
}

.style-poster .photo:nth-child(1) {
  width: 62%;
  height: 34%;
  left: 3%;
  top: 4%;
}

.style-poster .photo:nth-child(2) {
  width: 72%;
  height: 46%;
  right: 0;
  top: 30%;
}

.style-poster .photo:nth-child(3) {
  width: 52%;
  height: 28%;
  left: 0;
  bottom: 3%;
}

.style-poster::after {
  content: "I LOVE YOU";
  position: absolute;
  right: -30px;
  top: 60px;
  writing-mode: vertical-rl;
  color: var(--red);
  font: 900 4.3rem/0.78 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  opacity: 0.9;
}

.style-calendar {
  background: var(--red);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.42) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.42) 1px, transparent 1px);
  background-size: 33.33% 25%;
  padding: 18px;
}

.style-calendar .photo:nth-child(1) {
  width: 68%;
  height: 44%;
  left: 6%;
  top: 16%;
}

.style-calendar .photo:nth-child(2) {
  width: 50%;
  height: 35%;
  right: 2%;
  bottom: 10%;
}

.style-calendar .photo:nth-child(3) {
  width: 42%;
  height: 28%;
  left: 6%;
  bottom: 4%;
}

.style-film {
  background: #171313;
  border: 14px solid #171313;
}

.style-film .photo {
  border-width: 5px;
  box-shadow: none;
}

.style-film .photo img {
  filter: saturate(0.9) contrast(1.12);
}

.style-film .photo:nth-child(1) {
  width: 92%;
  height: 30%;
  left: 4%;
  top: 4%;
}

.style-film .photo:nth-child(2) {
  width: 92%;
  height: 30%;
  left: 4%;
  top: 35%;
}

.style-film .photo:nth-child(3) {
  width: 92%;
  height: 30%;
  left: 4%;
  bottom: 4%;
}

.style-film::before,
.style-film::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 10px;
  background: repeating-linear-gradient(90deg, #fff 0 10px, transparent 10px 21px);
}

.style-film::before {
  top: 8px;
}

.style-film::after {
  bottom: 8px;
}

.style-scrapbook {
  background:
    linear-gradient(90deg, rgba(49, 95, 114, 0.12), transparent),
    repeating-linear-gradient(0deg, rgba(34, 23, 22, 0.08) 0 1px, transparent 1px 28px);
}

.style-scrapbook .photo:nth-child(1) {
  width: 60%;
  height: 45%;
  left: 0;
  top: 6%;
}

.style-scrapbook .photo:nth-child(2) {
  width: 60%;
  height: 45%;
  right: 0;
  top: 28%;
}

.style-scrapbook .photo:nth-child(3) {
  width: 56%;
  height: 33%;
  left: 8%;
  bottom: 4%;
}

.layout .photo:nth-child(4) {
  width: 38%;
  height: 25%;
  right: 4%;
  bottom: 0;
  z-index: 4;
}

.month__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tiny-button {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid rgba(34, 23, 22, 0.24);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  font: 700 0.78rem/1 ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.heart {
  position: fixed;
  z-index: 30;
  width: 16px;
  height: 16px;
  pointer-events: none;
  color: var(--rose);
  animation: floatUp 900ms ease-out forwards;
}

@keyframes floatUp {
  to {
    transform: translateY(-60px) rotate(18deg);
    opacity: 0;
  }
}

.finale {
  min-height: 88svh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  color: #fffaf0;
  background:
    linear-gradient(rgba(70, 0, 5, 0.1), rgba(70, 0, 5, 0.58)),
    var(--red);
  text-align: center;
}

.finale__inner {
  width: min(100%, 520px);
}

.finale h2 {
  font-size: clamp(3rem, 13vw, 5rem);
}

.finale p:not(.eyebrow) {
  font-size: 1.1rem;
  line-height: 1.45;
}

.lightbox {
  width: min(calc(100% - 26px), 560px);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #fffaf0;
  box-shadow: 0 25px 90px rgba(0, 0, 0, 0.38);
}

.lightbox::backdrop {
  background: rgba(34, 23, 22, 0.62);
  backdrop-filter: blur(8px);
}

.lightbox img {
  width: 100%;
  max-height: 76svh;
  object-fit: contain;
  display: block;
}

.lightbox p {
  margin: 0;
  padding: 12px 16px 16px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.lightbox__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.54);
  font-size: 1.7rem;
  line-height: 1;
}

@media (min-width: 760px) {
  .hero__poster {
    object-fit: contain;
    background: #750006;
  }

  .hero__content {
    padding-top: 64svh;
  }

  .month {
    grid-template-columns: 0.8fr 1.2fr;
    align-items: center;
    gap: 32px;
    padding-inline: 28px;
  }

  .month__head,
  .month__actions {
    grid-column: 1;
  }

  .layout {
    grid-column: 2;
    grid-row: 1 / span 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
