/* ============================================================
   Schwarzwald Solutions — footer credit iframe widget
   Source of truth for client-site embeds.
   ============================================================ */

:root {
  color-scheme: dark;
  --sws-bg: rgb(2 7 5 / 88%);
  --sws-ink: #eef8f2;
  --sws-muted: #8ca69a;
  --sws-faint: #557166;
  --sws-accent: #56f2a6;
  --sws-accent-2: #31d6ff;
  --sws-hot: #ff4fd8;
  --sws-rule: rgb(238 248 242 / 12%);
  --sws-mono:
    ui-monospace, 'SFMono-Regular', 'SF Mono', Consolas, 'Liberation Mono',
    Menlo, monospace;
}

:root[data-theme='light'] {
  color-scheme: light;
  --sws-bg: rgb(247 244 235 / 92%);
  --sws-ink: #10231b;
  --sws-muted: #52685f;
  --sws-faint: #789087;
  --sws-rule: rgb(16 35 27 / 14%);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: transparent;
}

body {
  color: var(--sws-ink);
  font-family: var(--sws-mono);
}

.sws-credit {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  min-height: 74px;
  color: var(--sws-ink);
  background:
    linear-gradient(
      90deg,
      rgb(86 242 166 / 10%),
      transparent 26%,
      rgb(49 214 255 / 7%)
    ),
    var(--sws-bg);
  border-top: 1px solid var(--sws-rule);
  border-bottom: 1px solid var(--sws-rule);
  overflow: hidden;
}

.sws-credit::before,
.sws-credit::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sws-credit::before {
  z-index: -1;
  opacity: 0.58;
  background:
    radial-gradient(circle at 16% 50%, rgb(86 242 166 / 16%), transparent 28%),
    radial-gradient(circle at 86% 60%, rgb(49 214 255 / 10%), transparent 30%);
}

.sws-credit::after {
  opacity: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 4px,
      rgb(86 242 166 / 10%) 4px 5px
    ),
    linear-gradient(90deg, transparent, rgb(255 255 255 / 7%), transparent);
  mix-blend-mode: screen;
  background-size:
    100% 5px,
    260% 100%;
}

.sws-credit:hover::after,
.sws-credit:focus-within::after,
.sws-credit.is-active::after {
  opacity: 1;
  animation: sws-crt-scan 1.15s linear infinite;
}

.sws-credit__inner {
  position: relative;
  min-height: 74px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 34px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sws-credit__left,
.sws-credit__right {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 0;
  transform: translateY(-50%);
}

.sws-credit__left {
  right: calc(50% + 146px);
  justify-content: flex-end;
}

.sws-credit__right {
  left: calc(50% + 146px);
  color: var(--sws-faint);
  font-size: clamp(9px, 2.2vw, 11px);
  line-height: 1;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sws-credit__label {
  color: var(--sws-muted);
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sws-credit__brand {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  color: var(--sws-ink);
  font-size: clamp(15px, 4.5vw, 22.5px);
  font-weight: 950;
  line-height: 0.84;
  letter-spacing: -0.072em;
  text-decoration: none;
  white-space: nowrap;
  outline: none;
}

.sws-credit__brand:focus-visible {
  border-radius: 6px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sws-accent) 36%, transparent);
}

.sws-credit__brand-text {
  position: relative;
  z-index: 2;
}

.sws-credit__dot {
  color: var(--sws-accent);
  text-shadow: 0 0 12px var(--sws-accent);
}

.sws-credit__brand::before,
.sws-credit__brand::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0);
}

.sws-credit__brand::before {
  color: var(--sws-accent-2);
  clip-path: inset(0 0 52% 0);
}

.sws-credit__brand::after {
  color: var(--sws-hot);
  clip-path: inset(46% 0 0 0);
}

.sws-credit__brand:hover,
.sws-credit__brand:focus-visible,
.sws-credit.is-active .sws-credit__brand {
  color: white;
  text-shadow: 0 0 18px rgb(86 242 166 / 50%);
}

