@font-face { font-family: "Chivo"; src: url("fonts/chivo-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Readex Pro"; src: url("fonts/readex-pro-arabic-wght-normal.woff2") format("woff2"); font-weight: 160 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Chivo Mono"; src: url("fonts/chivo-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --tape: #ffd23f;
  --sticker: #ffffff;
  --ink: #141414;
  --muted: #5c5240;
  --edge: rgb(20 20 20 / 0.14);
  --ui: "Chivo", "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: var(--ui);
  --mono: "Chivo Mono", "Readex Pro", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --tape: #1e1a0c; --sticker: #2a2412; --ink: #ffe27a; --muted: #b5a77a; --edge: rgb(255 226 122 / 0.18); color-scheme: dark; }
}
:root[data-theme="dark"] { --tape: #1e1a0c; --sticker: #2a2412; --ink: #ffe27a; --muted: #b5a77a; --edge: rgb(255 226 122 / 0.18); color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body { margin: 0; background: var(--tape); color: var(--ink); font: 400 15px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 8px; }

.app { display: flex; flex-direction: column; min-height: 100dvh; }
.bar { display: flex; align-items: baseline; gap: 6px 20px; flex-wrap: wrap; padding: 16px 28px 6px; }
.brand { margin: 0; font: 900 28px/1 var(--ui); letter-spacing: -0.03em; }
.brand i { font-style: normal; }
.purpose { flex: 1; margin: 0; font-weight: 600; }
.bar-meta { font-size: 12.5px; opacity: 0.8; }

.kinds { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 28px; }
.kinds .tools { display: flex; gap: 6px; margin-inline-start: auto; }
.kinds > button { padding: 8px 16px; border: 2px solid var(--ink); border-radius: 20px; background: transparent; font-weight: 800; cursor: pointer; }
.kinds > button[aria-selected="true"] { background: var(--ink); color: var(--tape); }

.desk { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(240px, 1fr) minmax(300px, 420px) minmax(240px, 1fr); gap: 24px; align-items: start; padding: 10px 28px 24px; }
.panel { display: grid; gap: 10px; padding: 18px; border-radius: 20px; background: var(--sticker); box-shadow: 0 1px 0 var(--edge); }
.form { display: grid; gap: 10px; }
label { display: grid; gap: 4px; font-weight: 700; font-size: 13px; }
input[type="text"], input[type="tel"], input[type="email"], textarea { width: 100%; padding: 10px 12px; border: 2px solid var(--edge); border-radius: 12px; background: transparent; font: 400 15px var(--mono); resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--ink); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.raw summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 700; }
.raw pre { margin: 8px 0 0; padding: 10px; border-radius: 10px; background: var(--tape); font: 400 12.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; }

/* The sticker */
.sticker-wrap { display: grid; justify-items: center; gap: 12px; }
.sticker { width: 100%; max-width: 420px; aspect-ratio: 1; padding: 16px; border-radius: 20px; background: var(--sticker); box-shadow: 0 2px 0 var(--edge), 0 18px 40px rgb(20 20 20 / 0.16); rotate: -1.2deg; transition: rotate 0.3s ease; }
.sticker:hover { rotate: 0deg; }
.sticker svg { display: block; width: 100%; height: 100%; border-radius: 8px; }
.status { margin: 0; padding: 8px 14px; border-radius: 20px; background: var(--sticker); font-weight: 700; font-size: 14px; text-align: center; }
.status.warn { background: var(--ink); color: var(--tape); }
.downloads { display: flex; gap: 8px; }
.ink, .ghost { padding: 10px 18px; border: 2px solid var(--ink); border-radius: 20px; background: var(--ink); color: var(--tape); font-weight: 800; cursor: pointer; }
.ghost { background: transparent; color: var(--ink); }
.ghost:hover { background: var(--ink); color: var(--tape); }
.ink:disabled, .ghost:disabled { opacity: 0.4; cursor: default; }
.ghost.small { display: inline-block; padding: 7px 14px; font-size: 13px; }
.ghost:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }

.style h2 { margin: 6px 0 0; font: 800 12px/1 var(--ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.style h2:first-child { margin-top: 0; }
.colours { display: flex; align-items: end; gap: 10px; }
.colours label { flex: 1; }
.colours input[type="color"] { width: 100%; height: 40px; padding: 2px; border: 2px solid var(--edge); border-radius: 12px; background: transparent; cursor: pointer; }
.mini { padding: 6px 12px; border: 2px solid var(--edge); border-radius: 20px; background: transparent; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.mini:hover { border-color: var(--ink); }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button { flex: 1; padding: 7px 10px; border: 2px solid var(--edge); border-radius: 20px; background: transparent; font-weight: 800; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--tape); }
.seg button:disabled { opacity: 0.35; cursor: default; }
.logo-row { display: flex; gap: 8px; align-items: center; }
.hint.now { color: var(--ink); font-weight: 600; }
.bar-meta .lang { margin-inline-start: 12px; unicode-bidi: isolate; }
:lang(ar) :is(.brand, .style h2) { letter-spacing: 0; }

@media (prefers-reduced-motion: reduce) {
  .sticker { rotate: none; transition: none; }
}
@media (min-width: 1000px) and (min-height: 700px) {
  .app { height: 100dvh; }
  .sticker { max-width: min(420px, calc(100dvh - 300px)); }
}
@media (max-width: 999px) {
  .desk { grid-template-columns: 1fr; padding-inline: 16px; }
  .sticker-wrap { order: -1; }
  .bar, .kinds { padding-inline: 16px; }
  .purpose { flex-basis: 100%; order: 3; }
}

/* Questions under the tool: for people who scroll, and for search engines */
.faq { max-width: 920px; margin: 0 auto; padding: 56px 20px 64px; }
.faq h2 { margin: 0 0 20px; font: 700 22px/1.2 var(--display); letter-spacing: -0.02em; }
.faq-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px 32px; }
.faq h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.faq p { margin: 0; color: var(--muted); line-height: 1.6; }

/* Light/dark button (theme.js): follows the device until the visitor picks */
.theme { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-inline-start: 8px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; vertical-align: middle; }
.theme:hover { background: var(--edge); }
.theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme .sun, .theme[data-dark="true"] .moon { display: none; }
.theme[data-dark="true"] .sun { display: block; }
