:root {
  color-scheme: light;
  --cream: #f7f1e6;
  --ink: #382921;
  --muted: #67574b;
  --rose: #773f3a;
  --border: #d9caba;
  --serif: "Nanum Myeongjo", "Songti SC", "Batang", serif;
  --sans: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 0, #fffff780, transparent 730px), var(--cream);
  font: 16px/1.75 var(--sans);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
h1, h2, p, figure { margin: 0; }
h1, h2 { font-family: var(--serif); letter-spacing: -.045em; }
a { color: inherit; }
button { cursor: pointer; }
img { display: block; width: 100%; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 4px; }
main, .masthead { width: min(100% - 48px, 980px); margin-inline: auto; }
.masthead { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.masthead a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 14px var(--serif); }
.brand-mark { width: 13px; height: 9px; border: 1px solid var(--rose); display: inline-block; position: relative; }
.brand-mark::after { content: ""; position: absolute; width: 6px; height: 6px; border: solid var(--rose); border-width: 0 1px 1px 0; left: 2px; top: -3px; transform: rotate(45deg); }
.sample { color: var(--muted); font-size: 12px; }
.cover { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 7%; padding: 62px 4% 52px; }
.recipient { color: var(--rose); font: 700 18px/1.5 var(--serif); margin-bottom: 12px; }
.cover h1 { font-size: clamp(48px, 7.3vw, 90px); line-height: 1.04; }
.cover h1 em { color: var(--rose); font-style: normal; }
.dedication { color: var(--muted); font: 16px/1.6 var(--serif); margin-top: 18px; }
.cover-photo { width: min(100%, 365px); justify-self: center; padding: 14px; background: #ede1cd; border: 1px solid #ddcdb5; box-shadow: 2px 6px 15px #57392315; transform: rotate(2deg); }
.photo-mount { position: relative; padding: 8px; background: #fffaf0; }
.photo-mount::before, .photo-mount::after { content: ""; position: absolute; z-index: 1; width: 27px; height: 27px; background: #ad886a; }
.photo-mount::before { left: 0; top: 0; clip-path: polygon(0 0,100% 0,0 100%); }
.photo-mount::after { right: 0; bottom: 0; clip-path: polygon(100% 0,100% 100%,0 100%); }
.photo-mount img { aspect-ratio: 1; height: auto; object-fit: cover; }
.contents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 37px; border-bottom: 1px solid var(--border); }
.contents :is(a, button) { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 12px; min-height: 60px; padding: 12px 17px; border: 1px solid var(--border); background: #fffaf0; text-decoration: none; font-size: 14px; }
.contents :is(a, button):hover { background: #f1e4d6; }
.contents button { color: inherit; font-family: inherit; text-align: left; }
.contents button[aria-expanded="true"] .arrow { transform: rotate(180deg); }
.arrow { color: var(--rose); }
.index-icon { position: relative; display: inline-block; width: 17px; height: 13px; border: 1px solid var(--rose); }
.letter-icon::before { content: ""; position: absolute; inset: 3px 3px auto; height: 3px; border-block: 1px solid var(--rose); }
.photo-icon::after { content: ""; position: absolute; inset: 4px 3px 2px; border: 1px solid var(--rose); border-width: 1px 0 0 1px; transform: skew(-25deg); }
.section { padding: 54px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 16px; }
.section h2 { font-size: clamp(30px, 4.5vw, 47px); line-height: 1.2; }
.letter-paper {
  max-width: 540px;
  margin-inline: auto;
  padding-block: 2px 4px;
  font: clamp(16px, 4.3vw, 18px)/1.85 var(--serif);
}
.sheet-text p { white-space: pre-line; margin: 0 0 .85em; }
.sheet-text p:last-child { margin-bottom: 0; }
.letter-paper .letter-to { font-size: 1.18em; color: var(--rose); font-weight: bold; }
.letter-paper .signature { margin-top: 1em; text-align: right; color: var(--rose); }
.gallery-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.gallery-title span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.grid figure { padding: 7px; background: #fffaf0; border: 1px solid var(--border); }
.print { display: block; }
.print img { height: auto; aspect-ratio: 1; object-fit: cover; }
.page-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--rose); text-underline-offset: 4px; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 20px; }
.pagination > :last-child { text-align: right; }
footer { padding: 22px 0 46px; text-align: center; font-size: 14px; }
.message { text-align: center; padding-block: 20vh; }
.message p { margin-top: 12px; }
dialog { background: #faf1e3; color: var(--ink); width: min(92vw, 780px); max-height: 92dvh; border: 1px solid var(--border); padding: 12px; overflow: auto; }
dialog::backdrop { background: #251b17db; }
dialog button { height: 44px; width: 44px; font-size: 22px; border: 1px solid var(--border); color: var(--rose); background: #fffaf0; }
dialog button:disabled { opacity: .4; cursor: default; }
.close { display: block; margin: 0 0 8px auto; }
.zoom { background: #292019; }
.zoom img { height: min(64dvh, 640px); object-fit: contain; }
.controls { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; }
@media (max-width: 600px) {
  main, .masthead { width: calc(100% - 36px); }
  .masthead { min-height: 54px; }
  .cover { grid-template-columns: 1fr; justify-items: center; gap: 25px; text-align: center; padding: 28px 9px 30px; }
  .cover h1 { font-size: clamp(41px, 12vw, 55px); }
  .recipient { margin-bottom: 7px; font-size: 16px; }
  .dedication { margin-top: 10px; font-size: 15px; }
  .cover-photo { width: min(100%, 282px); padding: 10px; }
  .photo-mount { padding: 6px; }
  .contents { gap: 6px; padding-bottom: 26px; }
  .contents :is(a, button) { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 9px 4px; font-size: 12px; }
  .contents .arrow { display: none; }
  .section { padding: 38px 0; }
  .gallery-title { margin-bottom: 17px; }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .grid figure { padding: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.password-gate { min-height: 100dvh; display: grid; place-items: center; }
.password-gate form { width: min(100%, 340px); display: grid; gap: 12px; }
.password-gate input, .password-gate button { min-height: 48px; padding: 12px; font: inherit; border: 1px solid var(--border); border-radius: 0; }
.password-gate input { width: 100%; background: #fffaf0; }
.password-gate button { color: var(--ink); background: #f1e4d6; }
.password-gate p { font-size: 14px; color: var(--rose); }
