/* Sadik BG Remover — static in-browser demo */
:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-soft: #0b1220;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-strong: rgba(12, 19, 34, 0.92);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #e8edf7;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #818cf8;
  --accent-2: #22d3ee;
  --success: #34d399;
  --danger: #fb7185;
  --radius: 20px;
  --shadow: 0 26px 70px -28px rgba(2, 6, 23, 0.95);
  --font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(99, 102, 241, 0.26), transparent 62%),
    radial-gradient(760px 480px at 88% -2%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(900px 640px at 50% 118%, rgba(168, 85, 247, 0.14), transparent 66%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 72%);
  pointer-events: none;
}

.page-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(520px 320px at 18% 4%, rgba(129, 140, 248, 0.12), transparent 70%),
    radial-gradient(460px 300px at 84% 8%, rgba(34, 211, 238, 0.09), transparent 70%);
  pointer-events: none;
}

a {
  color: inherit;
}

svg {
  display: block;
}

.topbar {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #071019;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px -10px rgba(34, 211, 238, 0.55);
}

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

.brand-text {
  color: var(--muted);
}

.brand-text strong {
  color: var(--text);
  font-weight: 600;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.9rem;
}

.topbar-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.topbar-links a:hover {
  color: var(--text);
}

.topbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.06);
}

.topbar-cta svg {
  width: 14px;
  height: 14px;
}

.topbar-cta:hover {
  border-color: var(--line-strong);
  background: rgba(148, 163, 184, 0.1);
}

main {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding-bottom: 40px;
}

.hero {
  padding: 52px 0 42px;
  max-width: 880px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 24px;
  padding: 7px 13px 7px 11px;
  border: 1px solid rgba(52, 211, 153, 0.24);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.07);
  color: #a7f3d0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12), 0 0 14px rgba(52, 211, 153, 0.8);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.55rem, 5.2vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 680;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #c7d2fe 0%, #67e8f9 55%, #d8b4fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 24px 0 0;
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.65;
}

.lede strong {
  color: #c7d2fe;
  font-weight: 600;
}

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.72fr) minmax(0, 1.12fr);
  grid-template-areas: "source settings result";
  gap: 18px;
  align-items: stretch;
}

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 30, 50, 0.78), rgba(10, 16, 29, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.source-panel {
  grid-area: source;
}

.settings-panel {
  grid-area: settings;
}

.result-panel {
  grid-area: result;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.panel-head h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 388px;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #080e1a;
}

.checker {
  background-color: #0a101c;
  background-image:
    linear-gradient(45deg, rgba(148, 163, 184, 0.1) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.1) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.1) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.1) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.canvas-frame.is-dragging {
  border-color: rgba(34, 211, 238, 0.65);
  background-color: rgba(34, 211, 238, 0.06);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.28), 0 0 40px -12px rgba(34, 211, 238, 0.45);
}

#dropzone {
  cursor: pointer;
  outline: none;
}

#dropzone:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25);
}

#sourcePreview,
#resultPreview {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

#sourcePreview {
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9);
}

.drop-empty,
.result-empty {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
  color: var(--muted);
  user-select: none;
}

.upload-icon,
.result-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.06);
  color: var(--accent);
}

.result-icon {
  color: var(--muted-2);
}

.upload-icon svg,
.result-icon svg {
  width: 25px;
  height: 25px;
}

.drop-title {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.drop-sub,
.result-empty p {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 0.8rem;
}

.result-empty p {
  max-width: 190px;
  line-height: 1.5;
}

.examples {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
  min-height: 48px;
}

.examples-label {
  margin-right: 2px;
  color: var(--muted-2);
  font-size: 0.75rem;
}

.example-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.05);
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.example-btn img {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  object-fit: cover;
}

.example-btn:hover {
  border-color: var(--line-strong);
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
}

.settings-panel .panel-head {
  margin-bottom: 18px;
}

.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field legend {
  margin-bottom: 9px;
  padding: 0;
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.045);
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.swatch:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.swatch:has(input:checked) {
  border-color: rgba(129, 140, 248, 0.7);
  background: rgba(129, 140, 248, 0.12);
  color: #e0e7ff;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.22);
}

