/* qrforgood.com — shared stylesheet
   Extracted from the live single-page site so every new page matches it exactly.
   Tokens, type scale and component styles below are taken verbatim from the
   production index.html; everything under "NEW COMPONENTS" is additive. */

:root {
  --paper: #FFFFFF;
  --ink: #171717;
  --ink-soft: #55534C;
  --rule: #D8D8D3;
  --accent: #1E4FFF;
  --accent-soft: #EDF1FF;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 64px 24px 96px;
  position: relative;
  z-index: 1;
}

header { max-width: 560px; margin-bottom: 48px; }

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
  margin: 0 0 16px;
}

header p { color: var(--ink-soft); font-size: 1.05rem; margin: 0; }

.impact-note {
  font-size: 0.9rem !important;
  margin-top: 12px !important;
  color: var(--ink-soft);
}

/* ---------- studio (preview + form) ---------- */

.studio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

@media (max-width: 760px) {
  .studio { grid-template-columns: 1fr; }
}

.preview {
  border: 1px solid var(--rule);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: var(--paper);
}

#qr-canvas-holder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qr-canvas-holder img,
#qr-canvas-holder canvas { max-width: 100%; max-height: 100%; }

/* ---------------------------------------------------------------------------
   Live preview frame

   qrcodejs renders a <canvas>, and on Android additionally creates an <img>
   and swaps the two over. The logo overlay is therefore anchored to this
   frame, never to whichever of the two happens to exist at the time: wrapping
   one of them left the logo floating below the visible code on Android phones.

   The frame is fluid up to 280px (its old fixed size), so on a narrow screen
   the code scales down instead of overflowing its box.
   ------------------------------------------------------------------------- */

.qr-frame {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  margin: 0 auto;
}

/* Whichever element the library is currently showing fills the frame. Its own
   inline display:none on the hidden one still wins, as inline styles should. */
.qr-frame > canvas,
.qr-frame > img:not(.qr-frame-logo) {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-frame-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22%;
  height: auto;
  padding: 2.2%;        /* proportional, so it holds at every frame size */
  border-radius: 2px;
}

.placeholder { color: var(--ink-soft); font-size: 0.95rem; text-align: center; }

/* ---------- form controls ---------- */

.field { margin-bottom: 24px; }

label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 8px; }

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--paper);
  color: var(--ink);
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.color-row { display: flex; gap: 24px; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field label { margin-bottom: 0; }

input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
  cursor: pointer;
}

.dropzone {
  border: 1px dashed var(--rule);
  padding: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 2px;
}

.dropzone.has-file { border-color: var(--accent); color: var(--ink); }
.dropzone input { display: none; }

button.cta {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: var(--paper);
  border: none;
  border-radius: 2px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
}

button.cta:disabled { background: var(--rule); color: var(--ink-soft); cursor: not-allowed; }
button.cta:not(:disabled):hover { filter: brightness(0.92); }

.fineprint { margin-top: 16px; color: var(--ink-soft); font-size: 0.85rem; }
.error { color: #B3261E; font-size: 0.85rem; margin-top: 8px; display: none; }

/* ---------- decorative backdrop ---------- */

.qr-backdrop {
  position: absolute;
  top: -140px;
  right: -220px;
  width: 640px;
  height: 640px;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
}

/* =====================================================================
   NEW COMPONENTS — added by the growth pack
   ===================================================================== */

/* ---------- site navigation ---------- */

.site-nav {
  border-bottom: 1px solid var(--rule);
  position: relative;
  z-index: 2;
  background: var(--paper);
}

.site-nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: baseline;
  gap: 28px;
  flex-wrap: wrap;
}

.site-nav .brand {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
}

.site-nav a:hover,
.site-nav a:focus { color: var(--accent); text-decoration: underline; }

/* ---------- generic prose sections ---------- */

.section { margin-top: 72px; }

.section h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0 0 20px;
}

.section h3 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  margin: 28px 0 8px;
}

