@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/geist.woff2) format('woff2');
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/geist-mono.woff2) format('woff2');
}

/* Layout: quiet two-column tool. Controls on the left in a single column, the code on a
   floating white card on the right. Monochrome; one blue used only for focus and state. */
:root {
  --bg: #FBFBFA;
  --surface: #FFFFFF;
  --soft: #F3F3F1;
  --ink: #0A0A0A;
  --muted: #6E6E6B;
  --line: #E8E8E5;
  --accent: #2742E8;
  --on-ink: #FFFFFF;
  --warn: #9A4B00;
  --warn-bg: #FDF1E4;
  --ok: #17663A;
  --check-a: #ECECE9;
  --shadow: 0 1px 2px rgba(10, 10, 10, 0.04), 0 8px 32px -8px rgba(10, 10, 10, 0.10);

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-md: 1rem;
  --t-lg: 1.125rem;
  --t-xl: 1.5rem;
  --t-hero: clamp(2.5rem, 1.6rem + 3.8vw, 4.25rem);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0B0C;
    --surface: #141416;
    --soft: #1C1C1F;
    --ink: #F2F2F0;
    --muted: #8F8F94;
    --line: #26262A;
    --accent: #8EA0FF;
    --on-ink: #0B0B0C;
    --warn: #F2B36E;
    --warn-bg: #2E2012;
    --ok: #7FD39E;
    --check-a: #232326;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 40px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0B0C;
  --surface: #141416;
  --soft: #1C1C1F;
  --ink: #F2F2F0;
  --muted: #8F8F94;
  --line: #26262A;
  --accent: #8EA0FF;
  --on-ink: #0B0B0C;
  --warn: #F2B36E;
  --warn-bg: #2E2012;
  --ok: #7FD39E;
  --check-a: #232326;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 40px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--soft); padding: 1px 5px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: max(20px, env(safe-area-inset-left, 0px));
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--ink);
  color: var(--on-ink);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  z-index: 10;
}
.skip:focus { top: 8px; }

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 600;
  font-size: var(--t-lg);
  letter-spacing: -0.03em;
}
.brand-mark { width: 18px; height: 18px; fill: currentColor; }
.site-nav { display: flex; gap: 22px; font-size: var(--t-sm); }
.site-nav a { text-decoration: none; color: var(--muted); transition: color 0.15s; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(28px, 4vw, 48px); }
.hero h1 {
  margin: 0;
  font-size: var(--t-hero);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.lede {
  margin: 20px 0 0;
  max-width: 46ch;
  font-size: var(--t-lg);
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: -0.01em;
}

/* ---------- workbench ---------- */
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: 56px;
  align-items: start;
  padding-block: 0 96px;
}
@media (max-width: 880px) {
  .workbench { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .preview { order: -1; }
}

.controls { min-width: 0; display: grid; gap: 28px; }

/* content type: pill segmented control */
.type-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: -4px;
  padding: 4px;
}
.type-scroll::-webkit-scrollbar { display: none; }
.type-picker {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: var(--soft);
  border-radius: 999px;
  white-space: nowrap;
}
.type-picker label, .seg label, .size-picker label { position: relative; cursor: pointer; }
.type-picker input, .seg input, .size-picker input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.type-picker span {
  display: block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.type-picker label:hover span { color: var(--ink); }
.type-picker input:checked + span {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(10, 10, 10, 0.08), 0 0 0 1px var(--line);
}
.type-picker input:focus-visible + span,
.seg input:focus-visible + span,
.size-picker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* fields */
.fields { display: grid; gap: 16px; margin-top: -8px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 520px) { .field-row { grid-template-columns: minmax(0, 1fr); } }
.field > label, .color-field > label, .sublabel {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink);
}
.sublabel { display: block; margin-bottom: 8px; }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%;
  font: inherit;
  font-size: var(--t-md);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  min-height: 46px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.7; }
