/* ==========================================================================
   QR Stamp — design tokens
   Palette: stone paper + deep teal ink + stamp-red accent (rubber-stamp
   / printed-label mood, since this tool exists to put ink on paper).
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500&display=swap");

:root {
  --paper: #ece7db;
  --paper-raised: #f6f3ea;
  --ink: #17302b;
  --ink-soft: #3d534d;
  --accent: #c1272d;
  --accent-ink: #7a1418;
  --teal: #2f6f62;
  --line: rgba(23, 48, 43, 0.14);
  --line-strong: rgba(23, 48, 43, 0.28);
  --shadow: 0 1px 0 rgba(23, 48, 43, 0.06), 0 12px 24px -16px rgba(23, 48, 43, 0.35);
  --radius: 14px;
  --font-display: "Space Grotesk", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--paper);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 18px 18px;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
  font-weight: 500;
}
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }

/* ---------- Hero (the tool itself is the thesis) ---------- */

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px 6px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 6px 0 8px;
}

.hero p.lede {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 0 4px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: rgba(193, 39, 45, 0.1);
  border: 1px solid rgba(193, 39, 45, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------- App shell ---------- */

.app-shell {
  max-width: 1180px;
  margin: 18px auto 40px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
}

.panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.workspace { padding: 6px; }

/* Tabs — styled like stamped label tabs on a folder */
.tabbar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 10px 0;
  scrollbar-width: thin;
}
.tabbar::-webkit-scrollbar { height: 4px; }

.tab {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 9px 14px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab--active {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
  font-weight: 600;
}

.workspace-body {
  border-top: 1px solid var(--line);
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
}

@media (max-width: 720px) {
  .workspace-body { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Form ---------- */

#tab-hint { color: var(--ink-soft); font-size: 14px; margin: 0 0 14px; }

.field { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.field--row { flex-direction: row; align-items: center; gap: 8px; }
.field--row label { order: 2; }
.field--row input { order: 1; width: auto; }

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); }

.quick-fills { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 14px; }
.chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.chip:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- Customization panel ---------- */

.customize h3 {
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
  color: var(--ink-soft);
}

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.color-field { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.color-field label { font-size: 12.5px; font-weight: 600; flex: 1; }
.color-field input[type="color"] {
  width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; background: #fff;
}

.swatches { display: flex; gap: 6px; margin: 8px 0 14px; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; padding: 0;
}

.field-mini { margin-bottom: 10px; }
.field-mini label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.field-mini select { width: 100%; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line-strong); font-size: 13.5px; background: #fff; }

.logo-upload { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.logo-upload input[type="file"] { font-size: 12px; max-width: 160px; }
.field-error { font-size: 12px; color: var(--accent); margin: 6px 0 0; }
.btn-mini {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

/* ---------- Preview column ---------- */

.preview-col { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.reticle {
  position: relative;
  padding: 18px;
  background: #fff;
  border-radius: 10px;
}
.reticle::before, .reticle::after,
.reticle .c2, .reticle .c3 { content: ""; position: absolute; width: 18px; height: 18px; }
.reticle::before { top: 4px; left: 4px; border-top: 3px solid var(--accent); border-left: 3px solid var(--accent); }
.reticle::after { top: 4px; right: 4px; border-top: 3px solid var(--accent); border-right: 3px solid var(--accent); }
.reticle .c2 { bottom: 4px; left: 4px; border-bottom: 3px solid var(--accent); border-left: 3px solid var(--accent); }
.reticle .c3 { bottom: 4px; right: 4px; border-bottom: 3px solid var(--accent); border-right: 3px solid var(--accent); }

#qr-preview { width: 320px; height: 320px; max-width: 100%; }
#qr-preview canvas, #qr-preview img, #qr-preview svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }

.qr-empty-state {
  width: 320px; height: 320px; max-width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--ink-soft); text-align: center; font-size: 13.5px; padding: 20px;
}

.download-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.download-bar.is-disabled button { opacity: 0.45; pointer-events: none; }

.btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }

/* ---------- Ad slots ----------
   Clearly labelled placeholders. Replace the inner comment with your
   real <ins class="adsbygoogle">…</ins> tag once AdSense approves you. */

.ad-slot {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: repeating-linear-gradient(135deg, rgba(23,48,43,0.03) 0 8px, transparent 8px 16px);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 11.5px; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.ad-slot::before { content: "Advertisement"; }

.ad-slot--sidebar { min-height: 600px; margin-top: 20px; }
.ad-slot--banner { min-height: 100px; margin: 24px 0; max-width: 1180px; margin-left: auto; margin-right: auto; }
.ad-slot--inline { min-height: 100px; margin: 32px 0; }
.ad-slot--modal { min-height: 250px; margin: 14px 0; }

@media (max-width: 900px) { .ad-slot--sidebar { display: none; } }

/* ---------- Ad interstitial modal ---------- */

.ad-modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(23, 48, 43, 0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
  padding: 20px;
}
.ad-modal[hidden] { display: none; }
.ad-modal.is-open { opacity: 1; }
.ad-modal-card {
  background: var(--paper-raised); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; width: 320px; max-width: 100%;
}
.ad-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ad-modal-head strong { font-family: var(--font-display); font-size: 14px; }
.ad-modal-head button { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink-soft); line-height: 1; }
.ad-modal-note { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Consent banner ---------- */

.consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: var(--ink); color: #f2efe6;
  padding: 14px 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  font-size: 13.5px;
}
.consent-banner[hidden] { display: none; }
.consent-banner a { color: #cfe6df; }
.consent-actions { display: flex; gap: 8px; margin-left: auto; }
.consent-actions button {
  font-family: var(--font-mono); font-size: 12px; padding: 7px 12px; border-radius: 7px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.3);
}
#consent-accept { background: var(--accent); color: #fff; border-color: var(--accent); }
#consent-decline { background: transparent; color: #f2efe6; }

/* ---------- Feature strip / SEO content sections ---------- */

.section {
  max-width: 1180px; margin: 0 auto; padding: 40px 24px;
}
.section h2 {
  font-family: var(--font-display); font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.01em; margin: 0 0 18px;
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 800px) { .grid-3 { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.feature-card .num {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em;
}
.feature-card h3 { font-family: var(--font-display); font-size: 17px; margin: 6px 0 6px; }
.feature-card p { font-size: 14px; color: var(--ink-soft); margin: 0; }

.faq details {
  border-bottom: 1px solid var(--line); padding: 14px 0;
}
.faq summary { cursor: pointer; font-weight: 600; font-family: var(--font-display); font-size: 15.5px; }
.faq p { color: var(--ink-soft); margin: 10px 0 0; font-size: 14.5px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 24px 90px;
  max-width: 1180px; margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--ink-soft);
}
.site-footer nav { display: flex; gap: 14px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Legal pages ---------- */

.legal { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; }
.legal h1 { font-family: var(--font-display); font-size: 32px; }
.legal h2 { font-family: var(--font-display); font-size: 19px; margin-top: 34px; }
.legal p, .legal li { color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
