/* Hadiansyah Media & Design Lab — WebP & Image Studio Stylesheet */
:root {
  --bg-main: #080b12;
  --bg-card: #111726;
  --bg-panel: #0b101c;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-cyan: rgba(56, 189, 248, 0.42);
  --border-emerald: rgba(16, 185, 129, 0.42);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent-sky: #38bdf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 14% 8%, rgba(56, 189, 248, 0.09), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(16, 185, 129, 0.08), transparent 36%);
  color: var(--text-main);
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.bento-card {
  background: linear-gradient(180deg, rgba(19, 26, 42, 0.95) 0%, rgba(11, 16, 27, 0.98) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bento-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 14px 32px -14px rgba(2, 132, 199, 0.22);
}

.dropzone-border {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  background: rgba(8, 12, 22, 0.72);
  transition: all 0.2s ease;
}

.dropzone-border.drag-over,
.dropzone-border:hover {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.06);
}

.stage-checker {
  background-color: #0f172a;
  background-image:
    linear-gradient(45deg, #1e293b 25%, transparent 25%),
    linear-gradient(-45deg, #1e293b 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1e293b 75%),
    linear-gradient(-45deg, transparent 75%, #1e293b 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.stage-dark { background: #070a10; }
.stage-light { background: #e2e8f0; }

.split-viewport {
  position: relative;
  width: 100%;
  min-height: 340px;
  max-height: 480px;
  height: 400px;
  border-radius: 0.9rem;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .split-viewport {
    height: 300px;
    min-height: 280px;
  }
}

.split-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.split-layer img,
.split-layer canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  border-radius: 6px;
}

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

.curtain-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.85);
  transform: translateX(-50%);
  z-index: 20;
  cursor: ew-resize;
}

.curtain-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #090d16;
  border: 2px solid var(--accent-emerald);
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
  transition: transform 0.15s ease;
}

.curtain-divider:hover .curtain-handle {
  transform: translate(-50%, -50%) scale(1.08);
}

/* 3x Pixel Magnifier Loupe */
.loupe-lens {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  border: 2px solid var(--accent-sky);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(15, 23, 42, 0.95);
  pointer-events: none;
  z-index: 30;
  display: none;
  background-repeat: no-repeat;
  background-color: #090d16;
  image-rendering: pixelated;
}

.loupe-lens::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(56, 189, 248, 0.75);
  border-radius: 50%;
}

input[type="range"].studio-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #1e293b;
  outline: none;
}

input[type="range"].studio-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-emerald);
  border: 2px solid #080b12;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.55);
}

.preset-btn.active,
.bg-mode-btn.active,
.toggle-chip.active {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(16, 185, 129, 0.58) !important;
  color: #34d399 !important;
}

.batch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 0.75rem;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(30, 41, 59, 0.85);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.batch-row:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.batch-row.active {
  background: rgba(16, 185, 129, 0.11);
  border-color: rgba(16, 185, 129, 0.5);
}

.studio-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(9, 14, 24, 0.96);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #e2e8f0;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 60;
}

.studio-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ts-hidden-slot {
  position: fixed;
  bottom: 8px;
  right: 8px;
  z-index: 50;
}
