/* bojerry.art — the site is one of Bojerry's character sheets: cream paper, ink-outlined UI,
   die-cut sticker art and handwritten margin notes. */
:root {
  --paper: #f5ecd9; --ink: #2b1a2c; --plum: #9a4a89; --teal: #3db3a3; --coral: #ef7d68; --lilac: #cbb7ea; --white: #fffaf2;
  --night: #17121a; --night-2: #241c27;
  --f-display: "Dela Gothic One", "Arial Black", sans-serif;
  --f-hand: "Gochi Hand", "Comic Sans MS", cursive;
  --f-body: "Figtree", system-ui, sans-serif;
  --line: 3px; --shadow: 6px 6px 0 var(--ink);
  color-scheme: light;
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth } }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 400 1.05rem/1.55 var(--f-body);
  background-image: radial-gradient(rgba(43,26,44,.06) 1px, transparent 1.2px); background-size: 5px 5px;
}
a { color: inherit }
img, video { max-width: 100% }
::selection { background: var(--lilac); color: var(--ink) }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px }
[hidden] { display: none !important }

.sheet { max-width: 1180px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); padding-block: 28px 60px }
.frame { position: relative; border: var(--line) solid var(--ink); border-radius: 4px; padding: clamp(18px, 4vw, 48px); background: var(--paper) }
.frame::before { content: ""; position: absolute; inset: 8px; border: 1.5px solid var(--ink); border-radius: 2px; pointer-events: none; opacity: .5 }
.corner { position: absolute; width: 44px; height: 44px; color: var(--ink) }
.corner.tl { top: -6px; left: -6px } .corner.tr { top: -6px; right: -6px; transform: scaleX(-1) }
.corner.bl { bottom: -6px; left: -6px; transform: scaleY(-1) } .corner.br { bottom: -6px; right: -6px; transform: scale(-1) }

/* ---------- logo + header ---------- */
.logo { display: inline-flex; gap: 8px; align-items: stretch; transform: rotate(-2deg); margin: 0 0 10px; text-decoration: none }
.logo b, .logo i { background: var(--plum); color: var(--white); padding: 4px 14px 2px; border: var(--line) solid var(--ink); box-shadow: 4px 4px 0 var(--ink) }
.logo b { font: italic 400 clamp(1.9rem, 4.2vw, 4rem)/1 var(--f-display); letter-spacing: .01em }
.logo i { font: italic 300 clamp(1.2rem, 2.6vw, 2.4rem)/1.45 var(--f-body); align-self: end }
.logo.small b { font-size: 1.5rem } .logo.small i { font-size: 1rem }
.tag { font: 400 1.6rem/1.2 var(--f-hand); margin: 14px 0 6px; max-width: 30ch }
.tag em { background: linear-gradient(transparent 55%, var(--lilac) 55%); font-style: normal }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 26px; padding: 0; list-style: none }
.meta li { font: 600 .78rem/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; border: 2px solid var(--ink); border-radius: 99px; padding: 7px 12px; background: var(--white) }

.head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(20px, 4vw, 56px); align-items: start }

/* ---------- link buttons ---------- */
.links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px }
.link { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; text-decoration: none; background: var(--white); border: var(--line) solid var(--ink); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; color: var(--ink); font: inherit; text-align: left; cursor: pointer }
.link.half { grid-column: auto }
.link:hover, .link:focus-visible { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); outline: none }
.link:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink) }
.link .dot { width: 38px; height: 38px; border-radius: 50%; border: var(--line) solid var(--ink); display: grid; place-items: center; font: 400 1rem var(--f-display) }
.link strong { font: 400 1.35rem/1.1 var(--f-display); display: block }
.link small { display: block; font: 400 1.12rem/1.2 var(--f-hand); opacity: .8 }
.link .go { font: 400 1.4rem var(--f-display) }
.link.half strong { font-size: 1.05rem }
.link.big { padding: 16px 18px }
.c-coral .dot, button.link.c-coral { background: var(--coral) }
.c-teal .dot { background: var(--teal) }
.c-plum .dot { background: var(--plum); color: var(--white) }