.prose { max-width: 680px; }
.prose p { color: var(--ink-soft); margin: 0 0 16px; }
.prose ul, .prose ol { color: var(--ink-soft); padding-left: 20px; margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 600; }

.lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 620px; }

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

.faq { max-width: 720px; }

.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}

.faq details:first-of-type { border-top: 1px solid var(--rule); }

.faq summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.faq details[open] summary::after { content: '\2212'; }

.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.faq .answer { color: var(--ink-soft); font-size: 0.95rem; margin: 12px 0 0; }
.faq .answer a { color: var(--accent); }

/* ---------- pack pricing ---------- */

.packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.pack {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 16px;
  cursor: pointer;
  background: var(--paper);
  text-align: left;
  font-family: inherit;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.pack:hover { border-color: var(--accent); }

.pack[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pack:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pack .qty { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 4px; }
.pack .price { display: block; font-family: 'Fraunces', serif; font-size: 1.4rem; line-height: 1.1; }
.pack .unit { display: block; color: var(--ink-soft); font-size: 0.8rem; margin-top: 4px; }

.pack .price s { color: var(--ink-soft); font-size: 0.95rem; margin-right: 6px; }

/* ---------- bulk textarea ---------- */

textarea#destinations {
  min-height: 160px;
  font-family: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  resize: vertical;
}

.counter { color: var(--ink-soft); font-size: 0.85rem; margin-top: 8px; }
.counter.over { color: #B3261E; }

.charity-row { display: flex; gap: 10px; align-items: flex-end; }
.charity-row .field { flex: 1; margin-bottom: 0; }

button.secondary {
  padding: 12px 16px;
  background: var(--paper);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

button.secondary:hover { background: var(--accent-soft); }
button.secondary:disabled { border-color: var(--rule); color: var(--ink-soft); cursor: not-allowed; background: var(--paper); }

.notice {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 16px;
  font-size: 0.9rem;
  margin: 16px 0;
  display: none;
}

.notice.show { display: block; }

/* ---------- cards / vertical grids ---------- */

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

.card {
  border: 1px solid var(--rule);
  padding: 20px;
  border-radius: 2px;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 600; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- comparison table ---------- */

.table-scroll { overflow-x: auto; margin: 0 0 24px; }

table.compare {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 0.92rem;
}

table.compare th,
table.compare td {
  border: 1px solid var(--rule);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

table.compare th { font-weight: 600; background: var(--accent-soft); }
table.compare td { color: var(--ink-soft); }

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

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 96px;
  position: relative;
  z-index: 1;
  background: var(--paper);
}

.site-footer-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 24px 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}

.site-footer h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0 0 12px;
  font-weight: 600;
}

.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }

.site-footer a { color: var(--ink); text-decoration: none; font-size: 0.9rem; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

.site-footer .legal {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.site-footer .legal p { margin: 0 0 6px; }

/* ---------- utilities ---------- */

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 10;
}

.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------------------
   In-context example (landing pages)

   Shows a real, scannable branded code as it would appear on the printed thing
   it belongs on — a collection tin, a menu card, a For Sale board. The codes in
   /assets/examples/ are generated by the site's own lib/generateQr.js and are
   verified to decode before they ship, so a visitor who scans one gets the page
   it claims. See .build-examples.js.
   ------------------------------------------------------------------------- */

.example {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 28px;
  background: var(--paper);
}

/* The mock "printed item" the code is sitting on. */
.example-mock {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 20px;
  text-align: center;
  background: var(--paper);
}

.example-mock .mock-eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.example-mock .mock-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.25;
  margin: 0 0 14px;
}

.example-mock img {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  margin: 0 auto;
}

.example-mock .mock-caption {
  margin: 14px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.example-mock .mock-sub {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.example-notes p { margin: 0 0 12px; }
.example-notes p:last-child { margin-bottom: 0; }

.example-notes ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.example-notes li { margin-bottom: 6px; }

.example-try {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 760px) {
  .example {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px;
  }
}
