/* ============ Brittani Fagel — the fun journal ============ */
.preview-banner { position: sticky; top: 0; z-index: 30; margin: 0; padding: 10px 16px; background: var(--velvet); color: var(--ivory); text-align: center; font-size: 13px; letter-spacing: .06em; }

/* ---------- diary header ---------- */
.diary-head { position: relative; }
.diary-date { margin: 0; font-family: var(--f-display); font-style: italic; font-size: 22px; color: var(--rose-ink); }
.post-stickers { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.cat-sticker, .mood-sticker { padding: 7px 14px 6px; font-size: 11.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; box-shadow: 0 6px 12px -8px rgba(59, 37, 27, .5); }
.cat-sticker { background: var(--velvet); color: var(--ivory); border-radius: 999px; transform: rotate(-3deg); }
.mood-sticker { background: var(--butter); color: var(--burgundy); transform: rotate(2deg); clip-path: polygon(3% 0, 97% 4%, 100% 96%, 0 100%); }
.mood-sticker b { font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: 16px; letter-spacing: 0; text-transform: none; }

/* notebook paper: lined, with a pink margin rule */
.post-body.notebook {
  background-color: var(--ivory);
  background-image:
    linear-gradient(90deg, transparent 38px, rgba(224, 125, 152, .45) 38px 39.5px, transparent 39.5px),
    repeating-linear-gradient(transparent 0 31px, rgba(90, 59, 42, .12) 31px 32px),
    var(--grain);
  background-position: 0 0, 0 18px, 0 0;
}
.post-letter { position: relative; }
.margin-stickers { position: absolute; inset: 0; pointer-events: none; }
.drag-sticker { position: absolute; left: var(--x); top: var(--y); width: var(--w); transform: rotate(var(--r)); pointer-events: auto; cursor: grab; touch-action: none; filter: drop-shadow(0 6px 6px rgba(40, 10, 16, .3)); transition: transform .25s var(--ease); }
.drag-sticker:hover { transform: rotate(var(--r)) scale(1.08); }
.drag-sticker.dragging { cursor: grabbing; transform: rotate(0) scale(1.15); transition: none; z-index: 5; }
.drag-sticker[src*="kiss"] { mix-blend-mode: multiply; }

/* shared block look */
.jb { position: relative; max-width: 560px; margin: 2.2em auto; transform: rotate(var(--tilt, 0deg)); }
.jb-label { margin: 0 0 8px; font-size: 11.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--rose-ink); text-align: center; }
.jb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 0; background: var(--velvet); color: var(--ivory); font: 500 12px/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.jb-btn:hover { background: var(--burgundy); }