/* ---------- hero sticker ---------- */
.hero { position: relative; padding-top: 10px }
.sticker { display: block; background: var(--white); padding: 10px; border-radius: 18px; filter: drop-shadow(8px 8px 0 rgba(43,26,44,.22)); transform: rotate(2.5deg) }
.sticker img { display: block; width: 100%; height: auto; border-radius: 10px }
.tape { position: absolute; top: -6px; left: 50%; width: 120px; height: 30px; background: rgba(203,183,234,.75); transform: translateX(-50%) rotate(-4deg); border-inline: 2px dashed rgba(255,255,255,.6) }

/* ---------- sections ---------- */
.sec { margin-top: clamp(48px, 7vw, 84px) }
.sec-h { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 22px }
.sec-h h2 { font: 400 clamp(1.8rem, 4vw, 2.6rem)/1 var(--f-display); margin: 0 }
.sec-h p { font: 400 1.25rem var(--f-hand); margin: 0; opacity: .8 }

/* ---------- favourites viewer ----------
   Fixed-height stage, then the strip, so the strip never moves when a caption changes.
   Desktop: stage | info, strip under both. Phone: stage, strip, info. */
.gallery { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); grid-template-areas: "stage info" "strip strip"; column-gap: clamp(20px, 4vw, 48px); align-items: center }
.stage { grid-area: stage; height: min(70vh, 660px); height: min(70svh, 660px); display: grid; place-items: center; touch-action: pan-y; user-select: none }
.piece { background: var(--white); padding: 10px; border-radius: 16px; filter: drop-shadow(8px 8px 0 rgba(43,26,44,.22)); transform: rotate(1deg); transition: opacity .22s, transform .3s cubic-bezier(.2,.9,.25,1.2); max-width: 100% }
.piece.out { opacity: 0; transform: rotate(-3deg) scale(.96) }
.piece img, .piece video { display: block; max-width: 100%; max-height: calc(min(70vh, 660px) - 20px); max-height: calc(min(70svh, 660px) - 20px); border-radius: 8px; -webkit-user-drag: none }
.info { grid-area: info; min-width: 0 }
.count { font: 600 .78rem var(--f-body); letter-spacing: .12em; font-variant-numeric: tabular-nums; opacity: .6; margin: 0 0 10px }
.info h3 { font: 400 clamp(1.6rem, 3vw, 2.3rem)/1.05 var(--f-display); margin: 0 0 6px; text-wrap: balance }
.info .src { font: 600 .8rem var(--f-body); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 16px; opacity: .7; min-height: 1em }
.info .memo { font: 400 1.3rem/1.25 var(--f-hand); margin: 0; padding: 12px 14px; background: var(--white); border: 2px dashed var(--ink); border-radius: 10px; transform: rotate(-1deg) }
.rail { grid-area: strip; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "prev strip next"; align-items: center; gap: 6px 12px; margin-top: 22px }
#prev { grid-area: prev } #next { grid-area: next } .strip { grid-area: strip }
.nav { width: 48px; height: 48px; border-radius: 50%; border: var(--line) solid var(--ink); background: var(--white); box-shadow: 3px 3px 0 var(--ink); font: 400 1.5rem/1 var(--f-display); color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 0 0 3px; transition: transform .12s, box-shadow .12s }
.nav:hover, .nav:focus-visible { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); outline: none; background: var(--lilac) }
.nav:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink) }
.strip { position: relative; overflow: hidden; padding-block: 40px 14px; padding-inline: 4px; touch-action: pan-y; cursor: grab }
.strip.dragging, .strip.dragging .thumb { cursor: grabbing }
.track { display: flex; gap: 14px; will-change: transform }
.thumb { position: relative; flex: 0 0 84px; height: 84px; padding: 4px; background: var(--white); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; display: block; pointer-events: none; -webkit-user-drag: none }
.thumb.is-video::before { content: "▶"; position: absolute; right: 6px; bottom: 6px; z-index: 1; font-size: .6rem; line-height: 1; padding: 3px 4px 3px 5px; border-radius: 4px; background: var(--ink); color: var(--paper) }
.thumb:hover, .thumb:focus-visible { transform: translateY(-3px); outline: none }
.thumb:focus-visible { border-color: var(--teal) }
.thumb.on { border-color: var(--plum); box-shadow: 4px 4px 0 var(--plum); transform: translateY(-8px) }
.thumb::after { content: attr(data-t); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap; font: 400 1rem var(--f-hand); background: var(--ink); color: var(--paper); padding: 2px 9px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .12s }
@media (hover: hover) { .thumb:hover::after { opacity: 1 } }
.strip.dragging .thumb::after { opacity: 0 }

