/* Han Junmo — personal archive · v3 "One board" (owner feedback round 2, 2026-11-21)
   Design: Figma file OhwC4i3DHeMvabPkLYJtu3, pages "v3 · …". Colour tokens = Figma variables hj/*
   (code syntax var(--hj-*)). Where each board piece sits is generated into css/layout.css by
   tools/build.mjs from data/collage-layout.json — edit the data, not that file. */

:root {
  --hj-ink: #2A2A2E;
  --hj-ink-line: #EFEFEA;
  --hj-chalk: #FAFAF7;
  --hj-chalk-line: #1F1F22;
  --hj-hi: #F5D447;
  --hj-hi-line: #231D10;
  --hj-frame-dark: #121214;
  --hj-cord: #F6F6F2;
  --hj-tape: rgba(245, 212, 71, .86);
  --hj-rule: rgba(64, 92, 140, .17);
  --hj-rule-strong: rgba(64, 92, 140, .3);
  --hj-paper: #F2EFE8;
  --hj-paper-ink: #232124;
  --hj-paper-ink-soft: #5E5A55;
  --hj-ps-red: #C8232A;
  --hj-scrim: #0F0F11;
  --hj-vinyl: #141416;

  --f-display: "Prompt", "Leelawadee UI", "Thonburi", sans-serif;
  --f-ko: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --f-label: "Mitr", "Leelawadee UI", "Thonburi", sans-serif;
  --f-body: "IBM Plex Sans Thai Looped", "Leelawadee UI", "Thonburi", sans-serif;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  /* Two-tone focus ring: yellow 3 px + dark band outside (yellow alone is 1.27:1 on the paper). */
  --ring: 3px solid var(--hj-hi);
  --ring-out: 0 0 0 8.5px var(--hj-hi-line);

  /* Desktop / tablet / phone: print border 5 / 4 / 3 px, shadow scale. The record's size and place
     (--v-d, --v-b, --v-in, --v-tag, --v-tr, --v-gap) come from data/collage-layout.json through
     css/layout.css, scaled with the board like everything on it. */
  --pb: 5px;
  --pk: 1;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
@media (max-width: 1023.98px) {
  :root { --pb: 4px; --pk: .8; }
}
@media (max-width: 599.98px) {
  :root { --pb: 3px; --pk: .62; }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--hj-scrim);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  position: relative; /* tablet / phone: the record is placed at the end of the page (body's bottom) */
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--hj-scrim);
  color: var(--hj-chalk);
  font: 400 16px/1.7 var(--f-body);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--hj-hi); color: var(--hj-hi-line); }

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--hj-paper);
  color: var(--hj-paper-ink);
  font: 400 16px/1.2 var(--f-label);
  text-decoration: none;
  transform: translateY(calc(-100% - 24px));
}
.skip:focus { transform: none; outline: var(--ring); outline-offset: 3px; box-shadow: var(--ring-out); }

/* ---------- backdrop: his band-tee selfie, fixed while the collage scrolls over it ---------- */
.bg {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  pointer-events: none;
}
.bg img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 14, 16, .30), rgba(14, 14, 16, .10) 45%, rgba(14, 14, 16, .34));
}
/* film grain, static */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: url("../assets/texture/grain.png") 0 0 / 192px 192px repeat;
  opacity: .55;
}

/* ---------- the board: one screen on desktop (size and scale in css/layout.css) ---------- */
.wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  container-type: inline-size;
  /* desktop: the board fits the window; glyph boxes of the giant name hanging past it must not add a
     2 px scrollbar. Tablet and phone scroll, so only the sides are clipped there. */
  overflow: clip;
}
@media (max-width: 1023.98px) {
  /* the page ends above the home indicator, so the record in the board's last corner clears it */
  .wrap { overflow-y: visible; padding-bottom: var(--safe-b); }
}
.wrap:focus { outline: none; }
.canvas {
  position: relative;
  flex: none;
  margin: 0 auto;
  --u: calc(100cqw / 1440);
}
.it { position: absolute; margin: 0; }
.grp, .prints { margin: 0; padding: 0; list-style: none; }

