/* Joey — legal site. No framework, no build step for CSS.
   Written by hand; the HTML pages are generated by
   scripts/build-legal-site.js from the Markdown in legal/.

   STATUS.md §85 (27/09/2026): reworked after the site went live on
   joey-go.com. Two problems Orel reported — Hebrew and English mixed into
   one paragraph, and a design that "looks very basic" when an App Store
   reviewer is going to open it.

   The accent is #1F7EDA, taken from the apps' own theme
   (rider/constants/theme.ts -> primary), NOT invented here. The point is
   that a reviewer opening the app and then its privacy URL sees the same
   product, and that nobody has to maintain a second brand colour.

   Restraint is deliberate: this is where someone reads a privacy policy,
   not a landing page. */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --fg: #111827;
  --fg-soft: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-soft: #eef1f5;

  /* The app's primary. #1F7EDA is fine on white for large text; links use a
     slightly darker step so body-size link text clears WCAG AA (4.5:1). */
  --accent: #1f7eda;
  --accent-strong: #1a63ad;
  --accent-wash: #e6f4fe; /* the apps' splash background */
  --link: #1a5fb4;

  --draft-bg: #fffbeb;
  --draft-border: #f59e0b;
  --draft-fg: #713f12;
  --code-bg: #f3f4f6;
  --todo-bg: #fef3c7;
  --todo-fg: #713f12;
  --todo-border: #fcd34d;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.05);
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1214;
    --bg-soft: #161a1e;
    --fg: #e8eaed;
    --fg-soft: #c7ccd1;
    --muted: #9aa0a6;
    --line: #2a2e33;
    --line-soft: #21252a;

    --accent: #5aa2ea;
    --accent-strong: #8cc0f5;
    --accent-wash: #12222f;
    --link: #7db4f0;

    --draft-bg: #2a2312;
    --draft-border: #b45309;
    --draft-fg: #fcd34d;
    --code-bg: #1c1f23;
    --todo-bg: #3a2f12;
    --todo-fg: #fcd34d;
    --todo-border: #8a6412;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
               "Noto Sans Hebrew", "Arial Hebrew", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); }

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

/* ---------- skip link ----------
   STATUS.md §87. WCAG 2.0 2.4.1 Bypass Blocks (Level A): the header repeats
   on every page, so keyboard users get a way past it.

   Moved off-screen rather than display:none or visibility:hidden -- both of
   those remove it from the tab order too, which would defeat the point. It
   becomes visible the moment it takes focus. */
.skip {
  position: absolute;
  inset-inline-start: 0.75rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--bg);
  color: var(--link);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  /* No transition: an animated skip link is slower to use, not nicer. */
}
.skip:focus {
  top: 0.75rem;
}

/* The target takes tabindex="-1" so focus really moves there. That makes it
   focusable, and a page-wide outline around all of <main> on every skip is
   noise rather than information -- the heading it lands on is the feedback. */
main:focus {
  outline: none;
}

/* ---------- top bar ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(8px);
  z-index: 5;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--fg);
}
/* A plain round mark rather than an image: no asset to ship, no logo to get
   wrong, and it still reads as a product rather than a bare document. */
.brand::before {
  content: "";
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  flex: none;
}
.bar nav { display: flex; gap: 0.35rem; }
.bar nav a {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--fg-soft);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}
.bar nav a:hover { background: var(--bg-soft); color: var(--fg); }

/* ---------- layout ---------- */
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4rem;
}

footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
footer p { margin: 0.4rem 0; }

/* ---------- bilingual blocks ----------
   §85: every bilingual block is two SIBLING blocks, one per language, each
   carrying its own lang/dir. Previously an English sentence sat inside a
   Hebrew paragraph in the same <p>, which put LTR text mid-line in an RTL
   flow — unreadable, and it made the warning look careless on the one page
   an App Store reviewer is guaranteed to open.

   text-align comes from [dir] rather than a class, so it cannot disagree
   with the direction the browser is actually using for the text. */
