/*!
 * qr-code-free.org — https://github.com/spidfire/qr-code-free-org
 * Licensed under the Apache License 2.0.
 */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --ink-soft: #475069;
  --muted: #6b7490;
  --line: #e2e7f0;
  --line-strong: #cfd6e4;
  --accent: #4f46e5;
  --accent-soft: #eef0fe;
  --accent-ink: #ffffff;
  --ok: #0f7a4f;
  --ok-soft: #e6f6ee;
  --warn: #8a5300;
  --warn-soft: #fdf3e2;
  --bad: #b42318;
  --bad-soft: #fdeceb;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -12px rgba(15, 23, 42, .14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080b14;
    --surface: #111726;
    --surface-2: #161d30;
    --ink: #e9edf8;
    --ink-soft: #b9c2d9;
    --muted: #8e99b5;
    --line: #222b42;
    --line-strong: #2d3854;
    --accent: #8b8cf7;
    --accent-soft: #1b2140;
    --accent-ink: #0b1020;
    --ok: #5fd3a0;
    --ok-soft: #10271f;
    --warn: #f0b356;
    --warn-soft: #2a1f0d;
    --bad: #ff8f84;
    --bad-soft: #2b1414;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); }
h3 { font-size: 1.12rem; margin-top: 1.6em; }

code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: .1em .35em; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 20;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

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

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.06rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); }
.brand-dim { color: var(--muted); font-weight: 600; }
.header-nav { display: flex; align-items: center; gap: 4px; }
.header-nav a { color: var(--ink-soft); text-decoration: none; padding: 7px 11px; border-radius: 8px; font-size: .93rem; font-weight: 500; }
.header-nav a:hover { background: var(--surface); color: var(--ink); }
.header-nav .gh { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); margin-left: 6px; }
@media (max-width: 640px) { .header-nav a:not(.gh) { display: none; } }

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

.hero { padding: 44px 0 26px; max-width: 760px; }
.lede { font-size: clamp(1rem, 1.6vw, 1.14rem); color: var(--ink-soft); margin: 0 0 18px; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin: 0; padding: 0; }
.badges li {
  font-size: .81rem; font-weight: 600; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px;
}
.badges li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: 5px; }

.notice { border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); }
.notice--warn { border-color: var(--warn); background: var(--warn-soft); color: var(--ink); }

/* --------------------------------------------------------------------- app */

.app { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 940px) { .app { grid-template-columns: minmax(0, 1fr); } }
.col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
@media (min-width: 941px) { .card--sticky { position: sticky; top: 82px; } }

.step { display: flex; align-items: center; gap: 10px; font-size: 1.08rem; margin: 0 0 16px; }
.step-num {
  display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px;
  background: var(--ink); color: var(--surface); font-size: .84rem; font-weight: 700; flex: none;
}

/* type picker */

