/* Shared paper, photo mounts and independent decorative layers. */
.scrapbook {
  --scrap-ink: #422c3c;
  --scrap-rose: #834459;
  --scrap-paper: #fff7eb;
  --scrap-paper-grain: repeating-linear-gradient(101deg, #79493906 0 1px, transparent 1px 5px);
  --scrap-rule: #ad746b55;
  --scrap-shadow: 1px 4px 9px #49302d24, 0 17px 28px -14px #49302d55;
  --scrap-heading: "Baskervville", Georgia, "Songti SC", SimSun, serif;
}
.scrap-piece {
  position: absolute;
  z-index: var(--piece-layer, 0);
  inset: var(--piece-inset, auto);
  width: var(--piece-width, 160px);
  height: auto;
  transform: rotate(var(--piece-turn, 0deg));
  opacity: var(--piece-opacity, 1);
  pointer-events: none;
  user-select: none;
}
.scrap-note {
  background: var(--scrap-paper-grain), var(--note-paper, var(--scrap-paper));
  border: 1px solid #a6776540;
  box-shadow: var(--scrap-shadow);
}
.scrap-tape {
  display: block;
  position: absolute;
  width: 74px;
  height: 21px;
  transform: rotate(var(--tape-angle, -8deg));
  clip-path: polygon(2% 0, 98% 3%, 100% 18%, 97% 37%, 100% 56%, 98% 77%, 100% 100%, 0 96%, 2% 76%, 0 58%, 3% 42%, 0 19%);
  background: repeating-linear-gradient(92deg, #fff8 0 1px, transparent 1px 5px), var(--tape-color, #cfabae);
  opacity: .84;
  pointer-events: none;
}

/* Social index, arranged as a spread with three photo mounts. */
.social.scrapbook { color: var(--scrap-ink); background: #f7eddf; }
.social.scrapbook > header { min-height: 56px; padding-block: 12px; }
.social.scrapbook > header a {
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--scrap-rule);
}
.social-showcase.scrapbook {
  --spread-width: min(1100px, calc(100% - 52px));
  padding: clamp(24px, 4vw, 47px) 0 27px;
  background: var(--scrap-paper-grain), linear-gradient(110deg, #eed3d6, #f7eadc 49%, #ecd6cd);
  border-block: 1px solid #bb86744d;
}
.social-showcase.scrapbook::before {
  background: radial-gradient(ellipse at 62% 64%, #d7e0e9a6, transparent 73%);
}
.social-showcase.scrapbook::after {
  background: radial-gradient(ellipse at 62% 64%, #efbcca92, transparent 76%);
}
.scrap-spread-heading {
  position: relative;
  z-index: 1;
  width: var(--spread-width);
  margin: 0 auto 0;
  padding-left: clamp(20px, 8vw, 125px);
}
.social-showcase.scrapbook h1 {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: .16em .23em .22em .04em;
  text-align: left;
  color: var(--scrap-ink);
  font-family: var(--scrap-heading);
  font-weight: 700;
  letter-spacing: .025em;
  line-height: 1.12;
}
.social-showcase.scrapbook h1::after {
  content: "";
  position: absolute;
  inset: auto 0 .03em .035em;
  height: 2px;
  background: var(--scrap-rose);
  opacity: .55;
  transform: rotate(-1.4deg);
  pointer-events: none;
}
.scrap-spread-gingham { --piece-inset: -30px auto auto -45px; --piece-width: clamp(120px, 22vw, 310px); --piece-turn: -7deg; --piece-opacity: .78; }
.scrap-spread-letter { --piece-inset: 32% auto auto -5%; --piece-width: clamp(110px, 20vw, 250px); --piece-turn: 8deg; --piece-opacity: .58; }
.scrap-spread-strawberry { --piece-inset: 2.5% 9% auto auto; --piece-width: clamp(135px, 22vw, 285px); --piece-turn: 13deg; --piece-opacity: .88; }
.scrap-spread-red { --piece-inset: auto -2.5% -30px auto; --piece-width: clamp(115px, 21vw, 300px); --piece-turn: 4deg; --piece-opacity: .82; }
.social-showcase.scrapbook .platform-carousel { position: relative; z-index: 1; }
.social-showcase.scrapbook .platform-card {
  --mount-turn: -2deg;
  --mount-paper: #fff9ed;
  padding: 13px 11px 0;
  overflow: visible;
  border: 1px solid #b99a865c;
  border-radius: 4px;
  background: var(--scrap-paper-grain), var(--mount-paper);
  box-shadow: var(--scrap-shadow);
  transform: translate(-50%, -50%) translateX(calc(var(--x, 0px) + var(--drag, 0px))) translateZ(var(--z, 0px)) rotateY(var(--angle, 0deg)) rotateZ(var(--mount-turn));
}
.social-showcase.scrapbook .platform-card[data-tint="threads"] { --mount-paper: #f1eee6; --tape-color: #b9c9d5; --tape-angle: -10deg; }
.social-showcase.scrapbook .platform-card[data-tint="douyin"] { --mount-turn: 1.4deg; --tape-color: #d9b9a2; --tape-angle: 7deg; }
.social-showcase.scrapbook .platform-card[data-tint="xiaohongshu"] { --mount-turn: 3deg; --mount-paper: #f8e7e6; --tape-color: #d2a2af; }
.social-showcase.scrapbook .platform-card[data-position="0"] { box-shadow: 0 22px 38px #59394336, 1px 2px 6px #59394339; }
.platform-card .scrap-tape { top: -8px; left: calc(50% - 37px); z-index: 1; }
.social-showcase.scrapbook .platform-shot { padding: 5px; background: #fffdf8; border: 1px solid #ad8c7949; }
.social-showcase.scrapbook .platform-info { border-top: 1px dashed #ad746b69; margin-top: 8px; padding: 10px 3px 13px; }
.social-showcase.scrapbook .platform-info h2 { color: #5c3146; }
.social-showcase.scrapbook .platform-controls button,
#threads-details.scrapbook .threads-controls button,
#threads-details.scrapbook .threads-close {
  background: #fbf2e5;
  color: var(--scrap-ink);
  border-color: #9f6b775e;
  box-shadow: 1px 2px 0 #a97c7340;
}

/* The existing About text editor sits on four independent pieces of paper. */
#workDialog .about-scrap-decor { display: none; }
#workDialog.about-mode.scrapbook {
  border: 1px solid #a67a7066;
  border-radius: 11px;
  background: #f2e4d5;
  color: var(--scrap-ink);
}
#workDialog.about-mode .dialog-visual {
  isolation: isolate;
  background: var(--scrap-paper-grain), linear-gradient(132deg, #e4c1c7, #f5e7d6 70%);
  border-right: 1px dashed #b0787580;
}
#workDialog.about-mode .about-scrap-decor { display: block; position: absolute; inset: 0; pointer-events: none; }
.scrap-about-heart { --piece-inset: -13px auto auto -19px; --piece-width: 64%; --piece-turn: -8deg; --piece-opacity: .86; }
.scrap-about-postcard { --piece-inset: 23% auto auto -7%; --piece-width: 39%; --piece-turn: -11deg; --piece-opacity: .75; }
.scrap-about-envelope { --piece-inset: auto 1% 2% auto; --piece-width: 52%; --piece-turn: 7deg; }
.scrap-about-floral { --piece-inset: auto -4% -4% auto; --piece-width: 43%; --piece-turn: 9deg; --piece-opacity: .85; }
#workDialog.about-mode #aboutLanyard { z-index: 1; }
#workDialog.about-mode .dialog-copy {
  background: var(--scrap-paper-grain), radial-gradient(ellipse at 85% 10%, #f2dbd4, #f7eadb 65%);
}
#workDialog.about-mode #aboutTextEditor {
  color: var(--scrap-ink);
  gap: clamp(16px, 2vw, 30px) clamp(12px, 1.7vw, 25px);
  padding: clamp(22px, 3vw, 46px) clamp(16px, 2.5vw, 36px);
}
#workDialog.about-mode #aboutTextEditor .about-section {
  --note-paper: #fff8ee;
  position: relative;
  padding: clamp(10px, 1.15vw, 19px);
  background: var(--scrap-paper-grain), var(--note-paper);
  border: 1px solid #a6776540;
  box-shadow: var(--scrap-shadow);
}
#workDialog.about-mode #aboutTextEditor [data-section="contact"] { --note-paper: #f9e4e5; }
#workDialog.about-mode #aboutTextEditor [data-section="education"] { --note-paper: #f8f0df; margin-top: 9px; }
#workDialog.about-mode #aboutTextEditor [data-section="projects"] { --note-paper: #fffbf1; }
#workDialog.about-mode #aboutTextEditor [data-section="platforms"] { --note-paper: #e9edf0; align-self: start; margin-top: 9px; }
#workDialog.about-mode #aboutTextEditor .about-section::before {
  content: "";
  position: absolute;
  inset: -8px auto auto 14px;
  width: 45px;
  height: 14px;
  transform: rotate(-7deg);
  background: repeating-linear-gradient(90deg, #fff6 0 1px, transparent 1px 4px), #c79eae;
  opacity: .78;
  pointer-events: none;
}
#workDialog.about-mode #aboutTextEditor h2 {
  color: #703b50;
  border-bottom: 1px solid var(--scrap-rule);
  padding-bottom: 5px;
  margin-bottom: 10px;
  font-family: var(--scrap-heading);
}

/* The Threads artboards keep their editable geometry and colored paper layers. */
#threads-details.scrapbook::backdrop { background: #3d2a36b8; }
#threads-details.scrapbook .threads-card {
  position: relative;
  isolation: isolate;
  border-radius: 10px;
  border: 1px solid #ad826b9c;
  background: var(--scrap-paper-grain), #e9d5bf;
  box-shadow: 0 24px 45px #301c325c, inset 0 0 0 5px #f9ecdb;
}
#threads-details.scrapbook .thread-board {
  z-index: 1;
  width: min(calc(100% - 32px), calc(75dvh * 1128 / 609));
  box-shadow: 0 3px 15px #5a433233;
}
#threads-details.scrapbook .thread-shape { background-image: var(--scrap-paper-grain); }
#threads-details.scrapbook .thread-image:not([data-layer="growth-board"]) {
  border-radius: .7cqw;
  box-shadow: 0 .3cqw .9cqw #6e3c4a24;
}
#threads-details.scrapbook .thread-text h2,
#threads-details.scrapbook h2.thread-text { font-family: var(--scrap-heading); }
.scrap-threads-clip { --piece-inset: -7% 4% auto auto; --piece-width: 27%; --piece-turn: 12deg; --piece-opacity: .82; }
.scrap-threads-fabric { --piece-inset: auto auto -7% -4%; --piece-width: 31%; --piece-turn: -9deg; }
.scrap-threads-postcard { --piece-inset: -6% auto auto 1%; --piece-width: 21%; --piece-turn: -10deg; --piece-opacity: .82; }
.scrap-threads-floral { --piece-inset: auto -1% -11% auto; --piece-width: 34%; --piece-turn: -5deg; }
@media (max-width: 700px) {
  .social-showcase.scrapbook { --spread-width: calc(100% - 30px); }
  .scrap-spread-heading { padding-left: 16px; }
  .scrap-spread-letter, .scrap-about-postcard, .scrap-threads-postcard, .scrap-threads-clip { display: none; }
  .scrap-spread-strawberry { --piece-inset: 1% -5% auto auto; --piece-opacity: .7; }
  .social-showcase.scrapbook .platform-card { padding: 10px 7px 0; }
  #workDialog.about-mode .dialog-visual { border-right: 0; border-bottom: 1px dashed #b0787580; }
  #workDialog.about-mode #aboutTextEditor [data-section] { margin-top: 0; }
  #threads-details.scrapbook .thread-board { margin-inline: 9px; }
}