.i18n[dir="rtl"] { text-align: right; }
.i18n[dir="ltr"] { text-align: left; }

/* The second language is visibly secondary but not hidden: same content,
   separated, so each reads cleanly on its own. */
.i18n + .i18n {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
}

/* ---------- draft / notice banner ---------- */
.draft {
  background: var(--draft-bg);
  border: 1px solid var(--draft-border);
  border-inline-start: 4px solid var(--draft-border);
  color: var(--draft-fg);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.5rem 0 2.25rem;
}
.draft strong { display: block; margin-bottom: 0.3rem; font-size: 0.98rem; }
.draft p { margin: 0; font-size: 0.94rem; line-height: 1.7; }
.draft .i18n + .i18n { border-top-color: color-mix(in srgb, var(--draft-border) 35%, transparent); }

/* ---------- home page ---------- */
.hero {
  padding: 1rem 0 0.5rem;
}
main > h1,
.hero h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
}
.lead { color: var(--fg-soft); margin: 0; font-size: 1.02rem; }

main > h2 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin: 2.75rem 0 0.85rem;
}

/* Documents as cards: the home page exists to hand a reviewer four links,
   so those links are the page's main affordance rather than a bare list. */
ul.docs { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
ul.docs li { margin: 0; }
ul.docs .card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.05rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
ul.docs a {
  text-decoration: none;
  font-weight: 600;
  color: var(--link);
}
ul.docs a:hover { text-decoration: underline; }
ul.docs .en { font-weight: 500; font-size: 0.95rem; }
.sep { color: var(--muted); margin: 0 0.4rem; }

.support a { font-weight: 600; }

/* ---------- document body ---------- */
article { color: var(--fg); }
article h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 0.5rem 0 1rem;
}
article h2 {
  font-size: 1.22rem;
  line-height: 1.35;
  margin: 2.5rem 0 0.7rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
article h3 { font-size: 1.05rem; margin: 1.6rem 0 0.5rem; }

article p { margin: 0.85rem 0; }
article ul, article ol { margin: 0.85rem 0; padding-inline-start: 1.4rem; }
article li { margin: 0.5rem 0; }
article li::marker { color: var(--muted); }
article li > p:first-child { margin-top: 0; }
article li > p:last-child { margin-bottom: 0; }

article hr { border: 0; border-top: 1px solid var(--line); margin: 2.25rem 0; }

article strong { color: var(--fg); font-weight: 650; }

blockquote {
  margin: 1.25rem 0;
  padding: 0.85rem 1.1rem;
  background: var(--accent-wash);
  border-inline-start: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--fg-soft);
  font-size: 0.95rem;
}
[dir="rtl"] blockquote { border-radius: var(--radius) 0 0 var(--radius); }
blockquote p { margin: 0.4rem 0; }

code {
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}

/* An unresolved [bracketed] decision. Deliberately loud: a reader must be
   able to tell at a glance that this document is not finished. */
code.todo {
  display: inline-block;
  background: var(--todo-bg);
  color: var(--todo-fg);
  border: 1px dashed var(--todo-border);
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.9em;
  line-height: 1.6;
  padding: 0.15em 0.5em;
}

/* ---------- small screens ---------- */
@media (max-width: 480px) {
  body { font-size: 16px; }
  main { padding: 1.5rem 1rem 3rem; }
  footer { padding-inline: 1rem; }
  main > h1, .hero h1 { font-size: 1.7rem; }
  article h1 { font-size: 1.45rem; }
  article h2 { font-size: 1.14rem; }
  .bar { padding: 0.7rem 1rem; }
  ul.docs .card { padding: 0.8rem 0.9rem; }
}

/* ---------- print ----------
   A lawyer reviewing these will print or save to PDF. */
@media print {
  .bar, footer { display: none; }
  body { font-size: 11pt; line-height: 1.5; background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
  .draft { border: 1pt solid #999; background: #fff; color: #000; }
  article h2 { page-break-after: avoid; }
  article li, article p { page-break-inside: avoid; }
  a { color: #000; }
}
