/* Legal pages for Floe.

   Plain CSS, no build step, no fonts to fetch: these have to render for a Play reviewer
   on any device and keep working untouched for years. Readability is the whole brief. */

:root {
    --ink: #0e1e36;
    --ink-soft: #45566f;
    --paper: #fbfcfe;
    --rule: #dde5ef;
    --accent: #9c6412;   /* 4.8:1 on paper — #b8791a was 3.5:1 and failed AA */
    --card: #ffffff;
}

/* Dark applies from the OS setting unless the reader has explicitly chosen light,
   and applies always if they have explicitly chosen dark. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ink: #e8eef7;
        --ink-soft: #a3b2c6;
        --paper: #101c2e;
        --rule: #26374f;
        --accent: #f5c563;
        --card: #16243a;
    }
}

:root[data-theme="dark"] {
    --ink: #e8eef7;
    --ink-soft: #a3b2c6;
    --paper: #101c2e;
    --rule: #26374f;
    --accent: #f5c563;
    --card: #16243a;
}

/* Text size. Everything below is in rem, so moving the root moves the whole page —
   including the measure, so long lines do not get longer as the type grows. */
:root[data-scale="1"] { font-size: 112.5%; }
:root[data-scale="2"] { font-size: 125%; }
:root[data-scale="3"] { font-size: 140%; }

/* Beyond AA, for readers who want maximum separation. */
:root.a11y-contrast {
    --ink: #000000;
    --ink-soft: #000000;
    --paper: #ffffff;
    --rule: #000000;
    --accent: #5a3800;
    --card: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root.a11y-contrast:not([data-theme="light"]) {
        --ink: #ffffff;
        --ink-soft: #ffffff;
        --paper: #000000;
        --rule: #ffffff;
        --accent: #ffd166;
        --card: #000000;
    }
}

:root.a11y-contrast[data-theme="dark"] {
    --ink: #ffffff;
    --ink-soft: #ffffff;
    --paper: #000000;
    --rule: #ffffff;
    --accent: #ffd166;
    --card: #000000;
}

:root.a11y-links a { text-decoration: underline; }
:root.a11y-links nav a, :root.a11y-links footer a { text-decoration: underline; }

* { box-sizing: border-box; }

/* Keyboard focus has to be obvious on both themes. The accent clears 3:1 against
   both backgrounds, so it works as an outline colour without a second variable. */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Lets a keyboard or screen-reader user jump the header on every page. Visible only
   when focused, which is the one time it is useful. */
.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--rule);
    padding: 0.6rem 1rem;
    border-radius: 0 0 8px 0;
    z-index: 10;
}

.skip:focus {
    left: 0;
}

main:focus { outline: none; }

body {
    margin: 0;
    padding: 0 1.25rem 5rem;
    background: var(--paper);
    color: var(--ink);
    /* rem, not px: a px body size would ignore the text-size control entirely. */
    font: 1.0625rem/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 44rem; margin: 0 auto; }

header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    align-items: baseline;
    padding: 2.5rem 0 1.25rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 2.5rem;
}

header .name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-right: auto;
}

header .name a { color: var(--ink); text-decoration: none; }

nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.92rem;
    margin-left: 1.1rem;
}

nav a:hover, nav a:focus-visible, nav a[aria-current="page"] { color: var(--accent); }
/* Colour alone should not be the only signal that something is a link. */
nav a:hover, nav a:focus-visible { text-decoration: underline; }
nav a[aria-current="page"] { font-weight: 600; }

h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 0.5rem; }
h2 { font-size: 1.15rem; margin: 2.5rem 0 0.6rem; }
h3 { font-size: 1rem; margin: 1.75rem 0 0.4rem; }

.updated {
    color: var(--ink-soft);
    font-size: 0.9rem;
    margin: 0 0 2.5rem;
}

p, li { color: var(--ink); }
ul, ol { padding-left: 1.3rem; }
li { margin: 0.35rem 0; }

a { color: var(--accent); }

strong { font-weight: 650; }

.lede {
    font-size: 1.08rem;
    color: var(--ink-soft);
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 0 0 2rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
    margin: 1.5rem 0;
}

.card p:first-child { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

/* Plain :focus, not :focus-visible. This block is focusable only so a keyboard user
   can scroll it, so the indicator must not depend on the browser's heuristic for
   whether focus "deserves" to be shown. */
pre:focus {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

pre {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--ink-soft);
}

footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    color: var(--ink-soft);
    font-size: 0.88rem;
}

footer a { color: var(--ink-soft); }
footer a:hover, footer a:focus-visible { color: var(--accent); }

/* ---------------------------------------------------------------- accessibility widget

   The control itself has to meet the bar it exists to serve: 48px hit target, real
   focus rings, aria-pressed states that are visible and not signalled by colour alone,
   and it must not cover the text it is sitting on top of. */

.a11y-host {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
}

.a11y-toggle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 2px solid var(--rule);
    background: var(--card);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.a11y-toggle:hover { border-color: var(--accent); }

.a11y-panel {
    background: var(--card);
    border: 2px solid var(--rule);
    border-radius: 12px;
    padding: 1rem;
    width: min(19rem, calc(100vw - 2rem));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.a11y-panel[hidden] { display: none; }

.a11y-title {
    font-size: 1rem;
    margin: 0 0 0.75rem;
}

.a11y-row { margin-bottom: 0.85rem; }
.a11y-row:last-of-type { margin-bottom: 1rem; }

.a11y-label {
    display: block;
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-bottom: 0.35rem;
}

.a11y-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.a11y-opt, .a11y-reset {
    font: inherit;
    font-size: 0.88rem;
    padding: 0.45rem 0.7rem;
    min-height: 2.5rem;
    border: 2px solid var(--rule);
    border-radius: 7px;
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
}

.a11y-opt:hover, .a11y-reset:hover { border-color: var(--accent); }

/* Selected state carries a border and a mark, not just a fill — colour alone would
   fail for anyone who cannot distinguish it. */
.a11y-opt[aria-pressed="true"] {
    border-color: var(--accent);
    font-weight: 700;
}

.a11y-opt[aria-pressed="true"]::after {
    content: " ✓";
}

.a11y-scale-value {
    min-width: 3.2rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

.a11y-reset { width: 100%; }

@media print {
    .a11y-host { display: none; }
}

/* ---------------------------------------------------------------- right-to-left

   The Hebrew accessibility statement sits inside an English page, so RTL is scoped to
   that section rather than the document. Padding and borders have to swap sides —
   logical properties would do it automatically, but these rules are explicit so the
   two directions can be read side by side. */

[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] ul, [dir="rtl"] ol {
    padding-left: 0;
    padding-right: 1.3rem;
}

[dir="rtl"] .lede {
    border-left: none;
    border-right: 3px solid var(--accent);
    padding-left: 0;
    padding-right: 1rem;
}

hr {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 3rem 0 2.5rem;
}
