/* =========================================================
   Brote — "Clean The Site" interactive stain layer
   Drag / move your cursor to wipe the grime away.
   Self-contained: no template styles are overridden
   except the default custom cursor while clean-mode runs.
   ========================================================= */

:root {
  --sc-base: var(--brote-base, #35559c);
  --sc-primary: var(--brote-primary, #73b234);
  --sc-foam: #eaf3ff;
  --sc-shadow: 0 18px 40px -18px rgba(18, 35, 70, .45);
}

/* ---------- stain layer ---------- */
.sc-layer {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 95;
  overflow: hidden;
  contain: layout style;
}

.sc-stain {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform, opacity;
  mix-blend-mode: multiply;
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(.94);
  transition: opacity .9s ease, transform .9s cubic-bezier(.22, 1, .36, 1);
}

.sc-stain.is-in {
  opacity: var(--sc-stain-opacity, .78);
  transform: translate3d(0, 0, 0) scale(1);
}

.sc-stain.is-clean {
  opacity: 0 !important;
  transform: translate3d(0, 0, 0) scale(1.14);
  transition: opacity .55s ease, transform .55s ease;
}

.sc-stain canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- sponge cursor ---------- */
body.sc-on.custom-cursor .custom-cursor__cursor,
body.sc-on.custom-cursor .custom-cursor__cursor-two {
  opacity: 0;
  visibility: hidden;
}

.sc-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 62px;
  height: 44px;
  margin: -22px 0 0 -31px;
  pointer-events: none;
  z-index: 999992;
  opacity: 0;
  transition: opacity .35s ease;
  will-change: transform;
}

.sc-cursor.is-live {
  opacity: 1;
}

.sc-cursor__inner {
  width: 100%;
  height: 100%;
  transform-origin: 50% 60%;
  transition: transform .22s cubic-bezier(.22, 1, .36, 1);
  filter: drop-shadow(0 8px 12px rgba(20, 38, 74, .28));
}

.sc-cursor.is-wiping .sc-cursor__inner {
  transform: scale(1.06, .9);
}

.sc-cursor.is-link .sc-cursor__inner {
  transform: scale(.62) rotate(-12deg);
}

/* soapy halo shown while actually scrubbing a stain */
.sc-cursor__halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .55) 0%, rgba(210, 232, 255, .35) 45%, rgba(210, 232, 255, 0) 70%);
  opacity: 0;
  transform: scale(.5);
  transition: opacity .3s ease, transform .3s ease;
}

.sc-cursor.is-wiping .sc-cursor__halo {
  opacity: 1;
  transform: scale(1);
}

.sc-cursor__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70px;
  height: 70px;
  margin: -35px 0 0 -35px;
  border: 1.5px solid rgba(53, 85, 156, .55);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .3s ease, transform .3s ease;
}

.sc-cursor.is-link .sc-cursor__ring {
  opacity: 1;
  transform: scale(1);
}

/* ---------- foam bubbles + sparkles ---------- */
.sc-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999990;
  overflow: hidden;
}

.sc-bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95), rgba(214, 235, 255, .55) 46%, rgba(154, 197, 255, .22) 72%, rgba(154, 197, 255, 0) 100%);
  box-shadow: inset -1px -2px 3px rgba(53, 85, 156, .18);
  animation: sc-bubble-rise var(--sc-dur, 1200ms) cubic-bezier(.24, .6, .3, 1) forwards;
}

@keyframes sc-bubble-rise {
  0% { transform: translate3d(0, 0, 0) scale(.3); opacity: 0; }
  18% { opacity: .95; }
  100% { transform: translate3d(var(--sc-dx, 0), var(--sc-dy, -70px), 0) scale(1); opacity: 0; }
}

/* "Clean!" glint: four-point stars. The glow sits on the outer span and
   the star shape on ::before, because clip-path would clip the glow too. */
.sc-star {
  position: absolute;
  width: var(--sc-size, 24px);
  height: var(--sc-size, 24px);
  margin: calc(var(--sc-size, 24px) / -2) 0 0 calc(var(--sc-size, 24px) / -2);
  pointer-events: none;
  filter: drop-shadow(0 0 1.5px rgba(53, 85, 156, .55)) drop-shadow(0 0 4px rgba(255, 255, 255, .95)) drop-shadow(0 0 10px rgba(110, 180, 255, .85));
  animation: sc-twinkle var(--sc-dur, 900ms) cubic-bezier(.2, .9, .3, 1) var(--sc-delay, 0ms) both;
}

