*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg: #0a0a0a;
      --bg-2: #111114;
      --bg-3: #161619;
      --border: rgba(255,255,255,0.07);
      --border-bright: rgba(59,130,246,0.4);
      --blue: #3b82f6;
      --blue-light: #60a5fa;
      --blue-glow: rgba(59,130,246,0.15);
      --blue-glow-strong: rgba(59,130,246,0.3);
      --text: #f8fafc;
      --text-muted: #64748b;
      --text-dim: #94a3b8;
      --font: 'DM Sans', sans-serif;
      --mono: 'DM Mono', monospace;
    }

    html { scroll-behavior: smooth; }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: var(--font);
      min-height: 100vh;
      overflow-x: hidden;
    }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background-image:
        linear-gradient(rgba(59,130,246,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.03) 1px, transparent 1px);
      background-size: 48px 48px;
      pointer-events: none;
      z-index: 0;
    }

    body::after {
      content: '';
      position: fixed;
      top: -20%;
      left: 50%;
      transform: translateX(-50%);
      width: 700px;
      height: 500px;
      background: radial-gradient(ellipse, rgba(59,130,246,0.08) 0%, transparent 70%);
      pointer-events: none;
      z-index: 0;
    }

    .wrapper {
      position: relative;
      z-index: 1;
      max-width: 1080px;
      margin: 0 auto;
      padding: 3rem 1.5rem 4rem;
    }

    /* ─── HEADER ─── */
    header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 4rem;
    }

    .logo {
      font-family: var(--mono);
      font-size: 0.9rem;
      color: var(--blue-light);
      letter-spacing: 0.04em;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .logo-dot {
      width: 7px; height: 7px;
      border-radius: 50%;
      background: var(--blue);
      box-shadow: 0 0 8px var(--blue);
      animation: pulse 2s ease-in-out infinite;
    }

    @keyframes pulse {
      0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--blue); }
      50% { opacity: 0.5; box-shadow: 0 0 3px var(--blue); }
    }

    nav { display: flex; gap: 0.75rem; }

    .btn-pill {
      border-radius: 999px;
      font-family: var(--font);
      font-weight: 700;
      font-size: 0.875rem;
      cursor: pointer;
      transition: all 0.2s ease;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
    }

    .btn-primary {
      background: #fff;
      color: #0a0a0a;
      border: none;
      padding: 0.6rem 1.25rem;
    }

    .btn-primary:hover {
      background: var(--blue-light);
      transform: translateY(-1px);
      box-shadow: 0 4px 20px rgba(59,130,246,0.35);
    }

    .btn-outline {
      background: transparent;
      color: var(--text);
      border: 1px solid var(--border);
      padding: 0.6rem 1.25rem;
    }

    .btn-outline:hover {
      border-color: var(--blue);
      color: var(--blue-light);
      transform: translateY(-1px);
      box-shadow: 0 4px 16px rgba(59,130,246,0.2);
    }

    /* ─── HERO ─── */
    .hero {
      margin-bottom: 3.5rem;
    }

    .hero-tag {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      background: rgba(59,130,246,0.1);
      border: 1px solid rgba(59,130,246,0.2);
      border-radius: 999px;
      padding: 0.35rem 1rem;
      font-size: 0.8rem;
      font-family: var(--mono);
      color: var(--blue-light);
      margin-bottom: 1.5rem;
    }

    .hero h1 {
      font-size: clamp(2.8rem, 6vw, 5.5rem);
      font-weight: 900;
      letter-spacing: -0.04em;
      line-height: 1;
      margin-bottom: 1.2rem;
    }

    .hero h1 span {
      background: linear-gradient(135deg, var(--blue-light), #a78bfa);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .hero p {
      font-size: 1.125rem;
      color: var(--text-dim);
      max-width: 480px;
      line-height: 1.7;
      font-weight: 400;
    }

    /* ─── STATS BAR ─── */
    .stats-bar {
      display: flex;
      align-items: center;
      gap: 2rem;
      padding: 0.9rem 1.5rem;
      background: var(--bg-2);
      border: 1px solid var(--border);
      border-radius: 14px;
      margin-bottom: 2.5rem;
      overflow-x: auto;
    }

    .stat {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      white-space: nowrap;
    }

    .stat-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: var(--blue);
      flex-shrink: 0;
    }

    .stat-label {
      font-size: 0.8rem;
      color: var(--text-muted);
      font-family: var(--mono);
    }

    .stat-value {
      font-size: 0.8rem;
      color: var(--blue-light);
      font-family: var(--mono);
      font-weight: 500;
    }

    .stat-sep {
      width: 1px;
      height: 18px;
      background: var(--border);
      flex-shrink: 0;
    }

    /* ─── MAIN GRID ─── */
    .grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1.5rem;
      align-items: start;
    }

    @media (max-width: 768px) {
      .grid { grid-template-columns: 1fr; }
      .hero h1 { font-size: 2.8rem; }
      header { flex-direction: column; gap: 1.5rem; align-items: flex-start; }
    }

    /* ─── PANELS ─── */
    .panel {
      background: var(--bg-2);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 1.75rem;
    }

    .panel-title {
      font-size: 0.75rem;
      font-family: var(--mono);
      color: var(--text-muted);
      letter-spacing: 0.1em;
      text-transform: uppercase;
      margin-bottom: 1.5rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .panel-title::before {
      content: '';
      display: block;
      width: 3px; height: 12px;
      background: var(--blue);
      border-radius: 2px;
    }

    /* ─── INPUT ─── */
    .field { margin-bottom: 1.5rem; }

    .field label {
      display: block;
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text-dim);
      margin-bottom: 0.6rem;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    .input-wrap { position: relative; }

    .input-icon {
      position: absolute;
      left: 1rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      pointer-events: none;
      font-size: 0.9rem;
    }

    input[type="text"], textarea {
      width: 100%;
      background: var(--bg-3);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 0.85rem 1rem 0.85rem 2.6rem;
      color: var(--text);
      font-family: var(--font);
      font-size: 0.95rem;
      transition: border-color 0.2s, box-shadow 0.2s;
      outline: none;
    }

    input[type="text"]:focus, textarea:focus {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(59,130,246,0.12), 0 0 20px rgba(59,130,246,0.06);
    }

    input[type="text"]::placeholder, textarea::placeholder {
      color: var(--text-muted);
      font-size: 0.9rem;
    }

    .size-options {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.5rem;
    }

    .size-btn {
      background: var(--bg-3);
      border: 1px solid var(--border);
      border-radius: 10px;
      color: var(--text-dim);
      font-family: var(--font);
      font-size: 0.85rem;
      font-weight: 700;
      padding: 0.65rem 0;
      cursor: pointer;
      transition: all 0.18s ease;
      text-align: center;
    }

    .size-btn:hover {
      border-color: var(--blue);
      color: var(--blue-light);
    }

    .size-btn.active {
      background: rgba(59,130,246,0.12);
      border-color: var(--blue);
      color: var(--blue-light);
      box-shadow: inset 0 0 16px rgba(59,130,246,0.08);
    }

    .colors-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
    }

    .color-field label {
      display: block;
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--text-muted);
      margin-bottom: 0.5rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .color-picker-wrap {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      background: var(--bg-3);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 0.5rem 0.75rem;
      cursor: pointer;
      transition: border-color 0.2s;
    }

    .color-picker-wrap:hover { border-color: var(--border-bright); }

    input[type="color"] {
      width: 24px; height: 24px;
      border: none;
      border-radius: 6px;
      background: none;
      cursor: pointer;
      padding: 0;
    }

    .color-hex {
      font-family: var(--mono);
      font-size: 0.8rem;
      color: var(--text-dim);
    }

    .actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }

    .btn-download-main {
      background: var(--blue);
      color: #fff;
      border: none;
      border-radius: 12px;
      padding: 0.95rem 1.5rem;
      font-family: var(--font);
      font-weight: 700;
      font-size: 0.95rem;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
    }

    .btn-download-main:hover {
      background: var(--blue-light);
      transform: translateY(-2px);
      box-shadow: 0 8px 30px rgba(59,130,246,0.4);
    }

    .btn-copy {
      background: transparent;
      color: var(--text-dim);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 0.9rem 1.5rem;
      font-family: var(--font);
      font-weight: 700;
      font-size: 0.9rem;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
    }

    .btn-copy:hover {
      border-color: var(--blue);
      color: var(--blue-light);
      box-shadow: 0 4px 20px rgba(59,130,246,0.15);
    }

    /* ─── QR PREVIEW ─── */
    .qr-panel {
      background: var(--bg-2);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 1.75rem;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }

    .qr-stage {
      position: relative;
      border-radius: 16px;
      background: var(--bg-3);
      border: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 2rem;
      min-height: 280px;
      overflow: hidden;
    }

    .qr-glow {
      position: absolute;
      inset: 0;
      background: radial-gradient(circle at 50% 50%, rgba(59,130,246,0.12) 0%, transparent 65%);
      pointer-events: none;
      transition: opacity 0.5s;
    }

    .qr-glow.active {
      background: radial-gradient(circle at 50% 50%, rgba(59,130,246,0.18) 0%, transparent 65%);
    }

    .qr-corner {
      position: absolute;
      width: 18px; height: 18px;
      border-color: var(--blue);
      border-style: solid;
      opacity: 0.4;
    }
    .qr-corner.tl { top: 12px; left: 12px; border-width: 2px 0 0 2px; border-radius: 2px 0 0 0; }
    .qr-corner.tr { top: 12px; right: 12px; border-width: 2px 2px 0 0; border-radius: 0 2px 0 0; }
    .qr-corner.bl { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; border-radius: 0 0 0 2px; }
    .qr-corner.br { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; border-radius: 0 0 2px 0; }

    #qrCanvas {
      position: relative;
      z-index: 1;
      border-radius: 8px;
      max-width: 100%;
      opacity: 0;
      transform: scale(0.96);
      transition: opacity 0.35s ease, transform 0.35s ease;
    }

    #qrCanvas.visible {
      opacity: 1;
      transform: scale(1);
    }

    .qr-placeholder {
      position: absolute;
      z-index: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.75rem;
      opacity: 0.35;
      transition: opacity 0.3s;
    }

    .qr-placeholder.hidden { opacity: 0; pointer-events: none; }

    .placeholder-grid {
      display: grid;
      grid-template-columns: repeat(7, 10px);
      grid-template-rows: repeat(7, 10px);
      gap: 2px;
    }

    .placeholder-grid span {
      background: var(--text-muted);
      border-radius: 2px;
      display: block;
    }

    .qr-placeholder p {
      font-size: 0.8rem;
      font-family: var(--mono);
      color: var(--text-muted);
    }

    /* ─── TOAST ─── */
    .toast {
      position: fixed;
      bottom: 2rem;
      left: 50%;
      transform: translateX(-50%) translateY(8px);
      background: var(--blue);
      color: #fff;
      font-family: var(--mono);
      font-size: 0.85rem;
      padding: 0.6rem 1.25rem;
      border-radius: 999px;
      opacity: 0;
      pointer-events: none;
      transition: all 0.3s ease;
      z-index: 100;
    }

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

    /* ─── FOOTER ─── */
    footer {
      margin-top: 4rem;
      padding-top: 2rem;
      border-top: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 1rem;
    }

    footer p {
      font-size: 0.8rem;
      font-family: var(--mono);
      color: var(--text-muted);
    }

    footer span { color: var(--blue-light); }

    .footer-links { display: flex; gap: 1.5rem; }
    .footer-links a {
      font-size: 0.8rem;
      font-family: var(--mono);
      color: var(--text-muted);
      text-decoration: none;
      transition: color 0.2s;
    }
    .footer-links a:hover { color: var(--blue-light); }