/* ══ accessibility.css ══ */


/* ── 0. screen-reader utilities: .a11y-sr-only (visually hidden), .skip-link (shows on Tab) ── */

.a11y-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background: var(--primary, #3A4B3A);
    color: var(--cream, #D6CBAE);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    border: 1px solid rgba(255,255,255,0.15);
    border-top: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: top 0.15s ease;
}
/* dual ring: readable on the dark pill and the light page (SC 1.4.11) */
.skip-link:focus {
    top: 0;
    outline: 2px solid var(--tertiary-pale, #B4BFA9);
    outline-offset: 2px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3),
                0 0 0 4px var(--primary, #3A4B3A);
}


/* ── 0b. global focus rings - keyboard only (:focus-visible), dark on light, pale on dark ── */

/* base focus ring - light background (the default on this site) */
:focus-visible {
    outline:        2px solid var(--primary, #3A4B3A);
    outline-offset: 3px;
    border-radius:  3px;
}

/* dark background: a light ring for contrast */
.site-footer :focus-visible,
.nav-dropdown-content :focus-visible,
.minibar-sheet :focus-visible,
.mobile-nav :focus-visible,
.hero :focus-visible {
    outline-color: var(--tertiary-pale, #B4BFA9);
}

/* inside the drawer the ring goes inward so it is not clipped */
.mobile-nav .mnav-direct:focus-visible,
.mobile-nav .mnav-group-head:focus-visible,
.mobile-nav-group li a:focus-visible {
    outline-offset: -3px;
}

/* buttons / links that already have a border-radius → it follows the shape */
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
    outline-offset: 4px;
}

/* ── navbar links: dual ring, readable on any background ── */
.navbar a:focus-visible,
.nav-dropbtn:focus-visible,
.hamburger:focus-visible,
.mobile-nav a:focus-visible {
    opacity: 1 !important;
    outline: 2px solid var(--primary, #3A4B3A);
    outline-offset: 3px;
    border-radius: 4px;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.92);
}

/* ── dropdown open state lives in global.css; no :focus-within opener (see keyboard-nav.js) ── */


/* ══ 1. FONT SIZE SCALING ══ */
html[data-font-level="0"] { font-size: 80%;  --fs-scale: 0.80; }
html[data-font-level="1"] { font-size: 90%;  --fs-scale: 0.90; }
html[data-font-level="2"] { font-size: 100%; --fs-scale: 1.00; }
html[data-font-level="3"] { font-size: 110%; --fs-scale: 1.10; }
html[data-font-level="4"] { font-size: 120%; --fs-scale: 1.20; }
html[data-font-level="5"] { font-size: 133%; --fs-scale: 1.33; }
html[data-font-level="6"] { font-size: 150%; --fs-scale: 1.50; }

/* ── --fs-scale also scales vw-based headings ── */


/* ══ 2. REDUCE TRANSPARENCY ══ */

/* universal: remove any blur/frosted effect */
html[data-reduce-transparency] *,
html[data-reduce-transparency] *::before,
html[data-reduce-transparency] *::after {
    backdrop-filter:         none !important;
    -webkit-backdrop-filter: none !important;
}

/* ── Navbar ── */
html[data-reduce-transparency] .navbar,
html[data-reduce-transparency] .navbar.team-nav,
html[data-reduce-transparency] .team-nav .nav-container {
    background: var(--primary-mid, #2C3A2C) !important;
}
/* home navbar: solid background, so light ink and no veil */
html[data-reduce-transparency] .home-nav {
    color: var(--text-on-dark, rgba(255,255,255,0.92)) !important;
}
html[data-reduce-transparency] .home-nav::before,
html[data-reduce-transparency] .home-nav::after { opacity: 0 !important; }
html[data-reduce-transparency] .home-nav .logo,
html[data-reduce-transparency] .home-nav .nav-links > li > :is(a, button) { text-shadow: none !important; }
html[data-reduce-transparency] .mobile-nav {
    background: var(--primary-mid, #2C3A2C) !important;
}
html[data-reduce-transparency] .nav-dropdown-content {
    background: var(--primary-mid, #2C3A2C) !important;
}

/* ── team: solid white name pill ── */
html[data-reduce-transparency] .glass-name-pill {
    background:   #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
/* dark text - needed because the default is white (for glass) */
html[data-reduce-transparency] .glass-name-pill h3,
html[data-reduce-transparency] .glass-name-pill p,
html[data-reduce-transparency] .glass-name-pill .member-role {
    color: var(--ink, #243024) !important;
}
html[data-reduce-transparency] .glass-name-pill .member-pronouns {
    color: rgba(36, 48, 36, 0.55) !important;
}

/* icon buttons: solid dark (matches the photo) */
html[data-reduce-transparency] .glass-icon-btn {
    background:   #ffffff !important;
    border-color: rgba(0, 0, 0, 0.10) !important;
    color:        var(--ink, #243024) !important;
}

/* ── Project: glass captions on figures ── */
html[data-reduce-transparency] .glass-caption {
    background:   #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color:        var(--ink, #243024) !important;
}

/* ── home problem-card controls: solid, like the explore-more ones ── */
html[data-reduce-transparency] .impact-ctrl,
html[data-reduce-transparency] .impact-dots {
    background: #e7eae0 !important;
    border-color: rgba(40, 55, 40, 0.28) !important;
}

/* ── home problem cards: the flat colour without the glass sheen over it ── */
html[data-reduce-transparency] .impact-card-media::after,
html[data-reduce-transparency] .step-scene::after {
    background:  none !important;
    box-shadow:  none !important;
}

/* ── gradient-glass panes: solid instead of layered ── */
html[data-reduce-transparency] .pane {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 12px 35px rgba(27,27,24,0.08) !important;
}
/* the travelling ring is motion, not decoration - reduce-motion shows the full outline instead */
html[data-reduce-motion] .ring-rotor { display: none; }
html[data-reduce-motion] .ring {
    background: var(--ring-light);
    opacity: 0.45;
}

/* ── explore-more controls: solid background without the blur ── */
html[data-reduce-transparency] .dots-pill,
html[data-reduce-transparency] .pause-btn,
html[data-reduce-transparency] .em-arrow {
    background:   #e7eae0 !important;
    border-color: rgba(40, 55, 40, 0.28) !important;
}

/* ── hover must not wash out solid surfaces ── */
html[data-reduce-transparency] .dots-pill:hover,
html[data-reduce-transparency] .pause-btn:hover,
html[data-reduce-transparency] .em-arrow:hover,
html[data-reduce-transparency] .glass-icon-btn:hover,
html[data-reduce-transparency] .glass-icon-btn:focus-visible {
    filter: none !important;
}
html[data-reduce-transparency] .dots-pill:hover,
html[data-reduce-transparency] .pause-btn:hover,
html[data-reduce-transparency] .em-arrow:hover {
    background:   #d8ded0 !important;
    border-color: rgba(40, 55, 40, 0.45) !important;
}
html[data-reduce-transparency] .glass-icon-btn:hover,
html[data-reduce-transparency] .glass-icon-btn:focus-visible {
    background:   #eaeee4 !important;
    border-color: rgba(0, 0, 0, 0.22) !important;
}

/* card expand chevron: solid */
html[data-reduce-transparency] .expand-hint {
    background:   rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color:        var(--ink, #243024) !important;
}

/* ── Accessibility widget itself ── */
html[data-reduce-transparency] .a11y-panel {
    background: rgb(36, 48, 36) !important;
}
html[data-reduce-transparency] .a11y-trigger {
    background: rgb(36, 48, 36) !important;
}

/* ── decorative leaves: off under reduce transparency ── */
html[data-reduce-transparency] .leaves-container {
    display: none !important;
}


/* ══ 3. REDUCE MOTION ══ */

/* no outline around <main> after the skip link */
#main-content:focus { outline: none; }

/* universal: kills animations & transitions */
html[data-reduce-motion] *,
html[data-reduce-motion] *::before,
html[data-reduce-motion] *::after {
    animation-duration:        0.001ms !important;
    animation-iteration-count: 1       !important;
    transition-duration:       0.001ms !important;
    transition-delay:          0ms     !important;
    scroll-behavior:           auto    !important;
}

/* ── team: captions always visible (not only on :hover) ── */
html[data-reduce-motion] .glass-overlay {
    opacity:    1       !important;
    transform:  none    !important;
    visibility: visible !important;
}
html[data-reduce-motion] .glass-name-pill,
html[data-reduce-motion] .glass-buttons {
    opacity:   1    !important;
    transform: none !important;
}

/* ── team + reduce-motion: no hover effects ── */
html[data-reduce-motion] .team-member-clean:hover,
html[data-reduce-motion] .team-member-clean:focus-within {
    transform:  none !important;
    box-shadow: 0 12px 35px rgba(0,0,0,0.05) !important;   /* = base */
}
html[data-reduce-motion] .team-member-clean:hover .member-image-bg {
    transform: none !important;                             /* no zoom */
}
html[data-reduce-motion] .team-member-clean:hover .glass-name-pill,
html[data-reduce-motion] .team-member-clean:focus-within .glass-name-pill {
    background:  rgba(255, 255, 255, 0.72) !important;      /* = base bg */
    box-shadow:  0 6px 20px rgba(0, 0, 0, 0.14) !important; /* = base shadow */
}

/* ── team + reduce-motion: icon links always visible ── */
html[data-reduce-motion] .glass-icon-btn {
    opacity:        1    !important;
    transform:      none !important;
    pointer-events: auto !important;
}
html[data-reduce-motion] .glass-icon-btn:hover,
html[data-reduce-motion] .glass-icon-btn:focus-visible {
    transform: none !important;
}

/* ── Accessibility widget itself ── */
html[data-reduce-transparency] .a11y-panel {
    background: rgb(36, 48, 36) !important;
}
html[data-reduce-transparency] .a11y-trigger {
    background: rgb(36, 48, 36) !important;
}

/* ── decorative leaves: off under reduce transparency ── */
html[data-reduce-transparency] .leaves-container {
    display: none !important;
}


/* ══ 3. REDUCE MOTION ══ */

/* no outline around <main> after the skip link */
#main-content:focus { outline: none; }

/* universal: kills animations & transitions */
html[data-reduce-motion] *,
html[data-reduce-motion] *::before,
html[data-reduce-motion] *::after {
    animation-duration:        0.001ms !important;
    animation-iteration-count: 1       !important;
    transition-duration:       0.001ms !important;
    transition-delay:          0ms     !important;
    scroll-behavior:           auto    !important;
}

/* ── team: captions always visible (not only on :hover) ── */
html[data-reduce-motion] .glass-overlay {
    opacity:    1       !important;
    transform:  none    !important;
    visibility: visible !important;
}
html[data-reduce-motion] .glass-name-pill,
html[data-reduce-motion] .glass-buttons {
    opacity:   1    !important;
    transform: none !important;
}

/* ── team + reduce-motion: no hover effects ── */
html[data-reduce-motion] .team-member-clean:hover,
html[data-reduce-motion] .team-member-clean:focus-within {
    transform:  none !important;
    box-shadow: 0 12px 35px rgba(0,0,0,0.05) !important;   /* = base */
}
html[data-reduce-motion] .team-member-clean:hover .member-image-bg {
    transform: none !important;                             /* no zoom */
}
html[data-reduce-motion] .team-member-clean:hover .glass-name-pill,
html[data-reduce-motion] .team-member-clean:focus-within .glass-name-pill {
    background:  rgba(255, 255, 255, 0.72) !important;      /* = base bg */
    box-shadow:  0 6px 20px rgba(0, 0, 0, 0.14) !important; /* = base shadow */
}

/* ── team + reduce-motion: icon links always visible ── */
html[data-reduce-motion] .glass-icon-btn {
    opacity:        1    !important;
    transform:      none !important;
    pointer-events: auto !important;
}
html[data-reduce-motion] .glass-icon-btn:hover,
html[data-reduce-motion] .glass-icon-btn:focus-visible {
    transform: none !important;
}

/* ── team: the open card keeps its clarity under hover ── */
html[data-reduce-motion] .team-member-clean.is-expanded,
html[data-reduce-motion] .team-member-clean.is-expanded:hover,
html[data-reduce-motion] .team-member-clean.is-expanded:focus-within {
    transform: none !important;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.14) !important;
}
/* pin only the opacity */
html[data-reduce-motion] .team-member-clean.is-expanded .glass-name-pill,
html[data-reduce-motion] .team-member-clean.is-expanded:hover .glass-name-pill,
html[data-reduce-motion] .team-member-clean.is-expanded:focus-within .glass-name-pill {
    background: linear-gradient(165deg,
                rgba(255, 255, 255, 0.97) 0%,
                rgba(255, 255, 255, 0.90) 100%) !important;
}
html[data-reduce-motion] .team-member-clean.is-expanded .member-image-bg {
    transform: none !important;
}

/* reduce-transparency: no light layer over the photo */
html[data-reduce-transparency] .glass-overlay::after {
    display: none !important;
}

/* ── project: glass captions always visible ── */
html[data-reduce-motion] .glass-caption {
    opacity:   1    !important;
    transform: none !important;
}

/* ── carousel nav: visible immediately (safety net) ── */
html[data-reduce-motion] .carousel-nav,
html[data-reduce-motion] .dots-pill,
html[data-reduce-motion] .pause-btn,
html[data-reduce-motion] .nav-dot {
    opacity:    1    !important;
    transform:  none !important;
    visibility: visible !important;
}
html[data-reduce-motion] .dots-pill {
    max-width: none   !important;
    width:     auto   !important;
    overflow:  visible !important;
}
/* card-label: always visible (the JS adds em-visible immediately) */
html[data-reduce-motion] .card-label {
    opacity:   1    !important;
    transform: none !important;
}
/* carousel transitions off (safety net) */
html[data-reduce-motion] .carousel-track,
html[data-reduce-motion] .carousel-card,
html[data-reduce-motion] .dot-fill { transition: none !important; }

/* ── team hero parallax: zeroed ── */
html[data-reduce-motion] .team-hero-clean {
    --hero-parallax: 0px !important;
    --hero-title-shift: 0px !important;
    --hero-title-fade: 1 !important;
}


/* ── 3b. high contrast: more contrast, underlined links, solid widget surfaces ── */

html[data-high-contrast] {
    filter: contrast(1.2) saturate(1.15);
}

/* links stand apart from text without relying on colour */
html[data-high-contrast] a:not(.a11y-trigger):not(.skip-link) {
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

/* interactive elements: stronger borders so they stand out */
html[data-high-contrast] button,
html[data-high-contrast] input,
html[data-high-contrast] select,
html[data-high-contrast] textarea {
    border-width: 2px !important;
}

/* focus ring: even more visible */
html[data-high-contrast] :focus-visible {
    outline-width: 3px !important;
}

/* accessibility widget: a solid background instead of translucent */
html[data-high-contrast] .a11y-panel,
html[data-high-contrast] .a11y-trigger {
    background: rgb(20, 27, 20) !important;
    border-color: rgba(255,255,255,0.35) !important;
}


/* ── 3c. dyslexia-friendly font: Atkinson Hyperlegible + extra spacing (fonts.css, loaded on use) ── */

html[data-dyslexia-font] * {
    font-family: 'Atkinson Hyperlegible', sans-serif !important;
    letter-spacing: 0.02em !important;
}
html[data-dyslexia-font] p,
html[data-dyslexia-font] li {
    line-height: 1.7 !important;
}


/* ── 3d. wider text spacing: WCAG 1.4.12 letter and word spacing, taller lines, body text only ── */

/* the children too, since the dyslexia font sets letter-spacing on every element */
html[data-text-spacing] :is(main, #main-content) :is(p, li, dd, dt, td, th, figcaption, blockquote),
html[data-text-spacing] :is(main, #main-content) :is(p, li, dd, dt, td, th, figcaption, blockquote) * {
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
}
html[data-text-spacing] :is(main, #main-content) :is(p, li, dd, dt, td, th, figcaption, blockquote) {
    line-height: 1.8 !important;
}


/* ── 3e. reading ruler: a clear strip, the page above and below dimmed (placed by accessibility.js) ── */

.a11y-ruler {
    position: fixed; top: 0; left: 0; right: 0;
    /* rem, so it grows with the text size */
    height: 4.5rem;
    z-index: 299;   /* over the navbar, under the panel (300) */
    pointer-events: none;
    box-shadow: 0 0 0 100vmax rgba(20, 27, 20, 0.42);
    will-change: transform;
}
html[data-dark] .a11y-ruler { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55); }
@media print { .a11y-ruler { display: none; } }


/* ══ 4. WIDGET ══ */

.a11y-widget {
    position: fixed;
    bottom: 2rem; right: 2rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
    /* container ignores pointer events so the closed panel does not block taps */
    pointer-events: none;
}
.a11y-trigger,
.a11y-widget.open .a11y-panel { pointer-events: auto; }

.a11y-panel {
    background: rgba(36, 48, 36, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    /* border 5.07:1 on the page */
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    padding: 1.1rem 1.15rem 1.1rem;
    /* clamped so it fits narrow viewports at 150% zoom */
    min-width: min(280px, calc(100vw - 2rem));
    /* wide enough that labels and hints rarely wrap (grows with text zoom) */
    max-width: min(23rem, calc(100vw - 2rem));
    /* never taller than the viewport; scrolls inside */
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* scroll stays inside the panel */
    overscroll-behavior: contain;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 0.5px rgba(255,255,255,0.04) inset;
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    pointer-events: none;
    transition:
        opacity   0.2s var(--apple-ease, cubic-bezier(0.2,0.8,0.2,1)),
        transform 0.2s var(--apple-ease, cubic-bezier(0.2,0.8,0.2,1));
}
.a11y-widget.open .a11y-panel {
    opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
.a11y-panel::before {
    content: '';
    display: block;
    height: 1px;
    margin: -1.1rem -1.15rem 0.85rem;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(90deg, transparent, rgba(111,125,101,0.5), transparent);
}

.a11y-trigger {
    position: relative;
    /* 44px target (WCAG 2.5.5) */
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(36, 48, 36, 0.90);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(255, 255, 255, 0.90);
    font-family: 'Quicksand', sans-serif;
    /* em letter-spacing grows with zoom */
    font-size: 0.82rem; font-weight: 600; letter-spacing: 0.05em;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 14px rgba(0,0,0,0.3);
    transition: background 0.2s ease, border-color 0.2s ease,
                color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.a11y-trigger:hover {
    background: rgba(58,75,58,0.95);
    border-color: rgba(111,125,101,0.45);
    color: rgba(255,255,255,0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.a11y-widget.open .a11y-trigger {
    background: rgba(58,75,58,0.98);
    border-color: rgba(180,191,169,0.4);
    color: var(--tertiary-pale, #B4BFA9);
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.a11y-trigger::after {
    content: '';
    position: absolute; top: 3px; right: 3px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--tertiary-pale, #B4BFA9);
    border: 1.5px solid rgba(36,48,36,0.92);
    opacity: 0; transform: scale(0.4);
    pointer-events: none;
    transition: opacity 0.2s ease,
                transform 0.2s var(--apple-ease, cubic-bezier(0.2,0.8,0.2,1));
}
.a11y-widget--modified .a11y-trigger::after { opacity: 1; transform: scale(1); }


/* ── 4b. first-visit hint pill: grows out of the button, then retracts ── */

.a11y-trigger-row {
    display: flex;
    align-items: center;
    gap: 0;   /* no gap while the hint is collapsed - the button stays flush right */
}

.a11y-hint {
    display: flex;
    align-items: center;
    white-space: nowrap;
    /* decorative and temporary; ignores pointer events */
    pointer-events: none;
    /* rem height so zoomed text is not cut */
    height: 2.4rem;
    max-width: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    background: rgba(36, 48, 36, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid transparent;   /* transparent while collapsed → no 1px line */
    border-radius: 20px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.3);
    color: rgba(255,255,255,0.92);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    margin-right: 0;
    pointer-events: none;
    /* collapse easing (smooth ease-in) */
    transition: max-width   0.4s cubic-bezier(0.45, 0.05, 0.12, 1),
                padding      0.4s cubic-bezier(0.45, 0.05, 0.12, 1),
                margin-right 0.4s cubic-bezier(0.45, 0.05, 0.12, 1),
                opacity      0.28s ease;
}

/* expanded: spring overshoot - the same lively feel as the dots-pill */
.a11y-widget--hint .a11y-hint {
    /* clamped to the viewport */
    max-width: min(20rem, calc(100vw - 5.5rem));
    padding: 0 15px;
    margin-right: 0.55rem;
    opacity: 1;
    border-color: rgba(255,255,255,0.10);
    transition: max-width   0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                padding      0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                margin-right 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity      0.22s ease;
}

.a11y-hint-key {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.25rem; height: 1.25rem; margin: 0 0.45rem; padding: 0 0.25rem;
    border-radius: 5px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.40);   /* 3.35:1 - was 0.18 → 1.7:1 */
    border-bottom-width: 2px;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.76rem; font-weight: 600; line-height: 1;
    color: #fff;
}


/* ══ 5. PANEL - FONT SIZE ══ */

/* section headings in sentence case: capitals and wide tracking are harder to read with dyslexia */
.a11y-panel-label {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem; font-weight: 700; line-height: 1.3;
    letter-spacing: 0.01em;
    color: rgba(255,255,255,0.90);
    margin: 0 0 0.6rem;
}
/* one card per section, so each group reads as its own block */
.a11y-section {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 0.75rem 0.6rem 0.6rem;
}
.a11y-section + .a11y-section { margin-top: 0.6rem; }
.a11y-section > .a11y-panel-label { padding: 0 0.5rem; }
html[data-high-contrast] .a11y-section { border-color: rgba(255,255,255,0.35); }
/* size scale in rem */
.a11y-dots {
    display: flex; gap: 0.4rem;
    justify-content: center; align-items: center;
}
/* hollow vs filled dots, not faint vs bright */
.a11y-dot {
    width: 0.5rem; height: 0.5rem; border-radius: 50%;
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.45);
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease,
                transform 0.25s var(--apple-ease, cubic-bezier(0.2,0.8,0.2,1));
}
.a11y-dot.active {
    background: var(--tertiary-pale, #B4BFA9);
    border-color: var(--tertiary-pale, #B4BFA9);
    transform: scale(1.4);
}

/* visible percentage (aria-hidden; the buttons already say it) */
.a11y-level-readout {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
    text-align: center; line-height: 1;
    color: rgba(255,255,255,0.90);
}
/* A− | 100% and dots | A+ in one row */
.a11y-controls { display: flex; align-items: center; gap: 0.5rem; }
.a11y-size-meter {
    flex: 1.2; display: flex; flex-direction: column;
    align-items: center; gap: 0.5rem;
}
/* button boundary 3.35:1 (SC 1.4.11) */
.a11y-ctrl-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
    background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.40);
    border-radius: 8px; padding: 0.62rem 0.5rem; min-height: 2.75rem;
    cursor: pointer; color: rgba(255,255,255,0.90);
    font-family: 'Quicksand', sans-serif;
    transition: background 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, transform 0.15s ease;
}
.a11y-ctrl-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.62);
    color: #fff; transform: translateY(-1px);
}
/* disabled = end of the scale: own colour, still readable */
.a11y-ctrl-btn:disabled {
    cursor: not-allowed; transform: none;
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.60);
}
.a11y-ctrl-a            { font-family: 'Quicksand', sans-serif; font-weight: 600; line-height: 1; }
.a11y-ctrl-a--small     { font-size: 0.88rem; }
.a11y-ctrl-a--large     { font-size: 1.34rem; }
.a11y-ctrl-sign         { font-size: 1.02rem; font-weight: 400; line-height: 1; margin-top: -1px; }


/* ══ 6. PANEL - DISPLAY TOGGLES ══ */

/* top margin for toggles under other controls in the same section */
.a11y-inline-toggles { margin-top: 0.6rem; }
/* hover lights the row background; 36px target */
.a11y-toggle-btn {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; background: none; border: none;
    padding: 0.5rem 0.5rem; min-height: 2.75rem;
    border-radius: 8px; cursor: pointer;
    color: rgba(255,255,255,0.88); gap: 0.75rem;
    transition: color 0.15s ease, background 0.15s ease;
}
.a11y-toggle-btn + .a11y-toggle-btn { margin-top: 0.15rem; }
.a11y-toggle-btn:hover:not(:disabled) {
    color: #fff; background: rgba(255,255,255,0.09);
}
.a11y-toggle-btn[aria-checked="true"]{ color: var(--tertiary-pale, #B4BFA9); }
.a11y-toggle-text {
    flex: 1; display: flex; flex-direction: column; gap: 0.15rem;
    text-align: left; min-width: 0; user-select: none;
}
.a11y-toggle-label {
    font-family: 'Quicksand', sans-serif; font-size: 0.95rem; font-weight: 600;
    letter-spacing: 0.01em; text-align: left; line-height: 1.4;
    flex: 1; user-select: none;
}
/* what the switch does, in plain words */
.a11y-toggle-hint {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.82rem; font-weight: 400; line-height: 1.45;
    color: var(--text-on-dark-soft, rgba(255,255,255,0.70));
}
/* ── the switch: visible off/on states against the panel ── */
.a11y-toggle-track {
    position: relative; flex-shrink: 0; display: inline-block;
    width: 2.4rem; height: 1.4rem; border-radius: 0.7rem;
    background: rgba(255,255,255,0.14);
    border: 2px solid rgba(255,255,255,0.45);
    transition: background 0.2s ease, border-color 0.2s ease;
}
.a11y-toggle-track::after {
    content: ''; position: absolute; top: 50%; left: 0.22rem;
    width: 0.82rem; height: 0.82rem; border-radius: 50%;
    background: rgba(255,255,255,0.62);
    transform: translateY(-50%);
    transition: transform 0.22s var(--apple-ease, cubic-bezier(0.2,0.8,0.2,1)),
                background 0.2s ease;
}
.a11y-toggle-btn[aria-checked="true"] .a11y-toggle-track {
    background: var(--tertiary-pale, #B4BFA9);
    border-color: var(--tertiary-pale, #B4BFA9);
}
.a11y-toggle-btn[aria-checked="true"] .a11y-toggle-track::after {
    transform: translate(1.1rem, -50%); background: #1B241B;
}


/* ── 5b. hero contrast under the accessibility settings ── */

/* current daltonize filter, carried into the rules below */
html[data-cvd="protan"][data-cvd-images] { --a11y-dalt: url(#a11y-daltonize-protan); }
html[data-cvd="deutan"][data-cvd-images] { --a11y-dalt: url(#a11y-daltonize-deutan); }

/* ── --a11y-night: 0 = day, 1 = night (independent of dark mode) ── */
body { --a11y-night: clamp(0, calc(var(--dusk, 0) / 0.62), 1); }

/* night veil down to 30% */
html[data-high-contrast]       .hero-scene .nightfall,
html[data-reduce-transparency] .hero-scene .nightfall,
html[data-cvd]                 .hero-scene .nightfall,
html[data-dark]                .hero-scene .nightfall {
    opacity: calc(var(--dusk, 0) * 0.3);
}

/* ── trees: day and night settings crossfade via --a11y-night ── */
html[data-high-contrast]       .hero-scene .tree img,
html[data-reduce-transparency] .hero-scene .tree img,
html[data-cvd]                 .hero-scene .tree img,
html[data-dark]                .hero-scene .tree img {
    filter:
        saturate(calc(1.35 - 0.35 * var(--a11y-night, 0)))
        contrast(calc(1.12 + 0.08 * var(--a11y-night, 0)))
        brightness(calc(0.82 + 0.80 * var(--a11y-night, 0)))
        drop-shadow(0 0 1px rgba(30, 38, 26, calc(0.85 * (1 - var(--a11y-night, 0)))))
        drop-shadow(0 0 4px rgba(245, 250, 240, var(--a11y-night, 0)));
}

/* ── ground: stronger treatment, shadow upward ── */
html[data-high-contrast]       .hero-scene .ground img,
html[data-reduce-transparency] .hero-scene .ground img,
html[data-cvd]                 .hero-scene .ground img,
html[data-dark]                .hero-scene .ground img {
    filter:
        saturate(calc(1.4 - 0.25 * var(--a11y-night, 0)))
        contrast(calc(1.2 - 0.2 * var(--a11y-night, 0)))
        brightness(calc(0.57 + 1.13 * var(--a11y-night, 0)))
        drop-shadow(0 -1px 2px rgba(30, 38, 26, calc(0.95 * (1 - var(--a11y-night, 0)))))
        drop-shadow(0 -1px 2px rgba(240, 245, 235, calc(0.9 * var(--a11y-night, 0))));
}


/* ══ 6c. PANEL - COLOUR VISION ══ */

/* help line under a section label: AA at 100% zoom */
.a11y-panel-hint {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.82rem; font-weight: 400; line-height: 1.5;
    color: var(--text-on-dark-soft, rgba(255,255,255,0.70));   /* 6.89:1 */
    margin: -0.2rem 0 0.6rem; padding: 0 0.5rem;
}

.a11y-radiogroup { display: flex; flex-direction: column; gap: 2px; }

.a11y-radio-btn {
    display: flex; align-items: flex-start; gap: 0.6rem;
    width: 100%; background: none; border: none;
    padding: 0.5rem 0.5rem; min-height: 2.5rem; border-radius: 8px;
    cursor: pointer; text-align: left;
    color: rgba(255,255,255,0.82);
    transition: background 0.15s ease, color 0.15s ease;
}
.a11y-radio-btn:hover { background: rgba(255,255,255,0.09); color: #fff; }
.a11y-radio-btn[aria-checked="true"] {
    color: var(--tertiary-pale, #B4BFA9);
    background: rgba(255,255,255,0.08);
}

/* radio shape: selection also shown by text and background (SC 1.4.1) */
.a11y-radio-mark {
    position: relative; flex-shrink: 0;
    width: 1rem; height: 1rem; margin-top: 0.15rem;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.45);
    transition: border-color 0.15s ease;
}
.a11y-radio-btn[aria-checked="true"] .a11y-radio-mark {
    border-color: var(--tertiary-pale, #B4BFA9);
}
.a11y-radio-btn[aria-checked="true"] .a11y-radio-mark::after {
    content: ''; position: absolute; inset: 0.15rem;
    border-radius: 50%; background: var(--tertiary-pale, #B4BFA9);
}

.a11y-radio-text  { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.a11y-radio-name  {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem; font-weight: 600; line-height: 1.4;
}
/* mode explanation line: AA */
.a11y-radio-hint  {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.82rem; font-weight: 400; line-height: 1.4;
    color: var(--text-on-dark-soft, rgba(255,255,255,0.70));
}

/* active mode description: fainter than labels but AA */
.a11y-panel-note {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.82rem; font-weight: 400; line-height: 1.5;
    color: var(--text-on-dark-soft, rgba(255,255,255,0.70));
    margin: 0.6rem 0.5rem 0.1rem;
    padding-left: 0.6rem;
    border-left: 3px solid rgba(180,191,169,0.55);
}
.a11y-panel-note[hidden] { display: none; }

/* reset: an outlined button under the sections */
.a11y-reset-btn {
    display: flex; align-items: center; gap: 0.75rem;
    width: 100%; margin-top: 0.75rem;
    padding: 0.55rem 0.75rem; min-height: 2.75rem;
    background: none; border: 1px solid rgba(255,255,255,0.40);
    border-radius: 10px; cursor: pointer; text-align: left;
    color: rgba(255,255,255,0.88);
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.a11y-reset-btn:hover { color: #fff; background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.62); }
.a11y-reset-icon { flex-shrink: 0; font-size: 1.2rem; line-height: 1; }

/* "Recolour images" inactive: own colour, still readable */
.a11y-toggle-btn:disabled { cursor: not-allowed; color: rgba(255,255,255,0.52); }
.a11y-toggle-btn:disabled .a11y-toggle-hint { color: rgba(255,255,255,0.52); }
.a11y-toggle-btn:disabled .a11y-toggle-track { opacity: 0.62; }

/* the hidden <svg> holding the <filter> elements - zero footprint in the flow. */
.a11y-cvd-defs {
    position: absolute; width: 0; height: 0;
    overflow: hidden; pointer-events: none;
}


/* ══ 6b. PANEL - KEYBOARD GUIDE ══ */

/* 36px target, background on hover */
.a11y-help-btn {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; background: none; border: none;
    padding: 0.45rem 0.5rem; min-height: 2.25rem;
    border-radius: 8px; cursor: pointer;
    color: rgba(255,255,255,0.82); gap: 0.75rem;
    transition: color 0.15s ease, background 0.15s ease;
}
.a11y-help-btn .a11y-toggle-label { font-weight: 700; }
.a11y-help-btn:hover                 { color: #fff; background: rgba(255,255,255,0.09); }
.a11y-help-btn[aria-expanded="true"] { color: var(--tertiary-pale, #B4BFA9); }

.a11y-help-chevron {
    flex-shrink: 0; font-size: 0.8rem; line-height: 1;
    transition: transform 0.25s var(--apple-ease, cubic-bezier(0.2,0.8,0.2,1));
}
.a11y-help-chevron--open { transform: rotate(180deg); }

/* intro text 6.89:1 */
.a11y-kb-intro {
    margin: 0.55rem 0 0.15rem;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.82rem; font-weight: 400; line-height: 1.55;
    color: var(--text-on-dark-soft, rgba(255,255,255,0.70));
}
.a11y-kb-help { padding: 0 0.5rem; }
.a11y-kb-sublabel {
    margin: 0.5rem 0 0.1rem;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.88rem; font-weight: 700; letter-spacing: 0.01em;
    color: rgba(255,255,255,0.90);
}
.a11y-kb-list {
    margin: 0.55rem 0 0.15rem; padding: 0;
    display: flex; flex-direction: column; gap: 0.5rem;
}
/* keys in a fixed column, descriptions left-aligned beside them (ragged right is easier to track) */
.a11y-kb-row {
    display: grid; grid-template-columns: 6.2rem 1fr;
    align-items: start; gap: 0.75rem;
}
.a11y-kb-keys { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; }
.a11y-kbd {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.78rem; line-height: 1; font-weight: 600;
    color: var(--text-on-dark);
    background: rgba(255,255,255,0.16);
    /* 0.14 = 1.55:1, i.e. "keys" with no visible key shape. 0.40 → 3.35:1. */
    border: 1px solid rgba(255,255,255,0.40);
    border-bottom-width: 2px;
    border-radius: 5px; padding: 0.26rem 0.42rem;
    min-width: 1.1rem; text-align: center; white-space: nowrap;
}
.a11y-kb-desc {
    margin: 0; text-align: left;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.86rem; font-weight: 500; line-height: 1.45;
    color: rgba(255,255,255,0.88);
}


/* ══ 7. FOCUS / RESPONSIVE ══ */

/* pale 3px ring inside the panel */
.a11y-ctrl-btn:focus-visible,
.a11y-toggle-btn:focus-visible,
.a11y-radio-btn:focus-visible,
.a11y-help-btn:focus-visible,
.a11y-reset-btn:focus-visible {
    outline: 3px solid var(--tertiary-pale, #B4BFA9); outline-offset: 2px;
    border-radius: 8px;
}

/* ── trigger: floats over the light page, needs a dark halo ── */
.a11y-trigger:focus-visible {
    outline: 3px solid var(--tertiary-pale, #B4BFA9);
    outline-offset: 2px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35),
                0 0 0 6px #243024;
}
/* not var(--ink): it turns light in dark mode */
@media (prefers-reduced-motion: reduce) {
    .a11y-panel, .a11y-trigger, .a11y-ctrl-btn,
    .a11y-toggle-btn, .a11y-toggle-track, .a11y-toggle-track::after,
    .a11y-radio-btn, .a11y-radio-mark, .a11y-help-btn, .a11y-reset-btn,
    .a11y-dot, .a11y-help-chevron, .a11y-hint { transition: none; }
}
@media (max-width: 600px) {
    .a11y-widget { bottom: 1.25rem; right: 1.25rem; }
    .a11y-panel  { min-width: min(240px, calc(100vw - 2rem)); }
}

/* ── touch: ≥ 44px targets (WCAG 2.5.5) ── */
@media (hover: none) and (pointer: coarse) {
    .a11y-trigger    { width: 48px; height: 48px; }
    .a11y-ctrl-btn   { min-height: 48px; }
    .a11y-toggle-btn { min-height: 44px; }
    /* targets for the colour-vision radios and the keyboard guide */
    .a11y-radio-btn  { min-height: 44px; }
    .a11y-help-btn   { min-height: 44px; }
    .a11y-reset-btn  { min-height: 48px; }
}
/* ── the "A" shortcut switch in the keyboard guide ── */
.a11y-kb-toggle {
    margin: 0.75rem -0.5rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.16);
}
