
:root {
  /* Layout idea: a printer's proof sheet. Controls on one side, the code on a sheet with crop marks
     and a spec strip on the other. One ink-blue accent; everything else stays quiet. */
  --paper: #eef1f4;
  --sheet: #ffffff;
  --ink: #0f1620;
  --muted: #566272;
  --line: #cfd6de;
  --accent: #2238e8;
  --accent-ink: #ffffff;
  --good: #0c7448;
  --warn: #9a5200;
  --bad: #b3261e;
  --font-display: "Bricolage Grotesque", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1218;
    --sheet: #161d26;
    --ink: #e9eef4;
    --muted: #98a5b4;
    --line: #2b3542;
    --accent: #8fa0ff;
    --accent-ink: #0d1218;
    --good: #5fd3a0;
    --warn: #f0b060;
    --bad: #ff8f86;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1218;
  --sheet: #161d26;
  --ink: #e9eef4;
  --muted: #98a5b4;
  --line: #2b3542;
  --accent: #8fa0ff;
  --accent-ink: #0d1218;
  --good: #5fd3a0;
  --warn: #f0b060;
  --bad: #ff8f86;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 56px; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-mark { width: 22px; height: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.brand-mark i { background: var(--ink); border-radius: 1px; }
.brand-mark i:nth-child(5) { background: var(--accent); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(6) { background: transparent; }
.lang { font: 500 14px var(--font-body); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.lang:hover { border-color: var(--ink); }

.hero { padding: 26px 0 30px; max-width: 760px; }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 7vw, 60px); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 16px; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 0; font-size: 18px; color: var(--muted); max-width: 60ch; }
[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.2; }

.work { display: grid; gap: 20px; grid-template-columns: 1fr; grid-template-areas: "content" "proof" "look"; }
@media (min-width: 880px) {
  .work { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); grid-template-areas: "content proof" "look proof"; align-items: start; }
  .proof { position: sticky; top: 16px; }
}
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.content { grid-area: content; }
.look { grid-area: look; }
.proof { grid-area: proof; }
.panel h2 { font: 500 12px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
[lang="ar"] .panel h2 { font-family: var(--font-body); letter-spacing: 0; font-size: 14px; }

.types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.types button { font: 500 14px var(--font-body); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.types button:hover { border-color: var(--ink); }
.types button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); border-color: var(--ink); }

.fields { display: grid; gap: 14px; }
.fields[hidden] { display: none; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
label.f, div.f { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
label.f span.opt { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="url"], input[type="tel"], input[type="email"], textarea, select {
  width: 100%; font: 400 16px var(--font-body); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
textarea { min-height: 96px; resize: vertical; }
input[dir="ltr"], textarea[dir="ltr"] { text-align: start; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.colors { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.color { display: flex; align-items: center; gap: 10px; }
.color input[type="color"] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); cursor: pointer; }
.color code { font: 400 13px var(--font-mono); color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sheet { position: relative; padding: 22px; margin: 0; }
.crop { position: absolute; width: 14px; height: 14px; border-color: var(--muted); border-style: solid; border-width: 0; }
.crop.tl { top: 4px; left: 4px; border-top-width: 1px; border-left-width: 1px; }
.crop.tr { top: 4px; right: 4px; border-top-width: 1px; border-right-width: 1px; }
.crop.bl { bottom: 4px; left: 4px; border-bottom-width: 1px; border-left-width: 1px; }
.crop.br { bottom: 4px; right: 4px; border-bottom-width: 1px; border-right-width: 1px; }
#qr { display: block; width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; border-radius: 2px; }
.empty { aspect-ratio: 1; display: grid; place-items: center; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 4px; padding: 20px; }
.empty[hidden], #qr[hidden] { display: none; }

.spec { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 400 12px var(--font-mono); color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; direction: ltr; }
.spec b { font-weight: 500; color: var(--ink); }
.swatch { display: inline-block; width: 10px; height: 10px; border: 1px solid var(--line); border-radius: 2px; vertical-align: -1px; margin-inline-end: 4px; }

.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--good); border: 1px solid currentColor; border-radius: 999px; padding: 4px 12px; margin: 14px 0 0; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.notes { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.notes li { font-size: 14px; padding: 8px 12px; border-radius: 8px; border-inline-start: 3px solid var(--warn); background: var(--paper); color: var(--ink); }
.notes li.bad { border-inline-start-color: var(--bad); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn { font: 600 15px var(--font-body); border-radius: 8px; padding: 11px 16px; cursor: pointer; border: 1px solid var(--ink); background: transparent; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn[hidden] { display: none; }
.size { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 14px; }
.size select { width: auto; padding: 6px 10px; font-size: 14px; }
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.logo-row input[type="file"] { flex: 1 1 200px; min-width: 0; font: 400 14px var(--font-body); color: var(--muted); }
.logo-row input[type="file"]::file-selector-button { font: 600 14px var(--font-body); color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 8px; padding: 8px 12px; margin-inline-end: 10px; cursor: pointer; }
.btn.small { font-size: 14px; padding: 7px 12px; }
.toast { min-height: 22px; font-size: 14px; color: var(--muted); margin: 10px 0 0; }

.why { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 44px; }
.why article { border-top: 2px solid var(--ink); padding-top: 14px; }
.why h3, .limits h3 { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; margin: 0 0 6px; text-wrap: balance; }
[lang="ar"] .why h3, [lang="ar"] .limits h3 { letter-spacing: 0; }
.why p { margin: 0; color: var(--muted); }
.limits { margin-top: 40px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.limits ul { margin: 10px 0 0; padding-inline-start: 20px; color: var(--muted); display: grid; gap: 6px; max-width: 68ch; }
.limits p { margin: 12px 0 0; font-weight: 600; }
footer { margin-top: 36px; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .types button, .lang { transition: border-color .15s, background-color .15s, filter .15s; }
}

/* ---- site pages ---- */
.bar { flex-wrap: wrap; }
.bar a.brand { color: inherit; text-decoration: none; white-space: nowrap; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.nav a, .more a, .prose a, footer a { color: var(--accent); text-underline-offset: 3px; }
.crumbs { font-size: 13px; color: var(--muted); padding-top: 4px; }
.crumbs a { color: var(--muted); }
.prose { margin-top: 44px; max-width: 68ch; }
.prose h2 { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.015em; line-height: 1.15; margin: 34px 0 10px; text-wrap: balance; }
.prose h3 { font-size: 18px; margin: 22px 0 6px; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-inline-start: 22px; display: grid; gap: 6px; }
.prose .note { border-inline-start: 3px solid var(--accent); background: var(--sheet); padding: 12px 16px; border-radius: 0 8px 8px 0; }
.tablewrap { overflow-x: auto; margin: 14px 0; }
.prose table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 15px; }
.prose th, .prose td { text-align: start; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font: 500 12px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.faq { margin-top: 40px; max-width: 68ch; }
.faq h2 { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.015em; margin: 0 0 8px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.more { margin-top: 44px; border-top: 2px solid var(--ink); padding-top: 16px; }
.more h2 { font: 500 12px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.more ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
footer { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.bar .lang[hidden], .install-hint[hidden] { display: none; }
.install-hint { margin: 0 0 8px; font-size: 14px; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.prose ul.ticks { list-style: none; padding-inline-start: 0; }
.prose ul.ticks li { padding-inline-start: 26px; position: relative; }
.prose ul.ticks li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 7px; width: 11px; height: 6px; border: solid var(--good); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
