/* ForeverQR - mobile-first, no external fonts */
:root {
  --bg: #f4efe6;
  --surface: #fffdf8;
  --surface-2: #ebe4d6;
  --ink: #16140f;
  --muted: #5c564b;
  --line: #d6cdbb;
  --accent: #1f6b4f;        /* "forever" green */
  --accent-ink: #ffffff;
  --accent-soft: #dcebe2;
  --warn: #8a4b00;
  --warn-bg: #fff1d6;
  --bad: #9b2c2c;
  --bad-soft: #f7e3df;
  --focus: #2563eb;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 24px -12px rgba(40,30,10,.25);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16140f; --surface: #201d17; --surface-2: #2b2720; --ink: #f3eee4; --muted: #b3ab9b;
    --line: #3b362c; --accent: #5fc79b; --accent-ink: #0d1a14; --accent-soft: #1d3329;
    --warn: #ffcf7a; --warn-bg: #3a2c12; --bad: #f2a199; --bad-soft: #3a1f1c; --focus: #8ab4ff;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16140f; --surface: #201d17; --surface-2: #2b2720; --ink: #f3eee4; --muted: #b3ab9b;
  --line: #3b362c; --accent: #5fc79b; --accent-ink: #0d1a14; --accent-soft: #1d3329;
  --warn: #ffcf7a; --warn-bg: #3a2c12; --bad: #f2a199; --bad-soft: #3a1f1c; --focus: #8ab4ff;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); overflow-x: hidden; }
img, canvas, video, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.02em; font-size: 1.1rem; }
.brand-mark { width: 22px; height: 22px; color: var(--accent); }
.top-nav { display: flex; align-items: center; gap: 4px; }
.top-nav a { color: var(--ink); text-decoration: none; padding: 8px 8px; border-radius: 8px; font-size: .95rem; }
.top-nav a:hover { background: var(--surface-2); }
.theme-toggle { background: none; border: 1px solid var(--line); color: var(--ink); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; margin-left: 4px; }
.theme-toggle svg { width: 18px; height: 18px; }
@media (max-width: 430px) { .top-nav a[href="#faq"] { display: none; } }
@media (max-width: 340px) { .top-nav a[href$="#guides"] { display: none; } }

/* Hero */
.hero { padding-top: 28px; padding-bottom: 8px; }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--muted); }
h1 { font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.05; letter-spacing: -.035em; margin: 0 0 12px; font-weight: 850; }
h1 em { font-style: normal; color: var(--accent); background: linear-gradient(transparent 70%, var(--accent-soft) 70%); }
.lede { font-size: 1.08rem; color: var(--muted); max-width: 46ch; margin: 0 0 14px; }
.promises { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.promises li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: .82rem; font-weight: 600; }
.promises span { color: var(--accent); font-weight: 900; }

/* Tool */
.tool { margin-top: 22px; }
.mode-tabs { display: inline-flex; background: var(--surface-2); padding: 4px; border-radius: 12px; gap: 4px; margin-bottom: 12px; }
.mode-tabs button { border: 0; background: transparent; color: var(--muted); font: 600 .95rem var(--font); padding: 9px 16px; border-radius: 9px; cursor: pointer; }
.mode-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }

.make-grid { display: grid; gap: 20px; }
@media (min-width: 860px) { .make-grid { grid-template-columns: 1.15fr 1fr; align-items: start; } .preview { position: sticky; top: 76px; } .panel { padding: 24px; } }

fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.type-list { display: flex; flex-wrap: wrap; gap: 6px; }
.type-list label { position: relative; }
.type-list input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.type-list span { display: block; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .92rem; background: var(--bg); cursor: pointer; }
.type-list input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.type-list input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.fields, .style-box { display: grid; gap: 6px; margin-bottom: 14px; }
label { font-weight: 600; font-size: .9rem; }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input:not([type]), textarea, select {
  width: 100%; font: 16px/1.4 var(--font); color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; min-width: 0;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="color"] { width: 100%; height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; }
input[type="file"] { font: inherit; font-size: .9rem; max-width: 100%; }
.row2 { display: grid; gap: 10px; grid-template-columns: 1fr; }
.row2 > div { display: grid; gap: 6px; min-width: 0; }
@media (min-width: 420px) { .row2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; align-self: end; padding-bottom: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: .85rem; margin: 0; }
.warn { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: .88rem; margin: 0; }
.error { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 8px 12px; font-size: .9rem; }
.style-box { border-top: 1px solid var(--line); padding-top: 12px; }
.style-box summary { font-weight: 700; cursor: pointer; margin-bottom: 8px; }
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn-link { background: none; border: 0; color: var(--bad); font: 600 .9rem var(--font); cursor: pointer; padding: 4px 0; text-decoration: underline; }

