/* Accessibility toolbar, accessibility modes, and legal pages. */
body { zoom: var(--a11y-zoom, 1); }

/* Toolbar (corner of every page; logical properties so it flips in RTL) */
.a11y { position: fixed; inset-block-end: 18px; inset-inline-start: 18px; z-index: 90; }
.a11y-toggle { width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 2px solid var(--on-fg); border-radius: 50%; color: var(--on-fg); background: var(--fg); box-shadow: var(--shadow); }
.a11y-toggle:hover { background: var(--accent); }
.a11y-panel { position: absolute; inset-block-end: 60px; inset-inline-start: 0; width: min(300px, calc(100vw - 36px)); padding: 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--fg); background: var(--bg); box-shadow: var(--shadow); }
.a11y-head { display: flex; align-items: center; justify-content: space-between; margin-block-end: 12px; }
.a11y-close { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 20px; line-height: 1; }
.a11y-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-tools button, .a11y-foot button { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px; font-weight: 600; text-align: start; }
.a11y-tools button:hover, .a11y-foot button:hover { background: var(--surface-hover); border-color: var(--fg); }
.a11y-tools button[aria-pressed="true"] { color: var(--on-fg); background: var(--fg); border-color: var(--fg); }
.a11y-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-block-start: 12px; font-size: 14px; }
.a11y-foot a { text-decoration: underline; }

/* Modes (token overrides, then a few rules) */
:root.a11y-contrast, :root.a11y-contrast[data-theme="dark"] {
  --bg: #000; --surface: #000; --surface-hover: #1a1a1a; --fg: #fff; --fg-soft: #fff; --line: #fff;
  --accent: #ffeb3b; --accent-text: #ffeb3b; --gold: #ffeb3b; --green: #fff; --on-fg: #000; color-scheme: dark;
}
.a11y-contrast .site-footer, .a11y-contrast[data-theme="dark"] .site-footer { color: var(--fg); background: var(--bg); border-top: 2px solid var(--fg); }
.a11y-contrast .footer-grid > div p, .a11y-contrast .footer-grid nav a, .a11y-contrast .copyright { color: var(--fg); }
.a11y-contrast .tile, .a11y-contrast .art-card, .a11y-contrast .mini-app { color: var(--fg); background: var(--bg); border: 2px solid var(--fg); }
.a11y-contrast a { text-decoration: underline; }
.a11y-grayscale body { filter: grayscale(1); }
.a11y-links a { text-decoration: underline !important; text-underline-offset: 3px; outline: 2px solid var(--gold); outline-offset: 2px; background: color-mix(in srgb, var(--gold) 30%, transparent); }
.a11y-font body, .a11y-font button, .a11y-font h1, .a11y-font h2, .a11y-font h3, .a11y-font .wordmark { font-family: Arial, Helvetica, sans-serif !important; font-style: normal !important; }
.a11y-spacing body { line-height: 1.9 !important; letter-spacing: .06em; word-spacing: .16em; }
.a11y-motion *, .a11y-motion *::before, .a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
.a11y-motion [data-reveal] { opacity: 1 !important; transform: none !important; }
.a11y-cursor, .a11y-cursor * { cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><path d='M4 2l26 14-11 3 6 14-5 2-6-14-8 8z' fill='black' stroke='white' stroke-width='2'/></svg>") 4 2, auto !important; }

/* Footer legal links */
.legal-nav { display: flex; flex-wrap: wrap; gap: 10px 24px; grid-column: 1 / -1; }
.legal-nav a { color: rgba(255,255,255,.72); font-size: 13px; text-decoration: underline; }
.legal-nav a:hover { color: var(--gold); }

/* Legal pages (accessibility statement, privacy policy) */
.legal { max-width: 760px; padding-block: 70px 20px; }
.legal h1 { margin-block-end: 8px; font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); line-height: 1.1; letter-spacing: -.02em; }
html[dir="rtl"] .legal h1 { font-family: Assistant, sans-serif; }
.legal-updated { margin-block-end: 36px; color: var(--fg-soft); font-size: 14px; }
.legal h2 { margin-block: 36px 10px; font-size: 22px; }
.legal p, .legal li { color: var(--fg); }
.legal ul { padding-inline-start: 22px; }
.legal li { margin-block-end: 8px; }
.legal a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.legal code { padding: 1px 6px; border-radius: 4px; background: var(--surface-hover); font-size: .9em; direction: ltr; unicode-bidi: isolate; }
