:root {
  --bg: #050b1a;
  --bg-soft: #0a1330;
  --text: #eaf1ff;
  --text-dim: #9fb2d8;
  --border: rgba(120, 160, 255, 0.16);
  --glass: rgba(18, 30, 66, 0.55);
  --glass-strong: rgba(22, 36, 80, 0.7);
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --accent-soft: rgba(59, 130, 246, 0.18);
  --ok: #34d399;
  --warn: #fbbf24;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(2, 8, 28, 0.55);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
}

html[data-theme="light"] {
  --bg: #eef4ff;
  --bg-soft: #dfe9ff;
  --text: #0c1c3d;
  --text-dim: #4a5d82;
  --border: rgba(30, 80, 200, 0.16);
  --glass: rgba(255, 255, 255, 0.65);
  --glass-strong: rgba(255, 255, 255, 0.85);
  --accent-soft: rgba(59, 130, 246, 0.12);
  --shadow: 0 20px 50px rgba(30, 60, 140, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

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

/* ---------- Background blobs ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: float 16s ease-in-out infinite;
}
.blob-a { width: 420px; height: 420px; background: #1d4ed8; top: -120px; left: -80px; }
.blob-b { width: 380px; height: 380px; background: #0891b2; top: 20%; right: -120px; animation-delay: -5s; }
.blob-c { width: 340px; height: 340px; background: #4f46e5; bottom: -120px; left: 30%; animation-delay: -10s; }
html[data-theme="light"] .blob { opacity: 0.35; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.12); }
}

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 14px;
  z-index: 50;
  margin: 14px auto 0;
  width: min(1120px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.brand-name b { color: var(--accent-2); }
.brand-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.45);
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--text-dim);
  transition: 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
}

/* ---------- Hero ---------- */
.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 70px 20px 40px;
  text-align: center;
}
.pill {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-dim);
}
.hero-title {
  font-size: clamp(32px, 6vw, 62px);
  line-height: 1.12;
  margin: 20px 0 14px;
  letter-spacing: -1px;
}
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 640px;
  margin: 0 auto 28px;
  color: var(--text-dim);
  font-size: 17px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s;
  color: var(--text);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.45);
}
.btn-primary:hover { box-shadow: 0 14px 40px rgba(59, 130, 246, 0.6); }
.btn-ghost { background: var(--glass); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--glass-strong); }

.hero-stats {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 40px;
}
.stat {
  display: flex;
  flex-direction: column;
  padding: 16px 26px;
  border-radius: var(--radius);
}
.stat b { font-size: 24px; color: var(--accent-2); }
.stat span { font-size: 13px; color: var(--text-dim); }

/* ---------- Sections ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 50px 20px; }
.section-title { text-align: center; font-size: clamp(24px, 4vw, 36px); margin: 0 0 8px; }
.section-sub { text-align: center; color: var(--text-dim); max-width: 620px; margin: 0 auto 34px; }

/* ---------- Tools grid ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.tool-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  transition: transform 0.18s ease, border-color 0.2s;
}
.tool-card:hover { transform: translateY(-4px); border-color: rgba(59, 130, 246, 0.5); }
.tool-card.active { border-color: rgba(59, 130, 246, 0.55); background: var(--glass-strong); }
.tool-card.soon { opacity: 0.85; }
.tool-ico { font-size: 28px; line-height: 1; }
.tool-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-body p { margin: 6px 0 0; font-size: 13.5px; color: var(--text-dim); }
.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.18);
  color: var(--ok);
  font-weight: 700;
}
.badge.soon { background: rgba(251, 191, 36, 0.16); color: var(--warn); }

/* ---------- QR tool ---------- */
.qr-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.qr-controls, .qr-preview {
  border-radius: var(--radius);
  padding: 22px;
}

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-label { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.field.check .field-label { color: var(--text); }

textarea, select, input[type="color"], input[type="range"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
}
textarea {
  resize: vertical;
  padding: 12px;
  min-height: 72px;
}
select {
  padding: 11px 12px;
  appearance: auto;
}
input[type="color"] {
  height: 46px;
  padding: 4px;
  cursor: pointer;
}
input[type="range"] { accent-color: var(--accent); cursor: pointer; }
.range-val { font-size: 12.5px; color: var(--text-dim); }

.qr-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.status { min-height: 18px; font-size: 13px; color: var(--ok); margin: 10px 0 0; }
.status.err { color: #f87171; }

.qr-preview { display: flex; flex-direction: column; gap: 14px; }
.qr-stage {
  flex: 1;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(10, 18, 40, 0.4);
  border: 1px dashed var(--border);
  padding: 18px;
}
html[data-theme="light"] .qr-stage { background: rgba(210, 225, 255, 0.4); }
#qrCanvas {
  max-width: 100%;
  max-height: 60vh;
  height: auto;
  border-radius: 8px;
}
.qr-meta { text-align: center; font-size: 13px; color: var(--text-dim); }

/* ---------- Features ---------- */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.feat { padding: 22px; border-radius: var(--radius); }
.feat-ico { font-size: 30px; }
.feat b { display: block; margin: 10px 0 6px; font-size: 16px; }
.feat p { margin: 0; font-size: 13.5px; color: var(--text-dim); }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 30px 20px 44px;
  color: var(--text-dim);
  font-size: 13.5px;
}

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .qr-layout { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .field-row { grid-template-columns: 1fr; }
}