/* ---------- peel-back sticky note ---------- */
.jb-sticky { max-width: 380px; min-height: 190px; padding: 0; background: var(--butter); box-shadow: 0 16px 24px -14px rgba(59, 37, 27, .5); }
.jb-sticky::before { content: ""; position: absolute; top: -12px; left: 50%; width: 110px; height: 26px; margin-left: -55px; background: rgba(245, 184, 200, .78); transform: rotate(-3deg); clip-path: polygon(2% 0, 98% 6%, 100% 94%, 0 100%); z-index: 3; }
.sticky-body { padding: 30px 26px 24px; font-family: var(--f-display); font-style: italic; font-size: 21px; line-height: 1.45; color: var(--cocoa); }
.sticky-body p { margin: 0 0 .6em; }
.sticky-flap {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  border: 0; padding: 20px;
  background: linear-gradient(135deg, #F9E6A9, #EFD37E);
  color: var(--burgundy); font: italic 500 24px/1.2 var(--f-display);
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  transform-origin: 100% 100%;
  transition: transform .7s var(--ease), clip-path .7s var(--ease), opacity .5s .3s;
  box-shadow: inset -14px -14px 20px -12px rgba(94, 59, 20, .25);
}
.sticky-flap::after { content: ""; position: absolute; right: 0; bottom: 0; width: 34px; height: 34px; background: linear-gradient(315deg, var(--butter) 50%, #D8B85C 50%); box-shadow: -3px -3px 6px rgba(59, 37, 27, .18); }
.sticky-flap:hover { transform: rotate(-3deg); }
.jb-sticky.peeled .sticky-flap { transform: rotate(-28deg) translate(-12%, -30%) scale(.9); opacity: 0; pointer-events: none; }

/* ---------- scratch-off ---------- */
.jb-scratch { max-width: 460px; text-align: center; }
.scratch-card { position: relative; min-height: 150px; display: grid; place-items: center; padding: 24px; background: #fff; border: 1px dashed var(--gold); box-shadow: 0 16px 26px -16px rgba(59, 37, 27, .5); overflow: hidden; }
.scratch-prize { font-family: var(--f-display); font-size: 22px; line-height: 1.35; color: var(--burgundy); }
.scratch-prize p { margin: 0; }
.scratch-code { font-family: var(--f-body); font-weight: 500; font-size: 30px; letter-spacing: .18em; }
.scratch-foil { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; transition: opacity .6s; }
.scratch-card.revealed .scratch-foil { opacity: 0; pointer-events: none; }
.scratch-reveal:focus { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: auto; height: auto; clip: auto; padding: 6px 10px; background: var(--ivory); z-index: 3; }
.scratch-copy { margin-top: 12px; }

/* ---------- envelope ---------- */
.jb-envelope { max-width: 420px; margin-top: 3.2em; text-align: center; transition: margin-top .5s var(--ease); }
.jb-envelope.open { margin-top: 9em; }
.env-closed { position: relative; display: block; width: 100%; aspect-ratio: 1.6; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.env-back { position: absolute; inset: 0; background: linear-gradient(160deg, #F6D9DF, #EDBCC7); box-shadow: 0 18px 28px -16px rgba(59, 37, 27, .5); }
.env-back::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent 49.6%, rgba(94, 22, 36, .12) 50%, transparent 50.4%), linear-gradient(to top left, transparent 49.6%, rgba(94, 22, 36, .12) 50%, transparent 50.4%); }
.env-letter-peek { position: absolute; left: 8%; right: 8%; top: 10%; bottom: 20%; background: var(--ivory); transition: transform .6s var(--ease); }
.env-flap { position: absolute; left: 0; right: 0; top: 0; height: 58%; background: linear-gradient(180deg, #F2C9D2, #E6AFBC); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .6s var(--ease); z-index: 2; filter: drop-shadow(0 3px 2px rgba(59, 37, 27, .2)); }
.env-wax { position: absolute; left: 50%; top: 58%; width: 64px; margin: -32px 0 0 -32px; z-index: 3; transition: transform .5s var(--ease), opacity .4s; }
.env-title { position: absolute; left: 0; right: 0; bottom: 10%; z-index: 3; font-family: var(--f-display); font-style: italic; font-size: 22px; color: var(--burgundy); }
.env-closed:hover .env-wax { transform: rotate(-12deg) scale(1.06); }
.jb-envelope.open .env-flap { transform: rotateX(180deg); z-index: 0; }
.jb-envelope.open .env-wax { opacity: 0; transform: scale(.6) rotate(40deg); }
.jb-envelope.open .env-letter-peek { transform: translateY(-16%); }
.env-letter { position: relative; margin: -30px 18px 0; padding: 30px 28px 22px; background-color: var(--ivory); background-image: repeating-linear-gradient(transparent 0 29px, rgba(90, 59, 42, .1) 29px 30px); text-align: left; font-family: var(--f-display); font-size: 21px; line-height: 30px; color: var(--cocoa); box-shadow: 0 16px 26px -16px rgba(59, 37, 27, .45); opacity: 0; transform: translateY(-20px); transition: opacity .4s, transform .5s var(--ease); z-index: 4; }
.env-letter.in { opacity: 1; transform: none; }
.env-letter p { margin: 0 0 30px; }
.env-sign { margin: 0 !important; text-align: right; font-style: italic; color: var(--rose-ink); }

/* ---------- flip card ---------- */
.jb-flip { display: block; width: min(360px, 100%); padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; perspective: 900px; }
.flip-inner { position: relative; display: block; aspect-ratio: 5 / 3; transform-style: preserve-3d; transition: transform .7s var(--ease); }
.jb-flip[aria-pressed="true"] .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 8px; padding: 20px; text-align: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 16px 24px -16px rgba(59, 37, 27, .5); }
.flip-front { background-color: var(--velvet); background-image: var(--img-velvet); background-size: 700px auto; color: var(--ivory); outline: 1px solid rgba(228, 208, 160, .6); outline-offset: -8px; }
.flip-q { font-family: var(--f-display); font-style: italic; font-size: 26px; line-height: 1.15; }
.flip-hint { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; opacity: .7; }
.flip-back { transform: rotateY(180deg); background: var(--blush-2); color: var(--burgundy); font-family: var(--f-display); font-size: 22px; line-height: 1.3; outline: 1px solid rgba(176, 141, 87, .55); outline-offset: -8px; }

/* ---------- developing polaroid ---------- */
.jb-polaroid { display: block; width: min(380px, 100%); padding: 12px 12px 16px; cursor: pointer; }
.jb-polaroid.post-cover { width: min(640px, 100%); transform: rotate(-1deg); }
.polaroid-film { position: relative; display: block; overflow: hidden; background: #1A1210; }
.polaroid-film img { display: block; width: 100%; height: auto; filter: brightness(.08) sepia(1) blur(6px) contrast(.8); transition: filter 2.8s ease-out; }
.jb-polaroid.developed .polaroid-film img { filter: none; }
.jb-polaroid figcaption { padding-top: 10px; text-align: center; font-family: var(--f-display); font-style: italic; font-size: 20px; color: var(--brown); }
.jb-polaroid.shake { animation: shake-it .5s ease-in-out; }
@keyframes shake-it { 0%, 100% { transform: rotate(var(--tilt, 0deg)); } 25% { transform: rotate(-6deg) translateX(-6px); } 50% { transform: rotate(5deg) translateX(6px); } 75% { transform: rotate(-3deg); } }

/* ---------- poll ---------- */
.jb-poll { max-width: 460px; padding: 22px 22px 16px; background-color: var(--ivory); background-image: var(--grain); border: 1px solid rgba(176, 141, 87, .55); outline: 1px solid rgba(176, 141, 87, .3); outline-offset: -7px; box-shadow: 0 16px 24px -16px rgba(59, 37, 27, .45); }
.poll-q { margin: 0 0 14px; text-align: center; font-family: var(--f-display); font-size: 26px; line-height: 1.15; color: var(--burgundy); }
.poll-opts { display: grid; gap: 8px; }
.poll-opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 10px 14px; overflow: hidden; border: 1px solid rgba(94, 22, 36, .35); background: #fff; color: var(--burgundy); font: 500 14px/1.3 var(--f-body); text-align: left; cursor: pointer; }
.poll-opt:hover { border-color: var(--burgundy); }
.poll-bar { position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); background: var(--blush); transition: width .8s var(--ease); }
.poll-opt[aria-pressed="true"] .poll-bar { background: #F0A9BB; }
.poll-text, .poll-pct { position: relative; }
.poll-pct { font-variant-numeric: tabular-nums; }
.jb-poll.voted .poll-opt { cursor: default; }
.poll-note { min-height: 20px; margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--brown); }

/* ---------- checklist ---------- */
.jb-checklist { max-width: 420px; padding: 24px 26px 18px; background: #fff; box-shadow: 0 16px 24px -16px rgba(59, 37, 27, .45); }
.jb-checklist::before { content: ""; position: absolute; top: -10px; left: 24px; width: 90px; height: 24px; background: rgba(243, 227, 168, .85); transform: rotate(-4deg); }
.checklist-title { margin: 0 0 10px; font-family: var(--f-display); font-style: italic; font-size: 26px; color: var(--burgundy); }
.jb-checklist ul { margin: 0; padding: 0; list-style: none; }
.jb-checklist li { border-bottom: 1px dashed rgba(90, 59, 42, .2); }
.jb-checklist label { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.jb-checklist input { position: absolute; opacity: 0; }
.check-box { flex: none; position: relative; width: 22px; height: 22px; border: 1.5px solid var(--burgundy); }
.check-box::after { content: ""; position: absolute; left: 3px; top: -6px; width: 12px; height: 22px; border: solid var(--rose-ink); border-width: 0 3px 3px 0; transform: rotate(40deg) scale(0); transform-origin: center; transition: transform .3s var(--ease); }
.jb-checklist input:checked + .check-box::after { transform: rotate(40deg) scale(1); }
.jb-checklist input:focus-visible + .check-box { outline: 2px solid var(--burgundy); outline-offset: 3px; }
.check-text { transition: color .3s; }
.jb-checklist input:checked ~ .check-text { color: rgba(59, 37, 27, .5); text-decoration: line-through; text-decoration-color: var(--rose); }

/* ---------- washi tape quote + sticker note ---------- */
.jb-tape { max-width: 520px; margin: 2.4em auto; padding: 18px 28px; border: 0; background: repeating-linear-gradient(45deg, rgba(245, 184, 200, .85) 0 12px, rgba(249, 230, 231, .85) 12px 24px); text-align: center; font-family: var(--f-display); font-style: italic; font-size: 26px !important; line-height: 1.3; color: var(--burgundy); clip-path: polygon(1% 4%, 99% 0, 100% 90%, 98% 100%, 0 96%); }
.jb-tape p { margin: 0; }
.jb-sticker-note { max-width: 300px; margin: 2em auto; padding: 16px 20px; background: var(--velvet); color: var(--ivory); text-align: center; font-family: var(--f-display); font-style: italic; font-size: 22px; border-radius: 50% 46% 52% 44% / 44% 52% 46% 50%; box-shadow: 0 14px 22px -14px rgba(59, 10, 20, .7); }

/* ---------- vibe check reactions ---------- */
.vibe-check { max-width: 760px; margin: 60px auto 0; text-align: center; }
.vibe-title { display: inline-block; margin: 0; padding: 10px 26px 12px; background-color: var(--ivory); background-image: var(--grain); font-family: var(--f-display); font-weight: 400; font-size: clamp(34px, 4.6vw, 48px); line-height: 1; color: var(--burgundy); transform: rotate(-1.5deg); box-shadow: 0 12px 20px -12px rgba(59, 37, 27, .45); }
.vibe-title em { font-style: italic; color: var(--rose-ink); }
.vibe-sub { margin: 14px 0 20px; font-size: 14px; color: var(--brown); }
.vibe-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.vibe { position: relative; display: grid; justify-items: center; gap: 6px; width: 112px; padding: 14px 8px 12px; border: 1px solid rgba(176, 141, 87, .5); background: var(--ivory); color: var(--burgundy); font: inherit; cursor: pointer; transition: transform .3s var(--ease), background .2s; }
.vibe:nth-child(odd) { transform: rotate(-2deg); } .vibe:nth-child(even) { transform: rotate(2deg); }
.vibe:hover { transform: translateY(-4px) rotate(0); }
.vibe[aria-pressed="true"] { background: var(--blush-2); border-color: var(--burgundy); box-shadow: 0 0 0 1px var(--burgundy); }
.vibe-art { display: grid; place-items: center; width: 44px; height: 44px; }
.vibe-art svg, .vibe-art img { width: 100%; height: 100%; object-fit: contain; }
.vibe-label { font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.vibe-count { position: absolute; top: -9px; right: -9px; min-width: 24px; padding: 3px 7px; border-radius: 999px; background: var(--velvet); color: var(--ivory); font-size: 11px; font-variant-numeric: tabular-nums; }
.vibe-count:empty { display: none; }
.vibe.pop { animation: vibe-pop .45s var(--ease); }
@keyframes vibe-pop { 50% { transform: scale(1.18) rotate(-4deg); } }

/* ---------- espresso martini reading meter ---------- */
.read-martini { position: fixed; left: 16px; bottom: 16px; z-index: 35; display: grid; justify-items: center; gap: 2px; padding: 8px 8px 6px; background: rgba(255, 251, 243, .92); border: 1px solid rgba(176, 141, 87, .5); box-shadow: 0 10px 20px -10px rgba(59, 37, 27, .5); opacity: 0; transform: translateY(12px); transition: opacity .35s, transform .35s var(--ease); pointer-events: none; }
.read-martini.show { opacity: 1; transform: none; }
.read-martini svg { width: 40px; height: 54px; }
.read-fill, .read-foam { transition: y .15s linear; }
.read-pct { font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--burgundy); font-variant-numeric: tabular-nums; }
.read-martini.full { animation: vibe-pop .6s var(--ease); }

/* ---------- journal index tools ---------- */
.journal-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 34px; }
.journal-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.jtab { padding: 9px 16px; border: 1px solid rgba(94, 22, 36, .35); background: var(--ivory); color: var(--burgundy); font: 500 12px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; border-radius: 999px; }
.jtab[aria-pressed="true"] { background: var(--velvet); color: var(--ivory); border-color: var(--velvet); }
.entry.chosen { animation: vibe-pop .6s var(--ease); }

@media (max-width: 760px) {
  .margin-stickers { display: none; }
  .post-body.notebook { background-image: repeating-linear-gradient(transparent 0 31px, rgba(90, 59, 42, .1) 31px 32px), var(--grain); background-position: 0 18px, 0 0; }
  .jb { margin: 1.8em auto; }
  .sticky-body, .env-letter { font-size: 19px; }
  .vibe { width: calc(33% - 10px); min-width: 96px; }
  .read-martini { left: 10px; bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .polaroid-film img { filter: none; }
}
