:root {
  color-scheme: dark;
  --bg: #0d0e0b;
  --bg-deep: #0a0b07;
  --panel: #14150d;
  --panel-2: #16170f;
  --line: #232419;
  --line-bright: #3a3b2b;
  --text: #f2f0e6;
  --muted: #9b9a8b;
  --muted-2: #7c7b6d;
  --lime: #c6f536;
  --danger: #ff8a7a;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--lime);
  color: var(--bg);
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

@keyframes spinslow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(220%);
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  padding: 44px 48px 56px;
}

.glow,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.glow-one {
  background: radial-gradient(900px 600px at 78% 18%, rgba(198, 245, 54, 0.1), transparent 60%);
}

.glow-two {
  background: radial-gradient(700px 500px at 8% 88%, rgba(198, 245, 54, 0.05), transparent 60%);
}

.grain {
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.studio {
  width: min(1280px, 100%);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.topbar {
  margin-bottom: 34px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--lime);
  color: var(--bg);
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.pill {
  margin-left: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--bg);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--lime);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 12.5px;
  letter-spacing: 0.18em;
}

.eyebrow span {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--lime);
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(3.25rem, 7vw, 4.75rem);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: 0;
}

h1 span {
  color: var(--lime);
}

.hero-copy {
  max-width: 300px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.workspace {
  display: block;
}

.stage-toolbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 6;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(10, 11, 7, 0.92), rgba(10, 11, 7, 0));
}

.upload-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px 0 8px;
  min-height: 44px;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.upload-chip:hover,
.upload-chip.is-dragging {
  border-color: var(--lime);
}

.upload-chip input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--lime);
  color: var(--bg);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 17px;
  font-weight: 700;
}

.upload-chip-text {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.upload-chip-copy {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.upload-chip-meta {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
}

.status-card,
.progress-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.strength-tabs {
  display: flex;
  gap: 8px;
  margin-right: auto;
}

.strength-tab {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #2e2f22;
  border-radius: 10px;
  background: transparent;
  color: #cfcdbe;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.strength-tab:hover,
.strength-tab.is-active {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--bg);
}

.remove-button {
  min-height: 44px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: var(--lime);
  color: var(--bg);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.remove-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(198, 245, 54, 0.25);
}

.remove-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.spinner {
  display: none;
}

.remove-button.is-loading .spinner {
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 2px solid rgba(13, 14, 11, 0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spinslow 700ms linear infinite;
}

.status-card {
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  color: #cfcdbe;
  font-size: 13.5px;
  word-break: break-word;
}

.progress-card {
  padding: 15px 16px;
}

.progress-card:not([hidden]) {
  display: grid;
  gap: 12px;
}

.progress-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #cfcdbe;
  font-size: 13.5px;
}

.progress-topline span:first-child {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 600;
}

.progress-topline span:last-child {
  color: var(--lime);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 700;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #25271b;
  position: relative;
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--lime);
  box-shadow: 0 0 18px rgba(198, 245, 54, 0.34);
  position: relative;
  transition: width 380ms ease;
}

.progress-track span::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 46%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52), transparent);
  animation: shimmer 1.15s ease-in-out infinite;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.step-dot {
  height: 4px;
  border-radius: 999px;
  background: #303224;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.step-dot.is-active {
  background: var(--lime);
  box-shadow: 0 0 10px rgba(198, 245, 54, 0.42);
}

.status-card:not([hidden]) {
  display: flex;
}

.status-card[data-tone="success"] {
  color: #e8ffd1;
}

.status-card[data-tone="error"] {
  color: var(--danger);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}

.status-card[data-tone="error"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.stage-card {
  min-height: 560px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-deep);
  user-select: none;
}

.stage-overlay {
  position: absolute;
  inset: auto 0 0;
  z-index: 5;
  display: grid;
  gap: 10px;
  padding: 18px;
  pointer-events: none;
}

.stage-overlay .progress-card,
.stage-overlay .status-card {
  pointer-events: auto;
  max-width: 380px;
  backdrop-filter: blur(8px);
  background: rgba(20, 21, 13, 0.82);
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid var(--lime);
  color: var(--lime);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}

.download-link:hover {
  background: var(--lime);
  color: var(--bg);
}

.comparison-stage {
  height: 560px;
  position: relative;
}

.stage-card.is-dragging {
  border-color: var(--lime);
  box-shadow: inset 0 0 0 2px var(--lime), 0 0 50px rgba(198, 245, 54, 0.18);
}

.after-layer,
.before-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.after-layer {
  background-color: #15160f;
}

.before-layer {
  clip-path: inset(0 50% 0 0);
}

.image-frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 74px 34px 48px;
}

.checkerboard {
  background-color: #15160f;
  background-image:
    linear-gradient(45deg, #23241a 25%, transparent 25%),
    linear-gradient(-45deg, #23241a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #23241a 75%),
    linear-gradient(-45deg, transparent 75%, #23241a 75%);
  background-position: 0 0, 0 13px, 13px -13px, -13px 0;
  background-size: 26px 26px;
}

.original-bg {
  background: linear-gradient(135deg, #e7e3d6, #cdd3c4);
}

.image-frame img {
  max-width: min(80%, 600px);
  max-height: 390px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 28px 54px rgba(0, 0, 0, 0.42));
}

.image-frame img:not([src]) {
  display: none;
}

.placeholder {
  display: grid;
  place-items: center;
  gap: 14px;
  text-align: center;
}

.image-frame img[src] + .placeholder {
  display: none;
}

.placeholder svg {
  width: 52px;
  height: 52px;
  color: var(--muted-2);
  opacity: 0.7;
}

.original-placeholder svg {
  color: #6f7263;
}

.placeholder-text {
  color: var(--muted-2);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.original-placeholder .placeholder-text {
  color: #6f7263;
}

.corner-label {
  position: absolute;
  bottom: 18px;
  z-index: 3;
  color: #6f6e60;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
}

.after-label {
  right: 22px;
}

.before-label {
  left: 22px;
  color: #5a5a4c;
}

.reveal-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 6;
  width: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* The slider only appears and becomes grabbable once a result exists. */
.comparison-stage.is-ready .reveal-handle {
  opacity: 1;
}

.comparison-stage.is-ready .handle-knob {
  pointer-events: auto;
  cursor: ew-resize;
  touch-action: none;
}

.handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--lime);
}

.handle-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--lime);
  color: var(--bg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 700;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 28px 18px 36px;
  }

  .topbar {
    margin-bottom: 28px;
  }

  .hero-row {
    display: grid;
    gap: 18px;
  }

  .hero-copy {
    max-width: 560px;
  }

  .stage-card,
  .comparison-stage {
    min-height: 480px;
    height: 480px;
  }
}

@media (max-width: 560px) {
  .brand-lockup {
    flex-wrap: wrap;
  }

  h1 {
    font-size: 3rem;
  }

  .stage-toolbar {
    gap: 8px;
    padding: 12px;
  }

  .strength-tabs {
    order: 3;
    width: 100%;
    margin-right: 0;
  }

  .strength-tab {
    flex: 1;
  }

  .image-frame {
    padding: 132px 18px 48px;
  }

  .stage-card,
  .comparison-stage {
    min-height: 420px;
    height: 420px;
  }
}