textarea { resize: vertical; min-height: 96px; }
input:hover, textarea:hover, select:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.hint { margin: 0; font-size: var(--t-sm); color: var(--muted); line-height: 1.45; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); cursor: pointer; }
.field-check { align-self: end; min-height: 46px; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }

/* groups */
.group { display: grid; gap: 14px; min-width: 0; padding-top: 24px; border-top: 1px solid var(--line); }
.group-title {
  margin: 0;
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: -0.005em;
}

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: transform 0.15s;
}
.swatch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%);
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.25);
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }

.color-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .color-grid { grid-template-columns: minmax(0, 1fr); } }
.color-field { display: grid; gap: 6px; min-width: 0; transition: opacity 0.15s; }
.color-input {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 5px;
}
.color-input:focus-within { border-color: var(--accent); }
.color-input input[type="color"] {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
.color-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 6px; }
.color-input input[type="color"]::-moz-color-swatch { border: 1px solid var(--line); border-radius: 6px; }
.color-input input[type="text"] {
  border: 0;
  min-height: 32px;
  padding: 0 2px;
  font-family: var(--mono);
  font-size: var(--t-sm);
  text-transform: uppercase;
  background: transparent;
  box-shadow: none;
}
.color-input input[type="text"][aria-invalid="true"] { color: var(--warn); }
.color-field.is-disabled { opacity: 0.4; }

.inline-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }

.link-btn {
  font: inherit;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }

.shape-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 520px) { .shape-row { grid-template-columns: minmax(0, 1fr); } }
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 3px;
  background: var(--soft);
  border-radius: var(--r-md);
}
.seg span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 4px 8px;
  border-radius: 9px;
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
  transition: color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.seg label:hover span { color: var(--ink); }
.seg input:checked + span {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(10, 10, 10, 0.08), 0 0 0 1px var(--line);
}
.seg svg { width: 18px; height: 18px; fill: currentColor; }
.seg-ecl b { font-family: var(--mono); font-size: var(--t-md); font-weight: 500; line-height: 1; }
.seg-ecl small { font-family: var(--mono); font-size: 0.6875rem; font-weight: 400; }

.logo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.file-btn { position: relative; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-btn span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--t-sm);
  font-weight: 500;
  background: var(--surface);
  transition: border-color 0.15s;
}
.file-btn:hover span { border-color: var(--muted); }
.file-btn input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.logo-thumb {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  padding: 3px;
}

.range-field label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.range-field output { font-family: var(--mono); font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--ink); margin: 4px 0; }

.advanced summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: "+"; font-family: var(--mono); font-weight: 400; color: var(--muted); }
.advanced[open] summary::after { content: "−"; }
.advanced-body { display: grid; gap: 20px; margin-top: 14px; }
.advanced-body .hint { margin-top: 8px; }

/* ---------- preview ---------- */
.preview { min-width: 0; position: sticky; top: calc(20px + env(safe-area-inset-top, 0px)); }
@media (max-width: 880px) { .preview { position: static; } }
.preview-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 18px;
}
.stage {
  display: grid;
  place-items: center;
  padding: 12px;
  background: var(--soft);
  border-radius: var(--r-md);
}
.qr-holder {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  line-height: 0;
  border-radius: 4px;
  overflow: hidden;
}
@media (max-width: 880px) { .qr-holder, .qr-empty { max-width: 240px; } }
.qr-holder svg { width: 100%; height: 100%; display: block; }
.qr-holder.is-transparent {
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, var(--check-a) 25%, transparent 25%, transparent 75%, var(--check-a) 75%),
    linear-gradient(45deg, var(--check-a) 25%, transparent 25%, transparent 75%, var(--check-a) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
}
.qr-holder.is-fresh svg { animation: settle 0.3s cubic-bezier(.2, .7, .3, 1); }
@keyframes settle { from { opacity: 0.4; transform: scale(0.985); } to { opacity: 1; transform: none; } }
.qr-empty {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: var(--t-sm);
}
.qr-empty p { margin: 0; max-width: 26ch; }

