/* Light/dark themes + accessibility tools. Light is the default; dark via html[data-theme="dark"]. */
html:not([data-theme="dark"]){
  --bg:#faf8f3; --bg2:#f1ece1; --card:#ffffff; --line:#e2d9c6;
  --gold:#a87a1f; --gold2:#7a5810; --ink:#1d1a15; --muted:#4f483d;
  --ok:#2e7d32; --warn:#9a5b00; --bad:#b3261e;
  color-scheme:light;
}
html[data-theme="dark"]{color-scheme:dark}
html:not([data-theme="dark"]) .site-header{background:rgba(250,248,243,.97)}
html:not([data-theme="dark"]) .btn:hover{background:#c4952f}
html:not([data-theme="dark"]) .kicker,
html:not([data-theme="dark"]) .brand em,
html:not([data-theme="dark"]) .card h3{color:var(--gold2)}
html:not([data-theme="dark"]) .card,
html:not([data-theme="dark"]) .step,
html:not([data-theme="dark"]) form.panel,
html:not([data-theme="dark"]) .founder{box-shadow:0 2px 10px rgba(60,45,20,.06)}
body{transition:background-color .2s,color .2s}

/* skip link + focus */
.skip-link{position:absolute;left:12px;top:-60px;z-index:1000;background:var(--gold);color:#141210;
  padding:10px 18px;border-radius:8px;font-weight:bold;text-decoration:none}
.skip-link:focus{top:12px}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{
  outline:3px solid var(--gold);outline-offset:3px}
main:focus{outline:none}
.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}

/* header theme toggle */
.theme-toggle{display:inline-flex;align-items:center;gap:8px;background:transparent;border:0;padding:4px 2px;
  color:var(--ink);cursor:pointer;font-family:var(--sans);font-size:.9rem;line-height:1}
.theme-toggle .tt-label{min-width:2.6em;text-align:left;font-weight:bold}
.theme-toggle .tt-track{position:relative;width:52px;height:28px;border-radius:14px;background:var(--bg2);
  border:2px solid var(--gold);transition:background .2s}
.theme-toggle .tt-thumb{position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:var(--gold);
  color:#141210;display:flex;align-items:center;justify-content:center;font-size:.75rem;transition:transform .2s}
.theme-toggle[aria-checked="true"] .tt-thumb{transform:translateX(24px)}
.theme-toggle:hover .tt-track{box-shadow:0 0 0 3px rgba(212,169,78,.25)}

/* accessibility launcher + panel */
.a11y-launch{position:fixed;left:18px;bottom:18px;z-index:900;width:56px;height:56px;border-radius:50%;
  background:#1d4ed8;color:#fff;border:3px solid #fff;box-shadow:0 4px 14px rgba(0,0,0,.3);cursor:pointer;
  display:flex;align-items:center;justify-content:center}
.a11y-launch svg{width:30px;height:30px}
.a11y-launch:hover{background:#1e40af}
.a11y-panel{position:fixed;left:18px;bottom:86px;z-index:901;width:min(340px,calc(100vw - 36px));max-height:calc(100vh - 110px);overflow:auto;
  background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:14px;padding:18px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);font-family:var(--sans)}
.a11y-panel[hidden]{display:none}
.a11y-panel h2{font-size:1.15rem;margin-bottom:4px;color:var(--ink);text-align:left}
.a11y-panel p.a11y-note{font-size:.85rem;color:var(--muted);margin-bottom:12px}
.a11y-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.a11y-opt{background:var(--bg2);color:var(--ink);border:2px solid var(--line);border-radius:10px;padding:10px 8px;
  font-size:.88rem;font-family:var(--sans);cursor:pointer;text-align:center;line-height:1.3}
.a11y-opt[aria-pressed="true"]{border-color:var(--gold);background:rgba(212,169,78,.18);font-weight:bold}
.a11y-size{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;
  background:var(--bg2);border:2px solid var(--line);border-radius:10px;padding:6px 8px}
.a11y-size span{font-size:.9rem}
.a11y-size button{background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:8px;width:40px;height:36px;font-size:1rem;font-weight:bold;cursor:pointer}
.a11y-actions{display:flex;gap:8px;margin-top:12px}
.a11y-actions button{flex:1;padding:10px;border-radius:10px;cursor:pointer;font-family:var(--sans);font-size:.9rem;font-weight:bold}
.a11y-reset{background:transparent;color:var(--ink);border:2px solid var(--line)}
.a11y-close{background:var(--gold);color:#141210;border:0}

/* accessibility modes (classes on <html>) */
html.a11y-contrast{--bg:#000;--bg2:#000;--card:#000;--line:#fff;--gold:#ffd400;--gold2:#ffff00;--ink:#fff;--muted:#fff;--ok:#00ff66}
html.a11y-contrast .site-header{background:#000}
html.a11y-contrast .card,html.a11y-contrast .step,html.a11y-contrast form.panel,html.a11y-contrast .founder,
html.a11y-contrast .chip,html.a11y-contrast .field input,html.a11y-contrast .field select,html.a11y-contrast .field textarea{border:2px solid #fff}
html.a11y-contrast a:not(.btn){color:#ffff00;text-decoration:underline}
html.a11y-links a:not(.btn){text-decoration:underline!important;text-underline-offset:3px;outline:2px dashed var(--gold);outline-offset:2px}
html.a11y-readable body,html.a11y-readable h1,html.a11y-readable h2,html.a11y-readable h3,
html.a11y-readable input,html.a11y-readable select,html.a11y-readable textarea,html.a11y-readable button{
  font-family:Verdana,Tahoma,'Atkinson Hyperlegible',Arial,sans-serif!important;letter-spacing:.03em;word-spacing:.12em}
html.a11y-spacing body{line-height:2.1}
html.a11y-spacing p,html.a11y-spacing li{margin-bottom:.6em;letter-spacing:.04em}
html.a11y-motion *,html.a11y-motion *::before,html.a11y-motion *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
html.a11y-grayscale body{filter:grayscale(1)}
html.a11y-cursor,html.a11y-cursor *{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l16 10-7 1.5L9.5 21z' fill='%23000' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E") 4 2,auto!important}
html.a11y-images img{visibility:hidden}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
@media(max-width:640px){.a11y-launch{left:12px;bottom:12px}.a11y-panel{left:12px;bottom:78px}}
@media print{.a11y-launch,.a11y-panel,.theme-toggle,.skip-link{display:none!important}}