.type-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px; margin-bottom: 20px; }
.type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 11px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink-soft); font: inherit; font-size: .82rem; font-weight: 600;
  cursor: pointer; text-align: center; line-height: 1.2;
}
.type-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.type-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.type-btn[aria-checked="true"] {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* fields */

.fields { display: grid; gap: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 13px; align-items: flex-end; margin-top: 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field--grow { flex: 1 1 190px; }
.field--half { flex: 1 1 calc(50% - 7px); }
.fields.two-col { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .fields.two-col { grid-template-columns: 1fr; } }
.fields .full { grid-column: 1 / -1; }

.label { font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.label--block { display: block; margin: 16px 0 7px; }
.label output { font-weight: 500; color: var(--ink-soft); }

input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"], select, textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 9px 11px; min-height: 40px;
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 28px; }
input[type="color"] {
  -webkit-appearance: none; appearance: none; width: 46px; height: 40px; padding: 3px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }
.field--colour { flex: none; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; color: var(--ink-soft); cursor: pointer; line-height: 1.4; }
.check input { margin: 2px 0 0; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.check small { color: var(--muted); }

.hint { font-size: .85rem; color: var(--muted); margin: 12px 0 0; }
.hint--centre { text-align: center; }

/* tabs */

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs button {
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 9px 12px; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* style pickers */

.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.picker--frames { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); max-height: 268px; overflow-y: auto; padding-right: 3px; }
.swatch-btn {
  display: grid; gap: 5px; justify-items: center; padding: 7px 5px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; font: inherit; font-size: .72rem; font-weight: 600; color: var(--muted); line-height: 1.15;
}
.swatch-btn img { display: block; width: 100%; height: auto; max-width: 62px; border-radius: 4px; }
.swatch-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.swatch-btn[aria-checked="true"] { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }

.palette { display: flex; flex-wrap: wrap; gap: 7px; }
.palette button {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line-strong);
  cursor: pointer; padding: 0; position: relative; overflow: hidden;
}
.palette button span { position: absolute; inset: 24% 24% 24% 24%; border-radius: 3px; }

/* logo */

.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.file-btn { position: relative; overflow: hidden; display: inline-block; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-btn span {
  display: inline-block; font-size: .9rem; font-weight: 600; padding: 9px 15px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-soft);
}
.file-btn:hover span { border-color: var(--accent); color: var(--accent); }
#logo-preview { width: 44px; height: 44px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 3px; }

/* ------------------------------------------------------------- output side */

.preview {
  position: relative; display: grid; place-items: center; padding: 18px; min-height: 260px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.preview--alpha {
  background:
    linear-gradient(45deg, var(--surface-2) 25%, transparent 25%, transparent 75%, var(--surface-2) 75%) 0 0/18px 18px,
    linear-gradient(45deg, var(--surface-2) 25%, transparent 25%, transparent 75%, var(--surface-2) 75%) 9px 9px/18px 18px,
    var(--surface);
}
#preview { display: block; width: auto; height: auto; max-width: 100%; max-height: 340px; border-radius: 4px; }
#preview[hidden] { display: none; }
.preview-empty { color: var(--muted); font-size: .9rem; text-align: center; max-width: 220px; margin: 0; }

.formats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.format-btn {
  flex: 1 1 auto; min-width: 58px; font: inherit; font-size: .84rem; font-weight: 600;
  padding: 8px 10px; cursor: pointer; color: var(--ink-soft); text-align: center;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.format-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.format-btn[aria-checked="true"] {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.btn--download {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; margin-top: 9px; padding: 13px;
}
.btn--download svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn {
  font: inherit; font-size: .92rem; font-weight: 600; padding: 11px 12px; cursor: pointer;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover:not(:disabled) { filter: brightness(1.08); color: var(--accent-ink); }
.btn--ghost { background: none; border-style: dashed; }
.btn--wide { display: inline-block; padding: 13px 22px; text-decoration: none; }
.cta-row { margin: 18px 0; }

.report { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.report h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.report dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; font-size: .88rem; }
.report dt { color: var(--muted); }
.report dd { margin: 0; font-weight: 600; text-align: right; }
.report dd .tag { font-weight: 700; font-size: .78rem; padding: 1px 7px; border-radius: 999px; }
.tag--ok { background: var(--ok-soft); color: var(--ok); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--bad { background: var(--bad-soft); color: var(--bad); }

.warnings { list-style: none; margin: 13px 0 0; padding: 0; display: grid; gap: 7px; }
.warnings li {
  font-size: .85rem; line-height: 1.45; padding: 9px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft);
}
.warnings li.warn { background: var(--warn-soft); border-color: var(--warn); }
.warnings li.warn { border-color: color-mix(in srgb, var(--warn) 34%, var(--line)); }
.warnings li.bad { background: var(--bad-soft); border-color: var(--bad); }
.warnings li.bad { border-color: color-mix(in srgb, var(--bad) 34%, var(--line)); }
.warnings li.ok { background: var(--ok-soft); border-color: var(--ok); }
.warnings li.ok { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }

/* ------------------------------------------------------------------- prose */

.prose { max-width: 760px; padding: 44px 0 6px; }
.prose p, .prose li { color: var(--ink-soft); }
.prose strong { color: var(--ink); }
.list { padding-left: 1.1em; display: grid; gap: 9px; }
.list--check { list-style: none; padding-left: 0; counter-reset: step; }
.list--check li { position: relative; padding-left: 34px; counter-increment: step; }
.list--check li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 23px; height: 23px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 700;
}

.rule { border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin: 18px 0; }
.rule-title { font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.rule p:last-child { margin-bottom: 0; }

.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 12px; margin: 18px 0 24px; }
.calc-input { display: flex; gap: 8px; }
.calc-input input { max-width: 120px; }
.calc-input select { max-width: 110px; }
.calc-out { display: grid; gap: 8px; font-size: .92rem; }
.calc-out strong { color: var(--ink); }
.calc-line { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; border-top: 1px dashed var(--line); padding-top: 8px; }
.calc-line span:first-child { color: var(--muted); }
.calc-big { font-size: 1.5rem; font-weight: 700; color: var(--accent); letter-spacing: -.02em; }

.table-wrap { overflow-x: auto; margin: 16px 0 8px; -webkit-overflow-scrolling: touch; }
.table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .9rem; }
.table caption { text-align: left; font-size: .8rem; color: var(--muted); padding-bottom: 7px; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.table tbody tr:hover { background: var(--surface); }

.defs { display: grid; gap: 4px; margin: 16px 0; }
.defs dt { font-weight: 700; color: var(--ink); margin-top: 12px; }
.defs dd { margin: 0; color: var(--ink-soft); }

details {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 16px; margin-bottom: 8px;
}
details summary { cursor: pointer; font-weight: 600; padding: 13px 0; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; font-weight: 400; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { margin: 0 0 14px; }

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

.site-footer { margin-top: 56px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { padding: 26px 20px; font-size: .88rem; color: var(--muted); display: grid; gap: 5px; }
.footer-inner p { margin: 0; }
