/* ── CSS Gradient Generator ── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[x-cloak] { display: none !important; }

:root {
  --accent:  #8b5cf6;
  --agrad:   linear-gradient(135deg,#8b5cf6,#6d28d9);
  --bg:      #09090f;
  --card:    #111119;
  --card2:   #16161f;
  --text:    #f1f5f9;
  --text2:   #94a3b8;
  --faint:   #64748b;
  --border:  #1c1c2a;
  --border2: #252535;
  --input:   #0d0d17;
}

body { background:var(--bg); color:var(--text); font-family:system-ui,-apple-system,sans-serif; line-height:1.6; min-height:100vh; }

/* ── HEADER ──────────────────────────────────── */
.site-header { position:sticky; top:0; z-index:100; background:rgba(9,9,15,.88); backdrop-filter:blur(12px); border-bottom:1px solid var(--border); }
.header-inner { max-width:1240px; margin:0 auto; padding:0 20px; display:flex; align-items:center; justify-content:space-between; height:56px; }
.logo { display:flex; align-items:center; gap:10px; text-decoration:none; }
.logo-icon { width:32px; height:32px; flex-shrink:0; }
.logo-text { font-size:.95rem; font-weight:800; background:var(--agrad); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.nav-links { display:flex; gap:24px; }
.nav-links a { color:var(--text2); text-decoration:none; font-size:.87rem; font-weight:500; transition:color .15s; }
.nav-links a:hover { color:var(--text); }

/* ── HERO ────────────────────────────────────── */
.hero { text-align:center; padding:52px 20px 36px; }
.hero-badge { display:inline-flex; align-items:center; gap:6px; background:rgba(139,92,246,.1); border:1px solid rgba(139,92,246,.25); color:#a78bfa; border-radius:999px; padding:4px 14px; font-size:.78rem; font-weight:600; margin-bottom:18px; }
.hero h1 { font-size:clamp(2rem,5vw,2.8rem); font-weight:900; letter-spacing:-.03em; margin-bottom:12px; }
.g { background:var(--agrad); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.hero p { color:var(--text2); font-size:1rem; max-width:540px; margin:0 auto; }

/* ── PAGE WRAP ───────────────────────────────── */
.page-wrap { max-width:1240px; margin:0 auto; padding:0 20px 80px; }

/* ── PRESET BAR ──────────────────────────────── */
.preset-bar { display:flex; gap:8px; overflow-x:auto; padding:4px 0 16px; scrollbar-width:none; }
.preset-bar::-webkit-scrollbar { display:none; }
.preset-chip {
  flex-shrink:0; display:flex; align-items:center; gap:10px;
  background:var(--card); border:1px solid var(--border2); border-radius:10px;
  padding:6px 12px 6px 6px; cursor:pointer; transition:border-color .15s,transform .12s;
}
.preset-chip:hover { border-color:var(--accent); transform:translateY(-1px); }
.preset-swatch { width:32px; height:28px; border-radius:6px; flex-shrink:0; }
.preset-label { font-size:.78rem; font-weight:700; color:var(--text2); white-space:nowrap; }

/* ── MAIN LAYOUT ─────────────────────────────── */
.gg-layout {
  display:grid;
  grid-template-columns:320px 1fr;
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  background:var(--border);
  gap:1px;
  margin-bottom:16px;
}

/* ── CONTROLS ────────────────────────────────── */
.gg-controls { background:var(--card); padding:22px 18px; display:flex; flex-direction:column; gap:20px; }

/* Type tabs */
.type-tabs { display:grid; grid-template-columns:1fr 1fr 1fr; gap:4px; background:var(--input); border-radius:10px; padding:4px; }
.type-tab { padding:8px 4px; border-radius:7px; font-size:.78rem; font-weight:700; border:none; background:transparent; color:var(--text2); cursor:pointer; transition:all .15s; }
.type-tab:hover { color:var(--text); }
.type-tab.active { background:var(--card2); color:var(--accent); box-shadow:0 1px 4px rgba(0,0,0,.3); }

/* Section headers */
.ctrl-head { font-size:.7rem; font-weight:800; color:var(--faint); text-transform:uppercase; letter-spacing:.08em; margin-bottom:10px; }
.ctrl-sep  { height:1px; background:var(--border); }

/* Sliders */
.ctrl-row  { display:flex; justify-content:space-between; align-items:center; font-size:.73rem; font-weight:700; color:var(--text2); text-transform:uppercase; letter-spacing:.07em; margin-bottom:8px; }
.ctrl-val  { color:var(--accent); font-weight:800; font-size:.8rem; font-variant-numeric:tabular-nums; }
input[type=range] { -webkit-appearance:none; appearance:none; width:100%; height:5px; background:var(--border2); border-radius:99px; outline:none; cursor:pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:16px; height:16px; border-radius:50%; background:var(--accent); border:2px solid var(--card); box-shadow:0 0 0 2px rgba(139,92,246,.25); }
input[type=range]::-moz-range-thumb { width:16px; height:16px; border-radius:50%; background:var(--accent); border:2px solid var(--card); }
input[type=range]:disabled { opacity:.3; cursor:not-allowed; }

/* Direction grid */
.dir-grid { display:grid; grid-template-columns:repeat(3,42px); grid-template-rows:repeat(3,42px); gap:4px; margin:0 auto 16px; width:fit-content; }
.dir-btn  { width:42px; height:42px; border-radius:8px; border:1px solid var(--border2); background:var(--input); color:var(--text2); font-size:1.1rem; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .15s; }
.dir-btn:hover  { border-color:var(--accent); color:var(--text); background:rgba(139,92,246,.08); }
.dir-btn.active { border-color:var(--accent); background:rgba(139,92,246,.15); color:var(--accent); }
.dir-center { width:42px; height:42px; border-radius:8px; background:rgba(139,92,246,.06); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:.72rem; font-weight:800; color:var(--accent); font-variant-numeric:tabular-nums; }

/* Seg buttons */
.seg-row { display:flex; gap:4px; margin-bottom:8px; flex-wrap:wrap; }
.seg-btn { flex:1; min-width:0; padding:6px 4px; border-radius:8px; font-size:.72rem; font-weight:700; border:1px solid var(--border2); background:var(--input); color:var(--text2); cursor:pointer; transition:all .15s; text-align:center; }
.seg-btn:hover  { border-color:var(--accent); color:var(--text); }
.seg-btn.active { border-color:var(--accent); background:rgba(139,92,246,.12); color:var(--accent); }

/* Position XY sliders */
.pos-xy { display:flex; flex-direction:column; gap:10px; }
.pos-row { display:flex; align-items:center; gap:10px; }
.pos-label { font-size:.72rem; font-weight:700; color:var(--faint); width:14px; flex-shrink:0; }

/* Color stops */
.gradient-bar { height:36px; border-radius:8px; border:1px solid var(--border2); margin-bottom:14px; transition:background .15s; }

.stop-list { display:flex; flex-direction:column; gap:8px; }
.stop-row  { display:flex; align-items:center; gap:8px; }
.stop-color-wrap { position:relative; flex-shrink:0; }
.stop-color-input { width:32px; height:32px; border:2px solid var(--border2); border-radius:8px; background:none; padding:2px; cursor:pointer; display:block; }
.stop-color-input::-webkit-color-swatch-wrapper { padding:0; border-radius:4px; }
.stop-color-input::-webkit-color-swatch { border:none; border-radius:4px; }
.stop-hex { font-size:.72rem; font-family:monospace; color:var(--text2); width:58px; flex-shrink:0; }
.stop-pos-slider { flex:1; min-width:0; }
.stop-pos-val { font-size:.72rem; font-weight:700; color:var(--faint); width:30px; text-align:right; flex-shrink:0; font-variant-numeric:tabular-nums; }
.stop-remove { width:22px; height:22px; border-radius:50%; border:1px solid var(--border2); background:transparent; color:var(--faint); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:.85rem; flex-shrink:0; transition:all .15s; }
.stop-remove:hover:not(:disabled) { border-color:#f43f5e; color:#f43f5e; background:rgba(244,63,94,.08); }
.stop-remove:disabled { opacity:.3; cursor:not-allowed; }

.add-stop-btn { display:flex; align-items:center; justify-content:center; gap:6px; width:100%; padding:8px; border-radius:8px; border:1px dashed var(--border2); background:transparent; color:var(--faint); font-size:.8rem; font-weight:700; cursor:pointer; transition:all .15s; margin-top:8px; }
.add-stop-btn:hover:not(:disabled) { border-color:var(--accent); color:var(--accent); background:rgba(139,92,246,.05); }
.add-stop-btn:disabled { opacity:.3; cursor:not-allowed; }

/* ── PREVIEW ─────────────────────────────────── */
.gg-preview { background:var(--card2); display:flex; align-items:center; justify-content:center; min-height:500px; padding:32px; }
.preview-scene { width:100%; height:100%; min-height:440px; border-radius:14px; border:1px solid rgba(255,255,255,.06); transition:background .15s; }

/* ── CODE OUTPUT ─────────────────────────────── */
.gg-code-wrap { background:var(--card); border:1px solid var(--border); border-radius:14px; overflow:hidden; margin-bottom:40px; }
.gg-code-head { display:flex; align-items:center; justify-content:space-between; padding:12px 18px; border-bottom:1px solid var(--border); }
.gg-code-title { font-size:.8rem; font-weight:700; color:var(--text2); display:flex; align-items:center; gap:6px; }
.gg-code-title svg { width:14px; height:14px; }
.copy-btn { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:8px; font-size:.8rem; font-weight:700; border:1px solid var(--border2); background:var(--input); color:var(--text2); cursor:pointer; transition:all .15s; }
.copy-btn:hover { border-color:var(--accent); color:var(--text); }
.copy-btn.done { border-color:#4ade80; color:#4ade80; background:rgba(74,222,128,.08); }
.copy-btn svg { width:13px; height:13px; }
.gg-code-body { padding:20px 22px; }
.gg-code-body pre { font-family:'Fira Code','Cascadia Code',Consolas,monospace; font-size:.84rem; line-height:1.8; color:var(--text2); white-space:pre; overflow-x:auto; }

/* ── INFO SECTIONS ───────────────────────────── */
.info-sections { display:flex; flex-direction:column; gap:20px; margin-bottom:48px; }
.info-section { background:var(--card); border:1px solid var(--border); border-radius:16px; padding:32px 36px; }
.info-icon-row { display:flex; align-items:center; gap:14px; margin-bottom:14px; }
.info-icon { width:40px; height:40px; border-radius:10px; background:rgba(139,92,246,.1); border:1px solid rgba(139,92,246,.2); display:flex; align-items:center; justify-content:center; flex-shrink:0; color:var(--accent); }
.info-icon svg { width:18px; height:18px; }
.info-section h2 { font-size:1.1rem; font-weight:800; }
.info-body { color:var(--text2); font-size:.9rem; line-height:1.8; }
.info-body p + p { margin-top:10px; }
.info-body ul { padding-left:20px; display:flex; flex-direction:column; gap:6px; }
.info-body strong { color:var(--text); font-weight:700; }
.info-body code { font-family:monospace; font-size:.83em; background:var(--border); padding:1px 5px; border-radius:4px; color:var(--accent); }

/* ── RELATED / BLOG ──────────────────────────── */
.related-section { margin-bottom:48px; }
.related-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.related-header h2 { font-size:1.15rem; font-weight:800; }
.view-all-link { display:inline-flex; align-items:center; gap:4px; font-size:.82rem; font-weight:600; color:var(--accent); text-decoration:none; }
.view-all-link svg { width:14px; height:14px; }
.related-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; }
.related-tool-card { display:flex; flex-direction:column; gap:10px; background:var(--card); border:1px solid var(--border); border-radius:14px; padding:18px; text-decoration:none; color:inherit; transition:border-color .15s,transform .15s; }
.related-tool-card:hover { border-color:var(--accent); transform:translateY(-2px); }
.rt-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; }
.rt-icon svg { width:20px; height:20px; color:#fff; }
.rt-name { font-size:.9rem; font-weight:700; }
.rt-desc { font-size:.78rem; color:var(--text2); line-height:1.5; flex:1; }
.rt-link { display:inline-flex; align-items:center; gap:3px; font-size:.76rem; font-weight:700; color:var(--accent); }
.rt-link svg { width:12px; height:12px; }
.blog-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:14px; }
.blog-card { display:flex; flex-direction:column; gap:8px; background:var(--card); border:1px solid var(--border); border-radius:14px; padding:20px; text-decoration:none; color:inherit; transition:border-color .15s; }
.blog-card:hover { border-color:var(--accent); }
.blog-cat { display:inline-block; padding:2px 10px; border-radius:999px; font-size:.71rem; font-weight:700; }
.blog-title { font-size:.92rem; font-weight:700; line-height:1.35; }
.blog-excerpt { font-size:.8rem; color:var(--text2); line-height:1.55; flex:1; }
.blog-meta { font-size:.72rem; color:var(--faint); }
.blog-read { display:inline-flex; align-items:center; gap:3px; font-size:.76rem; font-weight:700; color:var(--accent); margin-top:auto; }
.blog-read svg { width:12px; height:12px; }

/* ── FOOTER ──────────────────────────────────── */
.site-footer { background:var(--card); border-top:1px solid var(--border); padding:48px 20px 0; }
.footer-inner { max-width:1240px; margin:0 auto; display:grid; grid-template-columns:1fr auto; gap:40px; padding-bottom:40px; }
.footer-brand { max-width:280px; }
.footer-tagline { font-size:.82rem; color:var(--text2); margin-top:10px; line-height:1.55; }
.footer-nav-wrap { display:flex; gap:48px; }
.footer-col { display:flex; flex-direction:column; gap:8px; }
.footer-col h4 { font-size:.78rem; font-weight:700; color:var(--text2); text-transform:uppercase; letter-spacing:.07em; margin-bottom:12px; }
.footer-col a { font-size:.84rem; color:var(--faint); text-decoration:none; transition:color .15s; }
.footer-col a:hover { color:var(--text); }
.footer-bottom { border-top:1px solid var(--border); padding:16px 0; }
.footer-bottom .inner { max-width:1240px; margin:0 auto; padding:0 20px; display:flex; justify-content:space-between; align-items:center; }
.footer-bottom p { font-size:.78rem; color:var(--faint); }
