:root {
  --eco-navy: #0c2541;
  --eco-green: #56b56f;
  --eco-green-dark: #2f9650;
  --eco-red: #e3000b;
  --eco-red-soft: rgba(227, 0, 11, 0.16);
  --eco-bg: #f2f2f2;
  --eco-ink: #18211b;
  --eco-muted: #64716a;
  --eco-card: #ffffff;
  --eco-border: rgba(12, 37, 65, 0.10);
  --eco-shadow: 0 22px 60px rgba(12, 37, 65, 0.13);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  padding: clamp(16px, 4vw, 42px);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 8%, rgba(86, 181, 111, 0.10), transparent 28rem),
    linear-gradient(180deg, #f8faf8 0%, #eef3ef 100%);
  color: var(--eco-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

button, a { font: inherit; }

.eco-shell {
  width: min(100%, 790px);
}

.eco-card {
  overflow: hidden;
  border: 1px solid var(--eco-border);
  border-radius: 28px;
  background: var(--eco-card);
  box-shadow: var(--eco-shadow);
}

.eco-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
}

.eco-brand {
  min-width: 0;
}

.eco-eyebrow {
  margin: 0 0 4px;
  color: var(--eco-green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eco-algorithm-name {
  display: none !important;
  margin: 0;
  color: var(--eco-navy);
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.eco-live {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid rgba(86, 181, 111, 0.28);
  border-radius: 999px;
  background: rgba(86, 181, 111, 0.09);
  color: var(--eco-green-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eco-live__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--eco-green);
  box-shadow: 0 0 0 0 rgba(86, 181, 111, 0.35);
  animation: eco-live-pulse 1.8s ease-out infinite;
}

@keyframes eco-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(86, 181, 111, 0.42); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(86, 181, 111, 0); }
}

.eco-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 664 / 560;
  overflow: hidden;
  background: var(--eco-bg);
  border-block: 1px solid rgba(12, 37, 65, 0.06);
}

.eco-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.25), transparent 12%, transparent 88%, rgba(12,37,65,0.03)),
    radial-gradient(circle at 50% 50%, transparent 62%, rgba(12,37,65,0.04) 100%);
}

.eco-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.eco-image--base {
  z-index: 1;
}

.eco-image--result {
  z-index: 2;
  clip-path: inset(0 0 100% 0);
  will-change: clip-path, opacity;
}

.eco-fx {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.eco-scan {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 7px rgba(86, 181, 111, 0.75));
  will-change: transform, opacity;
}

.eco-scan__wash {
  fill: url(#eco-scan-gradient);
}

.eco-target,
.eco-shield,
.eco-keep,
.eco-removal {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform, opacity;
}

.eco-target__box {
  fill: transparent;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 8 6;
}

.eco-target--red .eco-target__box { stroke: var(--eco-red); }
.eco-target--green .eco-target__box { stroke: var(--eco-green-dark); }
.eco-target--navy .eco-target__box { stroke: var(--eco-navy); }

.eco-target__ring {
  fill: none;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.eco-target--red .eco-target__ring { stroke: rgba(227, 0, 11, 0.72); }
.eco-target--green .eco-target__ring { stroke: rgba(47, 150, 80, 0.72); }
.eco-target--navy .eco-target__ring { stroke: rgba(12, 37, 65, 0.68); }

.eco-particle {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.eco-particle--red { fill: var(--eco-red); }
.eco-particle--green { fill: var(--eco-green-dark); }
.eco-particle--blue { fill: #198bd1; }

.eco-shield__halo {
  fill: rgba(255, 255, 255, 0.12);
  stroke: var(--eco-green);
  stroke-width: 3;
  stroke-dasharray: 10 7;
  vector-effect: non-scaling-stroke;
}

.eco-shield__tick,
.eco-keep__tick {
  fill: none;
  stroke: var(--eco-green-dark);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.eco-keep__circle {
  fill: rgba(86, 181, 111, 0.10);
  stroke: var(--eco-green-dark);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.eco-removal__wash {
  fill: rgba(242, 242, 242, 0.77);
  stroke: rgba(227, 0, 11, 0.72);
  stroke-width: 2;
  stroke-dasharray: 7 6;
  vector-effect: non-scaling-stroke;
}

.eco-removal__x {
  stroke: var(--eco-red);
  stroke-width: 4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.eco-stage__hud {
  position: absolute;
  z-index: 7;
  inset: 0;
  pointer-events: none;
}

.eco-phase {
  display: none !important;
  position: absolute;
  left: 18px;
  bottom: 17px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 36px);
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 999px;
  background: rgba(12, 37, 65, 0.88);
  color: #fff;
  box-shadow: 0 8px 28px rgba(12, 37, 65, 0.18);
  font-size: clamp(11px, 2vw, 13px);
  font-weight: 750;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.eco-phase::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--eco-green);
}

.eco-phase__text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eco-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(12, 37, 65, 0.08);
}

.eco-progress__bar {
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--eco-green), var(--eco-green-dark));
  will-change: transform;
}

.eco-card__copy {
  padding: 22px 22px 8px;
}

.eco-title {
  margin: 0;
  color: var(--eco-navy);
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.eco-description {
  margin: 12px 0 0;
  color: var(--eco-muted);
  font-size: clamp(15px, 2.4vw, 17px);
  line-height: 1.55;
}

.eco-caption-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(86, 181, 111, 0.08);
  color: var(--eco-green-dark);
  font-size: 12px;
  font-weight: 750;
}

.eco-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px 22px;
}

.eco-controls__group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.eco-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid rgba(12, 37, 65, 0.13);
  border-radius: 12px;
  background: #fff;
  color: var(--eco-navy);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.eco-button:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 150, 80, 0.42);
  background: rgba(86, 181, 111, 0.06);
}

.eco-button:focus-visible {
  outline: 3px solid rgba(86, 181, 111, 0.28);
  outline-offset: 2px;
}

.eco-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.eco-time {
  color: var(--eco-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.eco-paused .eco-live__dot { animation-play-state: paused; }

body.embed {
  min-height: 0;
  padding: 0;
  background: transparent;
}

body.embed .eco-shell { width: 100%; }
body.embed .eco-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
body.embed .eco-card__top,
body.embed .eco-card__copy,
body.embed .eco-controls { display: none; }
body.embed .eco-stage { border: 0; border-radius: 18px; }
body.hide-controls .eco-controls { display: none; }

body.reduced-motion .eco-image--result {
  clip-path: inset(0 0 0 0) !important;
  opacity: 1 !important;
}
body.reduced-motion .eco-scan,
body.reduced-motion .eco-target,
body.reduced-motion .eco-shield,
body.reduced-motion .eco-keep,
body.reduced-motion .eco-removal,
body.reduced-motion .eco-particle { opacity: 0 !important; }
body.reduced-motion .eco-progress__bar { transform: scaleX(1) !important; }
body.reduced-motion .eco-phase__text::after { content: ""; }
body.reduced-motion .eco-live__dot { animation: none; }

@media (max-width: 560px) {
  body { padding: 12px; }
  .eco-card { border-radius: 20px; }
  .eco-card__top { padding: 14px 15px 12px; }
  .eco-live { padding: 6px 9px; font-size: 10px; }
  .eco-stage { border-radius: 0; }
  .eco-card__copy { padding: 18px 16px 6px; }
  .eco-controls { padding: 12px 16px 18px; }
  .eco-button span { display: none; }
  .eco-button { width: 42px; padding-inline: 0; }
  .eco-phase { left: 12px; bottom: 12px; max-width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  .eco-live__dot { animation: none; }
  .eco-button { transition: none; }
}
