/* Trazo design system */
:root {
  --ink: #0B1020;
  --bg: #F7F8FC;
  --surface: #FFFFFF;
  --muted: #5B6474;
  --line: #E6E8F0;
  --iris: #5850EC;
  --iris-600: #4338CA;
  --aqua: #22D3EE;
  --emerald: #10B981;
  --rose: #FB7185;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(11,16,32,.04), 0 8px 24px rgba(11,16,32,.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1020;
    --surface: #141A2E;
    --ink: #EAECF5;
    --muted: #9AA3B8;
    --line: #232B45;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1020;
  --surface: #141A2E;
  --ink: #EAECF5;
  --muted: #9AA3B8;
  --line: #232B45;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 .5em;
}
p { margin: 0 0 1em; color: var(--ink); }
a { color: var(--iris); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* focus */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--iris);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo .mark { width: 28px; height: 28px; display: block; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a.navlink { color: var(--muted); font-weight: 500; font-size: 14.5px; }
.nav a.navlink:hover { color: var(--ink); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.mobile-toggle { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--iris), var(--iris-600));
  color: #fff; box-shadow: 0 4px 14px rgba(88,80,236,.32);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(88,80,236,.4); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--rose); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
}
.card-flat { border-radius: 14px; padding: 20px; }

/* Inputs */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 15px; font-family: inherit;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
.input-row { display: flex; gap: 10px; flex-wrap: wrap; }
.input-row > * { flex: 1; min-width: 180px; }

/* Hero */
.hero {
  position: relative; overflow: hidden; padding: 88px 0 64px;
}
.hero::before {
  content: ''; position: absolute; inset: -20% -10% auto -10%; height: 620px;
  background: radial-gradient(600px 300px at 30% 20%, color-mix(in srgb, var(--iris) 22%, transparent), transparent 70%),
              radial-gradient(500px 260px at 80% 10%, color-mix(in srgb, var(--aqua) 20%, transparent), transparent 70%);
  pointer-events: none; z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--iris-600); background: color-mix(in srgb, var(--iris) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--iris) 25%, transparent); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: 46px; margin-bottom: 18px; }
.hero .lede { font-size: 18px; color: var(--muted); max-width: 52ch; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* scan pulse motif */
.scan-badge { position: relative; width: 180px; height: 180px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.scan-ring {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--aqua) 55%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
.scan-ring.delay { animation-delay: 1.2s; }
@keyframes pulse {
  0% { transform: scale(.7); opacity: .9; }
  100% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .scan-ring { animation: none; opacity: .4; }
}

/* Generator card */
.generator { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.qr-preview {
  display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 14px;
  border: 1px solid var(--line); padding: 16px; width: 220px; height: 220px;
}
.qr-preview svg { width: 100%; height: 100%; }
.tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 18px; width: fit-content; }
.tabs button { background: transparent; border: none; padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Sections */
.section { padding: 72px 0; }
.section-head { text-align: center; max-width: 600px; margin: 0 auto 44px; }
.section-head h2 { font-size: 32px; }
.section-head p { color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { text-align: left; }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--iris) 12%, transparent); color: var(--iris); margin-bottom: 14px;
}
.feature-card h3 { font-size: 18px; margin-bottom: 6px; }
.feature-card p { color: var(--muted); font-size: 14.5px; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding-top: 8px; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--iris); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-family: 'Space Grotesk', sans-serif;
}

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { display: flex; flex-direction: column; }
.plan.featured { border-color: var(--iris); box-shadow: 0 0 0 2px color-mix(in srgb, var(--iris) 30%, transparent), var(--shadow); }
.plan .price { font-size: 36px; font-family: 'Space Grotesk', sans-serif; margin: 10px 0; }
.plan .price span { font-size: 15px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.plan li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--muted); }
.plan li:first-child { border-top: none; }
.plan-badge { display: inline-block; background: var(--aqua); color: #032; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; width: fit-content; }

.faq-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 16px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 20px; color: var(--muted); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin-top: 12px; color: var(--muted); }

/* stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.stat-tile .num { font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 700; }
.stat-tile .label { color: var(--muted); font-size: 13px; }

/* data table */
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.badge-active { background: color-mix(in srgb, var(--emerald) 15%, transparent); color: var(--emerald); }
.badge-disabled { background: color-mix(in srgb, var(--muted) 15%, transparent); color: var(--muted); }
.badge-flagged { background: color-mix(in srgb, var(--rose) 15%, transparent); color: var(--rose); }

footer.site-footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 60px; color: var(--muted); font-size: 14px; }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* toast */
#toast-region { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); }

.auth-card { max-width: 420px; margin: 60px auto; }
.center-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 40px 0; }

.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row input { flex: 1; font-family: ui-monospace, monospace; }

.theme-toggle { background: transparent; border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); }

.prose h2 { margin-top: 1.6em; font-size: 22px; }
.prose p { color: var(--ink); }
.prose { max-width: 68ch; }

.breadcrumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--muted); }

.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Branded QR: logo picker */
.logo-field { border: none; padding: 0; margin: 0 0 18px; }
.logo-field-legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.pro-badge {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--iris-600); background: color-mix(in srgb, var(--iris) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--iris) 30%, transparent); padding: 2px 8px; border-radius: 999px;
}
.logo-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-chip { position: relative; display: inline-flex; }
.logo-chip input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.logo-chip span:not(.sr-only) {
  display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.logo-chip input:checked + span:not(.sr-only) {
  border-color: var(--iris); color: var(--iris); background: color-mix(in srgb, var(--iris) 10%, transparent);
}
.logo-chip input:focus-visible + span:not(.sr-only) { outline: 2px solid var(--iris); outline-offset: 2px; }
.logo-chip input:hover + span:not(.sr-only) { color: var(--ink); }
.logo-upload { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.logo-upload input[type=file] { font-size: 13px; max-width: 100%; color: var(--muted); }

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr !important; }
  .hero-grid { grid-template-columns: 1fr; }
  .features, .steps, .pricing-grid { grid-template-columns: 1fr; }
  .nav { position: fixed; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line);
        flex-direction: column; align-items: flex-start; padding: 16px 20px; gap: 16px; display: none; }
  .nav.open { display: flex; }
  .mobile-toggle { display: flex; background: transparent; border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 38px; align-items: center; justify-content: center; cursor: pointer; }
  .nav-desktop-only { display: none; }
  .hero h1 { font-size: 34px; }
  .generator { grid-template-columns: 1fr; }
  .qr-preview { width: 100%; max-width: 220px; margin: 0 auto; }
}
