@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root{
  --bg:#FAFAFB;
  --surface:#FFFFFF;
  --surface-raised:#F4F5F7;
  --border:#E7E9EE;
  --border-light:#D8DCE4;
  --text:#14161C;
  --text-dim:#5B6472;
  --text-faint:#8B93A3;
  --cyan:#0D9488;
  --magenta:#DB2777;
  --yellow:#D97706;
  --font-display:'Space Grotesk','Inter',system-ui,sans-serif;
  --font-body:'Inter',system-ui,-apple-system,sans-serif;
  --font-mono:'JetBrains Mono','Courier New',monospace;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
html,body{margin:0;padding:0;}
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
}
.wrap{ max-width:1180px; margin:0 auto; padding:0 24px; }
button{ font-family:inherit; cursor:pointer; }
a{ text-decoration:none; color:inherit; }
input[type="file"]{ display:none; }
img{ max-width:100%; }

/* ================= Header ================= */
.site-header{
  position:sticky; top:0; z-index:40;
  border-bottom:1px solid var(--border);
  background:rgba(250,250,251,0.88);
  backdrop-filter:blur(10px);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0;
}
.brand{ display:flex; align-items:center; gap:10px; }
.logo{ width:24px; height:24px; display:grid; grid-template-columns:1fr 1fr; gap:2.5px; flex-shrink:0; }
.logo.small{ width:18px; height:18px; }
.logo span{ border-radius:3px; }
.brand-name{ font-family:var(--font-display); font-weight:600; font-size:19px; letter-spacing:-0.02em; }
.brand-name.small{ color:var(--text-dim); font-size:14px; }

.main-nav{ display:none; align-items:center; gap:28px; }
.main-nav a{ font-size:14px; font-weight:500; color:var(--text-dim); transition:color .15s; }
.main-nav a:hover{ color:var(--text); }
.nav-cta{
  display:none; align-items:center; gap:8px;
  background:var(--surface-raised); border:1px solid var(--border-light);
  color:var(--text) !important; font-size:13px; font-weight:600;
  padding:9px 16px; border-radius:9px;
}
.menu-btn{ background:none; border:none; color:var(--text); padding:4px; }

@media (min-width:860px){
  .main-nav{ display:flex; }
  .nav-cta{ display:flex; }
  .menu-btn{ display:none; }
}

/* mobile drawer */
.mobile-nav{
  display:none; flex-direction:column; gap:2px;
  border-top:1px solid var(--border);
  padding:12px 0 16px;
}
.mobile-nav.open{ display:flex; }
.mobile-nav a{
  padding:11px 4px; font-size:14px; font-weight:500; color:var(--text-dim);
  border-bottom:1px solid var(--border);
}

