/* qrx.apphaus.us. Colours are tokens; dark mode follows the system. The seven bars are the test card's. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #16161a;
  --muted: #55555f;
  --line: #e2dfd8;
  --accent: #2442c4;
  --accent-ink: #ffffff;
  --accent-soft: #e8ecff;
  --focus: #2442c4;
  --shadow: 0 1px 2px rgb(20 20 30 / 6%), 0 8px 24px rgb(20 20 30 / 8%);

  --bar-1: #ebebeb;
  --bar-2: #f2c72a;
  --bar-3: #29bdd1;
  --bar-4: #3cb453;
  --bar-5: #c43fbf;
  --bar-6: #df3232;
  --bar-7: #2a4bc8;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  --wrap: 72rem;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111114;
    --surface: #1a1a1f;
    --surface-2: #222228;
    --text: #f1f0ec;
    --muted: #a6a6b0;
    --line: #2e2e36;
    --accent: #8ea3ff;
    --accent-ink: #0d0f1c;
    --accent-soft: #1d2242;
    --focus: #b3c1ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
    --bar-1: #d9d9d9;
  }
}

@media (min-width: 640px) {
  :root { --gutter: 24px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }

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

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 750; margin-top: 0; }
h3 { font-size: 1.2rem; font-weight: 700; }
p, ul, ol { margin: 0 0 1em; }
li + li { margin-top: 0.35em; }

code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0.05em 0.35em; }
pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9em 1em;
  overflow-x: auto;
  line-height: 1.5;
  margin: 0 0 1em;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 46rem; }
.fine { font-size: 0.875rem; color: var(--muted); }
.kicker { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.35em; }
.lede { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 40rem; }

.skip {
  position: absolute; left: 8px; top: -100px; z-index: 10;
  background: var(--accent); color: var(--accent-ink); padding: 0.5em 1em; border-radius: 8px;
}
.skip:focus { top: 8px; }

/* Header */

.site-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.8rem; padding-bottom: 0.8rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; }
.brand__mark { width: 32px; height: 32px; color: var(--text); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.15rem 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: block; padding: 0.4rem 0.7rem; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 550; font-size: 0.97rem;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--text); color: var(--bg); }

.bars { display: grid; grid-template-columns: repeat(7, 1fr); height: 4px; }
.bars i:nth-child(1) { background: var(--bar-1); }
.bars i:nth-child(2) { background: var(--bar-2); }
.bars i:nth-child(3) { background: var(--bar-3); }
.bars i:nth-child(4) { background: var(--bar-4); }
.bars i:nth-child(5) { background: var(--bar-5); }
.bars i:nth-child(6) { background: var(--bar-6); }
.bars i:nth-child(7) { background: var(--bar-7); }

/* Sections */

.section { padding: clamp(2.5rem, 7vw, 5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section--tint { background: var(--surface-2); }
.page-head { padding: clamp(2rem, 6vw, 4rem) 0 clamp(1rem, 3vw, 2rem); }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); }

/* Buttons */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 44px; padding: 0.6em 1.15em;
  border: 1.5px solid var(--accent); border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.08); text-decoration: none; }
.button--quiet { background: transparent; color: var(--accent); }
.button--small { min-height: 36px; padding: 0.35em 0.9em; font-size: 0.9rem; }
.button[disabled] { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Home: hero */

.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 860px) { .hero__grid { grid-template-columns: 1.1fr 0.9fr; } }
.hero h1 span { color: var(--accent); }

.hero-figure { position: relative; margin: 0 auto; width: min(100%, 360px); aspect-ratio: 1 / 1.3; }
.hero-figure__card {
  position: absolute; left: 14%; right: 14%; top: 0;
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow);
  transform: perspective(900px) rotateX(8deg);
  animation: float 6s ease-in-out infinite;
}
.hero-figure__card img { display: block; width: 100%; height: auto; }
.hero-figure__code {
  position: absolute; left: 25%; right: 25%; bottom: 0;
  background: #fff; border-radius: 8px; box-shadow: var(--shadow); padding: 2%;
  transform: perspective(700px) rotateX(48deg);
  transform-origin: 50% 100%;
}
.hero-figure__code svg { display: block; width: 100%; height: auto; }
.hero-figure__beam {
  position: absolute; left: 16%; right: 16%; top: 52%; bottom: 12%;
  background: linear-gradient(to top, color-mix(in srgb, var(--accent) 30%, transparent), transparent 90%);
  clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%);
}
@keyframes float { 50% { transform: perspective(900px) rotateX(8deg) translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .hero-figure__card { animation: none; } }

/* Home: steps, platforms, types */

.steps { display: grid; gap: 1.25rem; counter-reset: step; list-style: none; padding: 0; margin: 2rem 0 0; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.2rem; }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 2.2rem; height: 2.2rem; margin-bottom: 0.9rem;
  border-radius: 50%; background: var(--text); color: var(--bg); font-weight: 800;
}
.steps li p { color: var(--muted); margin: 0; }