.swatch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.swatch:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chip {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.chip-transparent {
  background-color: #1e293b;
  background-image:
    linear-gradient(45deg, #475569 25%, transparent 25%),
    linear-gradient(-45deg, #475569 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #475569 75%),
    linear-gradient(-45deg, transparent 75%, #475569 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
}

.chip-white {
  background: #ffffff;
}

.chip-black {
  background: #050505;
}

.chip-custom {
  background: conic-gradient(from 210deg, #f43f5e, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #f43f5e);
}

.custom-color {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
}

.custom-color input[type="color"] {
  width: 26px;
  height: 26px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: none;
  cursor: pointer;
}

.custom-color input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.custom-color input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 7px;
}

.custom-color output {
  margin-left: auto;
  color: var(--muted-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
}

.engine-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 16px 0 12px;
  color: var(--muted-2);
  font-size: 0.72rem;
}

.engine-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
}

.engine-sep {
  color: rgba(148, 163, 184, 0.35);
}

.run-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(100deg, #6366f1, #0891b2);
  color: #f8fafc;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 16px 34px -16px rgba(56, 189, 248, 0.7);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.run-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px -14px rgba(56, 189, 248, 0.8);
}

.run-btn:active:not(:disabled) {
  transform: translateY(0);
}

.run-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  box-shadow: none;
}

.run-icon {
  width: 18px;
  height: 18px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status {
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(2, 6, 23, 0.36);
}

.status-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.status-line span:first-child {
  min-width: 0;
}

.status-pct {
  flex: 0 0 auto;
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
}

.progress {
  height: 4px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease;
}

.status.is-indeterminate .progress-fill {
  width: 38%;
  animation: indeterminate 1.25s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(275%); }
}

.status.is-done {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(16, 185, 129, 0.06);
}

.status.is-done .status-line {
  color: #a7f3d0;
}

.status.is-done .progress-fill {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.status.is-error {
  border-color: rgba(251, 113, 133, 0.32);
  background: rgba(244, 63, 94, 0.07);
}

.status.is-error .status-line {
  color: #fecdd3;
}

.fineprint {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 0.7rem;
  line-height: 1.55;
}

.fineprint a {
  color: var(--muted);
  text-decoration-color: rgba(148, 163, 184, 0.4);
  text-underline-offset: 2px;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-top: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.07);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.download-btn svg {
  width: 17px;
  height: 17px;
  color: var(--accent-2);
}

.download-btn:hover {
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.09);
}

.download-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.notes {
  margin-top: 74px;
}

.notes-head {
  max-width: 620px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.notes-head h2,
.limits h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  letter-spacing: -0.03em;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.note {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.055), rgba(148, 163, 184, 0.018));
}

.note-num {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.note h3 {
  margin: 0 0 9px;
  font-size: 1rem;
  font-weight: 620;
}

.note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.limits {
  margin-top: 54px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.45);
}

.limits h2 {
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}

.limits ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.limits li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.limits li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(129, 140, 248, 0.7);
}

.limits strong {
  color: #cbd5e1;
  font-weight: 600;
}

.footer {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.74rem;
}

.footer-brand {
  color: var(--muted);
  font-weight: 600;
}

.footer-sep {
  margin: 0 6px;
  color: rgba(148, 163, 184, 0.35);
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--muted-2);
  text-decoration: none;
  transition: color 160ms ease;
}

.footer-links a:hover {
  color: var(--text);
}

@media (max-width: 1180px) {
  .editor {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "source result"
      "settings settings";
  }

  .settings-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "swatches engine"
      "custom run"
      "status status"
      "fineprint fineprint";
    gap: 0 22px;
    align-items: start;
  }

  .settings-panel .panel-head { grid-area: head; }
  .settings-panel .field { grid-area: swatches; }
  .settings-panel .custom-color { grid-area: custom; align-self: end; }
  .settings-panel .engine-line { grid-area: engine; margin-top: 0; }
  .settings-panel .run-btn { grid-area: run; align-self: end; margin-top: 16px; }
  .settings-panel .status { grid-area: status; }
  .settings-panel .fineprint { grid-area: fineprint; }
}

@media (max-width: 760px) {
  .topbar,
  main,
  .footer {
    width: calc(100% - 28px);
  }

  .topbar {
    padding-top: 16px;
  }

  .topbar-links a:first-child {
    display: none;
  }

  .topbar-cta {
    padding: 8px 11px;
    font-size: 0.8rem;
  }

  .hero {
    padding: 38px 0 30px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 10vw, 3.1rem);
  }

  .editor {
    grid-template-columns: 1fr;
    grid-template-areas:
      "source"
      "settings"
      "result";
  }

  .settings-panel {
    display: flex;
    flex-direction: column;
  }

  .settings-panel .engine-line {
    margin-top: 16px;
  }

  .settings-panel .run-btn {
    margin-top: 12px;
  }

  .canvas-frame {
    height: 300px;
  }

  .note-grid,
  .limits ul {
    grid-template-columns: 1fr;
  }

  .notes {
    margin-top: 52px;
  }

  .limits {
    padding: 22px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
