/* ============================================================
   Lynxz Tools — Design System v2 (Premium)
   Tokens • Layout • Components • Motion • Responsive
   CSP-safe: no inline styles anywhere (all classes + canvas)
   ============================================================ */

/* ---------- 1. Tokens ---------- */

:root {
  color-scheme: light;
  /* Color — light */
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --surface-3: #eceef3;
  --text: #0b0f1a;
  --text-secondary: #3d4657;
  --muted: #667085;
  --border: #e6e8ef;
  --border-strong: #d4d8e2;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-strong: #3730a3;
  --accent-soft: #eef0fe;
  --accent-softer: #f5f6ff;
  --accent-ring: rgb(79 70 229 / 0.28);
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --accent-grad-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

  --success: #059669;
  --success-soft: #ecfdf5;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgb(11 15 26 / 0.05);
  --shadow-sm: 0 1px 2px rgb(11 15 26 / 0.04), 0 2px 6px rgb(11 15 26 / 0.05);
  --shadow-md: 0 2px 4px rgb(11 15 26 / 0.04), 0 8px 20px rgb(11 15 26 / 0.07);
  --shadow-lg: 0 4px 8px rgb(11 15 26 / 0.04), 0 16px 40px rgb(11 15 26 / 0.1);
  --shadow-glow: 0 8px 32px rgb(79 70 229 / 0.18);

  /* Geometry */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Type */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --leading: 1.6;
  --tracking-tight: -0.028em;
  --tracking-snug: -0.015em;

  /* Layout */
  --container: 1200px;
  --header-h: 68px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.15s;
  --dur-med: 0.28s;
  --dur-slow: 0.5s;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07090f;
  --bg-elevated: #0d1117;
  --surface: #0d1117;
  --surface-2: #141a24;
  --surface-3: #1b2330;
  --text: #eef1f6;
  --text-secondary: #c3cad6;
  --muted: #8b94a5;
  --border: #1e2632;
  --border-strong: #2a3442;

  --accent: #7c7ff2;
  --accent-hover: #9296f7;
  --accent-strong: #a5abfa;
  --accent-soft: #181c36;
  --accent-softer: #12152a;
  --accent-ring: rgb(124 127 242 / 0.35);
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --accent-grad-hover: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);

  --success: #34d399;
  --success-soft: #06281d;

  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35), 0 2px 8px rgb(0 0 0 / 0.3);
  --shadow-md: 0 2px 6px rgb(0 0 0 / 0.35), 0 10px 28px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 4px 10px rgb(0 0 0 / 0.35), 0 20px 48px rgb(0 0 0 / 0.5);
  --shadow-glow: 0 8px 32px rgb(124 127 242 / 0.22);
}

/* ---------- 2. Reset & base ---------- */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: var(--leading);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-med) ease, color var(--dur-med) ease;
}

::selection { background: var(--accent); color: #fff; }

a { color: var(--accent); text-decoration: none; transition: color var(--dur-fast) ease; }
a:hover { color: var(--accent-hover); }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }

/* ---------- 3. Typography ---------- */

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: var(--tracking-snug); font-weight: 700; }

.display {
  font-size: clamp(2.4rem, 5.4vw, 3.9rem);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: 1.08;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: var(--tracking-snug);
}

.section-sub { color: var(--muted); font-size: 1.05rem; max-width: 560px; }

.text-grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.mono { font-family: var(--mono); }

/* ---------- 4. Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo:hover { color: var(--text); text-decoration: none; }

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
  transition: transform var(--dur-fast) var(--ease-spring);
}

.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.05); }

.logo-sub {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-left: 2px;
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease,
              background var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0) scale(0.96); }
.icon-btn svg { width: 17px; height: 17px; }

.lang-btn {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: var(--font);
  width: auto;
  padding: 0 13px;
}

/* ---------- 5. Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-size: 0.94rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) ease,
              background var(--dur-fast) ease, border-color var(--dur-fast) ease,
              color var(--dur-fast) ease;
  white-space: nowrap;
}

.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(0) scale(0.985); }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--accent-grad-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgb(79 70 229 / 0.28);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.btn-lg { padding: 15px 28px; font-size: 1rem; border-radius: var(--radius-md); }

.btn-arrow { transition: transform var(--dur-fast) var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- 6. Hero ---------- */

.hero {
  position: relative;
  padding: 96px 0 72px;
  text-align: center;
  overflow: hidden;
}

.hero-mesh {
  position: absolute;
  inset: -20% -10% auto;
  height: 720px;
  pointer-events: none;
  background:
    radial-gradient(42% 46% at 22% 30%, rgb(99 102 241 / 0.16) 0%, transparent 70%),
    radial-gradient(38% 42% at 78% 24%, rgb(139 92 246 / 0.13) 0%, transparent 70%),
    radial-gradient(36% 40% at 52% 62%, rgb(14 165 233 / 0.09) 0%, transparent 70%);
  animation: mesh-drift 18s ease-in-out infinite alternate;
}

