  *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

  :root {
    --bg: #191127;
    --surface: #23133a;
    --surface2: #1f1232;
    --border: #3a1c63;
    --text: #e8e6f0;
    --text-dim: #d6d6d6;
    --accent: #883CF0;
    --accent2: #a29bfe;
    --accent3: #af62c8;
    --glow: rgba(108, 92, 231, 0.3);
  }

  html { font-size: 16px; }
  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* ---- NOISE OVERLAY ---- */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  /* ---- HEADER ---- */
  header {
    padding: 1.2rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: #180f26;
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .logo-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .logo-brand .mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent3));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: -1px;
    transform: rotate(-3deg);
  }

  .logo-brand span {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 1.3rem;
    letter-spacing: 2px;
    color: var(--text);
  }

  .header-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
  }

  .btn {
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.25s;
  }

  .btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
  }
  .btn-ghost:hover { border-color: var(--accent); color: var(--text); }

  .btn-primary {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 20px var(--glow);
  }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 30px var(--glow); }

  /* ---- LAYOUT ---- */
  .app-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: calc(100vh - 64px);
  }

  @media (max-width: 900px) {
    .app-layout { grid-template-columns: 1fr; }
    .sidebar { max-height: 50vh; overflow-y: auto; }
  }

  /* ---- SIDEBAR ---- */
  .sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
  }

  .sidebar h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-bottom: 0.8rem;
    margin-top: 1.5rem;
  }

  .sidebar h3:first-child { margin-top: 0; }

  .input-group {
    margin-bottom: 1rem;
  }

  .input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
    font-weight: 500;
  }

  .input-group input[type="text"],
  .input-group input[type="number"],
  .input-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
  }

  .input-group input:focus,
  .input-group select:focus {
    border-color: var(--accent);
  }

  .input-group select { cursor: pointer; }
  .input-group select option { background: var(--surface2); }

  /* Color pickers row */
  .color-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .color-swatch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
  }
  .color-swatch:hover { border-color: var(--accent); }

  .color-swatch input[type="color"] {
    width: 28px; height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    padding: 0;
  }
  .color-swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
  .color-swatch input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }

  .color-swatch span {
    font-size: 0.75rem;
    color: var(--text-dim);
  }

  /* Icon grid */
  .icon-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
  }

  .icon-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.2s;
  }

  .icon-cell:hover { border-color: var(--accent); transform: scale(1.05); }
  .icon-cell.active {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.15);
    box-shadow: 0 0 12px var(--glow);
  }

  /* Shape grid */
  .shape-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
  }

  .shape-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    cursor: pointer;
    transition: all 0.2s;
  }
  .shape-cell:hover { border-color: var(--accent); transform: scale(1.05); }
  .shape-cell.active {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.15);
    box-shadow: 0 0 12px var(--glow);
  }

  /* Range slider */
  input[type="range"] {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--glow);
  }

  /* ---- CANVAS AREA ---- */
  .canvas-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
  }

  .canvas-area::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(178, 92, 231, 0.08), transparent 60%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  /* Grid dots background */
  .canvas-area::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
  }

  .preview-container {
    position: relative;
    z-index: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 400px;
    min-height: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transition: background 0.3s;
  }

  .logo-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
    animation: logoFadeIn 0.5s ease;
  }

  @keyframes logoFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
  }

  .logo-preview .icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }

  .logo-preview .logo-text {
    transition: all 0.3s ease;
    line-height: 1.1;
    white-space: nowrap;
  }

  .logo-preview .logo-tagline {
    font-size: 0.75em;
    opacity: 0.6;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
  }

  /* Layout variants */
  .logo-preview.layout-stacked {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }

  .logo-preview.layout-horizontal {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .logo-preview.layout-icon-right {
    flex-direction: row-reverse;
    align-items: center;
    gap: 1rem;
  }

  /* ---- TEMPLATES ---- */
  .templates-bar {
    position: relative;
    z-index: 1;
    margin-top: 2rem;
    width: 100%;
    max-width: 700px;
  }

  .templates-bar h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-bottom: 0.8rem;
    text-align: center;
  }

  .templates-scroll {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
  }

  .templates-scroll::-webkit-scrollbar { height: 4px; }
  .templates-scroll::-webkit-scrollbar-track { background: transparent; }
  .templates-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  .template-card {
    min-width: 130px;
    height: 90px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface2);
    cursor: pointer;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.6rem;
    transition: all 0.25s;
    flex-shrink: 0;
  }

  .template-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }

  .template-card .t-icon { font-size: 1.4rem; }
  .template-card .t-name {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  /* ---- EXPORT MODAL ---- */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .modal-overlay.open { opacity: 1; pointer-events: all; }

  .modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s;
  }
  .modal-overlay.open .modal { transform: scale(1); }

  .modal h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }
  .modal p { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 1.5rem; }

  .export-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
  }

  .export-opt {
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface2);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
  }
  .export-opt:hover { border-color: var(--accent); }
  .export-opt .format { font-weight: 700; font-size: 1rem; }
  .export-opt .desc { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.2rem; }

  /* ---- TOGGLE SWITCH ---- */
  .toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
  }

  .toggle-row span { font-size: 0.8rem; color: var(--text-dim); }

  .toggle {
    width: 40px; height: 22px;
    border-radius: 11px;
    background: var(--border);
    cursor: pointer;
    position: relative;
    transition: background 0.3s;
  }
  .toggle.on { background: var(--accent); }
  .toggle::after {
    content: '';
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
  }
  .toggle.on::after { transform: translateX(18px); }

  /* Scrollbar */
  .sidebar::-webkit-scrollbar { width: 4px; }
  .sidebar::-webkit-scrollbar-track { background: transparent; }
  .sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  /* ---- HERO SECTION (landing overlay) ---- */
  .hero-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
    transition: opacity 0.6s, transform 0.6s;
  }
  .hero-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
  }

  .hero-overlay h1 {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
    letter-spacing: 4px;
    color:  #fff;
    animation: shimmer 4s ease-in-out infinite;
    background-size: 200% 200%;
  }

  @keyframes shimmer {
    0%,100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
  }

  .hero-overlay p {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 500px;
    text-align: center;
    line-height: 1.6;
  }

  .hero-overlay .btn-start {
    margin-top: 1rem;
    padding: 1rem 3rem;
    font-size: 1rem;
    border-radius: 60px;
    background: linear-gradient(135deg, var(--accent), var(--accent3));
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 8px 40px rgba(164, 92, 231, 0.4);
    transition: all 0.3s;
  }
  .hero-overlay .btn-start:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 50px rgba(108,92,231,0.5);
  }

  .floating-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .floating-shapes div {
    position: absolute;
    border-radius: 50%;
    opacity: 0.07;
    animation: floatShape 20s ease-in-out infinite;
  }

  @keyframes floatShape {
    0%,100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(20px) rotate(240deg); }
  }

  .fs-1 { width: 300px; height: 300px; background: var(--accent); top: 10%; left: 10%; animation-delay: 0s; }
  .fs-2 { width: 200px; height: 200px; background: var(--accent3); top: 60%; right: 15%; animation-delay: -7s; }
  .fs-3 { width: 150px; height: 150px; background: var(--accent2); bottom: 20%; left: 30%; animation-delay: -13s; }