/* The TigerQR Label site: the look of the TigerTag protocol site (dark by
   default, light when the system asks for it or when chosen with the button). */
:root {
  --bg: #14161a; --card: #1e2128; --line: #2b2f38; --text: #f2f2f2;
  --muted: #9aa0aa; --accent: #f58220; --link: #f58220; --code: #101216;
  --shadow: rgba(0, 0, 0, .45); --plate: #0f1114; --ok: #2f9e44; --private: #f08c00;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f5f7; --card: #ffffff; --line: #dde0e6; --text: #16181d;
    --muted: #5d6470; --accent: #e06d0c; --link: #b04a08; --code: #f0f1f4;
    --shadow: rgba(0, 0, 0, .12); --plate: #e9ebef;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f4f5f7; --card: #ffffff; --line: #dde0e6; --text: #16181d;
  --muted: #5d6470; --accent: #e06d0c; --link: #b04a08; --code: #f0f1f4;
  --shadow: rgba(0, 0, 0, .12); --plate: #e9ebef;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: clip;
}
a { color: var(--link); }
img { max-width: 100%; height: auto; }
.wrap { width: min(1200px, 100% - 48px); margin-left: auto; margin-right: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; z-index: 10; }
p { color: var(--muted); margin: 0 0 14px; }
b, strong { color: var(--text); }
h1, h2, h3 { line-height: 1.2; color: var(--text); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); margin: 0 0 8px; letter-spacing: -.01em; }
h3 { font-size: 1.08rem; margin: 0 0 8px; }
.sub { font-size: 1.05rem; max-width: 780px; margin-bottom: 22px; }
section { margin-top: 72px; scroll-margin-top: 80px; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { font-size: .92em; color: var(--text); }
pre { margin: 0 0 14px; background: var(--code); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: .88rem; line-height: 1.5; color: var(--text); }
:not(pre) > code { background: var(--code); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.ico { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Header: the logo, the sections, the theme, GitHub. */
header.bar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
header.bar .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brandmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; white-space: nowrap; }
.brandmark b { color: var(--accent); }
.brandmark img { height: 34px; width: auto; }
.logo-light { display: none; }
:root[data-shown="light"] .logo-light { display: block; }
:root[data-shown="light"] .logo-dark { display: none; }
.nav { display: flex; gap: 18px; flex: 1; justify-content: center; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--text); }
.tools { display: flex; gap: 8px; align-items: center; }
.iconbtn {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 10px; cursor: pointer;
  color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: .9rem; text-decoration: none;
}
.iconbtn:hover { border-color: var(--accent); color: var(--text); }
.iconbtn svg { width: 18px; height: 18px; flex: none; }
.themebtn .sun { display: none; }
:root[data-shown="light"] .themebtn .sun { display: block; }
:root[data-shown="light"] .themebtn .moon { display: none; }

/* Hero: the words, and the labels as separate floating layers. */
.hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 32px; align-items: center; margin-top: 40px; }
h1 { margin: 0; }
h1 .kicker, h1 .name { display: block; }
.kicker { color: var(--accent); font-weight: 650; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; margin-bottom: 10px; }
.hero .name { font-size: clamp(3rem, 1.8rem + 5vw, 5.2rem); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.hero .name span { color: var(--accent); }
.headline { text-wrap: balance; margin: 16px 0 12px; color: var(--text); font-weight: 650; line-height: 1.25; font-size: clamp(1.25rem, 1rem + 1.1vw, 1.8rem); }
.lead { font-size: 1.08rem; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--line); color: var(--text); background: var(--card); font-weight: 600; font: inherit; font-weight: 600; cursor: pointer;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a0f05; }
.btn.primary svg { stroke: #1a0f05; }
.btn.big { padding: 16px 28px; font-size: 1.08rem; }
.btn.small { padding: 7px 13px; font-size: .88rem; }
.stage { position: relative; aspect-ratio: 1000 / 640; }
.stage img { position: absolute; display: block; height: auto; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); }
.stage .l-vertical { left: 0; top: 17%; width: 34%; transform: rotate(-5deg); }
.stage .l-classic { left: 30%; top: 0; width: 50%; transform: rotate(2deg); }
.stage .l-slim { left: 50%; top: 66%; width: 42%; transform: rotate(-2deg); }
.stage .l-qr { left: 82%; top: 9%; width: 18%; transform: rotate(6deg); }

/* Four facts. */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 40px; }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.fact b { display: block; font-size: 1.55rem; color: var(--accent); line-height: 1.2; }
.fact span { color: var(--muted); font-size: .93rem; }

/* Cards and grids. */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.card p:last-child { margin-bottom: 0; }
.card.accent { border-color: var(--accent); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid2 > *, .grid3 > *, .tool > *, .gallery > * { min-width: 0; }
.metro code, .card code { overflow-wrap: anywhere; }
.pill { display: inline-block; font: 600 .78rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; margin-bottom: 12px; }
.linkbig { display: block; font: 700 clamp(.95rem, .8rem + .5vw, 1.15rem) ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); text-decoration: none; word-break: break-all; margin: 4px 0 12px; }
.linkbig span { color: var(--accent); }
.linkbig:hover { text-decoration: underline; }
.cardhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cardhead h3 { margin: 0; }
.mt { margin-top: 16px; }
.small { font-size: .88rem; }
ul.plain { margin: 0; padding-left: 18px; color: var(--muted); }
ul.plain li { margin-bottom: 6px; }

