:root {
  --ink: #2a241c;
  --ink-soft: #6e6558;
  --ink-faint: #9a9082;
  --wall: #ede6d8;
  --wall-2: #e4d9c6;
  --paper: #f7f1e6;
  --twine: #8a704c;
  --twine-hi: #cbb792;
  --accent: #a45b3a;
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", Palatino, serif;
  --hand: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }

body {
  color: var(--ink);
  background: var(--wall);
  font-family: var(--sans);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(255,250,240,.45), transparent 55%),
    radial-gradient(900px 600px at 100% 80%, rgba(196,154,110,.12), transparent 50%),
    linear-gradient(180deg, #f3ece0 0%, var(--wall) 28%, var(--wall-2) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: .13;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='.55'/></svg>");
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100%;
  padding: 28px 0 80px;
}

.mast {
  padding: 8px 48px 6px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.mast h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: .08em;
}

.mast h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0;
  margin-left: 2px;
}

.mast p {
  font-family: var(--hand);
  color: var(--ink-soft);
  font-size: 16px;
  letter-spacing: .12em;
}

.zone {
  position: relative;
  margin: 4px 0 8px;
}

.zone-break {
  height: 1px;
  margin: 18px 72px 10px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(138,112,76,.35) 0 10px,
      transparent 10px 18px
    );
}

.line-head {
  padding: 0 48px 4px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.line-head h2 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .28em;
}

.line-head span {
  font-family: var(--hand);
  font-size: 14px;
  color: var(--ink-faint);
}

.ropes {
  --w: 300px;
  --gap: 32px;
  padding: 0 48px 28px;
}

.hangs {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--gap);
  width: 100%;
  padding: 18px 0 8px;
}

.twine {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 54px;
  height: 22px;
  width: calc(100% - 16px);
  pointer-events: none;
  overflow: visible;
}

.twine path.core {
  fill: none;
  stroke: var(--twine);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.twine path.hi {
  fill: none;
  stroke: var(--twine-hi);
  stroke-width: 1.35;
  stroke-linecap: round;
  opacity: .85;
}

.hang {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--w, 300px);
  flex: 0 0 auto;
  transform: rotate(var(--r, 0deg));
  transform-origin: 50% 8px;
  animation: sway 5.4s ease-in-out var(--delay, 0s) infinite;
  cursor: default;
}

.hang:focus-within { animation: none; z-index: 6; }

.hang.add { cursor: pointer; }

@keyframes sway {
  0%, 100% { transform: rotate(var(--r, 0deg)); }
  50% { transform: rotate(calc(var(--r, 0deg) + 1.15deg)); }
}

@media (prefers-reduced-motion: reduce) {
  .hang { animation: none; }
}

.clip {
  position: relative;
  z-index: 3;
  width: 36px;
  height: 96px;
  margin-bottom: -42px;
  filter: drop-shadow(0 2px 1.5px rgba(60,40,20,.22));
  pointer-events: none;
}

.clip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
}

.postcard {
  position: relative;
  z-index: 2;
  width: 100%;
  background: var(--paper);
  padding: 11px 11px 8px;
  border-radius: 2px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.65) inset,
    0 14px 28px -18px rgba(42,36,28,.55),
    0 2px 6px rgba(42,36,28,.12);
}

.postcard::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='.4'/></svg>");
}

.hang[data-format="postcard"] .face,
.hang[data-format="memory"] .face { aspect-ratio: 3 / 2; }

.hang[data-format="zine"] { width: calc(var(--w) * 0.56); }
.hang[data-format="zine"] .face { aspect-ratio: 3 / 5; }

.hang[data-format="polaroid"] { width: calc(var(--w) * 0.7); }
.hang[data-format="polaroid"] .postcard { padding: 8px 8px 8px; }
.hang[data-format="polaroid"] .face { aspect-ratio: 3 / 4; }

.zone[data-kind="place"] .postcard { padding: 12px 12px 8px; }
.zone[data-kind="person"] .clip { width: 32px; height: 88px; margin-bottom: -38px; }

.face {
  display: block;
  width: 100%;
  object-fit: cover;
  background: #d9cbb6;
  cursor: zoom-in;
}

.journal {
  padding: 10px 6px 6px;
}

.journal .line {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: Palatino, "Palatino Linotype", "Times New Roman", "Noto Serif SC", serif;
  font-size: 12px;
  font-style: italic;
  line-height: 1.4;
  color: #9a9184;
  outline: none;
  letter-spacing: .08em;
  text-align: center;
}

.unpin {
  position: absolute;
  top: 86px;
  right: -10px;
  z-index: 4;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #f4eee3;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  box-shadow: 0 2px 8px rgba(42,36,28,.16);
}

.hang:hover .unpin,
.hang:focus-within .unpin { opacity: 1; }

.hang.add .postcard {
  min-height: 188px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    -12deg,
    rgba(247,241,230,.2),
    rgba(247,241,230,.2) 8px,
    rgba(237,230,216,.35) 8px,
    rgba(237,230,216,.35) 16px
  );
  border: 1.5px dashed rgba(138,112,76,.45);
  box-shadow: none;
  padding: 18px 12px 28px;
}

.hang.add[data-format="polaroid"] .postcard { min-height: 236px; }
.hang.add[data-format="postcard"] .postcard { min-height: 168px; }
.hang.add[data-format="zine"] .postcard { min-height: 248px; }

.hang.add .face-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-family: var(--hand);
  font-size: 16px;
  letter-spacing: .16em;
}

.hang.add .plus {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(138,112,76,.5);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
}

.hang.add input { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(42,36,28,.42);
  padding: 32px;
  cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox .sheet {
  max-width: min(920px, 92vw);
  max-height: 88vh;
  background: var(--paper);
  padding: 16px 16px 48px;
  box-shadow: 0 30px 80px -24px rgba(20,14,8,.7);
  cursor: default;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(88vh - 80px);
  object-fit: contain;
}

.lightbox .journal {
  margin-top: 10px;
  padding: 4px 2px 0;
}

.lightbox .line { font-size: 15px; color: #9a9184; }

@media (max-width: 720px) {
  .mast, .line-head, .ropes { padding-left: 20px; padding-right: 20px; }
  .mast { flex-direction: column; gap: 6px; }
  .mast h1 { font-size: 28px; }
  .zone-break { margin-left: 28px; margin-right: 28px; }
}