/* giant name: TH (dark) / EN (light) / KO (dark); EN and KO may stack, per breakpoint */
.name { position: absolute; inset: 0; margin: 0; font-size: 1rem; pointer-events: none; }
.nm {
  position: absolute;
  display: block;
  white-space: nowrap;
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -.02em;
  paint-order: stroke fill;
  pointer-events: auto;
}
.nm.dark { color: var(--hj-ink); -webkit-text-stroke: .05em var(--hj-ink-line); text-shadow: 0 .03em .08em rgba(0, 0, 0, .25); }
.nm.light { color: var(--hj-chalk); -webkit-text-stroke: .05em var(--hj-chalk-line); text-shadow: 0 .03em .1em rgba(0, 0, 0, .3); }
.nm-th { line-height: 1.3; }
.nm-en { line-height: .92; }
.nm-en > span { display: block; }
.nm-ko { font-family: var(--f-ko); font-weight: 900; line-height: 1.04; letter-spacing: -.03em; }
.nm-ko > span { display: block; }

/* yellow outlined captions = the Doc's section headings, word for word; the brackets are drawn by
   CSS (empty alt text), so the page text itself stays exactly the Doc's */
.cap {
  white-space: nowrap;
  font-family: var(--f-label);
  font-weight: 400;
  line-height: 1.2;
  color: var(--hj-hi);
  -webkit-text-stroke: .115em var(--hj-hi-line);
  paint-order: stroke fill;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
.cap::before { content: "( "; content: "( " / ""; }
.cap::after { content: " )"; content: " )" / ""; }
/* phones: 14–15 px captions over the photo backdrop need a heavier outline and a dark halo to stay legible */
@media (max-width: 599.98px) {
  .cap { -webkit-text-stroke: .18em var(--hj-hi-line); text-shadow: 0 0 4px rgba(0, 0, 0, .7); }
}

/* prints: straight, white or black border around the whole photo (its height follows the photo, so
   nothing is cropped); each opens the photo popup */
.print {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: var(--pb) solid var(--hj-chalk);
  border-radius: 0;
  background: #1b1b1e;
  cursor: zoom-in;
  box-shadow: 0 calc(14px * var(--pk)) calc(30px * var(--pk)) calc(-14px * var(--pk)) rgba(0, 0, 0, .6);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.print.dark { border-color: var(--hj-frame-dark); }
.print img { display: block; width: 100%; height: auto; }
@media (hover: hover) {
  .print:hover, .note:hover {
    transform: translateY(-4px);
    box-shadow: 0 calc(22px * var(--pk)) calc(40px * var(--pk)) calc(-16px * var(--pk)) rgba(0, 0, 0, .72);
  }
}
.print:focus, .note:focus { outline: none; }
.print:focus-visible, .note:focus-visible {
  transform: translateY(-4px);
  outline: var(--ring);
  outline-offset: 3px;
  box-shadow: var(--ring-out), 0 calc(22px * var(--pk)) calc(40px * var(--pk)) calc(-16px * var(--pk)) rgba(0, 0, 0, .72);
}
/* prints rise 12 px and fade in once, as they enter the screen (js adds .in) */
.js .print-it {
  opacity: 0;
  translate: 0 12px;
  transition: opacity .6s var(--ease-out), translate .6s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 70ms);
}
.js .print-it.in { opacity: 1; translate: none; }
/* a print reached by Tab shows at once (its staggered delay could keep the focus ring hidden ~0.5 s) */
.js .print-it:focus-within { opacity: 1; translate: none; transition: none; }

/* ENTANGLEMENTS & note: a taped paper note with the Doc's heading; it opens in the same card as the
   photos (the owner chose "info inside the popups") */
.note {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: calc(30 * var(--u)) calc(26 * var(--u)) calc(22 * var(--u));
  border: 0;
  border-radius: 0;
  background: var(--hj-paper);
  color: var(--hj-paper-ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 calc(14px * var(--pk)) calc(30px * var(--pk)) calc(-14px * var(--pk)) rgba(0, 0, 0, .6);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.note::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(-13 * var(--u));
  width: 36%;
  height: calc(30 * var(--u));
  translate: -50% 0;
  rotate: -3deg;
  background: var(--hj-tape);
  -webkit-clip-path: polygon(0 10%, 3% 0, 6% 12%, 9% 0, 91% 0, 94% 12%, 97% 0, 100% 10%, 100% 90%, 97% 100%, 94% 88%, 91% 100%, 9% 100%, 6% 88%, 3% 100%, 0 90%);
  clip-path: polygon(0 10%, 3% 0, 6% 12%, 9% 0, 91% 0, 94% 12%, 97% 0, 100% 10%, 100% 90%, 97% 100%, 94% 88%, 91% 100%, 9% 100%, 6% 88%, 3% 100%, 0 90%);
}
.note-h {
  display: block;
  font-family: var(--f-display);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.01em;
  overflow-wrap: break-word;
}

/* white earphone cords from the owner's board (decorative; the red headphones were removed) */
.cords {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: none;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.dd-white { fill: none; stroke: var(--hj-cord); stroke-linecap: round; }
.dd-white-f { fill: var(--hj-cord); }
.dd-bud { fill: #cfcfca; }

/* ---------- record player: half peeks in from the right edge; press = slides in and spins ----------
   Desktop (one screen): fixed to the window's corner, which the board keeps free. Tablet and phone
   scroll, and a fixed record would cover prints on the way down (QA round 2), so there it sits in the
   board's own bottom-right corner — the end of the page — where nothing else is. */
.deck {
  position: fixed;
  right: 0;
  bottom: calc(var(--v-b) + var(--safe-b) - 14px);
  z-index: 40;
  width: calc(var(--v-d) + var(--v-in) + 14px);
  height: calc(var(--v-d) + 28px);
  overflow: hidden;
  pointer-events: none;
}
.vinyl {
  position: absolute;
  right: 0;
  bottom: 14px;
  width: var(--v-d);
  height: var(--v-d);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--hj-vinyl);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .7);
  cursor: pointer;
  pointer-events: auto;
  transform: translateX(50%);
  transition: transform .7s var(--ease-out);
}
@media (hover: hover) {
  .vinyl:hover { transform: translateX(40%); transition-duration: .3s; }
}
.vinyl:focus { outline: none; }
.vinyl:focus-visible {
  transform: translateX(40%);
  transition-duration: .3s;
  outline: var(--ring);
  outline-offset: 3px;
  box-shadow: var(--ring-out), 0 10px 30px -8px rgba(0, 0, 0, .7);
}
.player.on .vinyl { transform: translateX(calc(-1 * var(--v-in))); transition-duration: .7s; }
.spin {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: hj-spin 1.8s linear infinite paused;
}
.player.on .spin { animation-play-state: running; }
@keyframes hj-spin { to { transform: rotate(1turn); } }
.grooves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #121214 0 1.5px, #1d1d20 1.5px 3px);
  box-shadow: inset 0 0 0 2px #0b0b0c;
}
/* label = the song's cover art (third-party artwork, used at the owner's request) */
.label {
  position: absolute;
  left: 30%;
  top: 30%;
  width: 40%;
  height: 40%;
  border-radius: 50%;
  background: #3a1416 url("../assets/music/lovers-rock-cover-480.webp") center / cover;
  box-shadow: 0 0 0 2px #0b0b0c;
}
.label::after {
  content: "";
  position: absolute;
  left: 46%;
  top: 46%;
  width: 8%;
  height: 8%;
  border-radius: 50%;
  background: #d9d6cf;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6);
}
/* light on the grooves stays still while the record turns */
.sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 20deg, rgba(255, 255, 255, 0) 0 12%, rgba(255, 255, 255, .14) 17%,
    rgba(255, 255, 255, 0) 24% 60%, rgba(255, 255, 255, .10) 66%, rgba(255, 255, 255, 0) 72%);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 40%, #000 41%);
  mask: radial-gradient(circle closest-side, transparent 0 40%, #000 41%);
  pointer-events: none;
}
/* the song tag sits above the record, inside the corner the board keeps free */
.vtag {
  position: fixed;
  right: var(--v-tr);
  bottom: calc(var(--v-b) + var(--v-d) + var(--v-gap) + var(--safe-b));
  z-index: 40;
  max-width: calc(100vw - 2 * var(--v-tr));
  margin: 0;
  text-align: right;
  font: 400 var(--v-tag)/1.2 var(--f-label);
  color: var(--hj-hi);
  -webkit-text-stroke: .13em var(--hj-hi-line);
  paint-order: stroke fill;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.player.on .vtag { opacity: 1; transition-delay: .35s; }
.vt { white-space: nowrap; } /* the tag may break only before "· ยังไม่มีไฟล์เสียง" */
.vtag-miss { display: none; }
.player.missing .vtag-miss { display: inline; }
@media (max-width: 1023.98px) {
  .deck, .vtag { position: absolute; }
}

/* ---------- photo popup v3: the photo whole + an index card holding the Doc's words ----------
   Owner round 2: "ออกแบบการ์ดข้อมูลใหม่ อยากให้สวยกว่านี้", and no numbers anywhere. On top: the Doc's
   six headings as tabs (the current one looks like the board's yellow caption) and ปิด. Middle: the
   photo as a print, and a taped index card — heading marked with a highlighter, a red rule, the text
   on faint ruled lines. Bottom: ก่อนหน้า · dots (no numbers) · ถัดไป. Phone/tablet: one sheet that
   scrolls, the nav pinned at the bottom. */
html.is-locked { overflow: hidden; }
.pop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--hj-chalk);
  overflow: hidden;
  container-type: size;
}
/* the board behind is blurred and darkened, so its captions and prints do not ghost through */
.pop::backdrop {
  background: rgba(15, 15, 17, .9);
  -webkit-backdrop-filter: blur(14px) saturate(.7);
  backdrop-filter: blur(14px) saturate(.7);
}
/* fill "backwards", not "both": a translate kept after the rise would make .pop-in the containing
   block of the fixed phone nav, and ก่อนหน้า / ถัดไป would scroll away with the sheet */
