:root {
  color-scheme: light;
  --paper: #faf5f1;
  --ink: #382b2a;
  --muted: #726964;
  --rose: #a43e4b;
  --line: #e6ded7;
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", "Noto Serif SC", serif;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--sans); }
button, select { font: inherit; color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button { border: 0; background: transparent; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid #aa5362; outline-offset: 4px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
.wrap { width: min(calc(100% - 9vw), 1260px); margin-inline: auto; }
.icon { width: 1.12em; height: 1.12em; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.site-head { border-bottom: 1px solid var(--line); }
.header-inner, nav, .brand, .nav-saved, .toolbar, .tabs, .filters, .meta, .meta span, .plain-action { display: flex; align-items: center; }
.header-inner { justify-content: space-between; min-height: 72px; }
.brand { gap: 8px; color: #69343a; }
.brand span { font: 700 1.47rem/1 var(--serif); letter-spacing: .06em; }
.brand-mark { width: 41px; height: 41px; color: var(--rose); }
nav { gap: 30px; }
nav a { font-size: .88rem; }
.nav-saved { gap: 7px; border: 1px solid #d9c5c1; border-radius: 24px; padding: 6px 14px; }
.nav-saved:hover, .nav-saved[aria-current="page"] { color: var(--rose); background: #f8eae7; }
#saved-count { font: 600 .77rem var(--sans); }
.library { margin-block: 36px 0; scroll-margin-top: 18px; }
.section-kicker { font: 600 .71rem/1.35 Georgia, serif; letter-spacing: .18em; color: #97545a; margin-bottom: 4px; }
h2 { font: 700 clamp(1.8rem, 2.55vw, 2.35rem)/1.35 var(--serif); letter-spacing: .035em; }
h2:focus { outline: none; }
.result-count { color: var(--muted); font-size: .84rem; margin-bottom: 3px; }
.toolbar { justify-content: space-between; gap: 12px; margin: 15px 0 18px; }
.tabs { gap: 6px; }
.tabs button { padding: 6px 16px; font-size: .9rem; border-radius: 50px; color: #70615e; }
.tabs button:hover { background: #f4ede7; }
.tabs button[aria-pressed="true"] { background: #63363b; color: white; }
.filters { gap: 9px; }
.filters label { position: relative; }
.filters select { appearance: none; background: #fffdfa; border: 1px solid #e2dad4; border-radius: 6px; cursor: pointer; padding: 6px 29px 6px 12px; font-size: .84rem; }
.filters select.active { color: var(--rose); background: #f9e9e6; border-color: #cca1a0; }
.filters .icon { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; width: 14px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card { position: relative; background: #fffdf9; border: 1px solid #e5ddd4; border-radius: 12px; overflow: clip; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 7px 20px #5c3b3311; transform: translateY(-2px); }
.card-photo { aspect-ratio: 1.96; position: relative; overflow: hidden; background: #f0e0d5; }
.card-photo img { height: 100%; width: 100%; display: block; object-fit: cover; transition: transform .35s ease; }
.card:hover img { transform: scale(1.025); }
.type-tag { display: inline-flex; align-items: center; gap: 5px; font: 600 .77rem/1.4 var(--sans); border-radius: 25px; padding: 4px 10px; color: #8a3746; background: #fff2eafa; }
.type-tag.proposal { color: #73512f; background: #fff4dffa; }
.card-photo .type-tag { position: absolute; left: 13px; top: 12px; }
.round { height: 34px; width: 34px; display: grid; place-items: center; border: 1px solid #ffffffa6; background: #fffcf6f2; color: #604742; border-radius: 50%; }
.round:hover { background: white; color: var(--rose); }
.bookmark { position: absolute; top: 11px; right: 12px; z-index: 2; }
[aria-pressed="true"] .saved-icon { fill: currentColor; }
.bookmark[aria-pressed="true"] { color: var(--rose); background: #fff2ec; }
.card-copy { padding: 14px 18px 15px; }
.card-title { font: 700 1.38rem/1.4 var(--serif); letter-spacing: .02em; }
.card-title button, .detail-title-row h2 { text-wrap: balance; }
.open-card { font: inherit; text-align: left; padding: 0; }
.open-card::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.card:has(.open-card:focus-visible) { outline: 3px solid var(--rose); outline-offset: 3px; }
.summary { margin-top: 5px; color: #716661; font-size: .91rem; line-height: 1.55; }
.meta { flex-wrap: wrap; gap: 14px; font-size: .79rem; color: #70665f; }
.meta span { gap: 5px; }
.meta .icon { width: 14px; height: 14px; color: #8d7e75; }
.card .meta { margin-top: 13px; border-top: 1px solid #eee6de; padding-top: 10px; }
.more-wrap { display: flex; justify-content: center; margin-top: 27px; }
.plain-action { justify-content: center; gap: 6px; color: #85464c; border: 1px solid #d9bdb8; border-radius: 7px; padding: 8px 17px; font-size: .9rem; }
.plain-action:hover { background: #f9ede7; }
.empty { text-align: center; padding: 45px 15px; border: 1px dashed #d6c5bb; border-radius: 12px; }
.empty>.icon { width: 30px; height: 30px; color: var(--rose); }
.empty h3 { margin: 6px 0; font: bold 1.4rem var(--serif); }
.empty p { color: var(--muted); margin-bottom: 14px; }
.empty button { margin-inline: auto; }
footer { display: flex; align-items: center; justify-content: space-between; color: #847670; border-top: 1px solid var(--line); padding-block: 17px; margin-top: 45px; font: 1rem var(--serif); }
footer i { font: italic .85rem Georgia,serif; }
dialog { background: #fffbf6; color: var(--ink); padding: 0; width: min(590px, calc(100% - 26px)); max-height: 89dvh; overflow: auto; overscroll-behavior: contain; border: 1px solid #e1d4c9; border-radius: 15px; box-shadow: 0 18px 90px #38231e38; }
dialog::backdrop { background: #34262375; }
body:has(dialog[open]) { overflow: hidden; }
.detail-photo { height: 178px; width: 100%; object-fit: cover; display: block; }
.close-dialog { position: absolute; top: 12px; right: 12px; }
.detail-content { padding: 22px 30px 27px; }
.detail-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-block: 10px 6px; }
.detail-title-row h2 { font-size: 2rem; }
.detail-save { flex: none; display: flex; align-items: center; gap: 4px; color: var(--rose); font-size: .86rem; }
.detail-content>.meta { margin-block: 12px 20px; }
.detail-content h3 { font: 700 1.18rem var(--serif); margin: 21px 0 9px; }
.detail-content .materials { color: #655851; }
.steps { padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 0 0 0 33px; margin-block: 12px; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 2px; border-radius: 50%; width: 23px; height: 23px; text-align: center; color: #8c4049; background: #f3e3dd; font: italic 1rem/23px Georgia, serif; }
.personal { margin-top: 19px; padding: 12px 16px; border-left: 3px solid #b96c70; background: #f8ebe4; color: #634949; border-radius: 0 6px 6px 0; }
.personal strong { display: block; margin-bottom: 3px; color: #8a424c; font-weight: 600; }
.toast { position: fixed; bottom: 23px; left: 50%; transform: translate(-50%, 6px); pointer-events: none; opacity: 0; color: white; background: #553539; border-radius: 8px; padding: 6px 15px; font-size: .88rem; transition: .16s; z-index: 3; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 950px) {
  .wrap { width: 92%; }
  .cards { gap: 14px; }
  .card-copy { padding: 12px; }
  .meta { gap: 9px; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { min-height: 61px; }
  .brand-mark { width: 33px; }
  .brand { gap: 3px; }
  .brand span { font-size: 1.2rem; }
  nav { gap: 16px; }
  nav a { font-size: .83rem; }
  .nav-saved { padding: 5px 9px; gap: 4px; }
  .library { margin-top: 25px; }
  .toolbar { flex-wrap: wrap; gap: 11px; }
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .card .meta span:last-child { display: none; }
}
@media (max-width: 510px) {
  .filters { width: 100%; gap: 8px; }
  .filters select { padding: 5px 25px 5px 9px; }
  .tabs button { padding: 5px 14px; }
  .cards { grid-template-columns: 1fr; gap: 17px; }
  .card-copy { padding: 13px 16px 14px; }
  .card .meta span:last-child { display: flex; }
  .toolbar { margin: 13px 0 15px; }
  .detail-content { padding: 17px; }
  .detail-photo { height: 145px; }
  .detail-title-row h2 { font-size: 1.6rem; }
}
@media (max-width: 355px) { nav { gap: 7px; } .brand span { font-size: 1.08rem; } .filters { gap: 4px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

h1, h2, h3, p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px; clip-path: inset(50%); white-space: nowrap; }
body {
  min-height: 100vh;
  background: radial-gradient(ellipse at 7% 37%, #f1dcd3a1, transparent 50%), radial-gradient(ellipse at 94% 76%, #e9dfdfb0, transparent 44%), var(--paper);
}
.site-head { background: #fdf9f5cf; border-color: #e2d5cc; }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; min-height: 76px; gap: 24px; }
.brand { justify-self: start; }
.header-inner nav { display: contents; }
.head-links { display: flex; align-items: center; gap: clamp(22px, 3.3vw, 54px); }
.nav-link { position: relative; padding: 7px 1px; color: #6d5754; letter-spacing: .08em; }
.nav-link:hover, .nav-link[aria-current="page"] { color: #953e49; }
.nav-link[aria-current="page"]::after { content: ""; height: 1px; position: absolute; inset: auto 18% 2px; background: currentColor; }
.nav-saved { justify-self: end; color: #684a49; }

/* The two categories share the same spread and have their own paper and ink. */
.album {
  --edge: clamp(14px, 2vw, 32px);
  position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1160px; margin: clamp(26px, 4.2vh, 54px) auto 0; padding: 5px 6px 7px;
  background: #ac7875; border: 1px solid #ad817a; border-radius: 6px 10px 11px 6px;
  box-shadow: 0 2px 0 #b89587, 0 12px 24px -17px #683b31b0, 0 26px 62px -40px #603b3c9e;
}
.album::after {
  content: ""; pointer-events: none; position: absolute; z-index: 1; width: 7.5%; inset-block: 4px 5px; left: 50%;
  transform: translateX(-50%); background: linear-gradient(90deg, transparent, #8d694412 22%, #84664436 46%, #6f504546 49%, #e6d9c5 50%, #fcf0e28c 54%, #fff6e655 67%, transparent);
}
.album-page {
  --cover-ink: #863d47; --page: #fff7ed; position: relative; display: flex; flex-direction: column;
  padding: var(--edge) calc(var(--edge) * 1.22) 0; color: var(--cover-ink); background-color: var(--page);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.83' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath d='M0 0h160v160H0z' opacity='.075' filter='url(%23grain)'/%3E%3C/svg%3E");
  box-shadow: 0 1px 0 #c9baa7, 0 3px 0 #f4e7d5, 0 4px 0 #bea796;
}
.confession-page { border-radius: 3px 4% 1.2% 3px / 3px 5px 5px 3px; }
.proposal-page { --cover-ink: #685163; --page: #fbf5ec; border-radius: 4% 5px 5px 1.2% / 5px 5px 5px 5px; }
.print { position: relative; isolation: isolate; overflow: hidden; border-radius: 49% 49% 2px 2px / 15% 15% 2px 2px; background: #d3b7ab; }
.print::after { content: ""; position: absolute; inset: 6px; border: 1px solid #fff5e582; border-radius: inherit; pointer-events: none; }
.print img { display: block; width: 100%; height: clamp(310px, 49svh, 490px); object-fit: cover; transition: transform .6s ease; }
.confession-page img { object-position: 50% 46%; }
.proposal-page img { object-position: 50% 58%; }
.album-page:hover img, .album-page:focus-visible img { transform: scale(1.023); }
.album-page:focus-visible { outline-offset: -4px; }
.cover-caption { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px 2px 28px; text-align: center; }
.caption-top { display: flex; align-items: center; justify-content: center; gap: 12px; }
.caption-top h2 { font: 700 clamp(1.9rem, 3.1vw, 3rem)/1.24 var(--serif); letter-spacing: .08em; }
.category-mark { width: clamp(22px, 2.1vw, 30px); height: auto; aspect-ratio: 1; stroke-width: 1.25; }
.cover-caption p { color: #735d57; font: 1.06rem/1.65 var(--serif); margin: 7px 0 16px; letter-spacing: .025em; }
.enter { padding: 6px 20px; color: #fffaf5; background: var(--cover-ink); border: 1px solid var(--cover-ink); border-radius: 24px; font-size: .88rem; letter-spacing: .06em; }
.album-page:hover .enter { box-shadow: 0 3px 10px #5d302c28; }
body[data-view="home"] footer { max-width: 1160px; margin-top: 30px; }

.library { margin-top: 25px; }
.library-heading { position: relative; isolation: isolate; overflow: hidden; border: 1px solid #dec9c1; border-radius: 6px; background: #f5e5df; }
.collection-intro { position: relative; padding: 30px clamp(22px, 4vw, 56px); max-width: 66%; }
.section-kicker { margin: 0 0 6px; color: #874a53; font: italic 1rem/1.3 Georgia, serif; letter-spacing: .025em; }
#library-title { color: #62383b; font: 700 clamp(2rem, 3.5vw, 3.3rem)/1.25 var(--serif); letter-spacing: .05em; }
#library-title:focus { outline: 0; }
#category-note { margin: 9px 0 0; font-size: 1rem; color: #705653; }
.collection-photo { position: absolute; z-index: -1; inset: 0 0 0 58%; background-size: cover; mask-image: linear-gradient(90deg, transparent, #000 29%); }
[data-view="confession"] .collection-photo { background-image: url("./assets/confession-cover.webp"); background-position: center 27%; }
[data-view="proposal"] .collection-photo { background-image: url("./assets/proposal-cover.webp"); background-position: center 33%; }
[data-view="proposal"] .library-heading { background: #eee6eb; border-color: #d7c8d3; }
[data-view="proposal"] #library-title, [data-view="proposal"] .section-kicker { color: #67495f; }
[data-view="saved"] .collection-photo { background-image: url("./assets/letter.webp"); background-position: center; }
.toolbar { margin: 19px 0; }
.result-count { margin: 0; }
.filters { margin-left: auto; }
.card { display: flex; flex-direction: column; }
.card-copy { flex: 1; display: flex; flex-direction: column; }
.card-copy .summary { margin-bottom: auto; }

@media (max-width: 860px) and (min-width: 621px) {
  .album { --edge: 15px; }
  .print img { height: clamp(290px, 41vw, 380px); }
  .cover-caption { padding-block: 22px; }
}
@media (max-width: 620px) {
  .header-inner { min-height: 61px; gap: 8px; }
  .head-links { gap: 14px; }
  .nav-home { display: none; }
  .album { display: flex; flex-direction: column; gap: 18px; margin-top: 20px; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .album::after { display: none; }
  .album-page {
    display: grid; grid-template-columns: 46% 1fr; align-items: stretch; gap: 8px;
    min-height: clamp(205px, 30svh, 295px); padding: 10px; border: 1px solid #d6b9ad; border-radius: 5px;
    box-shadow: 0 2px 0 #eee0d3, 0 3px 0 #b38a82, 0 9px 15px -12px #73483b73;
  }
  .proposal-page { border-color: #cbb8c3; }
  .print { min-height: 100%; border-radius: 48% 48% 2px 2px / 13% 13% 2px 2px; }
  .print::after { inset: 4px; }
  .print img { position: absolute; inset: 0; height: 100%; }
  .cover-caption { align-items: start; text-align: left; padding: 16px 2px 16px clamp(5px, 2vw, 16px); }
  .caption-top { flex-direction: column; align-items: start; gap: 9px; }
  .category-mark { width: 20px; }
  .caption-top h2 { font-size: clamp(1.55rem, 6.2vw, 2.1rem); }
  .cover-caption p { margin: 5px 0 13px; font-size: .95rem; line-height: 1.5; text-wrap: pretty; }
  .cover-caption p span { display: block; }
  .enter { font-size: .84rem; letter-spacing: .02em; padding: 4px 12px; }
  .collection-intro { padding: 20px 14px; max-width: 72%; }
  .collection-photo { left: 56%; }
  #category-note { font-size: .9rem; }
  .toolbar { gap: 10px; }
  .filters { margin: 0; }
  .result-count { order: 1; }
  body[data-view="home"] footer { margin-top: 27px; }
}
@media (max-width: 370px) {
  .head-links { gap: 7px; }
  .album-page { min-height: 184px; grid-template-columns: 44% 1fr; padding: 8px; gap: 5px; }
  .header-inner { gap: 4px; }
}
