:root {
  --bg: #07070b;
  --glass: rgba(255, 255, 255, 0.045);
  --glass2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --text: #ededf3;
  --muted: #8e90a0;
  --acc: #00e676;
  --acc2: #007bff;
  --ok: #34d399;
  --err: #f87171;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}
html {
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  -ms-overflow-style: none;
}
body {
  font-family: Tajawal, system-ui, sans-serif;
  background:
    radial-gradient(
      900px 500px at 85% -10%,
      rgba(124, 108, 255, 0.12),
      transparent 60%
    ),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(7, 7, 11, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
}
.mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.links {
  display: flex;
  gap: 22px;
  margin-inline-start: auto;
}
.links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}
.links a:hover {
  color: var(--text);
}
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px 20px;
  background: linear-gradient(180deg, var(--acc2), var(--acc));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition:
    transform 0.15s,
    opacity 0.15s;
  text-decoration: none;
  display: inline-block;
}
.btn:hover {
  opacity: 0.92;
}
.btn:active {
  transform: scale(0.98);
}
.btn.ghost {
  background: var(--glass2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
}
.btn.sm {
  padding: 8px 14px;
  font-size: 14px;
}
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 64px 0 40px;
}
h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.18;
  font-weight: 700;
}
h1 span {
  color: var(--acc2);
}

.lead {
  color: var(--muted);
  margin: 16px 0 24px;
  max-width: 520px;
  font-size: 18px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.chips :hover {
  transform: scale(1.05);
}

.hero-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  display: grid;
  place-items: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform: rotate(120deg);
  width: 11rem;
  height: 11rem;
  margin-right: auto;
  overflow: visible;
}

#heroBox {
  width: 10rem;
  height: 10rem;
  display: grid;
  place-items: center;
  transform: rotate(60deg) translate(-10px, -35px);
}

#heroBox canvas,
#heroBox svg {
  width: 100% !important;
  height: 100% !important;
  border-radius: 16px;
}
.panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.panel h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 19px;
  margin: 0 0 14px;
}
.ws {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  padding-bottom: 48px;
  align-items: start;
}
.types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.type {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
}
.type.active {
  background: rgba(124, 108, 255, 0.18);
  border-color: rgba(124, 108, 255, 0.6);
  color: #fff;
}
.fl {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin: 14px 0 6px;
}
input,
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-size: 16px;
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--acc);
}
input.invalid {
  border-color: var(--err);
}
input[type="color"] {
  height: 44px;
  padding: 4px;
  cursor: pointer;
}
select option {
  background: #14141c;
}
.err {
  color: var(--err);
  font-size: 13px;
  min-height: 18px;
  margin-top: 6px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.preset {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.preset.active {
  border-color: var(--acc);
  color: var(--text);
}
.mini {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--mini-bg, #fff);
}
.mini svg {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
.swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.sw {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 0;
  background: var(--sw, transparent);
}
.drop {
  display: block;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}
.drop:hover {
  border-color: var(--acc);
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
.preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  position: sticky !important;
  top: 90px;
}
.preview h2 {
  align-self: stretch;
}
.stage {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s;
}
#qrBox svg {
  display: block;
  width: 260px;
  height: 260px;
  max-width: 100%;
  height: auto;
}
.status {
  font-size: 14px;
  min-height: 20px;
  text-align: center;
}
.ok {
  color: var(--ok);
}
.cap {
  margin-top: 8px;
  color: var(--cap-fg, #0b0d12);
  background: var(--cap-bg, transparent);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  max-width: 260px;
  word-break: break-word;
  font-family: Tajawal, sans-serif;
}
.dl {
  display: flex;
  gap: 8px;
  width: 100%;
}
.dl select {
  width: auto;
}
.dl .btn {
  flex: 1;
}
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-bottom: 56px;
}
.features h3 {
  font-size: 17px;
  margin-bottom: 6px;
  display: flex;
}

footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.hidden-render {
  position: fixed;
  left: -9999px;
  top: 0;
}

/* ===== Utility / moved from inline styles ===== */
.mt-22 {
  margin-top: 22px;
}
.mt-14 {
  margin-top: 14px;
}
.mt-10 {
  margin-top: 10px;
}
.mt-8 {
  margin-top: 8px;
}
.mt-4 {
  margin-top: 4px;
}

.logo-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  min-height: 0;
}

.logo-size-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}
.logo-size-row input[type="range"] {
  flex: 1;
  width: auto;
  accent-color: #7c6cff;
}
.logo-pct {
  min-width: 40px;
  text-align: start;
}

.cap-area {
  width: 100%;
}
.cap-styles {
  margin-top: 10px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  margin: auto;
  width: max-content;
  max-width: 90%;
  background: rgba(30, 30, 40, 0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 50;
  transition: opacity 0.2s;
  opacity: 0;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
}

/* caption styles */
.cap-normal {
  font-family: Tajawal, sans-serif;
  font-weight: 500;
}
.cap-bold {
  font-family: Tajawal, sans-serif;
  font-weight: 800;
}
.cap-tech {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}
.cap-pill {
  font-family: Tajawal, sans-serif;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
}

/* status */
.status-bad {
  color: var(--err);
}

/* input direction helpers */
.dir-ltr {
  direction: ltr;
}
.dir-rtl {
  direction: rtl;
}

@media (max-width: 900px) {
  .hero,
  .ws {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-top: 40px;
  }
  .hero-card {
    order: -1;
    margin: 0 auto;
    grid-row: 2;
  }
}
.preview {
  position: static;
}
.features {
  grid-template-columns: 1fr;
}

@media (max-width: 560px) {
  .wrap.nav {
    justify-content: space-between;
  }

  .links {
    display: none;
  }
  .wrap {
    padding: 0 16px;
  }
  .panel {
    padding: 18px;
  }
  .presets {
    grid-template-columns: repeat(2, 1fr);
  }

  .mini {
    width: 100%;
    height: 150px;
  }

  .row {
    grid-template-columns: 1fr;
  }

  canvas {
    width: 100%;
    height: 200px;
  }
}