.pop[open] .pop-in { animation: hj-rise .28s var(--ease-out) backwards; }
.pop[open]::backdrop { animation: hj-fade .28s ease both; }
@keyframes hj-rise { from { opacity: 0; translate: 0 12px; } }
@keyframes hj-fade { from { opacity: 0; } }

/* paper pill buttons: ปิด, ก่อนหน้า, ถัดไป */
.pbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  margin: 0;
  padding: 0 20px;
  border: 1.5px solid var(--hj-paper-ink);
  border-radius: 999px;
  background: var(--hj-paper);
  color: var(--hj-paper-ink);
  font: 400 16px/1.2 var(--f-label);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s var(--ease-out);
}
.pbtn .arr {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pop-go[data-go="-1"] { padding-left: 14px; }
.pop-go[data-go="1"] { padding-right: 14px; }
.pop-x { flex: none; padding: 0 18px 0 14px; }
@media (hover: hover) {
  .pbtn:hover { background: #fff; transform: translateY(-1px); }
}
.pbtn:active { transform: translateY(1px); }
.pbtn:focus { outline: none; }
.pbtn:focus-visible { outline: var(--ring); outline-offset: 3px; box-shadow: var(--ring-out); }

/* the sheet */
.pop-in {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 0 16px calc(96px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  /* sideways swipes step through the photos (site.js); the browser must not take them as "back" */
  touch-action: pan-y pinch-zoom;
}

/* top: tabs + ปิด */
.pop-top {
  position: sticky;
  top: 0;
  z-index: 3;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -16px;
  padding: 10px 16px 18px;
  background: linear-gradient(rgba(15, 15, 17, .97) 72%, rgba(15, 15, 17, 0));
}
.pop-tabs {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 2px;
  margin: -6px 0 -6px -10px;
  padding: 6px 22px 6px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 26px), transparent);
}
.pop-tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  min-height: 44px;
  margin: 0;
  padding: 0 6px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: rgba(250, 250, 247, .62);
  font: 400 15px/1.2 var(--f-label);
  white-space: nowrap;
  cursor: pointer;
  paint-order: stroke fill;
  transition: color .2s ease;
}
/* brackets drawn like the board's captions (empty alt text); hidden until the tab is the current one */
.tab::before { content: "( "; content: "( " / ""; }
.tab::after { content: " )"; content: " )" / ""; }
.tab::before, .tab::after { opacity: 0; transition: opacity .2s ease; }
.tab[aria-current="true"] { color: var(--hj-hi); -webkit-text-stroke: .13em var(--hj-hi-line); }
.tab[aria-current="true"]::before, .tab[aria-current="true"]::after { opacity: 1; }
@media (hover: hover) {
  .tab:hover { color: var(--hj-chalk); }
  .tab[aria-current="true"]:hover { color: var(--hj-hi); }
}
.tab:focus { outline: none; }
.tab:focus-visible { outline: var(--ring); outline-offset: -3px; }

