:root {
  color-scheme: light;
  --paper: #f7f1e8;
  --white: #fffaf4;
  --ink: #2f2723;
  --muted: #6f5e55;
  --berry: #9b394d;
  --berry-dark: #7b2b3d;
  --line: #dfd0c4;
  --serif: "Noto Serif SC", "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  --sans: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 83% 14%, #f3dfd5 0%, transparent 33rem),
    radial-gradient(ellipse at 8% 70%, #efe4d7 0%, transparent 37rem),
    var(--paper);
  font: 16px/1.65 var(--sans);
}

h1, h2, h3, p, figure, dl, dd { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--berry); outline-offset: 5px; }
section, #days { scroll-margin-top: 28px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell { width: min(1184px, calc(100% - 112px)); margin-inline: auto; }

.site-header, .site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 80px;
}

.site-header { border-bottom: 1px solid var(--line); }
.site-footer { border-top: 1px solid var(--line); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 700 19px/1.2 var(--serif);
  white-space: nowrap;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--white);
  background: var(--berry);
  font: 15px/1 var(--sans);
}

nav { display: flex; gap: clamp(14px, 3vw, 38px); }
nav a, .text-link { font-size: 14px; font-weight: 600; }
nav a { color: var(--muted); white-space: nowrap; }
nav a:hover, .text-link:hover { color: var(--berry-dark); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: clamp(36px, 6.5vw, 94px);
  align-items: center;
  min-height: 660px;
  padding-block: 76px 87px;
}

.since {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--berry-dark);
  font: 600 12px/1.3 ui-monospace, "Consolas", monospace;
  letter-spacing: .13em;
}

.since > span {
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--berry);
  box-shadow: 0 0 0 4px #edd3d4;
}

h1, h2, h3 { font-family: var(--serif); }

h1 {
  font-size: clamp(52px, 7.5vw, 108px);
  font-weight: 900;
  line-height: 1.07;
  letter-spacing: -.065em;
}

h1 em { color: var(--berry); font-style: normal; }
.intro { margin-top: 26px; color: var(--muted); line-height: 1.9; }

.counter {
  width: min(100%, 424px);
  margin-top: 28px;
  padding-block: 15px 16px;
  border-block: 1px solid var(--line);
}

.counter p { color: var(--muted); font-size: 12px; letter-spacing: .1em; }

.counter dl {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) repeat(3, minmax(0, 1fr));
  margin-top: 8px;
}

.counter dl > div {
  display: flex;
  flex-direction: column;
  padding-inline: clamp(8px, 1.6vw, 22px) 0;
}
.counter dl > div:first-child { padding-left: 0; }
.counter dl > div + div { border-left: 1px solid var(--line); }

.counter dd {
  order: -1;
  font: 400 clamp(25px, 3.4vw, 45px)/1 Georgia, serif;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

.counter dl > div:first-child dd { color: var(--berry-dark); }
.counter dt { margin-top: 5px; color: var(--muted); font-size: 11px; }

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 25px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 11px 19px;
  border-radius: 100px;
  color: var(--white);
  background: var(--berry);
  font-size: 14px;
  font-weight: 600;
  transition: background-color .2s;
}

.button:hover { background: var(--berry-dark); }
.button span, .text-link span { font-size: 16px; }
.text-link span { margin-left: 5px; color: var(--berry-dark); }

.portrait-wrap {
  position: relative;
  isolation: isolate;
  width: min(100%, 435px);
  margin-inline: auto;
}

.portrait-wrap::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px 5px 2px 1px;
  border: 1px solid #d9c1b7;
  background: #ecdad0;
  transform: rotate(-5deg);
}

.portrait {
  position: relative;
  padding: 13px 13px 0;
  background: var(--white);
  box-shadow: 0 14px 38px #68463924, 0 3px 8px #68463914;
  transform: rotate(3deg);
}

.portrait::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -13px;
  left: 50%;
  width: 30%;
  height: 33px;
  background: repeating-linear-gradient(106deg, #eac2afbb 0 3px, #f0cbb8a6 3px 7px);
  transform: translateX(-50%) rotate(-8deg);
  clip-path: polygon(1% 0, 97% 0, 100% 14%, 98% 27%, 100% 47%, 98% 67%, 100% 82%, 98% 100%, 1% 100%, 2% 79%, 0 60%, 2% 44%, 0 21%);
}

.portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 4.55;
  object-fit: cover;
  object-position: center 59%;
  background: #e2b59c;
}

