/*
 * Corner-vector buttons. public/js/corner-buttons.mjs adds a .cb-frame (eight corner vectors: closed and
 * open for each corner) to every matching button. The frame replaces the old rectangular border and
 * background; --cb-color is the old border color and --cb-hover-color the old hover border color.
 */
:where(.cb) { position: relative; }
.cb {
  --cb-u: calc(var(--cb-size, 22px) / 100);
  --cb-color: rgba(235, 232, 224, .22);
  --cb-hover-color: var(--accent, #c83b46);
}
.cb:not(.social-link) {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
/* Social links keep their rectangular box at rest; it gives way to the corner vectors on hover. */
.social-link.cb > .cb-frame > .cb-closed { opacity: 0; }
/* On hover the closed vectors show for a beat before the open ones take over. */
.social-link.cb[data-cb-active] > .cb-frame > .cb-closed { animation: cb-closed-beat .1s linear forwards; }
.social-link.cb[data-cb-active] > .cb-frame > .cb-open { transition: opacity .08s linear .1s; }
@keyframes cb-closed-beat { from, 90% { opacity: .5; } to { opacity: 0; } }
.social-link.cb[data-cb-active] {
  border-color: transparent !important;
  background: transparent !important;
}
/* The panel scrolls, so its padding must hold the scaled-out vectors (about 35px past the button edge). */
.world-panel.social-links-panel { width: min(464px, calc(100% - 8px)); padding: 42px; }
@media (max-width: 540px) {
  .world-panel.social-links-panel { width: min(368px, calc(100% - 8px)); padding: 40px; }
}
.cb-frame {
  position: absolute;
  inset: calc(-1 * var(--cb-bw, 1px));
  pointer-events: none;
  transform-origin: 50% 50%;
  transition: transform .16s cubic-bezier(.2, .75, .25, 1);
}
.cb[data-cb-active] > .cb-frame { transform: scale(1.1); }
.cb-g {
  position: absolute;
  display: block;
  width: calc(var(--gw) * var(--cb-u));
  height: calc(var(--gh) * var(--cb-u));
  -webkit-mask: var(--cb-mask) no-repeat center / 100% 100%;
  mask: var(--cb-mask) no-repeat center / 100% 100%;
  transition: opacity .1s linear;
}
.cb-closed { --cb-u: calc(var(--cb-size, 22px) * .75 / 100); --gw: 99.9968; --gh: 99.9999; --cx: 37.525; --cy: 38.125; background-color: var(--cb-color); opacity: .5; }
.cb-open { --gw: 139.3786; --gh: 139.3817; --cx: 76.905; --cy: 77.515; background-color: var(--cb-hover-color); opacity: 0; }
.cb[data-cb-active] > .cb-frame > .cb-closed { opacity: 0; }
.cb[data-cb-active] > .cb-frame > .cb-open { opacity: 1; }
.cb-tl { left: calc(-1 * var(--cx) * var(--cb-u)); top: calc(-1 * var(--cy) * var(--cb-u)); }
.cb-tr { right: calc(-1 * var(--cx) * var(--cb-u)); top: calc(-1 * var(--cy) * var(--cb-u)); }
.cb-bl { left: calc(-1 * var(--cx) * var(--cb-u)); bottom: calc(-1 * var(--cy) * var(--cb-u)); }
.cb-br { right: calc(-1 * var(--cx) * var(--cb-u)); bottom: calc(-1 * var(--cy) * var(--cb-u)); }
.cb-tl.cb-closed { --cb-mask: url("data:image/svg+xml,%3C%21-- Created with Inkscape %28http://www.inkscape.org/%29 --%3E %3Csvg width=%2299.996811mm%22 height=%2299.999916mm%22 viewBox=%220 0 99.996811 99.999916%22 version=%221.1%22 id=%22svg1%22 xmlns=%22http://www.w3.org/2000/svg%22 xmlns:svg=%22http://www.w3.org/2000/svg%22%3E %3Cdefs id=%22defs1%22 /%3E %3Cg id=%22layer1%22 transform=%22translate%28244.5489,331.40467%29%22%3E %3Cpath id=%22rect8-7%22 style=%22fill:%23000000;fill-opacity:1;stroke-width:0.319677;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill%22 d=%22m -213.26924,-331.40467 v 24.99862 h 12.49105 v -24.99862 z m -31.27966,31.88372 v 12.49104 h 24.99836 v -12.49104 z m 49.99982,0 v 12.49104 h 24.99863 24.99836 v -12.49104 h -24.99836 z m -18.72016,18.11637 v 24.99836 h 12.49105 v -24.99836 z m 0,25.0012 v 24.99862 h 12.49105 v -24.99862 z%22 /%3E %3C/g%3E %3C/svg%3E"); }
.cb-tr.cb-closed { --cb-mask: url("data:image/svg+xml,%3C%21-- Created with Inkscape %28http://www.inkscape.org/%29 --%3E %3Csvg width=%2299.996811mm%22 height=%2299.999916mm%22 viewBox=%220 0 99.996811 99.999916%22 version=%221.1%22 id=%22svg1%22 xmlns=%22http://www.w3.org/2000/svg%22 xmlns:svg=%22http://www.w3.org/2000/svg%22%3E %3Cdefs id=%22defs1%22 /%3E %3Cg id=%22layer1%22 transform=%22translate%2899.99681,333.03544%29%22%3E %3Cpath id=%22rect8-7-1-3%22 style=%22display:inline;fill:%23000000;fill-opacity:1;stroke-width:0.319677;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill%22 d=%22m -31.27967,-333.03544 v 24.99862 h -12.49105 v -24.99862 z M 0,-301.15172 v 12.49104 h -24.99837 v -12.49104 z m -49.99983,0 v 12.49104 h -24.99862 -24.99836 v -12.49104 h 24.99836 z m 18.72016,18.11637 v 24.99836 h -12.49105 v -24.99836 z m 0,25.0012 v 24.99862 h -12.49105 v -24.99862 z%22 /%3E %3C/g%3E %3C/svg%3E"); }
.cb-bl.cb-closed { --cb-mask: url("data:image/svg+xml,%3C%21-- Created with Inkscape %28http://www.inkscape.org/%29 --%3E %3Csvg width=%2299.996811mm%22 height=%2299.999916mm%22 viewBox=%220 0 99.996811 99.999916%22 version=%221.1%22 id=%22svg1%22 xmlns=%22http://www.w3.org/2000/svg%22 xmlns:svg=%22http://www.w3.org/2000/svg%22%3E %3Cdefs id=%22defs1%22 /%3E %3Cg id=%22layer1%22 transform=%22translate%28-205.06441,336.06262%29%22%3E %3Cpath id=%22rect8-7-1-4%22 style=%22display:inline;fill:%23000000;fill-opacity:1;stroke-width:0.319677;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill%22 d=%22m 236.34408,-236.06271 v -24.99862 h 12.49105 v 24.99862 z m -31.27967,-31.88372 v -12.49104 h 24.99837 v 12.49104 z m 49.99983,0 v -12.49104 h 24.99862 24.99836 v 12.49104 h -24.99836 z m -18.72016,-18.11637 v -24.99836 h 12.49105 v 24.99836 z m 0,-25.0012 v -24.99862 h 12.49105 v 24.99862 z%22 /%3E %3C/g%3E %3C/svg%3E"); }
.cb-br.cb-closed { --cb-mask: url("data:image/svg+xml,%3C%21-- Created with Inkscape %28http://www.inkscape.org/%29 --%3E %3Csvg width=%2299.996811mm%22 height=%2299.999924mm%22 viewBox=%220 0 99.996811 99.999923%22 version=%221.1%22 id=%22svg1%22 xmlns=%22http://www.w3.org/2000/svg%22 xmlns:svg=%22http://www.w3.org/2000/svg%22%3E %3Cdefs id=%22defs1%22 /%3E %3Cg id=%22layer1%22 transform=%22translate%28-49.99691,336.25714%29%22%3E %3Cpath id=%22rect8-7-1%22 style=%22display:inline;fill:%23000000;fill-opacity:1;stroke-width:0.319677;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill%22 d=%22m 118.71405,-236.25722 v -24.99862 H 106.223 v 24.99862 z m 31.27967,-31.88372 v -12.49104 h -24.99837 v 12.49104 z m -49.99983,0 v -12.49104 H 74.99527 49.99691 v 12.49104 h 24.99836 z m 18.72016,-18.11637 v -24.99837 H 106.223 v 24.99837 z m 0,-25.00121 v -24.99862 H 106.223 v 24.99862 z%22 /%3E %3C/g%3E %3C/svg%3E"); }
.cb-tl.cb-open { --cb-mask: url("data:image/svg+xml,%3C%21-- Created with Inkscape %28http://www.inkscape.org/%29 --%3E %3Csvg width=%22139.37857mm%22 height=%22139.38167mm%22 viewBox=%220 0 139.37857 139.38166%22 version=%221.1%22 id=%22svg1%22 xmlns=%22http://www.w3.org/2000/svg%22 xmlns:svg=%22http://www.w3.org/2000/svg%22%3E %3Cdefs id=%22defs1%22 /%3E %3Cg id=%22layer1%22 transform=%22translate%28-356.26686,354.47184%29%22%3E %3Cpath id=%22rect8-5%22 style=%22display:inline;fill:%23000000;fill-opacity:1;stroke-width:0.319677;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill%22 d=%22m 431.46176,-354.47184 v 34.95446 h 3.42408 v -34.95446 z m -4.53358,39.3821 v 24.99847 h 12.49123 v -24.99847 z m -31.27974,31.88332 v 12.49123 h 24.99847 v -12.49123 z m 50.00005,0 v 12.49123 h 24.99847 24.99848 v -12.49123 h -24.99848 z m -89.38163,4.53358 v 3.42459 h 34.88883 v -3.42459 z m 70.66132,13.58315 v 24.99795 h 12.49123 v -24.99795 z m 0,25.00105 v 24.99848 h 12.49123 v -24.99848 z%22 /%3E %3C/g%3E %3C/svg%3E"); }
.cb-tr.cb-open { --cb-mask: url("data:image/svg+xml,%3C%21-- Created with Inkscape %28http://www.inkscape.org/%29 --%3E %3Csvg width=%22139.37857mm%22 height=%22139.38167mm%22 viewBox=%220 0 139.37857 139.38166%22 version=%221.1%22 id=%22svg1%22 xmlns=%22http://www.w3.org/2000/svg%22 xmlns:svg=%22http://www.w3.org/2000/svg%22%3E %3Cdefs id=%22defs1%22 /%3E %3Cg id=%22layer1%22 transform=%22translate%28-542.21189,353.41547%29%22%3E %3Cpath id=%22rect8-5-3%22 style=%22display:inline;fill:%23000000;fill-opacity:1;stroke-width:0.319677;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill%22 d=%22m 606.39557,-353.41547 v 34.95446 h -3.42408 v -34.95446 z m 4.53358,39.3821 v 24.99847 h -12.49123 v -24.99847 z m 31.27974,31.88332 v 12.49123 h -24.99847 v -12.49123 z m -50.00005,0 v 12.49123 h -24.99847 -24.99848 v -12.49123 h 24.99848 z m 89.38163,4.53358 v 3.42459 h -34.88883 v -3.42459 z m -70.66132,13.58315 v 24.99795 h -12.49123 v -24.99795 z m 0,25.00105 v 24.99848 h -12.49123 v -24.99848 z%22 /%3E %3C/g%3E %3C/svg%3E"); }
.cb-bl.cb-open { --cb-mask: url("data:image/svg+xml,%3C%21-- Created with Inkscape %28http://www.inkscape.org/%29 --%3E %3Csvg width=%22139.37854mm%22 height=%22139.38167mm%22 viewBox=%220 0 139.37854 139.38166%22 version=%221.1%22 id=%22svg1%22 xmlns=%22http://www.w3.org/2000/svg%22 xmlns:svg=%22http://www.w3.org/2000/svg%22%3E %3Cdefs id=%22defs1%22 /%3E %3Cg id=%22layer1%22 transform=%22translate%28-880.50136,335.22067%29%22%3E %3Cpath id=%22rect8-5-3-6-7%22 style=%22display:inline;fill:%23000000;fill-opacity:1;stroke-width:0.319677;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill%22 d=%22m 955.69626,-195.83899 v -34.95446 h 3.42408 v 34.95446 z m -4.53358,-39.3821 v -24.99847 h 12.49123 v 24.99847 z m -31.27974,-31.88332 v -12.49123 h 24.99847 v 12.49123 z m 50.00005,0 v -12.49123 h 24.99847 24.99844 v 12.49123 h -24.99844 z m -89.38163,-4.53358 v -3.42459 h 34.88883 v 3.42459 z m 70.66132,-13.58315 v -24.99795 h 12.49123 v 24.99795 z m 0,-25.00105 v -24.99848 h 12.49123 v 24.99848 z%22 /%3E %3C/g%3E %3C/svg%3E"); }
.cb-br.cb-open { --cb-mask: url("data:image/svg+xml,%3C%21-- Created with Inkscape %28http://www.inkscape.org/%29 --%3E %3Csvg width=%22139.37857mm%22 height=%22139.38167mm%22 viewBox=%220 0 139.37857 139.38166%22 version=%221.1%22 id=%22svg1%22 xmlns=%22http://www.w3.org/2000/svg%22 xmlns:svg=%22http://www.w3.org/2000/svg%22%3E %3Cdefs id=%22defs1%22 /%3E %3Cg id=%22layer1%22 transform=%22translate%28-719.82109,337.3649%29%22%3E %3Cpath id=%22rect8-5-3-6%22 style=%22display:inline;fill:%23000000;fill-opacity:1;stroke-width:0.319677;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill%22 d=%22m 784.00477,-197.98322 v -34.95446 h -3.42408 v 34.95446 z m 4.53358,-39.3821 v -24.99847 h -12.49123 v 24.99847 z m 31.27974,-31.88332 v -12.49123 h -24.99847 v 12.49123 z m -50.00005,0 v -12.49123 h -24.99847 -24.99848 v 12.49123 h 24.99848 z m 89.38163,-4.53358 v -3.42459 h -34.88883 v 3.42459 z m -70.66132,-13.58315 v -24.99795 h -12.49123 v 24.99795 z m 0,-25.00105 v -24.99848 h -12.49123 v 24.99848 z%22 /%3E %3C/g%3E %3C/svg%3E"); }

.cb[data-cb-active]:not(:disabled):not([aria-disabled="true"]) { animation: cb-flash .3s linear 1; }
@keyframes cb-flash {
  0%, 100% { -webkit-text-fill-color: currentColor; }
  6%, 18% { -webkit-text-fill-color: transparent; }
  24%, 42% { -webkit-text-fill-color: currentColor; }
  48%, 60% { -webkit-text-fill-color: transparent; }
  66%, 78% { -webkit-text-fill-color: currentColor; }
  84%, 94% { -webkit-text-fill-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .cb-frame, .cb-g { transition: none !important; }
  .cb-closed { animation: none !important; }
  .cb[data-cb-active] { animation: none !important; }
}

/* Colors: each button type keeps the border colors it had before. */
.world-panel-back, .splash-enter-site { --cb-color: rgba(235, 232, 224, .22); --cb-hover-color: var(--accent); }
.social-link { --cb-color: var(--line); --cb-hover-color: var(--accent); }
.vault-link { --cb-color: var(--accent); --cb-hover-color: #df4a55; }
.preview-banner a { --cb-color: var(--line); --cb-hover-color: var(--accent); }
.stay-in-touch { --cb-color: var(--ml-line, color-mix(in srgb, var(--ml-ink) 40%, transparent)); --cb-hover-color: var(--ml-accent); }
.ml-submit { --cb-color: var(--ml-ink); --cb-hover-color: var(--ml-accent); }
.consent-banner button { --cb-color: rgba(235, 232, 224, .3); --cb-hover-color: #ebe8e0; }
#prevBtn, #nextBtn, #reloadBtn { --cb-color: var(--line); --cb-hover-color: var(--accent); }
#playBtn { --cb-color: var(--accent); --cb-hover-color: #df4a55; }

/* On light backdrops the vectors blend with difference, like the site's other overlay vectors. */
.world-stage[data-light-backdrop="true"] .cb:not(.stay-in-touch):not(.ml-submit) > .cb-frame { mix-blend-mode: difference; }