/* middle: the photo as a print */
.pop-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 640px;
}
.pop-photo { flex: none; }
.pop-photo img {
  --max-w: calc(100cqw - 42px);
  --max-h: min(380px, 50cqh); /* short phones still show the card's heading on the first screen */
  box-sizing: content-box;
  display: block;
  width: min(var(--max-w), calc(var(--w) * 2px), calc(var(--max-h) * var(--w) / var(--h)));
  height: auto;
  aspect-ratio: var(--w) / var(--h);
  border: 5px solid var(--hj-chalk);
  background: #1b1b1e;
  box-shadow: 0 18px 36px -16px rgba(0, 0, 0, .65);
  transition: opacity .15s ease;
}
.pop-photo.dark img { border-color: var(--hj-frame-dark); }
.pop-photo img.is-swapping { opacity: .35; }

/* the index card: grained paper, yellow tape, the heading under a highlighter, a red rule, then the
   Doc's text on faint ruled lines (line pitch --lh; paragraph gap = one empty line) */
.pop-card {
  --lh: 32px;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 36px 22px 26px;
  background: var(--hj-paper);
  color: var(--hj-paper-ink);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .05), 0 26px 46px -22px rgba(0, 0, 0, .78);
}
.pop-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../assets/texture/grain.png") 0 0 / 192px 192px repeat;
  opacity: .35;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.tape {
  position: absolute;
  left: 24px;
  top: -14px;
  z-index: 2;
  width: 112px;
  height: 30px;
  rotate: -4deg;
  background: var(--hj-tape);
  -webkit-clip-path: polygon(0 10%, 3% 0, 6% 12%, 9% 0, 91% 0, 94% 12%, 97% 0, 100% 10%, 100% 90%, 97% 100%, 94% 88%, 91% 100%, 9% 100%, 6% 88%, 3% 100%, 0 90%);
  clip-path: polygon(0 10%, 3% 0, 6% 12%, 9% 0, 91% 0, 94% 12%, 97% 0, 100% 10%, 100% 90%, 97% 100%, 94% 88%, 91% 100%, 9% 100%, 6% 88%, 3% 100%, 0 90%);
  pointer-events: none;
}
.pop-h {
  flex: none;
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--hj-ps-red);
  font: 800 30px/1.2 var(--f-display);
  letter-spacing: -.015em;
  color: var(--hj-paper-ink);
  overflow-wrap: break-word;
}
.pop-h > span {
  margin: 0 -.08em;
  padding: 0 .08em;
  background: linear-gradient(transparent 56%, rgba(245, 212, 71, .92) 56%, rgba(245, 212, 71, .92) 92%, transparent 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.pop-scroll { display: flex; flex-direction: column; padding-top: 22px; }
.pop-scroll:focus { outline: none; }
/* more text below the fold (desktop card): a small yellow chevron sits on the fade */
.pop-card:has(.pop-scroll.fade-b)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 30px;
  height: 30px;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--hj-hi) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M5 8l5 5 5-5%27 fill=%27none%27 stroke=%27%23231D10%27 stroke-width=%272.2%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E") center / 18px no-repeat;
  box-shadow: 0 0 0 1.5px var(--hj-hi-line);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .pop-card:has(.pop-scroll.fade-b)::after { animation: hj-nudge 1.8s ease-in-out infinite; }
}
@keyframes hj-nudge { 50% { translate: -50% 4px; } }
.pop-card:has(.pop-scroll:focus-visible) {
  outline: var(--ring);
  outline-offset: 3px;
  box-shadow: var(--ring-out), 0 26px 46px -22px rgba(0, 0, 0, .78);
}
.pop-body:not([data-sec="identity"]) {
  background: repeating-linear-gradient(transparent 0 calc(var(--lh) - 1px), var(--hj-rule) calc(var(--lh) - 1px) var(--lh));
}
/* pre-wrap keeps the Doc's own spacing (e.g. the double space after "( nol )") */
.pop-body p {
  margin: 0;
  font: 400 17px var(--f-body);
  line-height: var(--lh);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.pop-body p + p { margin-top: var(--lh); }
/* Thai compound words kept on one line (Chrome's dictionary split e.g. ขัด|เขิน at a line end) */
.nw { white-space: nowrap; }
/* identity: the Doc's name line, then its five lines on ruled rows */
.pop-body .id-name {
  margin: 0;
  font: 800 20px/1.35 "Prompt", "Noto Sans KR", "Leelawadee UI", "Thonburi", sans-serif;
  letter-spacing: -.01em;
  word-break: keep-all; /* never split 한준모 between syllables */
}
.id-lines { margin: 10px 0 0; padding: 0; list-style: none; }
.id-lines li {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hj-rule-strong);
  font: 500 17px/1.4 var(--f-body);
  overflow-wrap: anywhere;
}
.id-lines li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  rotate: 45deg;
  background: var(--hj-hi);
  box-shadow: 0 0 0 1.5px var(--hj-hi-line);
}