/* ---------- comic showcases ---------- */
.showcases { display: grid; gap: 28px }
.showcase { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: clamp(18px, 3vw, 34px); align-items: start;
  background: var(--white); border: var(--line) solid var(--ink); border-radius: 14px; padding: clamp(16px, 3vw, 26px); box-shadow: var(--shadow) }
.sc-cover { display: block; background: var(--white); padding: 8px; border-radius: 12px; border: 2px solid var(--ink); transform: rotate(-2deg); transition: transform .15s }
.sc-cover:hover { transform: rotate(0) scale(1.02) }
.sc-cover img { display: block; width: 100%; height: auto; border-radius: 6px }
.sc-body h3 { font: 400 clamp(1.6rem, 3.4vw, 2.2rem)/1.05 var(--f-display); margin: 0 0 6px }
.sc-meta { font: 600 .8rem var(--f-body); letter-spacing: .06em; text-transform: uppercase; opacity: .7; margin: 0 0 12px }
.sc-about { font-size: 1.1rem; max-width: 52ch; margin: 0 0 16px }
.sc-samples { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 18px }
.sc-samples a { display: block; transition: transform .15s }
.sc-samples img { display: block; height: 200px; width: auto; max-width: 100%; border: 2px solid var(--ink); border-radius: 6px; background: var(--white) }
.sc-samples a:nth-child(odd) { transform: rotate(-1.5deg) } .sc-samples a:nth-child(even) { transform: rotate(1.5deg) }
.sc-samples a:hover, .sc-samples a:focus-visible { transform: rotate(0) scale(1.04); outline: none }
.sc-read { display: grid; gap: 12px; max-width: 420px }
.badge { display: inline-block; font: 800 .72rem/1 var(--f-body); letter-spacing: .08em; background: var(--ink); color: var(--paper); padding: 5px 8px; border-radius: 4px }

/* sample page viewer */
.peek { padding: 0; border: 0; margin: 0; inset: 0; background: none; max-width: none; max-height: none; width: 100%; height: 100%; color: var(--paper); overflow: hidden }
.peek::backdrop { background: rgba(23,18,26,.88) }
.peek[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) }
.peek-bar { display: flex; align-items: center; gap: 14px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px }
.peek-count { font: 600 .85rem var(--f-body); letter-spacing: .08em; opacity: .75; font-variant-numeric: tabular-nums }
.peek-read { margin-left: auto; font: 400 1.25rem var(--f-hand); color: var(--paper) }
.peek-x, .peek-nav { width: 46px; height: 46px; border-radius: 50%; border: var(--line) solid var(--paper); background: var(--night-2); color: var(--paper); font: 400 1.3rem/1 var(--f-display); cursor: pointer; display: grid; place-items: center; padding: 0 }
.peek-x:hover, .peek-nav:hover { background: var(--plum) }
.peek-stage { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 12px 16px; min-height: 0 }
.peek-stage img { max-width: min(100%, 900px); max-height: 100%; min-width: 0; object-fit: contain; border-radius: 8px; background: var(--white); user-select: none; -webkit-user-drag: none }
@media (max-width: 600px) { .peek-nav { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom, 0px)) } #peekPrev { left: 16px } #peekNext { right: 16px } .peek-stage { padding-bottom: 80px } }

