/* ---- Accessibility choices (a11y.js; applied on <html> before the first paint) ---- */

/* The panel */
.a11y-button.is-on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.a11y-form { display: flex; flex-direction: column; gap: 6px; min-height: 100%; }
.a11y-group { margin: 6px 0 10px; padding: 0; border: 0; }
.a11y-group legend { margin-bottom: 10px; font-weight: 700; }
.a11y-sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.a11y-sizes label {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 76px; padding: 8px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--card);
    cursor: pointer; transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.a11y-sizes input, .a11y-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.a11y-size { font-weight: 800; line-height: 1; }
.a11y-sizes small { color: var(--muted); font-size: .8rem; }
.a11y-sizes label:has(input:checked) { border-color: var(--ink); background: color-mix(in srgb, var(--accent) 22%, var(--card)); }
.a11y-sizes label:has(input:focus-visible), .a11y-switch:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.a11y-switches { display: grid; gap: 8px; }
.a11y-switch {
    position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); cursor: pointer;
}
.a11y-switch > span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.a11y-switch small { color: var(--muted); font-size: .82rem; line-height: 1.35; }
/* The switch's track and knob, drawn after the text. */
.a11y-switch::after {
    content: ""; order: 2; flex: none; width: 44px; height: 26px; border-radius: 999px;
    background: radial-gradient(circle 9px at 13px 50%, #fff 98%, transparent) no-repeat, color-mix(in srgb, var(--ink) 22%, transparent);
    transition: background-color var(--speed) var(--ease), background-position var(--speed) var(--ease);
}
.a11y-switch:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.a11y-switch:has(input:checked)::after {
    background: radial-gradient(circle 9px at 31px 50%, #fff 98%, transparent) no-repeat, #3f7d0a;
}
.a11y-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: auto; padding-top: 18px; }
.footer-a11y { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: .92rem; cursor: pointer; }
.footer-a11y:hover { color: var(--accent-text); }

/* Text size: everything set in rem grows with it. */
:root[data-a11y-text="large"] { font-size: 118.75%; }
:root[data-a11y-text="larger"] { font-size: 137.5%; }
:root[data-a11y-text] .card-text, :root[data-a11y-text] .card-platform, :root[data-a11y-text] .hero-facts dt { font-size: .95rem; }

/* High contrast: near-black on white (or the reverse), solid borders, no faint text. */
:root[data-a11y-contrast="high"] {
    --ink: #000000; --muted: #2a2e35; --line: rgba(0, 0, 0, .42); --line-strong: rgba(0, 0, 0, .7);
    --accent-text: #2d4f00; --bg: #ffffff; --bg-2: #ffffff; --card: #ffffff; --surface: #ffffff;
}
:root[data-a11y-contrast="high"][data-site-appearance="dark"] {
    --ink: #ffffff; --muted: #e3e6ea; --line: rgba(255, 255, 255, .5); --line-strong: rgba(255, 255, 255, .8);
    --accent-text: #c8ff6a; --bg: #000000; --bg-2: #000000; --card: #0d0f13; --surface: #0d0f13;
}
:root[data-a11y-contrast="high"] body { background: var(--bg); }
:root[data-a11y-contrast="high"] :focus-visible { outline: 3px solid var(--ink) !important; outline-offset: 3px; box-shadow: 0 0 0 6px var(--accent) !important; }
:root[data-a11y-contrast="high"] :is(.card, .platform-card, .faq-item, .chip, .btn-ghost, .icon-button, .hero-facts div, .support-panel, .guide-platform) { border-width: 2px; border-color: var(--line-strong); }
:root[data-a11y-contrast="high"] :is(.site-nav .nav-soon, .platform-card.is-soon) { opacity: 1; }
:root[data-a11y-contrast="high"] .hero::before, :root[data-a11y-contrast="high"] .hero::after, :root[data-a11y-contrast="high"] .hero-glow { display: none; }
:root[data-a11y-contrast="high"] .hero-highlight { background: none; -webkit-text-fill-color: currentColor; color: var(--accent-text); }
:root[data-a11y-contrast="high"] .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 2px solid var(--line-strong); }
:root[data-a11y-contrast="high"] .card-body { background: var(--card); }

/* Reduce motion: nothing moves, slides or spins. */
:root[data-a11y-motion="reduce"] *, :root[data-a11y-motion="reduce"] *::before, :root[data-a11y-motion="reduce"] *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
:root[data-a11y-motion="reduce"] .reveal { opacity: 1 !important; }
:root[data-a11y-motion="reduce"] .wall-track { width: auto; overflow-x: auto; }
:root[data-a11y-motion="reduce"] :is(.hero-stage, .card:hover, a.platform-card:hover, .card:hover .card-media img) { transform: none !important; }
:root[data-a11y-motion="reduce"]::view-transition-group(*),
:root[data-a11y-motion="reduce"]::view-transition-old(*),
:root[data-a11y-motion="reduce"]::view-transition-new(*) { animation: none !important; }

/* Underline links: every link reads as one without relying on colour. */
:root[data-a11y-links="underline"] :is(main, .site-footer) a:not(.btn):not(.card-store):not(.chip),
:root[data-a11y-links="underline"] .site-nav a {
    text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: .22em;
}

/* Wider spacing (WCAG 1.4.12 text spacing). */
:root[data-a11y-spacing="wide"] body { letter-spacing: .06em; word-spacing: .16em; }
:root[data-a11y-spacing="wide"] :is(p, li, dd, label, small, .card-text, .section-lede) { line-height: 1.8 !important; }
:root[data-a11y-spacing="wide"] p { margin-bottom: 1.1em; }
:root[data-a11y-spacing="wide"] :is(h1, h2, h3, .hero-title) { letter-spacing: 0 !important; line-height: 1.3; }

/* At larger text the page grows, the top menu stays on one line. */
:root[data-a11y-text] .site-nav :is(a, .nav-soon) { white-space: nowrap; font-size: 15px; }
:root[data-a11y-text] .header-support { white-space: nowrap; }
@media (min-width: 64rem) {
    :root[data-a11y-text="larger"] .site-nav { gap: 0; }
    :root[data-a11y-text="larger"] .site-nav :is(a, .nav-soon) { padding-inline: 9px; }
}

/* On narrow phones "Support" moves into the menu, so the header keeps room for the brand. */
.site-nav .nav-narrow-only { display: none; }
@media (max-width: 29.99rem) {
    .header-actions .header-support { display: none; }
    .site-nav .nav-narrow-only { display: block; }
}
@media (max-width: 29.99rem) {
    .header-actions { gap: 4px; }
    .header-actions .icon-button { width: 36px; height: 36px; }
    .header-inner { gap: 10px; }
    .brand-name, :root[data-a11y-text] .brand-name { font-size: 16px; }
}