[data-theme="dark"] .hero-mesh {
  background:
    radial-gradient(42% 46% at 22% 30%, rgb(99 102 241 / 0.2) 0%, transparent 70%),
    radial-gradient(38% 42% at 78% 24%, rgb(139 92 246 / 0.16) 0%, transparent 70%),
    radial-gradient(36% 40% at 52% 62%, rgb(14 165 233 / 0.1) 0%, transparent 70%);
}

@keyframes mesh-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 26px;
  position: relative;
}

.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px var(--success-soft); }
  50% { box-shadow: 0 0 0 6px var(--success-soft); }
}

.hero .display { max-width: 780px; margin: 0 auto 22px; position: relative; }

.hero-sub {
  color: var(--muted);
  font-size: 1.13rem;
  max-width: 580px;
  margin: 0 auto 36px;
  position: relative;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  position: relative;
  margin-bottom: 54px;
}

/* Trust strip */
.trust-strip {
  display: flex;
  justify-content: center;
  gap: 12px 40px;
  flex-wrap: wrap;
  position: relative;
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
  font-weight: 550;
  color: var(--text-secondary);
}

.trust-item svg { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; }

/* ---------- 7. Sections ---------- */

.section { padding: 72px 0; position: relative; }

.section-alt { background: var(--surface-2); border-block: 1px solid var(--border); }

.section-head { margin-bottom: 44px; }
.section-head.center { text-align: center; }
.section-head.center .section-sub { margin: 12px auto 0; }
.section-head .section-sub { margin-top: 12px; }

/* ---------- 8. Tool cards ---------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) ease,
              border-color var(--dur-med) ease;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.tool-preview {
  position: relative;
  aspect-ratio: 1200 / 630;
  background:
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%, transparent 75%, var(--surface-3) 75%),
    linear-gradient(45deg, var(--surface-3) 25%, var(--surface-2) 25%, var(--surface-2) 75%, var(--surface-3) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.tool-preview canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.tool-preview-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: rgb(11 15 26 / 0.72);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tool-card-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.tool-card h3 { font-size: 1.18rem; font-weight: 750; letter-spacing: -0.02em; }

.tool-card p { color: var(--muted); font-size: 0.92rem; flex: 1; }

.tool-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.tool-meta-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.tool-card .btn { margin-top: 8px; align-self: flex-start; }

.tool-card-soon { border-style: dashed; background: transparent; box-shadow: none; }
.tool-card-soon:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }

.tool-icon-tile {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

/* Coming-soon preview tile */
.tool-preview-center-tile {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  border-radius: 16px;
}

/* ---------- 9. Features ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.feature-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: transform var(--dur-med) var(--ease-out), border-color var(--dur-med) ease,
              box-shadow var(--dur-med) ease;
}

.feature-item:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); box-shadow: var(--shadow-md); }

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.feature-icon svg { width: 20px; height: 20px; }

.feature-item h4 { font-size: 1.02rem; font-weight: 700; margin-bottom: 7px; }
.feature-item p { color: var(--muted); font-size: 0.89rem; }

/* ---------- 10. Steps ---------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; position: relative; }

.steps::before {
  content: "";
  position: absolute;
  top: 41px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 18%, var(--border-strong) 82%, transparent);
  z-index: 0;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  position: relative;
  z-index: 1;
  text-align: center;
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) ease;
}

.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  box-shadow: var(--shadow-glow);
}

.step h4 { font-size: 1rem; font-weight: 700; margin-bottom: 5px; }
.step p { color: var(--muted); font-size: 0.88rem; }

/* ---------- 11. FAQ ---------- */

.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--dur-fast) ease;
}

.faq-item[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  font-weight: 650;
  font-size: 0.97rem;
  color: var(--text);
  user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent); }

.faq-item summary .faq-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform var(--dur-med) var(--ease-out), background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.faq-item summary .faq-icon svg { width: 13px; height: 13px; }
.faq-item[open] summary .faq-icon { transform: rotate(45deg); background: var(--accent-soft); color: var(--accent); }

.faq-item .faq-answer { padding: 0 22px 20px; color: var(--muted); font-size: 0.92rem; max-width: 640px; }

/* ---------- 12. CTA band ---------- */

.cta-band {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 64px 48px;
  text-align: center;
  overflow: hidden;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 60% at 20% 20%, rgb(255 255 255 / 0.14), transparent 70%),
    radial-gradient(40% 50% at 85% 80%, rgb(255 255 255 / 0.1), transparent 70%);
  pointer-events: none;
}

.cta-band h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; letter-spacing: var(--tracking-snug); margin-bottom: 12px; position: relative; }
.cta-band p { opacity: 0.88; max-width: 480px; margin: 0 auto 30px; position: relative; font-size: 1.02rem; }

