:root {
  --paper: #fbf7f0;
  --paper-deep: #f0e5d8;
  --ink: #382c2b;
  --muted: #806f69;
  --rose: #b66a68;
  --rose-deep: #8f4749;
  --sage: #7c8b78;
  --gold: #b39362;
  --white: #fffdf9;
  --shadow: 0 18px 52px rgba(85, 60, 49, 0.14);
  --radius: 8px;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(251, 247, 240, 0.96), rgba(248, 241, 232, 0.96)),
    repeating-linear-gradient(90deg, rgba(142, 100, 80, 0.028) 0 1px, transparent 1px 5px);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", Arial, sans-serif;
  letter-spacing: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.page-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.24;
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0.24), transparent 42%),
    repeating-linear-gradient(0deg, rgba(56, 44, 43, 0.018) 0 1px, transparent 1px 4px);
  mix-blend-mode: multiply;
}

.hero {
  position: relative;
  min-height: 100svh;
  padding: 28px clamp(20px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #fffaf3;
  background:
    linear-gradient(90deg, rgba(32, 22, 23, 0.72), rgba(32, 22, 23, 0.3) 48%, rgba(32, 22, 23, 0.54)),
    linear-gradient(180deg, rgba(32, 22, 23, 0.16), rgba(32, 22, 23, 0.72)),
    url("images/optimized/_X9A0203.jpg") center / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(251, 247, 240, 0.96));
  pointer-events: none;
}

.hero__nav,
.hero__copy,
.hero__promise {
  position: relative;
  z-index: 1;
}

.hero__nav {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 250, 243, 0.86);
}

.hero__nav span:first-child {
  font-weight: 700;
}

.hero__copy {
  width: min(720px, 100%);
  padding-block: 12vh 10vh;
}

.eyebrow,
.section-tag {
  margin: 0 0 16px;
  color: var(--rose-deep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: #f6d7ca;
}

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

h1 {
  margin-bottom: 20px;
  max-width: 680px;
  font-size: clamp(42px, 8vw, 86px);
  line-height: 1.08;
  font-weight: 650;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 22px;
  font-size: clamp(29px, 5vw, 52px);
  line-height: 1.18;
  font-weight: 650;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.22;
  font-weight: 650;
  letter-spacing: 0;
}

.hero__copy p:not(.eyebrow) {
  width: min(620px, 100%);
  margin: 0;
  color: rgba(255, 250, 243, 0.9);
  font-size: clamp(16px, 2.5vw, 20px);
  line-height: 1.9;
}

.hero__promise {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  color: rgba(255, 250, 243, 0.9);
  font-size: 14px;
}

.hero__promise a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 250, 243, 0.72);
  border-radius: 50%;
  text-decoration: none;
  font-size: 24px;
  line-height: 1;
  transition: transform 180ms ease, background 180ms ease;
}

.hero__promise a:hover {
  transform: translateY(3px);
  background: rgba(255, 250, 243, 0.14);
}

.section {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
  padding: clamp(62px, 9vw, 120px) 0;
}

.letter-section {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr;
  gap: clamp(28px, 6vw, 82px);
  align-items: start;
}

.letter-copy,
.story__body,
.note-grid,
.future-grid,
.whisper-copy,
.ending__copy {
  color: var(--muted);
  font-size: 17px;
  line-height: 2.05;
}

.letter-copy p:last-child,
.story__body p:last-child,
.note-grid p:last-child,
.future-grid p:last-child,
.whisper-copy p:last-child,
.ending__copy p:last-child {
  margin-bottom: 0;
}

.story {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 78px);
  align-items: center;
}

.story--reverse {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
}

.story--reverse .story__media {
  order: 2;
}

.story__media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--paper-deep);
}

.story__media img {
  width: 100%;
  height: clamp(420px, 62vw, 680px);
  object-fit: cover;
}

.story--first .story__media img {
  object-position: center 28%;
}

.story--reverse .story__media img {
  object-position: center 36%;
}

.note-block {
  width: min(960px, calc(100% - 40px));
  text-align: center;
}

.note-grid,
.future-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  text-align: left;
}

.note-grid p,
.future-grid p {
  margin: 0;
  padding: 22px;
  background: rgba(255, 253, 249, 0.74);
  border: 1px solid rgba(179, 147, 98, 0.26);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(85, 60, 49, 0.08);
}

.gallery-intro {
  padding-bottom: 36px;
}

.gallery-intro p:not(.section-tag) {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 2;
}

.album {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: clamp(34px, 6vw, 70px) 0;
}

.album__head {
  width: min(820px, calc(100% - 16px));
  margin: 0 auto 24px;
}

.album__head p:not(.section-tag) {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.album__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(16px, calc((100vw - 1120px) / 2));
  padding: 8px max(16px, calc((100vw - 1120px) / 2)) 26px;
  -webkit-overflow-scrolling: touch;
}