.sc-star::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #fff 0 18%, #e6f4ff 34%, #7cc0ff 66%, #3d8bf0 100%);
  clip-path: polygon(50% 0, 57% 43%, 100% 50%, 57% 57%, 50% 100%, 43% 57%, 0 50%, 43% 43%);
}

/* the big one gets a second, diagonal glint behind it */
.sc-star--main::after {
  content: "";
  position: absolute;
  inset: 22%;
  background: #fff;
  clip-path: polygon(50% 0, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0 50%, 44% 44%);
  transform: rotate(45deg);
  opacity: .85;
}

@keyframes sc-twinkle {
  0% { transform: scale(0) rotate(-60deg); opacity: 0; }
  35% { transform: scale(1.15) rotate(0deg); opacity: 1; }
  55% { transform: scale(.9) rotate(12deg); opacity: 1; }
  100% { transform: scale(0) rotate(45deg); opacity: 0; }
}

.sc-flash {
  position: absolute;
  width: var(--sc-size, 140px);
  height: var(--sc-size, 140px);
  margin: calc(var(--sc-size, 140px) / -2) 0 0 calc(var(--sc-size, 140px) / -2);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .9) 0%, rgba(150, 205, 255, .4) 35%, rgba(150, 205, 255, 0) 70%);
  animation: sc-flash .7s ease-out both;
}

@keyframes sc-flash {
  0% { transform: scale(.2); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* ---------- HUD ---------- */
.sc-hud {
  position: fixed;
  left: 24px;
  bottom: 26px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 12px;
  border-radius: 60px;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(53, 85, 156, .12);
  box-shadow: var(--sc-shadow);
  font-family: var(--brote-font, 'DM Sans', sans-serif);
  transform: translateY(26px);
  opacity: 0;
  transition: transform .6s cubic-bezier(.22, 1, .36, 1), opacity .6s ease;
  display: none;
}

.sc-hud.is-in {
  transform: translateY(0);
  opacity: 1;
}

.sc-hud__dial {
  position: relative;
  width: 46px;
  height: 46px;
  flex: none;
}

.sc-hud__dial svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.sc-hud__track {
  fill: none;
  stroke: rgba(53, 85, 156, .14);
  stroke-width: 4;
}

.sc-hud__bar {
  fill: none;
  stroke: url(#scGrad);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset .55s cubic-bezier(.22, 1, .36, 1);
}

.sc-hud__pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--sc-base);
  letter-spacing: -.02em;
}

.sc-hud__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 124px;
}

.sc-hud__title {
  font-size: 13px;
  font-weight: 700;
  color: #16233f;
  letter-spacing: -.01em;
}

.sc-hud__sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(22, 35, 63, .55);
  letter-spacing: .01em;
}

.sc-hud__actions {
  display: flex;
  gap: 6px;
}

.sc-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(53, 85, 156, .08);
  color: var(--sc-base);
  transition: background .25s ease, color .25s ease, transform .25s ease;
}

.sc-btn:hover {
  background: var(--sc-base);
  color: #fff;
  transform: translateY(-2px);
}

.sc-btn:focus-visible {
  outline: 2px solid var(--sc-primary);
  outline-offset: 3px;
}

.sc-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.sc-btn[aria-pressed="false"] {
  background: rgba(22, 35, 63, .06);
  color: rgba(22, 35, 63, .4);
}

/* ---------- finish toast ---------- */
.sc-toast {
  position: fixed;
  left: 50%;
  top: 14%;
  z-index: 999993;
  transform: translate(-50%, -18px) scale(.94);
  padding: 16px 30px;
  border-radius: 60px;
  background: linear-gradient(120deg, var(--sc-base), #4a72c4 55%, var(--sc-primary));
  color: #fff;
  font-family: var(--brote-font, 'DM Sans', sans-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: 0 26px 60px -22px rgba(18, 35, 70, .7);
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease, transform .5s cubic-bezier(.22, 1, .36, 1);
}

.sc-toast.is-in {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ---------- responsive / a11y ---------- */
@media (max-width: 991px) {
  .sc-hud {
    left: 14px;
    bottom: 16px;
    padding: 8px 14px 8px 10px;
    gap: 10px;
  }
  .sc-hud__text { min-width: 0; }
  .sc-hud__sub { display: none; }
}

@media (max-width: 575px) {
  .sc-hud__text { display: none; }
}

@media (hover: none) {
  .sc-cursor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sc-stain,
  .sc-hud,
  .sc-cursor__inner {
    transition-duration: .01ms !important;
  }
  .sc-bubble,
  .sc-star,
  .sc-flash {
    display: none !important;
  }
}