.sws-credit__brand:hover::before,
.sws-credit__brand:focus-visible::before,
.sws-credit.is-active .sws-credit__brand::before {
  opacity: 0.85;
  animation: sws-glitch-a 2.7s steps(2, end) infinite;
}

.sws-credit__brand:hover::after,
.sws-credit__brand:focus-visible::after,
.sws-credit.is-active .sws-credit__brand::after {
  opacity: 0.78;
  animation: sws-glitch-b 3.1s steps(2, end) infinite;
}

.sws-credit__brand:hover .sws-credit__brand-text,
.sws-credit__brand:focus-visible .sws-credit__brand-text,
.sws-credit.is-active .sws-credit__brand-text {
  animation: sws-glitch-main 2.9s steps(2, end) infinite;
}

@keyframes sws-glitch-main {
  0%,
  7%,
  16%,
  45%,
  53%,
  73%,
  81%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  8% {
    transform: translate3d(-1px, 1px, 0) skewX(-3deg);
  }
  10% {
    transform: translate3d(1px, -1px, 0) skewX(4deg);
  }
  47% {
    transform: translate3d(-2px, 0, 0);
  }
  49% {
    transform: translate3d(1px, 1px, 0);
  }
  76% {
    transform: translate3d(1px, -1px, 0) skewX(2deg);
  }
}

@keyframes sws-glitch-a {
  0%,
  6%,
  17%,
  43%,
  54%,
  71%,
  82%,
  100% {
    transform: translate3d(0, 0, 0);
    clip-path: inset(0 0 52% 0);
  }
  8% {
    transform: translate3d(2px, -1px, 0);
    clip-path: inset(0 0 72% 0);
  }
  11% {
    transform: translate3d(-3px, 1px, 0);
    clip-path: inset(24% 0 42% 0);
  }
  46% {
    transform: translate3d(3px, 0, 0);
    clip-path: inset(8% 0 65% 0);
  }
  49% {
    transform: translate3d(-1px, -1px, 0);
    clip-path: inset(62% 0 16% 0);
  }
  76% {
    transform: translate3d(2px, 0, 0);
    clip-path: inset(0 0 34% 0);
  }
}

@keyframes sws-glitch-b {
  0%,
  9%,
  19%,
  39%,
  50%,
  68%,
  84%,
  100% {
    transform: translate3d(0, 0, 0);
    clip-path: inset(46% 0 0 0);
  }
  12% {
    transform: translate3d(-2px, 1px, 0);
    clip-path: inset(64% 0 5% 0);
  }
  15% {
    transform: translate3d(3px, 1px, 0);
    clip-path: inset(38% 0 34% 0);
  }
  43% {
    transform: translate3d(-1px, -2px, 0);
    clip-path: inset(14% 0 58% 0);
  }
  47% {
    transform: translate3d(2px, 0, 0);
    clip-path: inset(78% 0 0 0);
  }
  72% {
    transform: translate3d(-2px, 1px, 0);
    clip-path: inset(52% 0 19% 0);
  }
}

@keyframes sws-crt-scan {
  from {
    background-position:
      0 -24px,
      -160px 0;
  }
  to {
    background-position:
      0 24px,
      160px 0;
  }
}

@media (max-width: 820px) {
  .sws-credit__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    justify-items: center;
    text-align: center;
    min-height: 74px;
  }

  .sws-credit__left,
  .sws-credit__right {
    position: static;
    transform: none;
    min-height: 0;
    justify-content: center;
  }

  .sws-credit__left {
    justify-self: center;
  }

  .sws-credit__right {
    justify-self: center;
    gap: 8px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sws-credit,
  .sws-credit::after,
  .sws-credit__brand,
  .sws-credit__brand::before,
  .sws-credit__brand::after,
  .sws-credit__brand-text {
    animation: none !important;
    transition: none !important;
  }

  .sws-credit::after,
  .sws-credit__brand::before,
  .sws-credit__brand::after {
    display: none;
  }
}
