/* =====================================================================
   THE JOURNAL — a clickable 3D bullet-journal notebook (home page).
   Page size is --p; every page is a size container, so all type and pieces scale with it (cqw units).
   Realistic details: paper grain, die-cut vinyl stickers, washi tape, paperclips, ticket stub, business card,
   perforated stamp, torn spiral sheet, coffee ring, push pin, elastic band, spine shadows.
   ===================================================================== */
.jr { background: var(--deep-ink); color: #f5f0e6; padding: clamp(48px, 6vw, 96px) 0 clamp(36px, 4vw, 64px); overflow: hidden; position: relative; border-block: 1px solid #000; }
.jr__head { max-width: 760px; margin: 0 auto clamp(28px, 4vw, 56px); text-align: center; }
.jr__head h2 { margin: 12px 0 14px; font-size: clamp(40px, 6vw, 88px); font-weight: 900; text-transform: uppercase; letter-spacing: -.04em; line-height: .9; }
.jr__head h2 em { text-transform: none; color: #ff7ab3; font-size: 1.12em; letter-spacing: -.01em; }
.jr__head p { margin: 0 auto; max-width: 520px; font-size: 17px; line-height: 1.55; color: rgba(245,240,230,.75); }

.jr__stage { --p: clamp(250px, 32vw, 470px); --h: calc(var(--p) * 1.38); position: relative; perspective: 2600px; display: flex; justify-content: center; align-items: center; height: calc(var(--h) + 60px); }
.jr__book { position: relative; width: calc(var(--p) * 2); height: var(--h); transition: transform 1s cubic-bezier(.6,.05,.25,1); transform: translateX(calc(var(--p) * -.5)); }
.jr__book[data-state="open"] { transform: translateX(0); }
.jr__book[data-state="end"] { transform: translateX(0); }
.jr__book::before { content: ""; position: absolute; left: 4%; right: 4%; bottom: -26px; height: 44px; background: radial-gradient(50% 50% at 50% 50%, rgba(0,0,0,.65), transparent 70%); filter: blur(8px); z-index: -1; }
.jr__boardL, .jr__boardR { position: absolute; top: -1.2%; height: 102.4%; width: calc(var(--p) + 1.2%); background: #19171a url(../img/journal/cloth.jpg); border-radius: 6px; box-shadow: 0 2px 0 rgba(255,255,255,.05) inset; }
.jr__boardR { left: calc(50% - .4%); border-radius: 3px 8px 8px 3px; }
.jr__boardL { right: calc(50% - .4%); border-radius: 8px 3px 3px 8px; opacity: 0; transition: opacity .5s .25s; }
.jr__book:not([data-state="closed"]) .jr__boardL { opacity: 1; }

.jr__leaf { position: absolute; left: 50%; top: 0; width: var(--p); height: 100%; transform-origin: 0 50%; transform-style: preserve-3d; z-index: calc(20 - var(--i));
  transition: transform .75s cubic-bezier(.45,.05,.25,1), z-index 0s .35s; }
.jr__leaf.is-flipped { transform: rotateY(-180deg); z-index: calc(20 + var(--i)); }
.jr__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; container-type: inline-size; font-size: 3.2cqw; color: #1d1a17; }
.jr__back { transform: rotateY(180deg); }
.jr__front::after, .jr__back::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.jr__front::after { background: linear-gradient(90deg, rgba(0,0,0,.32), rgba(0,0,0,.08) 5%, transparent 14%), linear-gradient(270deg, rgba(0,0,0,.1), transparent 4%); }
.jr__back::after { background: linear-gradient(270deg, rgba(0,0,0,.32), rgba(0,0,0,.08) 5%, transparent 14%), linear-gradient(90deg, rgba(0,0,0,.1), transparent 4%); }
.jr__front { border-radius: 2px 6px 6px 2px; } .jr__back { border-radius: 6px 2px 2px 6px; }

/* type used on pages */
.jr .typed { font-family: var(--mono); font-weight: 500; letter-spacing: .04em; font-size: 2.9cqw; line-height: 1.5; color: #2a2620; }
.jr .typed.sm { font-size: 2.4cqw; } .jr .typed.xs { font-size: 1.9cqw; }
.jr .hand { font-family: "Caveat", cursive; font-weight: 700; line-height: .92; position: absolute; color: #1a1d3a; }
.jr .hand.big { font-size: 15cqw; } .jr .hand.med { font-size: 8.6cqw; }
.jr .typed.top { position: absolute; left: 9%; top: 4%; font-size: 2.3cqw; letter-spacing: .1em; opacity: .7; } .jr .typed.top.dk { color: #3a2412; }
.jr .typed.body { position: absolute; line-height: 1.65; font-size: 2.9cqw; }
.jr .lst { position: absolute; margin: 0; padding: 0; list-style: none; font-size: 2.6cqw; } .jr .lst li::before { content: "✱ "; color: #d6247a; }
.jr a { color: inherit; text-decoration: none; }

/* paper surfaces */
.p-dots, .p-kraft, .p-black, .p-graph, .p-sheet, .face-cover { position: absolute; inset: 0; }
.p-dots { background: #f3eee2 url(../img/journal/paper.jpg); } .p-dots::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(40,34,28,.38) 1.1px, transparent 1.5px); background-size: 5.4cqw 5.4cqw; background-position: 3cqw 3cqw; }
.p-graph { background: #f1ecdf url(../img/journal/graph-paper.jpg); } .p-graph::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(70,110,150,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(70,110,150,.22) 1px, transparent 1px); background-size: 5.4cqw 5.4cqw; }
.p-kraft { background: #c4a070 url(../img/journal/kraft.jpg); }
.p-black { background: #18161a url(../img/journal/cloth.jpg); color: #f5f0e6; }
.p-black .typed, .p-black .hand-w { color: #f5f0e6; }
.p-sheet { background: #fbfaf5 url(../img/journal/paper.jpg); background-blend-mode: multiply; }
.p-sheet::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(180deg, transparent 0 7.2cqw, rgba(75,120,170,.35) 7.2cqw calc(7.2cqw + 1px)); background-position: 0 9cqw; }
.p-sheet::after { content: ""; position: absolute; left: 13%; top: 0; bottom: 0; width: 2px; background: rgba(214,40,60,.5); }
.p-sheet .holes { position: absolute; left: 3.4cqw; top: 0; bottom: 0; width: 5cqw; background: radial-gradient(circle at 50% 50%, #1b1a1d 0 1.5cqw, rgba(0,0,0,.25) 1.5cqw 1.9cqw, transparent 2.1cqw) 0 3cqw / 5cqw 11cqw repeat-y; }
.jr .p-sheet > .hand { position: absolute; } .jr .ruled { position: absolute; margin: 0; padding: 0; list-style: none; font-size: 6.2cqw; line-height: 7.2cqw; } .jr .ruled li { display: block; } .jr .ruled b { color: #d6247a; margin-right: .3em; font-family: "Caveat"; }

/* pieces */
.jr .pc { position: absolute; transform: rotate(var(--r, 0deg)); transition: transform .35s cubic-bezier(.2,1,.3,1), filter .35s; }
.jr .pc:hover { transform: rotate(0deg) translateY(-1cqw) scale(1.03); z-index: 30; }
.jr .stk { filter: drop-shadow(.3cqw .6cqw .5cqw rgba(0,0,0,.35)); pointer-events: auto; }
.jr .stk:hover { transform: rotate(calc(var(--r) - 5deg)) scale(1.08); }
.jr .tp { position: absolute; height: auto; filter: drop-shadow(.2cqw .35cqw .3cqw rgba(0,0,0,.3)); z-index: 3; pointer-events: none; }
.jr .pc.tp { z-index: 6; }
.jr .pclip { height: auto; filter: drop-shadow(.3cqw .5cqw .3cqw rgba(0,0,0,.4)); z-index: 7; overflow: visible; }
.jr .pin { width: 4cqw; height: 4cqw; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9a8a 0 12%, #e04a3a 40%, #8d1f14 100%); box-shadow: .5cqw 1cqw .8cqw rgba(0,0,0,.45); z-index: 8; }
.jr .ph { background: #fffdf6; padding: 2.2cqw 2.2cqw 0; box-shadow: .4cqw .9cqw 1.4cqw rgba(0,0,0,.32), 0 0 0 1px rgba(0,0,0,.06); margin: 0; }
.jr .ph .tp { left: 30%; top: -5%; width: 38%; transform: rotate(var(--r, 0deg)); }
.jr .ph img.im { display: block; width: 100%; object-fit: cover; }
.jr .ph figcaption { padding: 1.6cqw .4cqw 2.4cqw; font-family: var(--mono); font-size: 1.9cqw; letter-spacing: .05em; text-transform: uppercase; color: #5a534a; }
.jr .ph.dark { background: #0f0e10; padding: 0; box-shadow: .4cqw .9cqw 1.4cqw rgba(0,0,0,.6); }
.jr .ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.18) 0%, transparent 38%); pointer-events: none; }
.jr .lnk { font-size: 2.5cqw; border-bottom: 1px solid currentColor; padding-bottom: 2px; z-index: 5; }
.jr .lbl2 { background: #f6f0e1 url(../img/journal/paper.jpg); padding: 4.6cqw 4cqw 4cqw; text-align: center; box-shadow: .3cqw .7cqw 1cqw rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 1.2cqw; }
.jr .lbl2 .hand { position: static; font-size: 9.4cqw; color: #7a1636; }
.jr .ticket { display: grid; grid-template-columns: 1fr 22%; background: #f1e5c8 url(../img/journal/paper.jpg); box-shadow: .3cqw .7cqw 1cqw rgba(0,0,0,.3);
  -webkit-mask: radial-gradient(circle 2.2cqw at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 2.2cqw at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat; mask: radial-gradient(circle 2.2cqw at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 2.2cqw at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat; filter: drop-shadow(.3cqw .6cqw .6cqw rgba(0,0,0,.3)); }
.jr .tk__main .typed { font-size: 1.9cqw; } .jr .tk__main { padding: 3.4cqw 3.4cqw 3.4cqw 5.4cqw; display: flex; flex-direction: column; gap: .8cqw; border-right: 2px dashed rgba(60,40,20,.5); } .jr .tk__main b { white-space: nowrap; font-family: var(--mono); font-weight: 500; font-size: 7.6cqw; letter-spacing: .04em; color: #7a1636; line-height: 1; }
.jr .tk__stub { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1.4cqw; padding: 2cqw; } .jr .tk__stub .bar { width: 70%; height: 13cqw; background: repeating-linear-gradient(90deg, #1d1a17 0 2px, transparent 2px 5px, #1d1a17 5px 6px, transparent 6px 9px); }
.jr .stamp { background: #f6f0e1; padding: 1.6cqw; text-align: center; display: flex; flex-direction: column; justify-content: center; aspect-ratio: 3/4; box-shadow: none; filter: drop-shadow(.3cqw .5cqw .5cqw rgba(0,0,0,.35)); } .jr .stamp b { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; font-size: 11cqw; color: #7a1636; line-height: 1; border: 1px solid #7a1636; }
.jr .ring { aspect-ratio: 1; border-radius: 50%; border: .9cqw solid rgba(110,60,20,.22); box-shadow: inset 0 0 .6cqw rgba(110,60,20,.2); filter: blur(.25px); mix-blend-mode: multiply; transform: rotate(var(--r,0deg)); pointer-events: none; }
.jr .bcard { background: #fbfaf4 url(../img/journal/paper.jpg); padding: 4cqw 4cqw 3.4cqw; display: flex; flex-direction: column; gap: .6cqw; text-align: center; box-shadow: .3cqw .8cqw 1.2cqw rgba(0,0,0,.35); aspect-ratio: 1.75/1; justify-content: center; }
.jr .bcard b { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; font-size: 6.4cqw; line-height: 1.05; }
.jr .mail { aspect-ratio: 1.6/1; background: repeating-linear-gradient(135deg, #d6247a 0 3cqw, #fffdf6 3cqw 6cqw, #2b6cb0 6cqw 9cqw, #fffdf6 9cqw 12cqw); padding: 1.6cqw; box-shadow: .3cqw .8cqw 1.2cqw rgba(0,0,0,.3); } .jr .mail span { display: block; height: 100%; background: #fffdf6; text-align: center; padding-top: 3cqw; letter-spacing: .2em; color: #b0123b; }
.jr .bj { position: absolute; margin: 0; padding: 0; list-style: none; font-family: "Caveat"; font-weight: 700; font-size: 6.1cqw; line-height: 1.12; color: #1a1d3a; }
.jr .bj li { display: flex; gap: 2.4cqw; padding: 2cqw 0; align-items: baseline; } .jr .bj b { width: 5cqw; color: #d6247a; flex: none; text-align: center; } .jr .bj li.done a { text-decoration: line-through; text-decoration-thickness: .6cqw; text-decoration-color: rgba(214,36,122,.6); opacity: .65; } .jr .bj a:hover { color: #d6247a; }
.jr .key { position: absolute; display: flex; gap: 3cqw; flex-wrap: wrap; }
.jr .trk { position: absolute; display: grid; gap: 2.4cqw; } .jr .trk__head, .jr .trk__row { display: grid; grid-template-columns: 1fr repeat(7, 4.6cqw); gap: 2cqw; align-items: center; } .jr .trk__head i { font: 700 2.4cqw var(--mono); font-style: normal; text-align: center; opacity: .6; }
.jr .trk__row span { font-family: "Caveat"; font-weight: 700; font-size: 4.6cqw; color: #1a1d3a; line-height: 1; white-space: nowrap; } .jr .trk__row i { width: 4.6cqw; height: 4.6cqw; border-radius: 50%; border: 1px solid rgba(40,34,28,.55); background: transparent; } .jr .trk__row i.on { background: #d6247a; border-color: #d6247a; box-shadow: inset 0 0 0 .7cqw #f3eee2; background-clip: content-box; background: radial-gradient(circle, #d6247a 0 52%, transparent 54%); }

/* cover */
.face-cover { background: #1b181c url(../img/journal/cloth.jpg); border-radius: 2px 7px 7px 2px; cursor: pointer; box-shadow: inset 0 0 0 .5cqw rgba(255,255,255,.04); }
.face-cover .stitch { position: absolute; inset: 3.2cqw 3.2cqw 3.2cqw 7cqw; border: 1px dashed rgba(245,240,230,.22); }
.face-cover .elastic { position: absolute; right: 10%; top: -1px; bottom: -1px; width: 3.8cqw; background: linear-gradient(90deg, #6e1230, #a61e4a 50%, #6e1230); box-shadow: 0 0 .8cqw rgba(0,0,0,.5); z-index: 3; }
.face-cover .lbl { position: absolute; left: 14%; top: 14%; width: 56%; background: #efe3c6 url(../img/journal/paper.jpg); padding: 6cqw 4cqw; text-align: center; display: flex; flex-direction: column; gap: 1.6cqw; box-shadow: .3cqw .7cqw 1cqw rgba(0,0,0,.5); transform: rotate(-2deg); z-index: 4; border: 1px solid rgba(60,40,20,.3); outline: 1px solid rgba(60,40,20,.3); outline-offset: -1.6cqw; }
.face-cover .lbl b { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; font-size: 9.6cqw; line-height: .95; color: #7a1636; }
.face-cover .stk { z-index: 5; }
.openhint { position: absolute; left: 14%; bottom: 7%; z-index: 4; color: #f5f0e6 !important; background: rgba(214,36,122,.92); padding: 1.6cqw 3cqw; transform: rotate(-1.5deg); letter-spacing: .09em; }
.jr__book[data-state="closed"] .face-cover { animation: jr-nudge 3.2s ease-in-out 1.2s 2; }
@keyframes jr-nudge { 0%, 100% { transform: none; } 12% { transform: rotateY(-7deg); } 24% { transform: none; } }

/* black pages */
.p-black .serif { position: absolute; left: 0; right: 0; top: 6%; text-align: center; font-family: "Instrument Serif", serif; font-weight: 400; font-size: 17cqw; letter-spacing: .02em; color: #f5f0e6; line-height: 1; z-index: 2; mix-blend-mode: normal; }
.p-black .serif-i { position: absolute; left: 0; right: 0; top: 82%; text-align: center; font-family: "Instrument Serif", serif; font-style: italic; font-size: 7cqw; margin: 0; } .p-black .serif-i em { color: #ff7ab3; }
.btnj { display: inline-block; position: absolute; border: 1px solid currentColor; padding: 1.7cqw 3cqw; font-size: 2.5cqw !important; letter-spacing: .09em; background: transparent; cursor: pointer; z-index: 6; color: inherit; font-family: var(--mono); font-weight: 500; transition: background .2s, color .2s; }
.p-black .btnj { left: 50%; transform: translateX(-50%); top: 91%; color: #f5f0e6; } .p-black .btnj:hover { background: #f5f0e6; color: #111 !important; }
.btnj.on-light { color: #1a1d3a; } .btnj.on-light:hover { background: #1a1d3a; color: #f3eee2 !important; }
.p-black.end { display: grid; place-items: center; align-content: center; gap: 3cqw; text-align: center; }
.p-black.end .seal { width: 46%; color: rgba(245,240,230,.88); transform: rotate(-10deg); } .p-black.end .hand-w { font-family: "Caveat"; font-weight: 700; font-size: 11cqw; line-height: 1; margin: 2cqw 0 0; } .p-black.end .signoff { font-size: 3.6cqw; letter-spacing: .14em; margin: 0; }
.p-black.end .btnj { position: static; transform: none; margin-top: 4cqw; }

/* controls */
.jr__nav { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #f5f0e6; font-size: 34px; cursor: pointer; padding: 18px; line-height: 1; z-index: 60; transition: transform .2s, opacity .3s; }
.jr__nav--prev { left: max(8px, calc(50% - var(--p) - 70px)); } .jr__nav--next { right: max(8px, calc(50% - var(--p) - 70px)); }
.jr__nav:hover:not(:disabled) { transform: translateY(-50%) scale(1.2); color: #ff9fc9; } .jr__nav:disabled { opacity: .18; cursor: default; } .jr__nav:focus-visible { outline: 2px solid #ff9fc9; outline-offset: 2px; }
.jr__count { text-align: center; margin: 18px 0 0; color: rgba(245,240,230,.65); }
.jr__strip { display: none; }
@media (prefers-reduced-motion: reduce) { .jr__leaf, .jr__book, .jr__boardL { transition: none !important; } .jr__book[data-state="closed"] .face-cover { animation: none; } }

/* phones: the notebook becomes a swipeable strip of pages */
@media (max-width: 720px) {
  .jr__stage, .jr__count { display: none; }
  .jr__strip { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 7vw 18px; -webkit-overflow-scrolling: touch; }
  .jr__strip .jr__face { position: relative; flex: 0 0 82vw; width: 82vw; height: calc(82vw * 1.38); transform: none; backface-visibility: visible; scroll-snap-align: center; border-radius: 4px; box-shadow: 0 10px 24px rgba(0,0,0,.5); }
  .jr__strip .jr__face::after { display: none; }
}
.jr__strip .openhint { font-size: 0 !important; } .jr__strip .openhint::after { content: "Swipe →"; font-size: 2.9cqw; }
