/* Guest Book Pro - how a cover is laid out and how it moves.
   Sizes are in cqmin, so the same cover reads right as a thumbnail in a grid,
   full screen on a phone, and across a TV. Every loop and entrance is switched
   off under prefers-reduced-motion and on .cv-still (thumbnails in a list). */

.cv { position: relative; overflow: hidden; isolation: isolate; background: var(--cv-bg); color: var(--cv-ink); }
/* A small cover is drawn large and scaled down (covers.js sets --cv-k), so its
   small print stays in proportion even in a browser that enforces a minimum
   font size. At full size --cv-k is 1 and this is a plain full-size layer. */
.cv-in {
  position: absolute; left: 0; top: 0;
  width: calc(100% * var(--cv-k, 1)); height: calc(100% * var(--cv-k, 1));
  transform: scale(calc(1 / var(--cv-k, 1))); transform-origin: 0 0;
  display: grid; place-items: center;
  container-type: size;
}
.cv-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.cv-text {
  position: relative; z-index: 1; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 2.8cqmin; padding: 8cqmin 11cqmin; max-width: 100%;
}
.cv-kicker { font: 600 2.7cqmin/1 var(--cv-body); letter-spacing: .34em; text-transform: uppercase; color: var(--cv-soft); padding-left: .34em; }
.cv-welcome { font-family: var(--cv-head); font-weight: 700; font-size: 10.5cqmin; line-height: 1.04; text-wrap: balance; overflow-wrap: anywhere; }
.cv-welcome.is-long { font-size: 8cqmin; }
.cv-script .cv-welcome { font-weight: 400; font-size: 14.5cqmin; line-height: 1; padding: 0 2cqmin; }
.cv-script .cv-welcome.is-long { font-size: 10.5cqmin; }
.cv-caps .cv-welcome { text-transform: uppercase; letter-spacing: .05em; font-size: 9cqmin; }
.cv-caps .cv-welcome.is-long { font-size: 7cqmin; }
.cv-rule { width: 14cqmin; height: max(1px, .3cqmin); background: var(--cv-accent); border-radius: 2px; }
.cv-sub { font: 600 4.7cqmin/1.2 var(--cv-body); text-wrap: balance; overflow-wrap: anywhere; }
.cv-date { font: 600 2.9cqmin/1.3 var(--cv-body); letter-spacing: .18em; text-transform: uppercase; color: var(--cv-soft); }
.cv-photo { width: 30cqmin; height: 30cqmin; border-radius: 50%; overflow: hidden; border: .8cqmin solid var(--cv-accent); box-shadow: 0 2cqmin 6cqmin -2cqmin rgba(0, 0, 0, .45); flex: none; }
.cv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Covers whose art runs under the words need the words lifted off it. */
.cv[data-art="skyline"] .cv-text { padding-bottom: 30cqmin; }
.cv[data-art="blocks"] .cv-text { background: color-mix(in srgb, var(--cv-paper) 88%, transparent); padding: 7cqmin 8cqmin; margin: 0 10cqmin; border-radius: 1cqmin; }
.cv[data-art="burst"] .cv-text, .cv[data-art="neon"] .cv-text { text-shadow: 0 .4cqmin 2.4cqmin rgba(0, 0, 0, .35); }
.cv[data-art="neon"] .cv-welcome { text-shadow: 0 0 2.4cqmin var(--cv-accent), 0 0 .6cqmin #fff; }

/* ------------------------------------------------------------ entrances */

.cv-draw { stroke-dasharray: 1; animation: cv-draw 1.25s cubic-bezier(.6, .1, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 110ms + 150ms); }
@keyframes cv-draw { from { stroke-dashoffset: 1; } }

.cv-pop { animation: cv-fade .7s ease-out backwards; animation-delay: calc(var(--i, 0) * 70ms + 350ms); }
.cv-rise { animation: cv-rise 1.3s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 90ms); }
.cv-up { animation: cv-rise .9s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 60ms + 100ms); }
.cv-slide { animation: cv-slide .9s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 120ms); }
@keyframes cv-fade { from { opacity: 0; } }
@keyframes cv-rise { from { opacity: 0; translate: 0 28px; } }
@keyframes cv-slide { from { opacity: 0; translate: -40px 0; } }