/* "more" has a heading and no text in the Doc: the card shrinks to a taped label */
.no-text .pop-card { width: auto; max-width: 100%; padding: 32px 30px 20px; }
.no-text .pop-h { padding-bottom: 0; border-bottom: 0; }
.no-text .pop-scroll { display: none; }
/* ENTANGLEMENTS & note from care taker’s has text and no photo */
.is-note .pop-photo { display: none; }

/* bottom: ก่อนหน้า · dots (one per item, a wider gap between categories, no numbers) · ถัดไป */
.pop-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 30px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(15, 15, 17, 0), rgba(15, 15, 17, .94) 42%);
  pointer-events: none;
}
.pop-nav .pbtn { pointer-events: auto; }
.dots { display: flex; align-items: center; gap: 6px; }
.dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(250, 250, 247, .3);
  transition: width .25s var(--ease-out), background-color .2s ease;
}
.dots i.gap { margin-left: 6px; }
.dots i.sib { background: rgba(250, 250, 247, .78); }
.dots i.on { width: 20px; background: var(--hj-hi); }
/* phones 380–429 px: the two buttons + 6 px dots measured 377 px in a 358 px row at 390, pushing ถัดไป
   3 px off the screen — smaller dots keep the row at 337 px */
@media (max-width: 429.98px) {
  .dots { gap: 4px; }
  .dots i { width: 5px; height: 5px; border-radius: 2.5px; }
  .dots i.gap { margin-left: 4px; }
  .dots i.on { width: 14px; }
}
@media (max-width: 379.98px) {
  .dots { display: none; }
}