.album__track:focus {
  outline: 2px solid rgba(182, 106, 104, 0.34);
  outline-offset: 6px;
}

.album__track::-webkit-scrollbar {
  height: 8px;
}

.album__track::-webkit-scrollbar-track {
  background: rgba(179, 147, 98, 0.12);
  border-radius: 999px;
}

.album__track::-webkit-scrollbar-thumb {
  background: rgba(143, 71, 73, 0.36);
  border-radius: 999px;
}

.photo-card {
  flex: 0 0 min(76vw, 330px);
  margin: 0;
  scroll-snap-align: center;
  background: var(--white);
  border: 1px solid rgba(179, 147, 98, 0.22);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(85, 60, 49, 0.12);
  transform: translateZ(0);
  transition: transform 220ms ease, box-shadow 220ms ease;
  cursor: zoom-in;
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(85, 60, 49, 0.18);
}

.photo-card img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  background: var(--paper-deep);
}

.photo-card--wide {
  flex-basis: min(86vw, 520px);
}

.photo-card--wide img {
  height: 360px;
}

.photo-card--tall:nth-child(2n) {
  margin-top: 22px;
}

.photo-card--wide:nth-child(2n + 1) {
  margin-top: 18px;
}

.photo-card figcaption {
  min-height: 78px;
  padding: 16px 18px 18px;
  color: #6f5d58;
  font-size: 15px;
  line-height: 1.65;
}

.future-section {
  width: min(1040px, calc(100% - 40px));
}

.vow-section {
  width: min(920px, calc(100% - 40px));
}

.vow-card {
  padding: clamp(28px, 6vw, 58px);
  border: 1px solid rgba(179, 147, 98, 0.34);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.96), rgba(245, 232, 221, 0.9));
  box-shadow: var(--shadow);
}

.vow-card p:not(.section-tag) {
  color: var(--muted);
  font-size: 17px;
  line-height: 2.05;
}

.whisper-section {
  width: min(900px, calc(100% - 40px));
  text-align: center;
}

.whisper-copy {
  text-align: left;
  padding: clamp(22px, 5vw, 42px);
  background: rgba(255, 253, 249, 0.76);
  border-left: 3px solid var(--rose);
  border-radius: var(--radius);
  box-shadow: 0 16px 38px rgba(85, 60, 49, 0.1);
}

.ending {
  width: min(1120px, calc(100% - 40px));
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1fr);
  gap: clamp(24px, 6vw, 78px);
  align-items: center;
  padding-bottom: clamp(70px, 10vw, 130px);
}

.ending > img {
  width: 100%;
  height: clamp(420px, 62vw, 680px);
  object-fit: cover;
  object-position: center 40%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.signature {
  margin-top: 34px;
  color: var(--ink);
  font-size: 18px;
}

.signature strong {
  display: inline-block;
  margin-top: 8px;
  color: var(--rose-deep);
  font-size: 28px;
  font-weight: 650;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 14px;
  padding: 28px;
  background: rgba(38, 29, 29, 0.86);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32);
}

.lightbox p {
  max-width: min(820px, 92vw);
  margin: 0;
  color: #fff7ef;
  text-align: center;
  line-height: 1.8;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 247, 239, 0.55);
  border-radius: 50%;
  color: #fff7ef;
  background: rgba(255, 247, 239, 0.08);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 620ms ease, transform 620ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .hero {
    padding: 22px 20px;
    background-position: 44% center;
  }

  .hero__nav {
    font-size: 12px;
  }

  .hero__copy {
    padding-block: 18vh 12vh;
  }

  .section,
  .note-block,
  .future-section,
  .vow-section,
  .whisper-section,
  .ending {
    width: min(100% - 32px, var(--max));
  }

  .letter-section,
  .story,
  .story--reverse,
  .ending {
    grid-template-columns: 1fr;
  }

  .story--reverse .story__media {
    order: 0;
  }

  .story__media img,
  .ending > img {
    height: min(116vw, 620px);
  }

  .note-grid,
  .future-grid {
    grid-template-columns: 1fr;
  }

  .album {
    width: 100%;
  }

  .photo-card {
    flex-basis: min(78vw, 330px);
  }

  .photo-card img {
    height: 390px;
  }

  .photo-card--wide {
    flex-basis: min(84vw, 460px);
  }

  .photo-card--wide img {
    height: 330px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 30px;
  }

  h3 {
    font-size: 25px;
  }

  .hero__copy p:not(.eyebrow),
  .letter-copy,
  .story__body,
  .note-grid,
  .future-grid,
  .whisper-copy,
  .ending__copy,
  .vow-card p:not(.section-tag) {
    font-size: 16px;
    line-height: 1.95;
  }

  .hero__nav span:last-child {
    display: none;
  }

  .photo-card img {
    height: 360px;
  }

  .photo-card--wide img {
    height: 290px;
  }

  .photo-card figcaption {
    min-height: 86px;
    font-size: 14px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
