/* ============ QR Mudra — style.css ============ */

:root {
  --bg: #f1f2f5;
  --surface: #ffffff;
  --ink: #15171a;
  --muted: #6e7480;
  --line: #e0e3e9;
  --accent: #2b4bf2;
  --accent-soft: #e8ecfe;
  --warn: #b4540a;
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

/* ---------- header ---------- */

.site-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 26px) clamp(14px, 3vw, 40px) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-nav { display: flex; gap: 22px; }
.header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.header-nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */

.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px) 20px clamp(20px, 4vw, 36px);
  text-align: center;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-sub {
  margin-top: 14px;
  font-size: clamp(14.5px, 2vw, 17px);
  line-height: 1.6;
  color: var(--muted);
}

.trust-pills {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.trust-pills span {
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- layout ---------- */

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 40px);
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 400px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1020px) {
  .app { grid-template-columns: 1fr; }
  .preview-col { order: -1; }
  .type-rail { flex-direction: row !important; overflow-x: auto; padding-bottom: 6px; }
  .type-btn { flex: 0 0 auto; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 26px);
}

/* ---------- type rail ---------- */

.type-rail { display: flex; flex-direction: column; gap: 6px; }

.type-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.type-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.type-btn:not([aria-pressed="true"]):hover { border-color: var(--muted); color: var(--ink); }
.type-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- forms ---------- */

.type-form h2, .design h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.design h2 { margin-top: 26px; }
.design h2:first-of-type { margin-top: 0; }

.form-hint { font-size: 13px; color: var(--muted); line-height: 1.5; margin: -6px 0 16px; }

.field { margin-bottom: 16px; min-width: 0; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.row.three { grid-template-columns: 1fr 1fr auto; }
@media (max-width: 560px) { .row, .row.three { grid-template-columns: 1fr; } }
.row .field { margin-bottom: 16px; }

label, .label-text {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 7px;
}

label em { font-style: normal; color: var(--accent); text-transform: none; }
.count { color: var(--ink); }

input[type="text"], input[type="url"], input[type="email"], input[type="tel"],
input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
}

textarea { resize: vertical; font-family: var(--mono); font-size: 13.5px; }

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

input[type="color"] {
  width: 100%;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}

.checkbox-field { display: flex; align-items: center; }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0;
  cursor: pointer;
}
.check input { accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segmented button {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.segmented button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.warn { font-size: 13px; color: var(--warn); margin: -6px 0 16px; line-height: 1.5; }

.logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.file-btn {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0;
}
.file-btn:hover { border-color: var(--muted); }

#logo-thumb {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 3px;
}

.ghost-btn {
  font-size: 13.5px;
  padding: 9px 14px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.ghost-btn:hover { color: var(--ink); border-color: var(--muted); }
.ghost-btn:focus-visible, .file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- preview ---------- */

.preview-col { position: sticky; top: 20px; }
@media (max-width: 1020px) { .preview-col { position: static; } }

.preview {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 26px 26px;
}

.finder { position: absolute; width: 26px; height: 26px; border: 4px solid var(--ink); border-radius: 6px; }
.finder::after { content: ""; position: absolute; inset: 4px; background: var(--ink); border-radius: 2px; }
.finder.tl { top: -5px; left: -5px; }
.finder.tr { top: -5px; right: -5px; }
.finder.bl { bottom: -5px; left: -5px; }

.qr-frame {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
  background: conic-gradient(var(--line) 0 25%, transparent 0 50%, var(--line) 0 75%, transparent 0) 0 0 / 16px 16px;
}

#qr-canvas { width: 100%; height: 100%; image-rendering: pixelated; display: none; }

.empty {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
  border-radius: 8px;
  padding: 14px 18px;
}

.meta {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  min-height: 1em;
  text-align: center;
}

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }

.actions button {
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  padding: 12px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.actions .primary { grid-column: 1 / -1; background: var(--accent); border-color: var(--accent); color: #fff; }
.actions button:disabled { opacity: 0.45; cursor: not-allowed; }
.actions button:not(:disabled):hover { filter: brightness(0.97); }
.actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.payload-box { width: 100%; }
.payload-box summary {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  cursor: pointer;
}
.payload-box pre {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 140px;
  overflow: auto;
}

/* ---------- features ---------- */

.features {
  max-width: 1180px;
  margin: clamp(36px, 6vw, 64px) auto 0;
  padding: 0 clamp(14px, 3vw, 40px);
}

.features h2, .faq h2 {
  font-size: clamp(21px, 3vw, 27px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.feat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.feat-icon { font-size: 24px; display: block; margin-bottom: 10px; }
.feat h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 7px; }
.feat p { font-size: 13.5px; line-height: 1.6; color: var(--muted); }

/* ---------- FAQ ---------- */

.faq {
  max-width: 760px;
  margin: clamp(36px, 6vw, 64px) auto 0;
  padding: 0 clamp(14px, 3vw, 40px);
}

.faq-list { display: flex; flex-direction: column; gap: 10px; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
}

.faq-item summary {
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 19px; color: var(--muted); flex: 0 0 auto; }
.faq-item[open] summary::after { content: "–"; }

.faq-item p { margin-top: 10px; font-size: 14px; line-height: 1.65; color: var(--muted); }
.faq-item p strong, .faq-item p em { color: var(--ink); }

/* ---------- footer ---------- */

.site-footer {
  margin-top: clamp(40px, 7vw, 72px);
  background: var(--ink);
  color: #d8dbe2;
  padding: clamp(28px, 5vw, 44px) clamp(14px, 3vw, 40px);
  text-align: center;
}

.footer-top { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.footer-top p { font-size: 13.5px; color: #9aa0ad; }

.footer-links {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer-links a { font-size: 13.5px; color: #c4c9d4; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

.footer-legal { font-size: 11.5px; line-height: 1.8; color: #8a909d; }

/* ---------- legal pages (privacy / terms) ---------- */

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) 20px clamp(40px, 6vw, 64px);
}

.legal-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 44px);
}

.legal h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.legal .updated { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 26px; }
.legal h2 { font-size: 17px; font-weight: 700; margin: 28px 0 10px; }
.legal p, .legal li { font-size: 14.5px; line-height: 1.7; color: #3a3f47; }
.legal ul { padding-left: 22px; margin: 8px 0; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent); }
.legal .tldr {
  background: var(--accent-soft);
  border: 1px solid #cdd6fb;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  #qr-canvas { transition: opacity 0.15s ease; }
  .type-btn, .segmented button { transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease; }
}