.preview-card { display: grid; gap: 12px; justify-items: center; text-align: center; }
.qr-frame { background: var(--surface-2); border-radius: 12px; padding: 16px; width: 100%; display: grid; place-items: center; }
.qr-frame canvas { width: min(100%, 300px); height: auto; aspect-ratio: 1; image-rendering: pixelated; border-radius: 4px; }
.payload { font: .82rem/1.4 var(--mono); color: var(--muted); margin: 0; word-break: break-all; max-width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 650 .95rem var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.toast { min-height: 1.2em; margin: 0; font-size: .9rem; color: var(--accent); font-weight: 600; }
.forever-note { margin: 0; font-size: .88rem; background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }

/* Scan */
.scan-grid { display: grid; gap: 18px; }
@media (min-width: 860px) { .scan-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.scan-input .actions { justify-content: flex-start; margin-bottom: 12px; }
.scan-intro { margin-top: 0; color: var(--muted); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.video-wrap { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 1; max-width: 420px; }
.video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.reticle { position: absolute; inset: 15%; border: 3px solid rgba(255,255,255,.85); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.scan-result { border: 2px solid var(--accent); border-radius: 12px; padding: 16px; background: var(--bg); }
.result-kind { margin: 0 0 10px; font-size: 1.05rem; }
.result-body { font-size: .95rem; }
.result-url { font: 1rem/1.45 var(--mono); word-break: break-all; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 0 0 10px; }
.result-url mark { background: var(--accent-soft); color: var(--ink); font-weight: 800; padding: 0 2px; border-radius: 3px; }
.result-pre { white-space: pre-wrap; word-break: break-word; font: .92rem/1.45 var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 0 0 10px; max-height: 320px; overflow: auto; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 10px; }
.kv dt { font-weight: 700; color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; font-family: var(--mono); }
.result-warn { background: var(--warn-bg); color: var(--warn); padding: 8px 10px; border-radius: 8px; font-size: .88rem; margin: 0 0 10px; }
.scan-result .actions { justify-content: flex-start; }

/* Explainer */
section h2 { font-size: clamp(1.4rem, 4.5vw, 2rem); letter-spacing: -.025em; line-height: 1.15; }
.explainer, .dynamic, .faq { margin-top: 44px; }
.compare { display: grid; gap: 14px; }
@media (min-width: 760px) { .compare { grid-template-columns: 1fr 1fr; } }
.cmp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.cmp-card h3 { margin: 0 0 6px; }
.cmp-card.bad { border-top: 4px solid var(--bad); }
.cmp-card.good { border-top: 4px solid var(--accent); }
.flow { font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); }
.flow span { background: var(--surface-2); color: var(--ink); padding: 3px 9px; border-radius: 6px; font-weight: 600; }
.bad .flow span:nth-child(2) { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }

.dyn-card { background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 22px; }
.dyn-card h2 { margin-top: 6px; }
.dyn-card a { color: inherit; }
.dyn-card .hint { color: inherit; opacity: .7; }
.dyn-card .toast { color: inherit; }
.badge { display: inline-block; margin: 0; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.signup { display: grid; gap: 8px; margin: 14px 0 6px; max-width: 520px; }
.signup input { margin: 0; background: var(--bg); color: var(--ink); }
@media (min-width: 520px) { .signup { grid-template-columns: 1fr auto; } }
.dyn-card .btn:not(.primary) { background: transparent; color: inherit; border-color: currentColor; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 28px 12px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.3rem; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--muted); max-width: 70ch; }

/* Footer */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 20px 0 32px; font-size: .9rem; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center; }
.footer-row p { margin: 0; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 14px; }

/* Legal pages */
.legal { max-width: 760px; padding-top: 24px; padding-bottom: 40px; }
.legal h1 { font-size: 2rem; }
.template-banner { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 12px 14px; font-weight: 600; }

/* Caption + printable sign */
.qr-frame { gap: 10px; }
.qr-caption { margin: 0; font-weight: 800; font-size: 1.1rem; color: var(--ink); text-align: center; overflow-wrap: anywhere; max-width: 300px; }
.sign-box { width: 100%; display: grid; gap: 6px; text-align: left; border-top: 1px solid var(--line); padding-top: 12px; }
.sign-box input { margin-bottom: 2px; }
.sign-box .actions { justify-content: flex-start; }
.tool { scroll-margin-top: 64px; }

/* Guides list (home) */
.guides { margin-top: 44px; }
.guide-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .guide-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .guide-grid { grid-template-columns: 1fr 1fr 1fr; } }
.guide-grid a { display: grid; gap: 2px; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.guide-grid a:hover { border-color: var(--accent); }
.guide-grid span { color: var(--muted); font-size: .9rem; }

/* Guide pages */
.article { max-width: 760px; padding-top: 20px; }
.crumbs { font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
.crumbs a { color: var(--muted); }
.article h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); }
.article h2 { font-size: clamp(1.3rem, 4vw, 1.7rem); letter-spacing: -.02em; line-height: 1.2; margin: 34px 0 10px; }
.article h3 { font-size: 1.08rem; margin: 20px 0 6px; }
.article p, .article li { max-width: 68ch; }
.article li { margin-bottom: 6px; }
.article code { font: .9em/1.4 var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.article pre { font: .9rem/1.45 var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.article table { border-collapse: collapse; width: 100%; font-size: .93rem; margin: 8px 0 4px; }
.article th, .article td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.article th { font-weight: 700; }
.cta { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; box-shadow: var(--shadow); }
.cta p { margin: 0 0 10px; }
.cta .actions { justify-content: flex-start; }
.steps { padding-left: 1.3em; }
.steps li { padding-left: 4px; }
.note { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; }
.callout-warn { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 14px; }
.sources { font-size: .88rem; color: var(--muted); }
.sources a { overflow-wrap: anywhere; }
.more-guides { margin-top: 40px; }
