/* ============ Animoir — "Test your own photo" (landing page, #styles) ============
 *
 * Everything this feature adds to the before/after slider, kept in its own file so
 * it never collides with site.css. Loaded by index.html after nav.css; behaviour in
 * try-photo.js. Uses the site's tokens (--berry, --ink, --vanilla, --r-pill ...).
 */

/* ---- the button in the slider (bottom-left, as in the design) ---- */
.tp__cta{position:absolute;z-index:2;left:1.25rem;bottom:1.25rem;display:grid;gap:.5rem;justify-items:start;cursor:default}
.tp__cta[hidden],.tp__stage[hidden],.tp__panel[hidden]{display:none}
.tp__btn{display:inline-flex;align-items:center;gap:.75rem;min-height:3.25rem;padding:0 1.5rem 0 .5rem;border-radius:var(--r-pill);
  border:2px solid var(--ink);background:var(--berry);color:#fff;font:inherit;font-weight:600;font-size:1rem;line-height:1.2;cursor:pointer;
  box-shadow:0 .25rem 0 var(--ink);transition:transform .15s ease,box-shadow .15s ease}
.tp__btn:hover{transform:translateY(-.0625rem);box-shadow:0 .3125rem 0 var(--ink)}
.tp__btn:active{transform:translateY(.1875rem);box-shadow:0 .0625rem 0 var(--ink)}
.tp__btn:focus-visible{outline:3px solid var(--sun);outline-offset:3px}
.tp__btnico{width:2.25rem;height:2.25rem;border-radius:50%;background:rgba(255,255,255,.24);display:grid;place-items:center;flex:none}
.tp__btnico .ico{width:1.125rem;height:1.125rem}
.tp__note{padding:.3125rem .75rem;border-radius:var(--r-pill);background:rgba(43,35,80,.86);color:#fff;font-size:.75rem;font-weight:500;line-height:1.3;white-space:nowrap}
/* the visitor's own photo is in the slider: the next step lives in the panel below it */
.ba.is-own .tp__cta{display:none}

/* ---- the visitor's own photo and character: a taller frame, faces kept in view ---- */
.likeness__main.is-own img{aspect-ratio:4/3;object-position:50% 25%}
.likeness__main.is-own .ba__after img{object-position:50% 0}   /* a character sheet is full body: show the head */
/* while it is being drawn (or could not be): nothing to compare yet, so the slider rests */
.ba.is-locked{cursor:default}
.ba.is-locked .ba__knob,.ba.is-locked .ba__tag--art{display:none}
.ba.is-locked .ba__after img{visibility:hidden}
/* ...and their photo is shown whole in the left half (not cut in two by the middle line) */
.likeness__main.is-own.is-locked > .ba__img{width:50%;aspect-ratio:2/3}

/* ---- the character side while we work: calm, no percentage ---- */
.tp__stage{position:absolute;z-index:1;inset:0 0 0 50%;display:grid;align-content:center;justify-items:center;gap:.5rem;padding:1rem;
  text-align:center;background:var(--vanilla);color:var(--ink);cursor:default}
.tp__stage strong{font-size:clamp(.9375rem,2vw,1.25rem);font-weight:600;line-height:1.25;max-width:16ch}
.tp__time{font-size:.8125rem;color:var(--muted);font-variant-numeric:tabular-nums;min-height:1.2em}
.tp__stars{display:flex;gap:.375rem;color:var(--berry)}
.tp__stars .ico{width:1.5rem;height:1.5rem;fill:currentColor;stroke:none}
.tp__stars .ico-wrap{animation:tp-twinkle 1.8s ease-in-out infinite}
.tp__stars .ico-wrap:nth-child(2){animation-delay:.3s;color:var(--sun)}
.tp__stars .ico-wrap:nth-child(3){animation-delay:.6s;color:var(--grape)}
@keyframes tp-twinkle{0%,100%{opacity:.35;transform:scale(.85)}50%{opacity:1;transform:scale(1.1)}}
.tp__stage.is-error .tp__stars{display:none}
.tp__stage.is-error{background:var(--berry-tint)}
@media (prefers-reduced-motion:reduce){.tp__stars .ico-wrap{animation:none;opacity:1}}

/* ---- the panel under the slider: status, errors, what to do next ---- */
.tp__panel{grid-column:1/-1;display:grid;gap:.875rem;padding:1.25rem 1.5rem;border:2px solid var(--ink);border-radius:var(--r-card);background:#fff;
  box-shadow:0 .3125rem 0 var(--ink)}
.tp__panel.is-error{border-color:var(--berry);box-shadow:0 .3125rem 0 #d4502f;background:var(--berry-tint)}
.tp__msg strong{display:block;font-size:1.125rem;font-weight:600;line-height:1.3}
.tp__msg p{margin:.25rem 0 0;color:var(--muted);font-size:.9375rem;line-height:1.5}
.tp__msg p:empty{display:none}
.tp__actions{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}
.tp__actions [hidden]{display:none}
.tp__actions .btn{background:#fff}
.tp__actions .btn--primary{background:var(--berry)}
.tp__actions .btn[disabled]{opacity:.55;cursor:default;transform:none}
.tp__delete{font-size:.875rem;margin-left:auto;text-decoration:underline;min-height:2.5rem}
.tp__delete:focus-visible{outline:3px solid var(--sun);outline-offset:3px;border-radius:.25rem}
.tp__hint{margin:0;font-size:.8125rem;color:var(--muted)}
.tp__hint[hidden]{display:none}

/* ---- share the finished character ---- */
.tp__share{display:flex;flex-direction:column;gap:.5rem;margin-top:.25rem;padding-top:.75rem;border-top:2px dashed rgba(43,35,80,.18)}
.tp__share[hidden]{display:none}
.tp__sharetitle{font-weight:700;font-size:.9375rem}
.tp__sharerow{display:flex;flex-wrap:wrap;gap:.5rem}
.tp__sharebtn{display:inline-flex;align-items:center;gap:.4375rem;min-height:2.5rem;padding:.4375rem .75rem;
  border:2px solid var(--ink);border-radius:.625rem;background:#fff;color:var(--ink);font:inherit;font-size:.875rem;
  font-weight:600;text-decoration:none;cursor:pointer;box-shadow:0 .1875rem 0 var(--ink);transition:transform .12s,box-shadow .12s}
.tp__sharebtn:hover{transform:translateY(-.0625rem);box-shadow:0 .25rem 0 var(--ink)}
.tp__sharebtn:active{transform:translateY(.1875rem);box-shadow:none}
.tp__sharebtn:focus-visible{outline:3px solid var(--sun);outline-offset:3px}
.tp__sharebtn[hidden]{display:none}
.tp__sharebtn.is-done{background:var(--mint)}
.tp__shareico{display:inline-flex;align-items:center;justify-content:center;width:1.125rem;height:1.125rem}
.tp__shareico .ico{width:1.125rem;height:1.125rem}
.tp__shareico--fb{color:#1877F2}
.tp__shareico--x{color:#000}
.tp__shareico--wa{color:#25D366}
.tp__sharenote{margin:0;font-size:.8125rem;color:var(--muted)}
.tp__sharenote[hidden]{display:none}
@media (prefers-reduced-motion:reduce){
  .tp__sharebtn{transition:none}
  .tp__sharebtn:hover,.tp__sharebtn:active{transform:none}
}

/* ---- the consent step ---- */
.tp__dialog{width:min(32rem,calc(100% - 2rem));max-height:calc(100% - 2rem);padding:1.5rem;border:2px solid var(--ink);border-radius:var(--r-panel);
  background:var(--vanilla);color:var(--ink);box-shadow:0 .375rem 0 var(--ink);overflow:auto}
.tp__dialog::backdrop{background:rgba(43,35,80,.55)}
.tp__dialog:not([open]){display:none}
/* browsers without <dialog>.showModal(): the same box, centred over the page */
.tp__dialog.is-fallback[open]{display:block;position:fixed;z-index:1000;left:50%;top:50%;transform:translate(-50%,-50%);margin:0}
.tp__dialoghead{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:.5rem}
.tp__dialoghead h3{font-size:1.5rem;line-height:1.2;margin:0}
.tp__close{flex:none;width:2.75rem;height:2.75rem;border-radius:50%;border:1.5px solid var(--ink);background:#fff;color:var(--ink);display:grid;place-items:center;padding:0;cursor:pointer}
.tp__close .ico{width:1.125rem;height:1.125rem}
.tp__close:focus-visible{outline:3px solid var(--sun);outline-offset:3px}
.tp__dialog p{margin:0 0 .75rem;line-height:1.5}
.tp__tips{margin:0 0 1rem;padding-left:1.25rem;color:var(--muted);font-size:.9375rem;line-height:1.6}
.tp__dialog .check{background:#fff}
.tp__dialog .check a{color:var(--berry);font-weight:600;white-space:nowrap}
.tp__err{color:var(--berry);font-weight:500;font-size:.9375rem;margin:.5rem 0 0}
.tp__err[hidden]{display:none}
.tp__dialogbtns{display:flex;justify-content:flex-end;gap:.75rem;margin-top:1.25rem;flex-wrap:wrap}
.tp__dialogbtns .ico{width:1rem;height:1rem}

@media (max-width:639px){
  .tp__cta{left:.625rem;bottom:.625rem;gap:.375rem}
  .tp__btn{min-height:2.5rem;padding:0 1rem 0 .375rem;font-size:.875rem;gap:.5rem;box-shadow:0 .1875rem 0 var(--ink)}
  .tp__btnico{width:1.75rem;height:1.75rem}
  .tp__btnico .ico{width:.9375rem;height:.9375rem}
  .tp__note{font-size:.6875rem;padding:.25rem .625rem}
  .likeness__main.is-own img{aspect-ratio:1/1}
  .likeness__main.is-own.is-locked > .ba__img{aspect-ratio:1/2}
  .tp__stage{padding:.5rem}
  .tp__stars .ico{width:1.125rem;height:1.125rem}
  .tp__panel{padding:1rem}
  .tp__actions .btn{flex:1 1 auto}
  .tp__delete{margin-left:0;width:100%;text-align:left}
  .tp__sharebtn{flex:1 1 auto;justify-content:center}
  .tp__dialog{padding:1.125rem}
  .tp__dialogbtns .btn{flex:1 1 auto}
}
/* one column (below the site's 960px breakpoint): the panel follows the slider directly */
@media (max-width:959px){
  .likeness .tp__panel{order:1}
  .likeness .likeness__side{order:2}
  .likeness .stylecar{order:3}
}