@media (min-width: 600px) {
  .pop-in { padding-inline: 32px; }
  .pop-top { margin-inline: -32px; padding-inline: 32px; }
  .tab { font-size: 16px; }
  .pop-photo img { --max-w: min(600px, calc(100cqw - 76px)); --max-h: min(520px, calc(100cqh - 330px)); border-width: 6px; }
  .pop-card { --lh: 33px; padding: 42px 36px 30px; }
  .pop-h { font-size: 34px; }
  .pop-body p { font-size: 17.5px; }
  .pop-body .id-name { font-size: 26px; }
  .id-lines li { font-size: 18px; }
  .pop-nav { justify-content: center; gap: 24px; }
  .dots { gap: 8px; }
  .dots i { width: 7px; height: 7px; border-radius: 3.5px; }
  .dots i.gap { margin-left: 8px; }
  .dots i.on { width: 24px; }
}

/* desktop: the photo whole on the left, the card on the right; long text scrolls inside the card */
@media (min-width: 900px) and (min-height: 560px) {
  .pop-in { justify-content: center; padding: 100px 40px; overflow: hidden; }
  .pop-top { position: absolute; top: 28px; left: 40px; right: 40px; margin: 0; padding: 0; background: none; }
  .pop-stage {
    --card-w: clamp(440px, 34cqw, 560px);
    flex-direction: row;
    justify-content: center;
    gap: 52px;
    max-width: none;
  }
  .pop-photo img {
    --max-w: min(780px, calc(100cqw - 152px - var(--card-w)));
    --max-h: min(720px, calc(100cqh - 216px));
    border-width: 8px;
  }
  .pop-card {
    --lh: 34px;
    flex: none;
    width: var(--card-w);
    max-height: calc(100cqh - 216px);
    padding: 46px 42px 32px;
  }
  .tape { left: 30px; width: 124px; height: 32px; top: -15px; }
  .pop-h { font-size: 38px; padding-bottom: 16px; }
  .pop-scroll {
    flex: 1 1 auto;
    min-height: 0;
    margin-right: -16px;
    padding-right: 16px;
    overflow-y: auto;
    /* a thin ink line on the paper instead of the system's grey bar with arrows */
    scrollbar-width: thin;
    scrollbar-color: rgba(35, 33, 36, .4) transparent;
  }
  .pop-scroll.fade-b {
    -webkit-mask-image: linear-gradient(#000 calc(100% - 56px), transparent);
    mask-image: linear-gradient(#000 calc(100% - 56px), transparent);
  }
  .pop-scroll.fade-t {
    -webkit-mask-image: linear-gradient(transparent, #000 40px);
    mask-image: linear-gradient(transparent, #000 40px);
  }
  .pop-scroll.fade-t.fade-b {
    -webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 56px), transparent);
    mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 56px), transparent);
  }
  .pop-body p { font-size: 18px; }
  .pop-body .id-name { font-size: 28px; }
  .id-lines li { min-height: 52px; font-size: 19px; }
  .no-text .pop-card { width: auto; padding: 40px 40px 26px; }
  .is-note .pop-stage { --card-w: min(640px, calc(100cqw - 80px)); }
  .pop-nav { position: absolute; bottom: 28px; padding: 0; background: none; gap: 28px; pointer-events: auto; }
  .dots { gap: 9px; }
  .dots i { width: 8px; height: 8px; border-radius: 4px; }
  .dots i.gap { margin-left: 10px; }
  .dots i.on { width: 28px; }
}

/* ---------- reduced motion: nothing rises, lifts, slides or spins ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .print-it { opacity: 1; translate: none; transition: none; }
  .print, .note, .vinyl, .vtag, .pbtn, .tab, .tab::before, .tab::after, .dots i, .pop-photo img { transition: none !important; }
  .print:hover, .print:focus-visible, .note:hover, .note:focus-visible, .pbtn:hover { transform: none; }
  .spin { animation: none; }
  .pop[open] .pop-in, .pop[open]::backdrop { animation: none; }
}

@media print {
  .bg, .deck, .vtag, body::after { display: none; }
  .js .print-it { opacity: 1; translate: none; }
}
