/* 我的作品 — an album of everything made here: restored photos, edits and new drawings, taped in like prints. */
.album-main { --tape-restore: rgb(199 91 40 / 78%); --tape-edit: rgb(47 111 115 / 78%); --tape-generate: rgb(227 167 60 / 85%); }

/* Header: title on the left, a kraft ticket with the cat and the balance on the right */
.album-hero { align-items: center; }
.wallet { position: relative; display: grid; grid-template-columns: auto auto; grid-template-areas: "cat num" "cat note" "actions actions"; align-items: center; column-gap: 14px; row-gap: 2px; min-width: 300px; padding: 18px 22px 18px 18px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); transform: rotate(.6deg); }
.wallet::before { content: ''; position: absolute; top: -9px; left: 50%; width: 74px; height: 20px; transform: translateX(-50%) rotate(-3deg); background: rgb(227 167 60 / 55%); border-radius: 2px; box-shadow: 0 1px 2px rgb(90 60 30 / 15%); }
.wallet-cat { grid-area: cat; width: 64px; height: 64px; border-radius: 50%; box-shadow: 0 6px 14px -6px rgb(70 40 15 / 45%); transform-origin: 50% 90%; }
.wallet:hover .wallet-cat { animation: purr .5s ease-in-out 2 alternate; }
.wallet-num { grid-area: num; display: flex; align-items: baseline; gap: 6px; color: var(--ink-2); font-size: 14px; }
.wallet-num strong { font: 600 40px/1 var(--serif); color: var(--accent); font-variant-numeric: tabular-nums; }
.wallet-note { grid-area: note; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.wallet-note[hidden] { display: none; }
.wallet-note i { width: 7px; height: 7px; border-radius: 50%; background: var(--safelight); animation: pulse 1.6s ease-in-out infinite; }
.wallet-note b { color: var(--ink); font-weight: 600; }
.wallet-actions { grid-area: actions; display: flex; gap: 8px; margin-top: 14px; }
.wallet-actions a { flex: 1; min-height: 42px; padding: 0 16px; font-size: 14px; }

/* Login: three prints, one for each thing the studio makes */
.login-photos.three { width: 200px; }
.login-photos.three img { width: 110px; height: 140px; }
.login-photos.three img:nth-child(1) { left: 0; top: 18px; transform: rotate(-11deg); }
.login-photos.three img:nth-child(2) { left: 45px; top: 0; z-index: 1; transform: rotate(2deg); }
.login-photos.three img:nth-child(3) { left: auto; right: 0; top: 26px; transform: rotate(10deg); }
.login-card:hover .login-photos.three img:nth-child(1) { transform: rotate(-15deg) translateX(-8px); }
.login-card:hover .login-photos.three img:nth-child(2) { transform: rotate(0) translateY(-8px); }
.login-card:hover .login-photos.three img:nth-child(3) { transform: rotate(14deg) translateX(8px); }

/* Toolbar under the tabs */
.album-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.no-works .album-tools { display: none; }
.kind-filter { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -4px; padding: 4px; }
.kind-filter::-webkit-scrollbar { display: none; }
.kind-filter button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2); background: rgb(255 250 242 / 55%); box-shadow: inset 0 0 0 1px var(--line); transition: background .25s, color .25s, box-shadow .25s, transform .25s var(--spring); }
.kind-filter button:hover { color: var(--ink); transform: translateY(-1px); }
.kind-filter button[aria-pressed="true"] { color: var(--ink); background: var(--card); font-weight: 500; box-shadow: 0 2px 0 var(--kraft), inset 0 0 0 1px var(--line-strong); }
.kind-filter span { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kind-filter span:empty { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.restore { background: var(--accent); }
.dot.edit { background: var(--jade); }
.dot.generate { background: var(--mustard); }
.album-tools .keep-note { flex: none; margin: 0; padding: 7px 14px 7px 10px; font-size: 12px; align-items: center; }
.album-tools .keep-note svg { width: 16px; height: 16px; margin: 0; }
.filter-empty { padding: 48px 0; text-align: center; color: var(--ink-3); font-size: 14px; }

/* Months */
.month + .month { margin-top: 46px; }
.month-label { display: flex; align-items: baseline; gap: 10px; margin: 0 0 18px; font: 600 20px var(--serif); letter-spacing: 1px; }
.month-label small { font: 400 13px var(--sans); color: var(--ink-3); letter-spacing: 0; }
.month-label::after { content: ''; flex: 1; height: 0; border-top: 1.5px dashed var(--line-strong); transform: translateY(-5px); }
.cols { display: flex; align-items: flex-start; gap: 22px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 26px; }

/* A print: photo on white card, a strip of tape coloured by kind, a caption underneath */
.print { position: relative; padding: 9px 9px 4px; border-radius: 6px; background: #fffaf1; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); transform: rotate(var(--tilt, 0deg)); transition: transform .5s var(--spring), box-shadow .5s var(--ease); }
.print[data-reveal] { opacity: 0; transform: rotate(var(--tilt, 0deg)); transition: none; }
.print[data-reveal].in { opacity: 1; transform: rotate(var(--tilt, 0deg)); animation: drop .8s var(--ease) backwards; animation-delay: calc(var(--d, 0) * 80ms); transition: transform .5s var(--spring), box-shadow .5s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(18px) rotate(calc(var(--tilt, 0deg) * 3)); } }
.print[data-reveal].in:hover { transform: rotate(0deg) translateY(-4px); box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line); z-index: 2; }
.print-tape { position: absolute; z-index: 3; top: -10px; left: 50%; padding: 3px 18px; transform: translateX(-50%) rotate(calc(var(--tilt, 0deg) * -2.4)); font-size: 11px; letter-spacing: 2px; color: #fffaf1; background: var(--tape-restore); white-space: nowrap; clip-path: polygon(0 8%, 5% 0, 10% 10%, 15% 0, 85% 0, 90% 8%, 95% 0, 100% 10%, 100% 92%, 95% 100%, 90% 90%, 85% 100%, 15% 100%, 10% 92%, 5% 100%, 0 90%); }
.print[data-kind="edit"] .print-tape { background: var(--tape-edit); }
.print[data-kind="generate"] .print-tape { background: var(--tape-generate); color: #4d3410; }

.print-photo { position: relative; aspect-ratio: 4 / 5; border-radius: 3px; overflow: hidden; background: var(--card-2); cursor: zoom-in; transition: aspect-ratio .4s var(--ease); }
.print-photo > img:not(.peek-before) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.peek-before { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.print.peeking .peek-before { opacity: 1; }
/* The original, tucked into the corner; hold it to see the photo before */
.before-chip { position: absolute; z-index: 2; left: 8px; bottom: 8px; width: 23%; aspect-ratio: 4 / 5; padding: 3px; border-radius: 3px; background: #fffaf1; box-shadow: 0 4px 10px -3px rgb(40 25 10 / 45%); transform: rotate(-5deg); transition: transform .35s var(--spring); cursor: pointer; }
.before-chip img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; filter: saturate(.85); }
.before-chip::after { content: '原图'; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); padding: 0 6px; border-radius: 999px; font-size: 10px; line-height: 15px; color: #fffaf1; background: rgb(43 32 26 / 78%); white-space: nowrap; }
.before-chip:hover, .print.peeking .before-chip { transform: rotate(0) scale(1.08); }
.print-tools { position: absolute; z-index: 2; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s var(--ease); }
.print:hover .print-tools, .print:focus-within .print-tools { opacity: 1; transform: none; }
.tool { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--ink); background: rgb(255 250 241 / 88%); backdrop-filter: blur(6px); box-shadow: 0 3px 8px -3px rgb(40 25 10 / 40%); transition: transform .25s var(--spring), color .2s, background .2s; }
.tool svg { width: 17px; height: 17px; }
.tool:hover { transform: scale(1.08); }
.tool.delete:hover { color: #fff; background: var(--accent); }

.print-cap { padding: 10px 3px 2px; }
.cap-text { font-size: 14px; line-height: 1.55; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cap-text.quote { color: var(--ink-2); font-size: 13px; }
.cap-text.quote::before { content: '“'; margin-right: 1px; color: var(--kraft-deep); font-weight: 600; }
.cap-text.quote::after { content: '”'; color: var(--kraft-deep); font-weight: 600; }
.cap-text:empty { display: none; }
.cap-meta { display: flex; align-items: center; gap: 0; min-height: 34px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cap-meta time { white-space: nowrap; }
.cap-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; margin-right: -6px; }
.cap-actions .icon-btn { width: 34px; height: 34px; }
.cap-actions .icon-btn svg { width: 18px; height: 18px; }
.cap-actions .text-button { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
.cap-actions .text-button svg { width: 15px; height: 15px; }
.cap-actions .delete { color: var(--ink-3); }

/* In progress: a little darkroom; failed: a faded print */
.print-photo.developing { background: var(--dark); cursor: default; }
.print-photo.developing > img { filter: grayscale(1) sepia(.5) brightness(.6) blur(1.5px); animation: develop 4s ease-in-out infinite; }
.print-photo.developing::before { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(80% 60% at 50% 0%, rgb(226 73 43 / 35%), transparent 70%); animation: safelight 4s ease-in-out infinite; }
.print[data-kind="generate"] .print-photo.developing::after { content: ''; position: absolute; left: 50%; top: 42%; width: 64px; height: 64px; transform: translate(-50%, -50%); background: url(assets/gulu-mark-192.png) center / cover; border-radius: 50%; opacity: .9; box-shadow: 0 0 0 6px rgb(255 255 255 / 6%), 0 0 40px rgb(226 73 43 / 40%); animation: doze 1.4s ease-in-out infinite alternate; }
@keyframes doze { from { transform: translate(-50%, -50%) rotate(-6deg); } to { transform: translate(-50%, -50%) rotate(6deg) scale(1.06); } }
.print-photo.failed { cursor: default; background: repeating-linear-gradient(-45deg, var(--card-2) 0 10px, #efe2cb 10px 20px); }
.print-photo.failed > img { filter: grayscale(1) contrast(.8) brightness(1.05); opacity: .55; }
.failed-note { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%) rotate(-4deg); padding: 6px 14px; border: 1.5px solid var(--warn); border-radius: 6px; font-size: 13px; color: var(--warn); background: rgb(255 250 241 / 85%); white-space: nowrap; }
.print[data-status="failed"] { opacity: .92; }
.print.just-done .print-photo::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(circle, #fffaf0, rgb(255 250 240 / 0%) 75%); animation: flash 1.4s var(--ease) both; opacity: 0; }
.print[data-reveal].in.just-done { animation: pop .8s var(--spring); }
.print.leaving { pointer-events: none; animation: leave .5s var(--ease) both !important; }

/* Empty album: the cat and three ways to start */
.album-empty { padding: 44px 24px 40px; }
.empty-cat { width: 88px; height: 88px; border-radius: 50%; box-shadow: 0 10px 24px -8px rgb(70 40 15 / 45%); animation: float 4s ease-in-out infinite; }
.album-empty h2 { margin-top: 18px; }
.starters { display: grid; grid-template-columns: repeat(3, minmax(0, 200px)); gap: 18px; }
.starter { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 10px 14px; border-radius: 8px; background: #fffaf1; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); transition: transform .4s var(--spring), box-shadow .4s; }
.starter:nth-child(1) { transform: rotate(-1.5deg); } .starter:nth-child(3) { transform: rotate(1.2deg); }
.starter:hover { transform: translateY(-4px) rotate(0); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.starter-pic { position: relative; display: block; width: 100%; aspect-ratio: 1; margin-bottom: 8px; border-radius: 4px; overflow: hidden; background: var(--card-2); }
.starter-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.starter-pic img + img { clip-path: inset(0 0 0 50%); }
.starter-pic img + img::after { content: ''; }
.starter b { font-size: 15px; font-weight: 600; }
.starter small { font-size: 12px; color: var(--ink-3); }
.starter.restore b { color: var(--accent); } .starter.edit b { color: var(--jade); } .starter.generate b { color: #8a5d12; }

/* Viewer additions */
.viewer-caption { max-width: min(720px, 90vw); margin: 12px auto 0; padding: 0 20px; text-align: center; font-size: 14px; line-height: 1.6; color: rgb(243 231 218 / 78%); }
.viewer-caption::before { content: '“'; } .viewer-caption::after { content: '”'; }
.viewer-stage { position: relative; }
#viewer-stage > img { position: absolute; inset: 0; margin: auto; max-width: calc(100% - 40px); max-height: 100%; border-radius: 14px; box-shadow: 0 30px 80px -20px rgb(0 0 0 / 60%); animation: slide-in .5s var(--ease) both; }
.secondary.on-dark { background: rgb(255 255 255 / 10%); color: #f6ead8; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%); }
.secondary.on-dark:hover { background: rgb(255 255 255 / 16%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 26%); }

@media (max-width: 860px) {
  .rec-hero { flex-direction: column; align-items: stretch; gap: 22px; }
  .wallet { min-width: 0; transform: none; }
  .album-tools { flex-direction: column; align-items: stretch; gap: 10px; }
  .album-tools .keep-note { align-self: flex-start; }
}
@media (max-width: 600px) {
  .album-hero .page-sub { font-size: 14px; }
  .wallet { width: 100%; grid-template-columns: auto 1fr auto; grid-template-areas: "cat num actions" "cat note actions"; padding: 14px 14px 14px 12px; border-radius: 18px; column-gap: 12px; }
  .wallet-cat { width: 48px; height: 48px; }
  .wallet-num strong { font-size: 30px; }
  .wallet-actions { flex-direction: column; margin: 0; gap: 6px; }
  .wallet-actions a { min-height: 36px; padding: 0 14px; font-size: 13px; }
  .wallet-actions svg { display: none; }
  .album-bar .tabs { display: flex; }
  .album-bar .tabs button { flex: 1; justify-content: center; }
  .kind-filter button { padding: 6px 12px; font-size: 13px; }
  .album-tools { margin-bottom: 20px; }
  .month-label { font-size: 17px; margin-bottom: 14px; }
  .cols { gap: 12px; }
  .col { gap: 18px; }
  .print { padding: 5px 5px 2px; }
  .print-tape { top: -8px; padding: 2px 10px; font-size: 10px; letter-spacing: 1px; }
  .before-chip { left: 5px; bottom: 5px; width: 28%; padding: 2px; }
  .before-chip::after { font-size: 9px; line-height: 13px; bottom: -6px; }
  .print-tools { display: none; }
  .print-cap { padding: 7px 2px 0; }
  .cap-text { font-size: 13px; }
  .cap-text.quote { font-size: 12px; }
  .cap-meta { font-size: 11px; min-height: 30px; flex-wrap: wrap; }
  .cap-meta .rec-keep { display: none; }
  .cap-meta .rec-keep.soon { display: inline; margin-left: 4px; }
  .cap-meta .rec-keep.soon::before { display: none; }
  .cap-actions .icon-btn { width: 30px; height: 30px; }
  .cap-actions .text-button { font-size: 12px; }
  .failed-note { font-size: 11px; padding: 4px 8px; }
  .starters { grid-template-columns: 1fr; width: 100%; max-width: 300px; gap: 12px; }
  .starter { flex-direction: row; text-align: left; gap: 12px; padding: 8px; }
  .starter-pic { width: 64px; flex: none; margin: 0; }
  .starter b { display: block; }
  .viewer-caption { font-size: 13px; margin-top: 8px; }
  #viewer-stage > img { max-width: calc(100% - 16px); }
  .viewer-index { display: none; }
  .viewer-bottom .secondary.on-dark { flex: none; padding: 0 16px; }
}

/* Simple style: white cards, no tape or tilt; the kind is a small tinted label. */
.album-main { --tape-restore: var(--accent-soft); --tape-edit: var(--jade-soft); --tape-generate: var(--mustard-soft); }
.wallet { background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); border-radius: 22px; transform: none; }
.wallet::before { content: none; }
.wallet-cat { width: 52px; height: 52px; border-radius: 14px; box-shadow: none; }
.wallet-num strong { color: var(--ink); }
.kind-filter button { background: var(--card); }
.kind-filter button[aria-pressed="true"] { color: #fff; background: var(--ink); box-shadow: none; }
.kind-filter button[aria-pressed="true"] span { color: rgb(255 255 255 / 65%); }
.month-label { font-weight: 500; font-size: 18px; }
.month-label::after { border-top: 1px solid var(--line); }
.print, .print[data-reveal], .print[data-reveal].in { padding: 8px 8px 2px; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); transform: none; }
.print[data-reveal].in { animation-name: rise; }
.print[data-reveal].in:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.print-tape { top: 16px; left: 16px; transform: none; padding: 2px 9px; border-radius: 999px; font-size: 11px; letter-spacing: .5px; color: var(--accent-hover); background: var(--tape-restore); clip-path: none; box-shadow: none; }
.print[data-kind="edit"] .print-tape { color: var(--jade-deep); }
.print[data-kind="generate"] .print-tape { color: #86621a; }
.print-photo { border-radius: 12px; }
.before-chip { padding: 0; border-radius: 8px; border: 2px solid #fff; background: none; transform: none; }
.before-chip img { border-radius: 6px; }
.cap-text.quote::before, .cap-text.quote::after { color: var(--ink-3); }
.print-photo.developing { background: var(--paper-2); }
.print-photo.developing > img { filter: grayscale(1) brightness(1.08) blur(1.5px); opacity: .55; }
.print-photo.developing::before { background: linear-gradient(180deg, transparent, rgb(255 236 214 / 60%), transparent); background-size: 100% 40%; background-repeat: no-repeat; animation: sweep-y 2.6s var(--ease) infinite; }
@keyframes sweep-y { from { background-position: 0 -40%; } to { background-position: 0 140%; } }
.print-photo.failed { background: var(--paper-2); }
.failed-note { transform: translate(-50%, -50%); border: 0; border-radius: 999px; color: var(--ink-2); background: rgb(255 255 255 / 94%); box-shadow: var(--shadow-sm); }
.empty-cat { border-radius: 22px; box-shadow: none; animation: none; }
.starter, .starter:nth-child(1), .starter:nth-child(3) { border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); transform: none; }
.starter:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.starter-pic { border-radius: 12px; }
@media (max-width: 600px) {
  .print, .print[data-reveal], .print[data-reveal].in { padding: 5px 5px 0; border-radius: 14px; }
  .print-tape { top: 10px; left: 10px; padding: 1px 7px; font-size: 10px; }
  .before-chip { left: 6px; bottom: 6px; }
}
