:root {
  --indigo: #6366f1;
  --indigo-dark: #4f46e5;
  --indigo-light: #a5b4fc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(79, 70, 229, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1160px, 92vw); margin: 0 auto; }

.muted { color: var(--muted); font-size: 0.85rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--indigo); color: #fff; box-shadow: 0 8px 20px rgba(99,102,241,.35); }
.btn-primary:hover { background: var(--indigo-dark); }
.btn-primary:disabled { background: #c7cbf5; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--indigo); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--indigo-light); background: #f5f6ff; }
.btn-ghost:disabled { color: #cbd5e1; cursor: not-allowed; }

.mini {
  padding: 6px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
  transition: all .15s ease;
}
.mini:hover:not(:disabled) { border-color: var(--indigo); color: var(--indigo); }
.mini:disabled { color: #cbd5e1; cursor: not-allowed; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; }
.brand-text { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-text strong { color: var(--indigo); }
.brand-tld { color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.topnav a:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 500px at 80% -10%, #e0e7ff 0%, transparent 60%),
              radial-gradient(900px 400px at 0% 0%, #ede9fe 0%, transparent 55%);
  padding: 70px 0 90px;
}
.hero-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: #eef2ff; color: var(--indigo-dark); font-size: 0.82rem; font-weight: 600;
  border: 1px solid #e0e7ff;
}
.hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); line-height: 1.12; margin: 18px 0 14px; letter-spacing: -0.03em; }
.grad { background: linear-gradient(120deg, var(--indigo), #8b5cf6 60%, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.06rem; max-width: 520px; }
.hero-cta { display: flex; gap: 14px; margin: 26px 0 18px; flex-wrap: wrap; }
.trust { list-style: none; display: flex; gap: 22px; padding: 0; margin: 0; color: var(--muted); font-size: 0.9rem; font-weight: 500; }

/* hero visual */
.hero-visual { display: grid; place-items: center; }
.mock-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  background: #fff; padding: 14px; border-radius: 22px; box-shadow: var(--shadow-lg);
  transform: rotate(-3deg);
}
.mock-grid span { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 1; box-shadow: 0 4px 12px rgba(15,23,42,.08); animation: float 4s ease-in-out infinite; animation-delay: calc(var(--d) * .25s); }
.mock-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---------- Sections ---------- */
.section-title { text-align: center; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.02em; margin: 0 0 8px; }
.section-sub { text-align: center; color: var(--muted); margin: 0 0 34px; }

.tool { padding: 70px 0; }
.tool-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 26px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }

/* dropzone */
.dropzone {
  border: 2px dashed var(--indigo-light); border-radius: 14px; padding: 34px 18px;
  text-align: center; cursor: pointer; background: #fafaff; transition: all .18s ease;
}
.dropzone.drag { border-color: var(--indigo); background: #eef2ff; transform: scale(1.01); }
.dz-icon { font-size: 2rem; }
.dz-title { font-weight: 600; margin: 8px 0 4px; }
.dz-title .link { color: var(--indigo); }
.dz-hint { color: var(--muted); font-size: 0.82rem; margin: 0; }

.list-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; font-weight: 600; font-size: 0.92rem; }
.list-actions { display: flex; gap: 8px; }
.thumb-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.thumb-list li { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); cursor: grab; background: #f1f5f9; }
.thumb-list li.dragging { opacity: .4; }
.thumb-list img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb-list .rm { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(15,23,42,.7); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.thumb-list .idx { position: absolute; bottom: 3px; left: 3px; background: rgba(99,102,241,.9); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.tip { color: var(--muted); font-size: 0.8rem; margin: 14px 0 0; }

/* controls */
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-bottom: 20px; }
.ctrl { display: flex; flex-direction: column; gap: 7px; }
.ctrl label { font-size: 0.85rem; font-weight: 600; display: flex; justify-content: space-between; }
.ctrl output { color: var(--indigo); font-weight: 700; }
.ctrl input[type="range"] { width: 100%; accent-color: var(--indigo); }
.ctrl select { padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 0.88rem; color: var(--ink); }
.bg-row { display: flex; align-items: center; gap: 8px; }
.bg-row input[type="color"] { width: 40px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }

/* preview */
.preview-wrap { border-top: 1px solid var(--line); padding-top: 18px; }
.preview-label { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 0.9rem; margin-bottom: 10px; }
.canvas-stage { background: repeating-conic-gradient(#eef1f6 0% 25%, #fff 0% 50%) 50% / 22px 22px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-height: 220px; display: grid; place-items: center; overflow: auto; }
#gridCanvas { max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 6px 18px rgba(15,23,42,.12); display: none; }
.empty-hint { color: var(--muted); font-size: 0.9rem; padding: 30px; text-align: center; }

.export-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.export-actions .btn { flex: 1; min-width: 160px; }

/* ---------- Features ---------- */
.features { padding: 70px 0; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.fcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: transform .18s ease, box-shadow .18s ease; }
.fcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.fico { font-size: 1.8rem; }
.fcard h3 { margin: 12px 0 6px; font-size: 1.1rem; }
.fcard p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- How ---------- */
.how { padding: 70px 0; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps .num { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--indigo); color: #fff; font-weight: 800; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(99,102,241,.4); }
.steps h4 { margin: 6px 0 4px; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- FAQ ---------- */
.faq { padding: 70px 0; background: #fff; border-top: 1px solid var(--line); }
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; background: var(--card); }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--indigo); font-size: 1.2rem; line-height: 1.3; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--muted); font-size: 0.92rem; }

/* ---------- Footer ---------- */
.footer { padding: 40px 0; background: var(--ink); color: #cbd5e1; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer .brand-text { color: #fff; }
.footer .brand-text .brand-tld { color: var(--indigo-light); }
.footer .copyright { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .tool-grid { grid-template-columns: 1fr; }
  .feature-cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .topnav a:not(.btn) { display: none; }
}
@media (max-width: 560px) {
  .feature-cards { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr; }
  .trust { flex-wrap: wrap; gap: 12px; }
  .hero { padding: 40px 0 60px; }
}
