:root {
  --primary: #6C5CE7;
  --primary-dark: #5849c2;
  --accent: #00CEC9;
  --ink: #1a1a2e;
  --ink-soft: #4a4a68;
  --muted: #6b6b85;
  --bg: #ffffff;
  --bg-soft: #f7f7fb;
  --border: #e6e6f0;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(26, 26, 46, 0.08);
  --gradient: linear-gradient(135deg, var(--primary), var(--accent));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { line-height: 1.2; margin: 0; }

a { color: inherit; text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 20px rgba(108,92,231,0.35); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(108,92,231,0.45); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-outline { background: #fff; color: var(--ink); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-small { padding: 9px 18px; font-size: 14px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
}
.logo b { color: var(--primary); font-weight: 800; }
.main-nav {
  display: flex;
  gap: 32px;
}
.main-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}
.main-nav a:hover { color: var(--primary); }
.main-nav a.nav-tool.active {
  color: var(--primary);
  font-weight: 700;
  position: relative;
}
.main-nav a.nav-tool.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
}

/* Hero */
.hero {
  padding: 72px 0 40px;
  background: radial-gradient(circle at 80% 0%, rgba(108,92,231,0.08), transparent 55%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(108,92,231,0.1);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}
.hero-copy h1 {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.hero-copy p {
  font-size: 18px;
  color: var(--muted);
  max-width: 480px;
  margin-bottom: 28px;
}
.hero-cta { display: flex; gap: 14px; margin-bottom: 40px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 20px; font-weight: 800; color: var(--ink); }
.hero-stats span { font-size: 13px; color: var(--muted); }

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}
.hero-qr-frame {
  width: 260px;
  height: 260px;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-qr-frame svg, .hero-qr-frame canvas { width: 100% !important; height: 100% !important; }
.floating-card {
  position: absolute;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: float 5s ease-in-out infinite;
}
.card-1 { top: 6%; left: 0%; animation-delay: 0s; }
.card-2 { bottom: 12%; left: -4%; animation-delay: 1.2s; }
.card-3 { top: 40%; right: -6%; animation-delay: 2.4s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Section heading */
.section-heading {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 44px;
}
.section-heading h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.section-heading p { color: var(--muted); font-size: 16px; margin: 0; }

/* Generator */
.generator-section { padding: 80px 0; background: var(--bg-soft); }
.generator {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: start;
}
.generator-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.type-tab {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.type-tab:hover { border-color: var(--primary); color: var(--primary); }
.type-tab.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

.type-form { display: none; flex-direction: column; gap: 4px; }
.type-form.active { display: flex; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 12px 0 6px;
}
label:first-child { margin-top: 0; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox-label input { width: auto; margin: 0; }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease;
  resize: vertical;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.customize-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.customize-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.customize-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.field label { margin: 0 0 6px; display: block; }
input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 4px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  background: #fff;
}
.logo-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
input[type="file"] {
  font-size: 13px;
  flex: 1;
  min-width: 180px;
}

.generator-preview { position: sticky; top: 96px; }
.preview-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.qr-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  margin-bottom: 16px;
}
.qr-canvas svg, .qr-canvas canvas { max-width: 100%; height: auto; }
.preview-hint { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.download-buttons { display: flex; flex-direction: column; gap: 10px; }
.download-buttons .btn { width: 100%; }

/* JSON Parser */
.json-section { padding: 80px 0; background: var(--bg-soft); min-height: 70vh; }
.json-tool {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.json-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.json-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 15px;
}
.json-actions { display: flex; gap: 8px; }
.json-textarea {
  width: 100%;
  min-height: 380px;
  padding: 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  color: var(--ink);
}
.json-textarea:focus { outline: none; border-color: var(--primary); }
.json-output {
  background: var(--bg-soft);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.json-status {
  font-size: 13.5px;
  font-weight: 600;
  padding: 0;
  margin-bottom: 10px;
  min-height: 18px;
}
.json-status.success { color: #1a9c6c; }
.json-status.error { color: #d64545; }
.json-status.info { color: #b5760a; }

.diff-line { padding: 0 2px; white-space: pre-wrap; }
.diff-line-added { background: #d4f7dc; color: #1a7a3d; }
.diff-line-removed { background: #fde2e2; color: #c62828; }

/* Text Compare */
.diff-section { padding: 80px 0; background: var(--bg-soft); min-height: 70vh; }
.diff-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px 0;
}
.diff-legend { display: flex; gap: 18px; font-size: 13.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.legend-added { background: #d4f7dc; border: 1px solid #1a7a3d55; }
.legend-removed { background: #fde2e2; border: 1px solid #c6282855; }
.diff-output {
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 140px;
  color: var(--muted);
}
.diff-output ins {
  background: #d4f7dc;
  color: #1a7a3d;
  text-decoration: none;
  border-radius: 3px;
  padding: 1px 2px;
}
.diff-output del {
  background: #fde2e2;
  color: #c62828;
  text-decoration: line-through;
  border-radius: 3px;
  padding: 1px 2px;
}

/* Features */
.features-section { padding: 90px 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.feature-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.feature-icon { font-size: 28px; margin-bottom: 14px; }
.feature-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 14.5px; color: var(--muted); margin: 0; }

/* How it works */
.how-section { padding: 90px 0; background: var(--bg-soft); }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-weight: 800;
  margin-bottom: 16px;
}
.step-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.step-card p { font-size: 14.5px; color: var(--muted); margin: 0; }

/* FAQ */
.faq-section { padding: 90px 0; }
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
details summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: '+';
  font-size: 20px;
  color: var(--primary);
  margin-left: 12px;
}
details[open] summary::after { content: '–'; }
details p { color: var(--muted); margin: 12px 0 0; font-size: 14.5px; }

/* Footer */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-inner p { color: var(--muted); font-size: 13.5px; margin: 0; }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { min-height: 280px; order: -1; }
  .generator { grid-template-columns: 1fr; }
  .generator-preview { position: static; }
  .json-tool { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .main-nav { display: none; }
  .hero-copy h1 { font-size: 32px; }
  .features-grid { grid-template-columns: 1fr; }
  .customize-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