/* ---------- inner pages ---------- */
.page-head { margin-bottom: 34px }
.page-head h1 { font: 400 clamp(2rem, 5vw, 3rem)/1 var(--f-display); margin: 18px 0 4px }
.page-head .tag { font-size: 1.3rem; max-width: 46ch }
.list { display: grid; gap: 16px; padding: 0; margin: 0; list-style: none; max-width: 760px }
.list a { display: block; text-decoration: none; background: var(--white); border: var(--line) solid var(--ink); border-radius: 10px; padding: 16px 18px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s }
.list a:hover, .list a:focus-visible { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); outline: none }
.list strong { font: 400 1.3rem/1.15 var(--f-display); display: block; margin-bottom: 4px }
.list span { display: block }
.list .llm { font: 400 1.05rem var(--f-hand); opacity: .7; margin-top: 6px }
.empty { font: 400 1.4rem var(--f-hand) }
.legal { max-width: 760px; overflow-wrap: anywhere }
.page-title-plain { font: 400 clamp(1.8rem, 4vw, 2.4rem)/1.1 var(--f-display); margin: 0 0 14px }
.lost { text-align: center; padding-block: 40px }
.lost h1 { font: 400 clamp(3rem, 12vw, 7rem)/1 var(--f-display); margin: 0; color: var(--plum); -webkit-text-stroke: 3px var(--ink) }
.lost p { font: 400 1.6rem var(--f-hand) }
.lost .link { display: inline-grid; max-width: 320px; margin-top: 10px }

/* ---------- stats page ---------- */
.stats-pick { display: flex; align-items: center; gap: 10px; font: 400 1.2rem var(--f-hand) }
.stats-pick select { font: 600 .95rem var(--f-body); padding: 6px 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--white); color: var(--ink) }
.stats-total { font: 400 1.6rem var(--f-display); margin: 14px 0 24px }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 22px }
.stats-grid section { background: var(--white); border: var(--line) solid var(--ink); border-radius: 12px; padding: 16px 18px; min-width: 0 }
.stats-grid section.wide { grid-column: 1 / -1 }
.stats-grid h2 { font: 400 1.25rem var(--f-display); margin: 0 0 10px }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px }
.bars li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 4px 8px; font-size: .92rem; z-index: 0 }
.bars .k { overflow-wrap: anywhere } .bars .v { font-weight: 800; font-variant-numeric: tabular-nums }
.bars .bar { position: absolute; inset: 0 auto 0 0; background: var(--lilac); border-radius: 4px; z-index: -1 }
.none { opacity: .6; font: 400 1.1rem var(--f-hand) }
.days { display: flex; align-items: flex-end; gap: 2px; height: 120px }
.days span { flex: 1 1 0; min-width: 2px; background: var(--plum); border-radius: 2px 2px 0 0 }

/* ---------- footer ---------- */
.foot { margin-top: 60px; display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; font-size: .9rem; border-top: 2px dashed var(--ink); padding-top: 18px }
.quiet { display: flex; flex-wrap: wrap; gap: 6px 18px }
.quiet a { text-decoration: none; opacity: .65 } .quiet a:hover, .quiet a:focus-visible { opacity: 1; text-decoration: underline }
.quiet span { opacity: .5 }
.mail { font: 400 1.1rem var(--f-hand); background: none; border: 2px solid var(--ink); border-radius: 99px; padding: 6px 14px; cursor: pointer; color: var(--ink); text-decoration: none; user-select: all }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .head { grid-template-columns: minmax(0, 1fr) }
  .hero { max-width: 340px; margin-inline: auto; margin-top: 10px }
  .gallery { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "strip" "info" }
  .stage { height: min(58vh, 540px); height: min(58svh, 540px) }
  .piece img, .piece video { max-height: calc(min(58vh, 540px) - 20px); max-height: calc(min(58svh, 540px) - 20px) }
  .info { margin-top: 22px }
  .showcase { grid-template-columns: minmax(0, 1fr) } .sc-cover { max-width: 240px }
}
@media (max-width: 600px) {
  .rail { grid-template-areas: "strip strip strip" "prev . next"; gap: 4px 10px }
  .thumb { flex-basis: 64px; height: 64px } .track { gap: 11px }
  .nav { width: 42px; height: 42px; font-size: 1.3rem }
  .frame { padding-inline: 14px }
}
@media (max-width: 420px) {
  .link.half { grid-column: 1 / -1 }
  .sc-samples img { height: 120px }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important } }