.cv-text > * { animation: cv-text .8s cubic-bezier(.2, .7, .2, 1) backwards; }
.cv-text > :nth-child(1) { animation-delay: .25s; }
.cv-text > :nth-child(2) { animation-delay: .38s; }
.cv-text > :nth-child(3) { animation-delay: .52s; }
.cv-text > :nth-child(4) { animation-delay: .64s; }
.cv-text > :nth-child(5) { animation-delay: .76s; }
.cv-text > :nth-child(6) { animation-delay: .88s; }
@keyframes cv-text { from { opacity: 0; translate: 0 18px; } }

/* ---------------------------------------------------------------- loops */

.cv-twinkle { animation: cv-twinkle 3.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -410ms); transform-box: fill-box; transform-origin: center; }
@keyframes cv-twinkle { 0%, 100% { opacity: .25; scale: .8; } 50% { opacity: 1; scale: 1.08; } }

.cv-glow { animation: cv-glow 4.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -700ms); }
@keyframes cv-glow { 0%, 100% { opacity: .35; } 45%, 60% { opacity: 1; } }

.cv-ping { transform-box: fill-box; transform-origin: center; animation: cv-ping 2.6s ease-out infinite; animation-delay: calc(var(--i, 0) * -520ms); }
@keyframes cv-ping { 0% { scale: .6; opacity: 1; } 70%, 100% { scale: 2.6; opacity: 0; } }

.cv-sway { animation: cv-sway 7s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -1.3s); }
@keyframes cv-sway { from { translate: -18px 0; } to { translate: 18px 0; } }

.cv-flicker { transform-box: fill-box; transform-origin: center; animation: cv-flicker 3.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -900ms); }
@keyframes cv-flicker { 0%, 100% { scale: 1; opacity: .16; } 40% { scale: 1.08; opacity: .26; } 70% { scale: .96; opacity: .14; } }
.cv-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: cv-flame 1.7s ease-in-out infinite; }
@keyframes cv-flame { 0%, 100% { scale: 1 1; rotate: -2deg; } 50% { scale: .92 1.08; rotate: 3deg; } }

.cv-ripple { transform-box: fill-box; transform-origin: center; animation: cv-ripple 5s ease-out infinite; animation-delay: calc(var(--i, 0) * -1s); }
@keyframes cv-ripple { 0% { scale: .5; opacity: .8; } 100% { scale: 1.25; opacity: 0; } }

.cv-fall { animation: cv-fall 6s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -500ms); }
@keyframes cv-fall { from { translate: 0 -7px; } to { translate: 0 9px; } }

.cv-bob { animation: cv-bob 5s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -800ms); }
@keyframes cv-bob { from { translate: 0 -8px; } to { translate: 0 8px; } }

.cv-swing { animation: cv-swing 3.4s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -300ms); }
@keyframes cv-swing { from { rotate: -5deg; } to { rotate: 5deg; } }

.cv-spin { animation: cv-spin 80s linear infinite; }
@keyframes cv-spin { to { rotate: 360deg; } }

.cv-drift { animation: cv-drift 12s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -2.6s); }
@keyframes cv-drift { from { translate: -10px 0; } to { translate: 14px 0; } }

/* Thumbnails in a grid, and anyone who asked for less motion, get the finished picture. */
.cv-still *, .cv-still .cv-text > * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .cv *, .cv .cv-text > * { animation: none !important; }
}

/* The genre buttons above a cover grid. */
.cv-genres { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.cv-genre { font: 600 13px/1 Inter, system-ui, sans-serif; padding: 8px 11px; border-radius: 5px; border: 1px solid rgba(124, 58, 237, .3); background: transparent; color: inherit; cursor: pointer; transition: background .15s, color .15s; }
.cv-genre:hover { border-color: #7C3AED; }
.cv-genre.on { background: #7C3AED; border-color: #7C3AED; color: #fff; }
.cv-genre:focus-visible { outline: 2px solid #7C3AED; outline-offset: 2px; }