.grid-cards { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 640px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-cards--4 { grid-template-columns: repeat(4, 1fr); } .grid-cards--3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.card h3 { display: flex; align-items: center; gap: 0.55rem; }
.card p { color: var(--muted); margin: 0; }
.card p + p { margin-top: 0.6em; }
.card .icon { width: 1.6rem; height: 1.6rem; flex: none; color: var(--accent); }
.card--bar { border-top: 5px solid var(--card-bar, var(--accent)); }

.note {
  border: 1px solid var(--line); border-left: 5px solid var(--bar-2);
  background: var(--surface); border-radius: 10px; padding: 1rem 1.2rem; margin: 1.5rem 0;
}
.note p:last-child { margin-bottom: 0; }

/* Try it: glyph cards */

.glyph-grid { display: grid; gap: 1.25rem; margin: 1.5rem 0 0; }
@media (min-width: 720px) { .glyph-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .glyph-grid--3 { grid-template-columns: repeat(3, 1fr); } }
.glyph-card {
  display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); gap: 1.1rem; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem;
}
.glyph-grid--3 .glyph-card { grid-template-columns: 1fr; }
.glyph-grid--3 .glyph-card__code { max-width: 15rem; }
.glyph-card__code { background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.glyph-card__code svg { display: block; width: 100%; height: auto; }
.glyph-card h3 { margin-bottom: 0.3em; }
.glyph-card p { margin-bottom: 0.6em; color: var(--muted); }
.glyph-card details { margin: 0.4rem 0 0.6rem; }
.glyph-card summary { cursor: pointer; font-weight: 600; color: var(--text); width: max-content; }
.payload { font-size: 0.8rem; white-space: pre-wrap; word-break: break-all; }
.glyph-card .payload { margin: 0.6rem 0 0.4rem; }
.glyph-card__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0; }
@media (max-width: 480px) {
  .glyph-card { grid-template-columns: 1fr; }
  .glyph-card__code { max-width: 13rem; }
}

/* Make a glyph: generator */

.maker { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
@media (min-width: 900px) { .maker { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 3vw, 1.5rem); }
.maker__out { position: sticky; top: 1rem; }
.field { margin: 0 0 1.1rem; }
.field > label, .field > legend, .label { display: block; font-weight: 650; margin-bottom: 0.35rem; }
.field .hint { font-size: 0.875rem; color: var(--muted); margin: 0.35rem 0 0; }
fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
input[type="text"], input[type="url"], select, textarea {
  width: 100%; min-height: 44px; padding: 0.55em 0.75em;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text);
  font: inherit;
}
textarea { font-family: var(--mono); font-size: 0.85rem; line-height: 1.5; min-height: 12rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bar-6); }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--line); border-radius: 14px; padding: 3px; gap: 3px; background: var(--bg); }
.segmented label { position: relative; flex: 1 1 auto; text-align: center; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 0.4em 1em; border-radius: 10px; font-weight: 600; font-size: 0.95rem; }
.segmented input:checked + span { background: var(--text); color: var(--bg); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.check, .field > label.check { display: flex; gap: 0.55rem; align-items: flex-start; font-weight: 400; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: 0.25rem; accent-color: var(--accent); }
.row { display: grid; gap: 0.75rem; }
@media (min-width: 520px) { .row--2 { grid-template-columns: 1fr 1fr; } }
.presets { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.error { color: var(--bar-6); font-size: 0.9rem; font-weight: 600; margin: 0.35rem 0 0; }
@media (prefers-color-scheme: dark) { .error { color: #ff8a8a; } }
.qr-out { background: #fff; border-radius: 10px; border: 1px solid var(--line); max-width: 20rem; margin: 0 auto; }
.qr-out svg { display: block; width: 100%; height: auto; }
.qr-out--empty { display: grid; place-items: center; aspect-ratio: 1; color: #666; font-size: 0.9rem; padding: 1rem; text-align: center; }
.stats { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; justify-content: center; margin: 0.8rem 0; font-size: 0.875rem; color: var(--muted); }
.stats strong { color: var(--text); }
.warn { border-left-color: var(--bar-6); }

/* Tables (format reference) */

.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { background: var(--surface-2); font-weight: 700; }
td code { white-space: nowrap; }

.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose > :first-child { margin-top: 0; }

/* Footer */

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; margin-top: 2rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.site-footer p { margin: 0; }

/* Print: the codes, at the 6 cm the apps assume */

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #333; --line: #bbb; }
  body { font-size: 11pt; }
  .site-header, .site-footer, .no-print, .page-head .actions, .skip { display: none !important; }
  .section { padding: 0; border: 0 !important; }
  .page-head { padding: 0 0 6mm; }
  .page-head .lede { display: none; }
  .glyph-grid, .glyph-grid--3 { display: block; }
  .glyph-card, .glyph-grid--3 .glyph-card {
    display: grid; grid-template-columns: var(--print-width, 7.2cm) 1fr; gap: 6mm;
    break-inside: avoid; page-break-inside: avoid; border: 1px dashed #999; border-radius: 0; margin: 0 0 6mm; padding: 4mm;
  }
  /* --print-width (set per card by the build) includes the 4-module quiet zone, so the code itself prints 6 cm wide. */
  .glyph-card__code, .glyph-grid--3 .glyph-card__code { width: var(--print-width, 7.2cm); max-width: none; border: 0; }
  body[data-print-one] [data-print-card]:not(.is-printing), body[data-print-one] .page-head { display: none !important; }
  a { color: #000; text-decoration: none; }
}

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