.portrait figcaption {
  padding: 15px 4px 17px;
  text-align: center;
  color: var(--berry-dark);
  font: 700 clamp(15px, 2vw, 22px)/1.2 var(--serif);
  letter-spacing: .07em;
}

.portrait figcaption span[aria-hidden="true"] { font-family: Georgia, serif; font-style: italic; }
.portrait-heart { margin-left: 6px; }

.spark { position: absolute; z-index: 2; color: var(--berry); line-height: 1; pointer-events: none; }
.spark-large { top: 9%; right: -8%; font-size: clamp(36px, 5vw, 66px); }
.spark-small { top: 5%; right: -10%; font-size: clamp(15px, 1.6vw, 22px); }

.memories { padding-block: 54px 78px; border-top: 1px solid var(--line); }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: 27px;
}

h2 { font-size: clamp(32px, 4.1vw, 54px); font-weight: 900; line-height: 1.22; letter-spacing: -.04em; }
.section-heading p, .memory-copy p { color: var(--muted); font-size: 14px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); }

.memory {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e6d8cd;
  background: var(--white);
  box-shadow: 0 4px 13px #6846390c;
}

.memory-photo { display: block; overflow: hidden; background: #e2b59c; cursor: zoom-in; }

.memory-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  transition: transform .3s ease;
}

.memory-photo:hover img { transform: scale(1.045); }
.memory-copy { padding: 13px 8px 12px; }
.memory-copy time { color: var(--berry-dark); font: 600 12px/1.4 ui-monospace, "Consolas", monospace; letter-spacing: .09em; }
.memory-copy h3 { margin-block: 3px 4px; font-size: clamp(19px, 2.1vw, 25px); line-height: 1.35; }

.letter {
  position: relative;
  margin-bottom: 65px;
  padding: 46px 22px 42px;
  border: 1px solid #e3c6c8;
  background: radial-gradient(ellipse at top, #f7e5df, #f0dbda);
  text-align: center;
}

.letter-heart { display: block; margin-bottom: 12px; color: var(--berry); font: 42px/1 Georgia, serif; }
.letter h2 { margin-bottom: 17px; }
.letter summary { display: inline-block; list-style: none; color: var(--berry-dark); font-size: 14px; font-weight: 700; cursor: pointer; }
.letter summary::-webkit-details-marker { display: none; }
.letter summary span { border-bottom: 1px solid currentColor; }
.letter details:not([open]) summary span:last-child, .letter details[open] summary span:first-child { display: none; }

.letter-body {
  max-width: 480px;
  margin: 21px auto 0;
  padding-top: 20px;
  border-top: 1px solid #dfbfc0;
  text-align: left;
  line-height: 1.9;
}

.letter-body p + p { margin-top: 12px; }

.lightbox {
  width: fit-content;
  max-width: calc(100vw - 28px);
  max-height: calc(100dvh - 28px);
  padding: 9px;
  border: 0;
  background: var(--white);
}

.lightbox::backdrop { background: #271b18da; }
.lightbox img { max-width: min(720px, calc(100vw - 46px)); max-height: calc(100dvh - 46px); object-fit: contain; }

.lightbox button {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--white);
  font: 27px/1 var(--sans);
  cursor: pointer;
}

@media (max-width: 1100px) {
  .shell { width: calc(100% - 80px); }
  .hero { min-height: 0; padding-block: 66px 77px; }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 48px); }
  .site-header, .site-footer { min-height: 67px; }
  .brand { font-size: 17px; }
  .brand-icon { width: 29px; height: 29px; }
  nav a { font-size: 13px; }
  .hero { grid-template-columns: 1fr; gap: 46px; padding-block: 45px 59px; }
  h1 { font-size: clamp(50px, 11.7vw, 82px); }
  .intro { margin-top: 18px; }
  .counter { margin-top: 21px; }
  .counter dd { font-size: clamp(34px, 6vw, 44px); }
  .portrait-wrap { width: min(85%, 390px); }
  .portrait { padding: 10px 10px 0; }
  .portrait figcaption { padding-block: 13px; }
  .memories { padding-block: 37px 49px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .letter { margin-bottom: 44px; }
}

@media (max-width: 500px) {
  .photo-grid { grid-template-columns: 1fr; }
  .memory-photo img { aspect-ratio: 4 / 3; }
  .intro { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .memory-photo img { transition: none; }
  .memory-photo:hover img { transform: none; }
}