/* Tables. */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Diagrams (inline SVG, coloured by the theme). */
.diagram { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram .box { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.diagram .box.pub { stroke: var(--ok); fill: color-mix(in srgb, var(--ok) 12%, var(--bg)); }
.diagram .box.priv { stroke: var(--private); fill: color-mix(in srgb, var(--private) 12%, var(--bg)); }
.diagram .box.start { stroke: var(--accent); }
.diagram text { fill: var(--text); font: 600 15px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.diagram text.m { fill: var(--muted); font-weight: 500; font-size: 13px; }
.diagram text.c { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; fill: var(--accent); }
.diagram .wire { stroke: var(--muted); stroke-width: 1.8; fill: none; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: .9rem; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; border: 2px solid; }
.sw.pub { border-color: var(--ok); } .sw.priv { border-color: var(--private); }

/* The reading order, as a metro line: one station a rule, in order. */
.metro { list-style: none; margin: 0; padding: 0; position: relative; }
.metro::before { content: ""; position: absolute; left: 17px; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--accent); }
.metro li { position: relative; padding: 0 0 18px 56px; }
.metro li:last-child { padding-bottom: 0; }
.metro .st { position: absolute; left: 4px; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--bg); border: 4px solid var(--accent); display: grid; place-items: center; font: 800 .8rem system-ui, sans-serif; color: var(--text); }
.metro b { display: block; margin-bottom: 2px; }
.metro p { margin: 0; font-size: .95rem; }

/* Formats gallery. */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; background: var(--card); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tab { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 650; padding: 9px 14px; border-radius: 9px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px var(--shadow); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fmt { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.fmt .plate { display: grid; place-items: center; background: var(--plate); padding: 26px 18px; height: 250px; }
.fmt .plate img { display: block; height: auto; max-width: 100%; border-radius: 6px; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); background: #fff; }
.fmt .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.fmt h3 { margin: 0; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.fmt h3 small { color: var(--muted); font-weight: 500; font-size: .88rem; white-space: nowrap; }
.fmt p { margin: 0; font-size: .92rem; }
.fmt .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.figure { margin: 0; }
.figure img { display: block; width: 100%; border-radius: 18px; }
.figure figcaption { color: var(--muted); font-size: .92rem; margin-top: 10px; }

/* Tools: link generator and reader. */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.f { display: block; margin-bottom: 12px; }
.f > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 5px; }
.f select, .f input {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.f input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.f select:focus, .f input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.out { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; }
.qrbox { width: 150px; aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 10px; display: grid; place-items: center; }
.qrbox svg { width: 100%; height: 100%; display: block; }
.qrbox:empty::after { content: ""; width: 60%; height: 60%; border: 2px dashed #c8ccd3; border-radius: 8px; }
.result { font: 700 1rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); word-break: break-all; margin: 0 0 6px; }
.result.err { color: #f06a6a; font-family: inherit; font-weight: 600; }
.meta { color: var(--muted); font-size: .88rem; margin: 0 0 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.json { min-height: 140px; margin: 0; }
pre.wrapcode { white-space: pre-wrap; word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { font: 600 .78rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.apiprev { display: grid; place-items: center; background: var(--plate); border-radius: 14px; min-height: 230px; padding: 20px; }
.apiprev img { max-width: 100%; height: auto; background: #fff; border-radius: 6px; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }

/* The call at the end. */
.join {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 32px 34px; border-radius: 20px; color: #fff;
  background: linear-gradient(120deg, #c2410c 0%, #b03a12 55%, #9a2f12 100%);
}
.join h2, .join p { color: #fff; margin: 0 0 6px; }
.joinbtn { flex: none; display: inline-flex; align-items: center; gap: 10px; padding: 16px 28px; border-radius: 999px; text-decoration: none; background: #fff; color: #9a2f12; font-weight: 750; font-size: 1.05rem; white-space: nowrap; }
.joinbtn svg { width: 20px; height: 20px; stroke: #9a2f12; }
.comm { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.comm li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.comm a { font-weight: 700; display: block; text-decoration: none; }
.comm span { color: var(--muted); font-size: .93rem; }
footer.foot { margin-top: 56px; padding: 28px 0 48px; border-top: 1px solid var(--line); text-align: center; font-size: .9rem; color: var(--muted); }
footer.foot p { margin: 6px 0; }

/* Tablet. */
@media (max-width: 999px) {
  .nav { display: none; }
  header.bar .wrap { justify-content: space-between; }
  .hero { grid-template-columns: 1fr; gap: 18px; text-align: center; }
  .ctas { justify-content: center; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3, .gallery, .comm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool { grid-template-columns: 1fr; }
}
/* Phone. */
@media (max-width: 639px) {
  .wrap { width: calc(100% - 32px); }
  section { margin-top: 48px; }
  .facts, .grid3, .grid2, .gallery, .comm { grid-template-columns: 1fr; }
  .card { padding: 20px; border-radius: 14px; }
  .out { grid-template-columns: 1fr; }
  .join { flex-direction: column; align-items: flex-start; padding: 24px 20px; }
  .joinbtn { align-self: stretch; justify-content: center; }
  .iconbtn span { display: none; }
  .f2 { grid-template-columns: 1fr; }
}