.spec {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.spec div { min-width: 0; }
.spec dt { font-size: 0.6875rem; color: var(--muted); }
.spec dd {
  margin: 1px 0 0;
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meter { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: -8px; }
.meter span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.25s ease-out; }

.status { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.status:empty { display: none; }
.status li { display: flex; gap: 9px; align-items: baseline; font-size: var(--t-sm); line-height: 1.4; color: var(--muted); }
.status li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translateY(-1px);
  background: var(--muted);
}
.status .ok::before { background: var(--ok); }
.status .warn { color: var(--warn); }
.status .warn::before { background: var(--warn); }
.status .note::before { background: var(--accent); }

.export { display: grid; gap: 10px; }
.size-picker { display: flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: var(--t-xs); }
.size-picker span:not(.size-unit) {
  display: block;
  padding: 5px 9px;
  border-radius: 6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.15s, background-color 0.15s;
}
.size-picker label:hover span { color: var(--ink); }
.size-picker input:checked + span { background: var(--soft); color: var(--ink); }
.size-unit { color: var(--muted); padding-left: 4px; }
.export-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.btn {
  font: inherit;
  font-size: var(--t-sm);
  font-weight: 500;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.08s, opacity 0.15s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
  min-height: 48px;
  font-size: var(--t-md);
}
.btn.primary:hover { opacity: 0.86; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.toast { margin: 0; min-height: 1.3em; font-size: var(--t-sm); color: var(--ok); text-align: center; }
.toast:empty { min-height: 0; margin-top: -10px; }
.preview-note { margin: 0; font-size: var(--t-xs); color: var(--muted); text-align: center; }

.payload { border-top: 1px solid var(--line); padding-top: 14px; }
.payload summary { cursor: pointer; font-size: var(--t-sm); color: var(--muted); }
.payload summary:hover { color: var(--ink); }
.payload pre {
  margin: 10px 0 6px;
  padding: 10px 12px;
  background: var(--soft);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: var(--t-xs);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow: auto;
}

/* ---------- content sections ---------- */
.section-title {
  margin: 0 0 32px;
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-wrap: balance;
}
.how { padding-block: 80px; border-top: 1px solid var(--line); }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
@media (max-width: 880px) { .how-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.how article { min-width: 0; }
.how h3 { margin: 0 0 8px; font-size: var(--t-md); font-weight: 600; letter-spacing: -0.01em; }
.how p { margin: 0; color: var(--muted); font-size: var(--t-sm); line-height: 1.6; max-width: 44ch; }

.faq { padding-block: 80px 96px; border-top: 1px solid var(--line); }
.faq-list { max-width: 720px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--muted); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--muted); max-width: 62ch; font-size: var(--t-sm); line-height: 1.65; }
.faq details p strong { color: var(--ink); font-weight: 600; }
.table-wrap { overflow-x: auto; margin-bottom: 20px; }
table { border-collapse: collapse; font-size: var(--t-sm); min-width: 100%; }
th, td { text-align: left; padding: 8px 16px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: var(--t-xs); font-weight: 500; color: var(--muted); }
td:nth-child(-n+2) { font-family: var(--mono); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 28px 40px;
  border-top: 1px solid var(--line);
  font-size: var(--t-xs);
  color: var(--muted);
}
.site-footer p { margin: 0; }

/* ---------- simple pages ---------- */
.page { padding-block: 64px 96px; }
.page h1 {
  margin: 0 0 8px;
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  text-wrap: balance;
}
.page .updated { margin: 0 0 40px; font-size: var(--t-sm); color: var(--muted); }
.prose { max-width: 62ch; }
.prose h2 { font-size: var(--t-md); font-weight: 600; margin: 36px 0 8px; letter-spacing: -0.01em; }
.prose p, .prose li { color: var(--muted); font-size: var(--t-sm); line-height: 1.7; }
.prose strong { color: var(--ink); font-weight: 600; }
.page .lede { margin-top: 16px; }
.page .btn { display: inline-flex; align-items: center; text-decoration: none; padding-inline: 20px; }
.page .btn.primary { margin-top: 28px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