/* ================= Pill sub-nav ================= */
.pill-nav-wrap{ border-bottom:1px solid var(--border); background:var(--bg); }
.pill-nav{
  display:flex; gap:8px; overflow-x:auto; padding:14px 0;
  scrollbar-width:none;
}
.pill-nav::-webkit-scrollbar{ display:none; }
.pill{
  flex-shrink:0; display:flex; align-items:center; gap:7px;
  padding:8px 14px; border-radius:999px; border:1px solid var(--border);
  color:var(--text-dim); font-size:13px; font-weight:500; background:var(--surface);
  transition:all .15s;
}
.pill:hover{ border-color:var(--border-light); color:var(--text); }
.pill.active{ color:#FFFFFF; border-color:transparent; }
.pill-dot{ width:6px; height:6px; border-radius:99px; flex-shrink:0; }

/* ================= Hero ================= */
.hero{ position:relative; padding:64px 0 40px; text-align:center; overflow:hidden; }
.hero-glow{
  position:absolute; inset:-40% -10% auto -10%; height:420px;
  background:radial-gradient(closest-side, var(--glow-color, var(--cyan)) 0%, transparent 72%);
  opacity:.12; filter:blur(30px); pointer-events:none; z-index:0;
}
.hero-inner{ position:relative; z-index:1; max-width:680px; margin:0 auto; }
.hero-icon{
  width:56px; height:56px; border-radius:16px; margin:0 auto 22px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border-light);
}
.hero h1{
  font-family:var(--font-display); font-size:clamp(28px,4.5vw,42px); font-weight:700;
  letter-spacing:-0.03em; line-height:1.15; margin:0 0 14px;
}
.hero p.lead{ color:var(--text-dim); font-size:16px; line-height:1.6; margin:0 0 24px; }
.badge-row{ display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.badge{
  display:flex; align-items:center; gap:6px;
  background:var(--surface); border:1px solid var(--border);
  color:var(--text-dim); font-size:12.5px; font-weight:500;
  padding:6px 12px; border-radius:999px;
}
.badge svg{ flex-shrink:0; }

/* homepage hero specifics */
.hero.home{ padding:80px 0 48px; }
.hero.home h1{ font-size:clamp(32px,5.5vw,52px); }
.hero-ctas{ display:flex; flex-wrap:wrap; justify-content:center; gap:12px; margin-top:28px; }
.btn-cta{
  display:inline-flex; align-items:center; gap:8px;
  font-size:14.5px; font-weight:600; padding:12px 22px; border-radius:10px;
}
.btn-cta.primary{ background:var(--text); color:#FFFFFF; }
.btn-cta.ghost{ border:1px solid var(--border-light); color:var(--text); }

/* ================= Ad slot ================= */
.ad-slot{
  border:1px dashed var(--border-light); border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  color:var(--text-faint); font-size:11px; letter-spacing:.08em; text-transform:uppercase;
  background:var(--surface); margin:32px auto; font-family:var(--font-mono);
}
.ad-slot.leaderboard{ max-width:728px; min-height:90px; }
.ad-slot.rectangle{ max-width:336px; min-height:280px; }
.ad-slot.inline{ max-width:100%; min-height:100px; }

/* ================= Section wrapper ================= */
.section{ padding:8px 0 56px; }
.section-head{ text-align:center; max-width:560px; margin:0 auto 36px; }
.section-head h2{ font-family:var(--font-display); font-size:26px; font-weight:700; letter-spacing:-0.02em; margin:0 0 10px; }
.section-head p{ color:var(--text-dim); font-size:14.5px; margin:0; }

/* ================= Tool card ================= */
.tool-section{ padding:8px 0 8px; }
.card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:20px; padding:24px; max-width:760px; margin:0 auto;
  box-shadow:0 1px 2px rgba(16,24,40,0.04), 0 20px 45px -18px rgba(16,24,40,0.18);
}
@media (min-width:640px){ .card{ padding:32px; } }
.tool-panel{ display:flex; flex-direction:column; gap:16px; }

/* ================= Dropzone ================= */
.dropzone{
  border:1.5px dashed var(--border-light);
  background:var(--surface-raised);
  border-radius:14px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px;
  padding:52px 24px; text-align:center; cursor:pointer;
  transition:all .15s ease;
}
.dropzone.dragover{ border-color:var(--cyan); background:rgba(13,148,136,0.07); }
.dz-icon{
  width:48px; height:48px; border-radius:99px;
  display:flex; align-items:center; justify-content:center;
}
.dz-label{ font-size:14.5px; font-weight:600; margin:0; }
.dz-note{ font-size:12px; color:var(--text-faint); margin:0; }

/* ================= Preview bar ================= */
.preview-bar{
  background:var(--surface-raised); border:1px solid var(--border);
  border-radius:12px; padding:12px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.preview-bar-left{ display:flex; align-items:center; gap:12px; min-width:0; }
.preview-bar img{ width:40px; height:40px; object-fit:cover; border-radius:8px; border:1px solid var(--border-light); flex-shrink:0; }
.preview-bar-name{ font-size:14px; font-weight:500; margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.preview-bar-meta{ font-family:var(--font-mono); font-size:12px; color:var(--text-faint); margin:0; }
.change-btn{
  display:flex; align-items:center; gap:4px; background:none; border:none;
  color:var(--text-dim); font-size:12px; padding:6px 10px; border-radius:8px; flex-shrink:0;
}
.change-btn:hover{ background:rgba(255,255,255,0.05); }

/* ================= Controls ================= */
.controls-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.chip{
  background:var(--surface-raised); color:var(--text-dim); border:1px solid var(--border);
  font-family:var(--font-mono); font-size:14px; padding:8px 16px; border-radius:9px;
}
.chip-outline{
  display:flex; align-items:center; gap:6px;
  background:var(--surface-raised); border:1px solid var(--border); color:var(--text);
  font-size:14px; padding:8px 12px; border-radius:9px;
}
.btn-primary{
  display:flex; align-items:center; justify-content:center; gap:8px;
  font-size:14px; font-weight:600; padding:11px 18px; border-radius:9px; border:none;
  color:#FFFFFF; transition:transform .1s ease;
}
.btn-primary:active{ transform:scale(0.98); }
.btn-primary:disabled{ opacity:.5; cursor:not-allowed; }
.btn-primary.ch0{ background:var(--cyan); }
.btn-primary.ch1{ background:var(--magenta); }
.btn-primary.ch2{ background:var(--yellow); }

.slider-row{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.slider-row label{ color:var(--text-dim); font-size:14px; }
input[type="range"]{ width:100%; accent-color:var(--magenta); }

/* ================= Result blocks ================= */
.result-img{ width:100%; border-radius:12px; border:1px solid var(--border); display:block; }
.compare-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.compare-label{ font-family:var(--font-mono); font-size:12px; margin:0 0 6px 0; color:var(--text-faint); }
.stat-grid{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; text-align:center; }
.stat-box{ background:var(--surface-raised); border:1px solid var(--border); border-radius:12px; padding:12px; }
.stat-box p:first-child{ font-family:var(--font-mono); font-size:10px; color:var(--text-faint); margin:0; }
.stat-box p:last-child{ font-family:var(--font-mono); font-size:14px; font-weight:500; margin:2px 0 0 0; }
.center-frame{
  display:flex; justify-content:center; padding:16px;
  background:var(--surface-raised); border:1px solid var(--border); border-radius:14px;
}
.center-frame img{ max-height:280px; border-radius:10px; }
.note-box{
  border-radius:12px; padding:14px 16px; display:flex; align-items:flex-start; gap:12px;
}
.note-box p:first-child{ font-size:14px; font-weight:600; margin:0; }
.note-box p:last-child{ font-size:12.5px; color:var(--text-dim); margin:4px 0 0 0; line-height:1.5; }

/* ================= Base64 ================= */
.mode-toggle{ display:flex; gap:8px; }
.mode-btn{
  background:var(--surface-raised); border:1px solid var(--border); color:var(--text-dim);
  font-size:13.5px; font-weight:500; padding:9px 16px; border-radius:9px;
}
.mode-btn.active{ background:var(--yellow); color:#FFFFFF; border-color:var(--yellow); }
.textarea{
  width:100%; height:128px; resize:none; border-radius:12px; padding:12px;
  background:var(--surface-raised); color:var(--text); border:1px solid var(--border);
  font-family:var(--font-mono); font-size:12px;
}
.b64-wrap{ position:relative; margin-top:12px; }
.b64-wrap textarea{ color:var(--text-dim); }
.copy-btn{
  position:absolute; top:8px; right:8px;
  display:flex; align-items:center; gap:6px;
  background:var(--surface); color:var(--text);
  font-size:12px; padding:6px 10px; border:1px solid var(--border-light); border-radius:7px;
}
.copy-btn.copied{ background:var(--yellow); color:#FFFFFF; }
.error-text{ color:#F87171; font-size:14px; }

/* ================= Color picker ================= */
.canvas-wrap{
  background:var(--surface-raised); border:1px solid var(--border); border-radius:14px;
  padding:12px; display:flex; justify-content:center;
}
#canvas-colorpicker{ max-width:100%; border-radius:10px; cursor:crosshair; }
.picked-row{ display:flex; align-items:center; gap:16px; }
.swatch-big{ width:64px; height:64px; border-radius:14px; border:1px solid var(--border-light); flex-shrink:0; }
.picked-values{ display:flex; flex-direction:column; gap:8px; }
.picked-values button{
  display:flex; align-items:center; gap:8px; background:none; border:none;
  font-family:var(--font-mono); font-size:14px; color:var(--text); padding:0;
}
.swatch-row{ display:flex; flex-wrap:wrap; gap:8px; }
.swatch{ width:32px; height:32px; border-radius:8px; border:1px solid var(--border-light); }
.swatch-label{ font-family:var(--font-mono); font-size:12px; color:var(--text-faint); margin:0 0 8px 0; }

/* ================= How it works ================= */
.steps{ display:grid; grid-template-columns:1fr; gap:20px; max-width:760px; margin:0 auto; }
@media (min-width:720px){ .steps{ grid-template-columns:repeat(3,1fr); } }
.step{ text-align:center; padding:0 8px; }
.step-num{
  width:36px; height:36px; border-radius:99px; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-mono); font-weight:600; font-size:14px; color:#FFFFFF; margin:0 auto 14px;
}
.step h3{ font-size:15px; font-weight:600; margin:0 0 6px; }
.step p{ font-size:13.5px; color:var(--text-dim); margin:0; line-height:1.55; }

/* ================= FAQ ================= */
.faq-list{ max-width:700px; margin:0 auto; display:flex; flex-direction:column; gap:1px; background:var(--border); border-radius:14px; overflow:hidden; border:1px solid var(--border); }
.faq-item{ background:var(--surface); padding:18px 20px; }
.faq-item h3{ font-size:14.5px; font-weight:600; margin:0 0 8px; }
.faq-item p{ font-size:13.5px; color:var(--text-dim); margin:0; line-height:1.6; }

/* ================= Tools grid (homepage + related) ================= */
.tools-grid{ display:grid; grid-template-columns:1fr; gap:14px; max-width:900px; margin:0 auto; }
@media (min-width:640px){ .tools-grid{ grid-template-columns:1fr 1fr; } }
@media (min-width:900px){ .tools-grid{ grid-template-columns:1fr 1fr 1fr; } }
.tool-card-link{
  display:flex; flex-direction:column; gap:12px;
  background:var(--surface); border:1px solid var(--border); border-radius:16px;
  padding:20px; transition:all .15s ease;
}
.tool-card-link:hover{ border-color:var(--border-light); transform:translateY(-2px); }
.tool-card-icon{
  width:42px; height:42px; border-radius:11px; display:flex; align-items:center; justify-content:center;
}
.tool-card-link h3{ font-size:15px; font-weight:600; margin:0; }
.tool-card-link p{ font-size:13px; color:var(--text-dim); margin:0; line-height:1.5; flex:1; }
.tool-card-arrow{ display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; }

/* ================= Features (homepage) ================= */
.features{ display:grid; grid-template-columns:1fr; gap:20px; max-width:900px; margin:0 auto; }
@media (min-width:720px){ .features{ grid-template-columns:repeat(3,1fr); } }
.feature{ text-align:center; padding:8px; }
.feature-icon{ width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; margin:0 auto 14px; background:var(--surface); border:1px solid var(--border); }
.feature h3{ font-size:15px; font-weight:600; margin:0 0 6px; }
.feature p{ font-size:13.5px; color:var(--text-dim); margin:0; line-height:1.55; }

/* ================= Footer ================= */
.site-footer{ border-top:1px solid var(--border); margin-top:40px; }
.footer-grid{
  display:grid; grid-template-columns:1fr; gap:32px;
  padding:48px 0 32px;
}
@media (min-width:720px){ .footer-grid{ grid-template-columns:1.4fr 1fr 1fr; } }
.footer-about p{ color:var(--text-dim); font-size:13.5px; line-height:1.6; margin:14px 0 0; max-width:280px; }
.footer-col h4{ font-size:12.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-faint); margin:0 0 14px; }
.footer-col ul{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:10px; }
.footer-col a{ font-size:13.5px; color:var(--text-dim); }
.footer-col a:hover{ color:var(--text); }
.footer-bottom{
  border-top:1px solid var(--border); padding:20px 0; display:flex; flex-wrap:wrap;
  align-items:center; justify-content:space-between; gap:12px;
}
.contact-link{ display:flex; align-items:center; gap:8px; color:var(--text-dim); font-size:13.5px; }
.contact-link:hover{ color:var(--text); }
.footer-note{ color:var(--text-faint); font-size:12.5px; }

.mono{ font-family:var(--font-mono); }
.ch0-bg{ background:rgba(13,148,136,0.10); color:var(--cyan); }
.ch1-bg{ background:rgba(219,39,119,0.10); color:var(--magenta); }
.ch2-bg{ background:rgba(217,119,6,0.10); color:var(--yellow); }
