:root {
  --bg: #fbfbf8;
  --surface: #ffffff;
  --ink: #1b1d1a;
  --muted: #5d625a;
  --line: #e3e5de;
  --accent: #1f8a4c;
  --accent-ink: #ffffff;
  --accent-soft: #e4f3e9;
  --wrong: #b4442f;
  --code-bg: #f1f2ed;
  --shadow: 0 1px 2px rgba(20, 24, 18, .06), 0 8px 24px rgba(20, 24, 18, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121411;
    --surface: #1a1d19;
    --ink: #e9ebe5;
    --muted: #a2a79d;
    --line: #2c302a;
    --accent: #4cc27c;
    --accent-ink: #0d1a12;
    --accent-soft: #1c2e22;
    --wrong: #ef8a73;
    --code-bg: #232720;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd {
  font: .88em/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--code-bg);
  border-radius: 5px;
  padding: .15em .4em;
}
kbd { border: 1px solid var(--line); border-bottom-width: 2px; }
/* File names and keys stay left-to-right inside right-to-left text. */
code, kbd { unicode-bidi: isolate; }
.he { font-family: "Segoe UI", Arial, sans-serif; }
/* Arabic letters join, so letter-spacing breaks them apart. */
:lang(ar) h1, :lang(ar) h2 { letter-spacing: 0; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* header */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.top nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }

/* language menu */
.lang { position: relative; border: 0; padding: 0; }
.lang summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: inherit; }
.lang summary::-webkit-details-marker { display: none; }
.lang[open] summary, .lang summary:hover { color: var(--ink); }
.lang ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 10px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  min-width: 160px; z-index: 10;
}
.top .lang a { display: block; padding: 6px 12px; border-radius: 6px; color: var(--ink); }
.top .lang a:hover { background: var(--code-bg); }
.top .lang a[aria-current] { font-weight: 600; color: var(--accent); }

/* hero */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
h1 { font-size: clamp(34px, 5vw, 50px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 18px; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 10px; font-weight: 600;
  text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--surface);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.fine { font-size: 14px; color: var(--muted); margin-top: 14px; }

/* demo field */
.demo {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  overflow: hidden;
}
.demo-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.demo-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.demo-body { padding: 26px 22px 22px; }
.demo-line {
  font-size: 24px; min-height: 1.6em; border-bottom: 2px solid var(--line); padding-bottom: 6px;
  display: flex; align-items: baseline; gap: 2px; white-space: pre; overflow: hidden;
}
.demo-line .caret { width: 2px; height: 1.1em; background: var(--ink); align-self: center; animation: blink 1s steps(1) infinite; }
.demo-line .bad { color: var(--wrong); }
.demo-line .fixed { color: var(--accent); }
.demo-status { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; color: var(--muted); }
.layout-pill {
  font: 600 12px/1 ui-monospace, Consolas, monospace; padding: 5px 8px; border-radius: 6px;
  background: var(--code-bg); color: var(--ink); transition: background .2s, color .2s;
}
.layout-pill.flip { background: var(--accent); color: var(--accent-ink); }
@keyframes blink { 50% { opacity: 0; } }

/* sections */
section { padding: 56px 0; border-top: 1px solid var(--line); }
h2 { font-size: 30px; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 32px; max-width: 40em; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.step { font: 700 13px/1 ui-monospace, Consolas, monospace; color: var(--accent); margin-bottom: 10px; display: block; }

.pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.pairs li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: 18px; }
.pairs .from { color: var(--wrong); }
.pairs .arrow { color: var(--muted); }
[dir="rtl"] .pairs .arrow { display: inline-block; transform: scaleX(-1); }

.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 32px; }
.checks li { padding-inline-start: 28px; position: relative; }
.checks li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent-soft); box-shadow: inset 0 0 0 5px var(--accent);
}

table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: start; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 10px 0 0; }

ol.install { padding-inline-start: 20px; }
ol.install li { margin-bottom: 10px; }

/* prose (privacy page) */
.prose { padding: 48px 0 64px; }
.prose h1 { font-size: 38px; }
.prose h2 { font-size: 22px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--ink); }
.prose .updated { color: var(--muted); margin-top: -6px; }
.prose .tldr { background: var(--accent-soft); border-radius: 12px; padding: 18px 22px; margin: 24px 0; }
.prose .tldr p { margin: 0; }
.prose .note { font-size: 15px; color: var(--muted); border-inline-start: 3px solid var(--line); padding-inline-start: 12px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer a { color: var(--muted); }

@media (max-width: 760px) {
  .hero { padding: 40px 0 36px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; }
  .grid { grid-template-columns: 1fr; }
  .checks { grid-template-columns: 1fr; }
  .top nav { gap: 14px; }
  .top nav .hide-sm { display: none; }
  .lang summary span { display: none; }
  section { padding: 44px 0; }
  table { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-line .caret { animation: none; }
}
