/* Freehold QR */
:root {
  --bg: #e9eef2;
  --surface: #ffffff;
  --ink: #14213d;
  --muted: #55607a;
  --line: #cfd7e0;
  --tag: #ffcf3f;
  --tag-ink: #14213d;
  --ring: #7d879b;
  --ok: #17784a;
  --warn: #9a5b00;
  --bad: #b42318;
  --focus: #2563eb;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101624; --surface: #19213a; --ink: #eef2f8; --muted: #a7b1c6; --line: #2f3a58;
    --tag: #ffcf3f; --tag-ink: #14213d; --ring: #9aa4b8; --ok: #4ccf8a; --warn: #f0b44a; --bad: #ff7b6e; --focus: #7aa7ff;
  }
}
:root[data-theme="dark"] {
  --bg: #101624; --surface: #19213a; --ink: #eef2f8; --muted: #a7b1c6; --line: #2f3a58;
  --tag: #ffcf3f; --tag-ink: #14213d; --ring: #9aa4b8; --ok: #4ccf8a; --warn: #f0b44a; --bad: #ff7b6e; --focus: #7aa7ff;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.55 var(--body);
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; z-index: 9; }
.skip:focus { left: 16px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-head { padding: 18px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 22px/1 var(--display); letter-spacing: -0.02em; }
.brand svg { width: 34px; height: 34px; }
.site-nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Hero */
.hero { padding: 26px 0 22px; }
.hero h1 {
  font: 800 clamp(38px, 6.4vw, 72px)/0.98 var(--display);
  letter-spacing: -0.035em; margin: 0 0 14px; max-width: 16ch;
}
.hero p { font-size: 19px; color: var(--muted); max-width: 60ch; margin: 0; }
.promises { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 15px; }
.promises li { display: flex; align-items: center; gap: 7px; }
.promises li::before {
  content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%;
  background: var(--tag) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.2 2.2 4.8-5' fill='none' stroke='%2314213d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}

/* Generator */
.generator {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px;
  align-items: start; margin: 8px 0 56px;
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.panel h2 { font: 700 19px/1.2 var(--display); margin: 0 0 12px; letter-spacing: -0.01em; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 0 -4px 18px; padding-left: 4px; scrollbar-width: thin; }
.tabs button {
  flex: none; border: 1px solid var(--line); background: transparent; color: var(--ink);
  font: 600 15px/1 var(--body); padding: 10px 14px; border-radius: 999px; cursor: pointer;
}
.tabs button:hover { border-color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.fields { display: flex; flex-wrap: wrap; gap: 14px 14px; }
.field { flex: 1 1 100%; display: flex; flex-direction: column; gap: 6px; }
.field.half { flex: 1 1 calc(50% - 7px); min-width: 180px; }
.field.check { flex-direction: row; align-items: center; gap: 10px; }
label { font-size: 15px; font-weight: 700; }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="datetime-local"], select, textarea, input[type="search"] {
  width: 100%; font: 17px/1.4 var(--body); color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--ink); }

details.style-opts { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
details.style-opts summary { cursor: pointer; font: 700 17px/1.3 var(--display); list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.style-opts summary::-webkit-details-marker { display: none; }
details.style-opts summary::after { content: "+"; font-size: 24px; line-height: 1; }
details.style-opts[open] summary::after { content: "\2212"; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 14px; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type="color"] { width: 46px; height: 44px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: none; padding: 3px; flex: none; cursor: pointer; }
.color-row input[type="text"] { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; grid-column: 1 / -1; align-items: center; }
.swatches span { font-size: 14px; color: var(--muted); margin-right: 4px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.linkish { background: none; border: 0; color: var(--ink); font: 600 15px var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 0; }
.opt-actions { grid-column: 1 / -1; display: flex; gap: 18px; flex-wrap: wrap; }
input[type="range"] { width: 100%; accent-color: var(--ink); }
input[type="file"] { font: 15px var(--body); max-width: 100%; }
.hint { font-size: 14px; color: var(--muted); margin: 0; font-weight: 400; }

/* The tag: the preview hangs from a key ring */
.tag-col { position: sticky; top: 16px; }
.ring { height: 56px; margin: 0 auto -32px; width: 120px; color: var(--ring); position: relative; z-index: 1; }
.tag {
  position: relative; background: var(--tag); color: var(--tag-ink);
  border-radius: 28px 28px var(--radius-lg) var(--radius-lg); padding: 38px 20px 20px;
  box-shadow: 0 1px 0 rgba(20, 33, 61, .15), 0 18px 40px -22px rgba(20, 33, 61, .55);
  transform: rotate(-1.2deg);
}
.tag::before {
  content: ""; position: absolute; top: 12px; left: 50%; width: 16px; height: 16px; margin-left: -8px;
  border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 3px rgba(20, 33, 61, .25);
}
.qr-box { background: #fff; border-radius: 12px; padding: 10px; aspect-ratio: 1; display: grid; place-items: center; }
.qr-box canvas, .qr-box svg { width: 100% !important; height: auto !important; }
.is-empty .qr-box { opacity: .45; }
.tag .bytes { font-size: 13px; margin: 8px 2px 0; opacity: .75; }
.scan-status { font-size: 14.5px; line-height: 1.4; margin: 14px 0 0; padding: 10px 12px 10px 36px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .55); position: relative; min-height: 44px; }
.scan-status::before { content: ""; position: absolute; left: 12px; top: 13px; width: 14px; height: 14px; border-radius: 50%; background: #8a93a6; }
.scan-status.ok::before { background: #17784a; }
.scan-status.warn::before { background: #c27a00; }
.scan-status.bad::before { background: #b42318; }
.scan-status.checking::before { background: transparent; border: 2px solid #14213d; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.downloads { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.btn {
  font: 700 16px/1 var(--body); border-radius: var(--radius-sm); padding: 13px 10px; cursor: pointer;
  border: 2px solid var(--tag-ink); background: var(--tag-ink); color: #fff; text-align: center; text-decoration: none; display: inline-block;
}
.btn.ghost { background: transparent; color: var(--tag-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.size-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 14.5px; }
.size-row label { font-size: 14.5px; }
.size-row select { width: auto; padding: 7px 10px; font-size: 15px; background: #fff; color: #14213d; border-color: rgba(20, 33, 61, .3); }
.copy-row { margin-top: 10px; display: flex; justify-content: center; }
.copy-row .linkish { color: var(--tag-ink); }
.privacy-note { font-size: 14px; color: var(--muted); margin: 18px 4px 0; }

/* Content sections */
.section { padding: 48px 0; border-top: 1px solid var(--line); }
.section h2 { font: 800 clamp(28px, 3.6vw, 40px)/1.08 var(--display); letter-spacing: -0.025em; margin: 0 0 18px; max-width: 22ch; }
.section h3 { font: 700 20px/1.25 var(--display); margin: 0 0 8px; }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 14px; }
.compare { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 16px; }
.compare th, .compare td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font: 700 16px var(--display); }
.compare tbody th { font-weight: 400; }
.compare td.us { font-weight: 700; }
.compare .us-head { background: var(--tag); color: var(--tag-ink); border-radius: 10px 10px 0 0; }
.compare td.us { background: color-mix(in srgb, var(--tag) 22%, transparent); }
.table-scroll { overflow-x: auto; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 26px; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding-top: 52px; }
.steps li::before { content: counter(s); position: absolute; top: 0; left: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--surface); display: grid; place-items: center; font: 800 19px var(--display); }
.steps p { margin: 0; color: var(--muted); }
.type-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 28px; list-style: none; padding: 0; margin: 0; }
.type-links li { border-bottom: 1px solid var(--line); }
.type-links a { display: block; padding: 13px 0; text-decoration: none; }
.type-links a:hover strong { text-decoration: underline; }
.type-links span { display: block; font-size: 14.5px; color: var(--muted); }
.faq details { border-bottom: 1px solid var(--line); max-width: 780px; }
.faq summary { cursor: pointer; padding: 16px 0; font: 700 18px/1.35 var(--display); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; line-height: 1; flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 18px; max-width: 68ch; }
.faq p { margin: 0 0 10px; }

/* Tools: bulk & scanner */
.tool { margin: 8px 0 56px; }
.tool textarea { min-height: 220px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; }
.tool-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: 14px; }
.tool-row .btn { background: var(--ink); border-color: var(--ink); color: var(--surface); padding: 14px 22px; }
.tool-row .btn.ghost { background: transparent; color: var(--ink); }
.status-line { margin: 12px 0 0; color: var(--muted); min-height: 1.5em; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#scan-video { width: 100%; max-width: 480px; border-radius: var(--radius-lg); margin-top: 16px; background: #000; }
.scan-result { margin-top: 18px; padding: 18px; border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--line); }
.scan-result pre { white-space: pre-wrap; word-break: break-word; font: 16px/1.5 ui-monospace, "SF Mono", Menlo, monospace; margin: 0 0 12px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 15px; color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.theme-toggle { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 14px var(--body); cursor: pointer; }

@media (max-width: 860px) {
  .generator { grid-template-columns: minmax(0, 1fr); }
  .tag-col { position: static; max-width: 380px; width: 100%; margin: 0 auto; }
  .tag { transform: none; }
}
@media (max-width: 480px) {
  body { font-size: 16.5px; }
  .panel { padding: 16px; border-radius: 14px; }
  .site-nav { gap: 12px; font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .site-head, .site-foot, .section, .panel, .ring, .downloads, .scan-status, .size-row, .copy-row, .privacy-note, .hero { display: none !important; }
  .generator { display: block; }
  .tag { background: none; box-shadow: none; transform: none; }
}

/* Self-hosted fonts: no third-party requests */
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Expiry checker */
.check-form { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; max-width: 560px; }
.check-row { display: flex; gap: 8px; flex-wrap: wrap; }
.check-row input { flex: 1 1 220px; min-width: 0; }
.check-row .btn, .tool-row .btn { background: var(--ink); border-color: var(--ink); color: var(--surface); padding: 12px 18px; }
.verdict { border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 16px; border: 2px solid var(--line); background: var(--surface); }
.verdict h3 { font: 700 20px/1.25 var(--display); margin: 0 0 6px; }
.verdict p { margin: 0 0 12px; max-width: 68ch; }
.verdict.ok { border-color: var(--ok); }
.verdict.ok h3 { color: var(--ok); }
.verdict.warn { border-color: var(--warn); }
.verdict.warn h3 { color: var(--warn); }
.verdict.bad { border-color: var(--bad); }
.verdict.bad h3 { color: var(--bad); }
.verdict .btn { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* Printable signs */
.signs { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; margin: 8px 0 56px; }
.sign-col { position: sticky; top: 16px; }
.sign-frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; display: grid; place-items: center; }
.sign-frame canvas { width: 100%; height: auto; max-width: 100%; box-shadow: 0 1px 0 rgba(20, 33, 61, .12), 0 14px 30px -18px rgba(20, 33, 61, .5); border-radius: 4px; background: #fff; }
.sign-col .scan-status { background: var(--surface); border: 1px solid var(--line); }
.downloads.two { grid-template-columns: 1fr 1fr; }
.downloads.two .btn { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.downloads.two .btn.ghost { background: transparent; color: var(--ink); }
@media (max-width: 860px) {
  .signs { grid-template-columns: minmax(0, 1fr); }
  .sign-col { position: static; max-width: 420px; width: 100%; margin: 0 auto; }
}

/* Articles */
.byline { font-size: 15px; color: var(--muted); margin: 14px 0 0; }
.article .prose { max-width: 68ch; }
.article .prose h2 { font: 800 clamp(24px, 3vw, 30px)/1.15 var(--display); letter-spacing: -0.02em; margin: 34px 0 12px; }
.article .prose ul, .article .prose ol { padding-left: 1.3em; margin: 0 0 16px; }
.article .prose li { margin-bottom: 8px; }
.article .table-scroll { margin: 22px 0 26px; }
.btn-inline { display: inline-block; margin-top: 10px; background: var(--ink); color: var(--surface); text-decoration: none; font-weight: 700; padding: 13px 20px; border-radius: var(--radius-sm); }
.btn-inline:hover { filter: brightness(1.15); }
.guide-index { margin: 8px 0 56px; max-width: 860px; }

/* Thank-you note after a download */
.thanks { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .7); color: #14213d; font-size: 15px; }
.signs .thanks, #bulk .thanks { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.thanks p { margin: 0 0 4px; }
.thanks-row { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.thanks .linkish { color: inherit; font-size: 14.5px; }

/* Sign palette swatches */
.label { font-size: 15px; font-weight: 700; }
.palette-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.pal { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.pal[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.signs input[type="color"] { width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: none; padding: 3px; cursor: pointer; }
.signs .opt-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