.cta-band .btn {
  position: relative;
  background: #fff;
  color: var(--accent-strong);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.18);
}

.cta-band .btn:hover { background: #fff; color: var(--accent-strong); transform: translateY(-2px); box-shadow: 0 14px 36px rgb(0 0 0 / 0.24); }

/* ---------- 13. Footer ---------- */

.site-footer { border-top: 1px solid var(--border); margin-top: 24px; background: var(--bg); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  padding: 56px 0 40px;
}

.footer-brand p { color: var(--muted); font-size: 0.89rem; margin-top: 14px; max-width: 300px; }

.footer-col h5 {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.83rem;
}

/* ---------- 14. Tool page ---------- */

.tool-hero { padding: 52px 0 8px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 550;
  margin-bottom: 20px;
  transition: color var(--dur-fast) ease, gap var(--dur-fast) ease;
}

.back-link:hover { color: var(--accent); text-decoration: none; gap: 10px; }
.back-link svg { width: 15px; height: 15px; }

.tool-hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); font-weight: 800; letter-spacing: var(--tracking-tight); }

.tool-hero p { color: var(--muted); margin-top: 10px; max-width: 640px; font-size: 1rem; }

.tool-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

.tool-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 26px;
  padding: 32px 0 64px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px;
}

.panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 26px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title:first-child { margin-top: 0; }

.panel-divider { height: 1px; background: var(--border); margin: 24px -26px 0; }

/* Template chips — canvas inside */
.template-chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}

.template-chip {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  background: var(--surface-2);
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1200 / 630;
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) ease;
  position: relative;
}

.template-chip:hover { transform: translateY(-2px) scale(1.03); border-color: var(--muted); box-shadow: var(--shadow-sm); }
.template-chip.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.template-chip canvas { display: block; width: 100%; height: 100%; }

/* Form fields */
.field { margin-bottom: 18px; }

.field label {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 0.83rem;
  font-weight: 650;
  margin-bottom: 7px;
  color: var(--text-secondary);
}

.field .hint { font-weight: 450; color: var(--muted); font-size: 0.77rem; }

.field input[type="text"],
.field input[type="url"],
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease,
              background var(--dur-fast) ease;
}

.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.75; }

.field textarea { resize: vertical; min-height: 78px; line-height: 1.5; }

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: var(--surface);
}

.char-count {
  text-align: right;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}

.char-count.warn { color: #d97706; }

/* Color row */
.color-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.color-picker-wrap {
  position: relative;
  width: 46px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.color-picker-wrap input[type="color"] {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}

.color-hex {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 76px;
}

.color-presets { display: flex; gap: 7px; flex-wrap: wrap; }

.color-preset {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) ease;
  position: relative;
}

.color-preset:hover { transform: scale(1.14); }
.color-preset.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

/* Preview panel */
.preview-panel { position: sticky; top: calc(var(--header-h) + 20px); }

.preview-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--dur-med) ease;
}

.preview-frame:hover { box-shadow: var(--shadow-lg); }

.preview-canvas-wrap { overflow: hidden; }

.preview-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  transition: width var(--dur-med) var(--ease-out);
}

.preview-frame.actual .preview-canvas-wrap { overflow-x: auto; }
.preview-frame.actual .preview-canvas { width: 1200px; min-width: 1200px; }

.preview-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.preview-actions .btn { flex: 1; min-width: 148px; }

.tip-box {
  margin-top: 18px;
  padding: 14px 17px;
  border-radius: var(--radius-sm);
  background: var(--accent-softer);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  gap: 11px;
  align-items: flex-start;
  line-height: 1.55;
}

.tip-box svg { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }

.meta-output {
  margin-top: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  display: none;
  max-height: 220px;
  overflow-y: auto;
}

.meta-output.show { display: block; animation: fade-up var(--dur-med) var(--ease-out); }

.meta-note { font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; font-family: var(--font); }

/* ---------- 15. Toast ---------- */

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: transform var(--dur-med) var(--ease-spring), opacity var(--dur-med) ease;
  z-index: 100;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 9px;
}

.toast svg { width: 16px; height: 16px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 16. Reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 17. Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-mesh { animation: none; }
}

/* ---------- 18. Responsive ---------- */

@media (max-width: 1020px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 920px) {
  .tool-layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .steps { grid-template-columns: 1fr; }
  .steps::before { display: none; }
}

@media (max-width: 640px) {
  .hero { padding: 64px 0 52px; }
  .trust-strip { gap: 12px 24px; }
  .tool-grid { grid-template-columns: 1fr; }
  .template-chips { grid-template-columns: repeat(3, 1fr); }
  .preview-actions .btn { min-width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .cta-band { padding: 48px 26px; }
  .section { padding: 56px 0; }
  .container { padding: 0 20px; }
}
