/* =====================================================================
   wave2-c.css — Builder C (accessibility + personalization), wave 2.
   Loaded after styles.css on every page. All rules are namespaced to
   .xc-* classes or to html.<pref> hooks set by the early inline prefs
   script, so this file is inert when prefs are unset.
   Brand: #6ea8ff / #cfe2ff on #0b0c11, dark mode always. Bungee + Inter.
   ===================================================================== */

/* ---------- preference hooks (set on <html> by the early prefs script,
   copied to <body> by wave2-c.js so legacy body.* selectors keep working) */

/* density: compact */
html.dense .section{padding-top:2.4rem;padding-bottom:2.4rem}
html.dense .card{padding:1rem 1.1rem}
html.dense .checklist{gap:.4rem}
html.dense .checklist label{padding:.6rem .9rem}
html.dense h1{font-size:clamp(1.7rem,5vw,2.4rem)}

/* high-contrast boost: brighter text, heavier borders, opaque muted */
html.hi-contrast{
  --ink:#ffffff;
  --muted:#d7dce8;
  --line:rgba(255,255,255,.32);
  --card:#10141f;
  --bg2:#0e1119;
}
html.hi-contrast .btn{border:2px solid var(--blue2)}
html.hi-contrast a{text-decoration-thickness:2px}
html.hi-contrast .checklist label,
html.hi-contrast .card{border-width:2px}

/* manual data-saver (mirrors the body.save-data rules in styles.css) */
html.save-data .hero-bg{background-image:none !important}
html.save-data .flip-demo{display:none !important}
html.save-data .trail{display:none !important}

/* manual reduce-motion: kill animation/transition, keep content visible.
   The hero demo rests on a still frame instead of disappearing. */
html.no-motion{scroll-behavior:auto}
html.no-motion *,
html.no-motion *::before,
html.no-motion *::after{
  animation-duration:.01ms !important;
  animation-iteration-count:1 !important;
  transition-duration:.01ms !important;
}
html.no-motion .flip-demo{opacity:.9}
html.no-motion .trail{display:none}

/* ---------- #281 compare-table caption ---------- */
.compare-table caption{
  caption-side:top;
  text-align:left;
  font-size:.85rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--muted);
  padding-bottom:.6rem;
}

/* ---------- #276 timeline status glyphs (shape + text, never color-only) */
.timeline .t-dot{position:relative}
.timeline .t-dot::after{
  content:"";
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;
  font-size:11px;line-height:1;color:var(--blue2);
}
.timeline li.done .t-dot{background:transparent !important;box-shadow:none !important;border:2px solid var(--blue)}
.timeline li.done .t-dot::after{content:"\2713";color:var(--blue)}            /* ✓ */
.timeline li.now .t-dot{background:transparent !important;border:2px solid var(--blue2)}
.timeline li.now .t-dot::after{content:"\25CF";color:var(--blue2);animation:none} /* ● */
.timeline li:not(.done):not(.now) .t-dot{background:transparent !important;border:2px solid var(--ice)}
.timeline li:not(.done):not(.now) .t-dot::after{content:"\25CB";color:var(--ice)} /* ○ */

/* ---------- #273/#274 dialog shell (nudge upgrade + shortcuts dialog) --- */
.xc-dialog-backdrop{
  position:fixed;inset:0;z-index:300;
  background:rgba(4,5,9,.72);
  display:flex;align-items:center;justify-content:center;
  padding:1rem;
}
.xc-dialog{
  background:var(--card);color:var(--ink);
  border:1px solid var(--line);border-radius:var(--radius);
  max-width:26rem;width:100%;max-height:80vh;overflow:auto;
  padding:1.4rem 1.5rem;
  box-shadow:0 24px 70px rgba(0,0,0,.6);
}
.xc-dialog h2{font-size:1.25rem;margin:0 0 .8rem}
.xc-dialog .xc-kbd-table{width:100%;border-collapse:collapse;font-size:.95rem}
.xc-dialog .xc-kbd-table th,
.xc-dialog .xc-kbd-table td{text-align:left;padding:.45rem .3rem;border-bottom:1px solid var(--line)}
.xc-dialog .xc-kbd-table th{color:var(--muted);font-weight:600;font-size:.8rem;text-transform:uppercase;letter-spacing:.08em}
.xc-dialog-actions{display:flex;gap:.6rem;justify-content:flex-end;margin-top:1.1rem}
kbd{
  font-family:var(--font-body);font-size:.85em;font-weight:700;
  background:#1b2030;border:1px solid var(--line);border-bottom-width:2px;
  border-radius:6px;padding:.1em .5em;color:var(--blue2);white-space:nowrap;
}
.xc-kbd-hint{font-size:.8rem;color:var(--muted);margin-top:.4rem}
.xc-kbd-hint kbd{font-size:.75rem}

/* visible "?" shortcuts button (injected into footer on shortcut pages) */
.xc-shortcuts-btn{
  background:none;border:1px solid var(--line);border-radius:999px;
  color:var(--muted);font-size:.8rem;padding:.35rem .9rem;cursor:pointer;
  margin-top:1rem;
}
.xc-shortcuts-btn:hover{color:var(--ink);border-color:var(--blue)}
.xc-motion-toggle{
  background:none;border:1px solid var(--line);border-radius:999px;
  color:var(--muted);font-size:.8rem;padding:.35rem .9rem;cursor:pointer;
  margin-top:1rem;margin-left:.5rem;
}
.xc-motion-toggle:hover{color:var(--ink);border-color:var(--blue)}
.xc-motion-toggle[aria-pressed="true"]{color:var(--blue2);border-color:var(--blue)}

/* ---------- #280 injected section skip links reuse .skip ------------ */
/* (no extra CSS needed; .skip from styles.css applies) */

/* ---------- #291 "pick up where you left off" strip ------------------ */
.xc-recent{
  border:1px solid var(--line);border-radius:var(--radius);
  background:var(--card);padding:1rem 1.25rem;margin:0 auto 1.5rem;
  max-width:1080px;
}
.xc-recent p{margin:0 0 .5rem;font-size:.8rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.xc-recent ol{list-style:none;display:flex;gap:.6rem;flex-wrap:wrap;margin:0;padding:0}
.xc-recent a{
  display:inline-block;padding:.45rem .95rem;border:1px solid var(--line);
  border-radius:999px;color:var(--blue2);text-decoration:none;font-size:.9rem;
}
.xc-recent a:hover{border-color:var(--blue)}

/* ---------- #293 "Continue learning" card ---------------------------- */
.xc-continue{
  border:1px solid var(--blue);border-radius:var(--radius);
  background:linear-gradient(120deg,rgba(110,168,255,.14),rgba(110,168,255,.04));
  padding:1.2rem 1.4rem;margin:1.6rem auto;max-width:640px;
}
.xc-continue h3{margin:0 0 .4rem;font-size:1.05rem}
.xc-continue p{margin:.3rem 0;color:var(--muted)}
.xc-continue .btn{margin-top:.6rem}

/* ---------- #298 trick difficulty filter ----------------------------- */
.xc-trick-filter{
  display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;
  margin:0 0 1.2rem;
}
.xc-trick-filter .xc-filter-label{font-weight:700;font-size:.9rem;color:var(--muted)}
.xc-trick-filter .xc-filter-btns{display:flex;gap:.4rem;flex-wrap:wrap}
.xc-filter-btn{
  border:1px solid var(--line);background:var(--card);color:var(--ink);
  border-radius:999px;padding:.4rem .95rem;font-size:.85rem;cursor:pointer;
}
.xc-filter-btn[aria-pressed="true"]{
  background:var(--blue);border-color:var(--blue);color:#0b1428;font-weight:700;
}
.xc-filter-note{font-size:.85rem;color:var(--muted)}

/* ---------- #299 share-progress button -------------------------------- */
.xc-share-progress{margin-top:1rem}

/* ---------- #292 configurator saved builds ---------------------------- */
.xc-builds{margin-top:1.2rem;border-top:1px solid var(--line);padding-top:1rem}
.xc-builds h3{font-size:1rem;margin:0 0 .6rem}
.xc-build-row{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:.8rem}
.xc-build-row input[type="text"]{
  flex:1;min-width:180px;background:#0e1119;border:1px solid var(--line);
  border-radius:10px;color:var(--ink);padding:.55rem .8rem;font-size:.9rem;
}
.xc-build-list{list-style:none;margin:0;padding:0;display:grid;gap:.5rem}
.xc-build-list li{
  display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;
  border:1px solid var(--line);border-radius:10px;padding:.5rem .8rem;
}
.xc-build-list .xc-build-name{font-weight:700;flex:1;min-width:120px}
.xc-build-dots{display:inline-flex;gap:4px}
.xc-build-dots i{width:14px;height:14px;border-radius:50%;border:1px solid var(--line);display:inline-block}
.xc-build-list .btn{padding:.3rem .7rem;font-size:.8rem}
.xc-empty{color:var(--muted);font-size:.9rem}

/* ---------- settings page ---------------------------------------------- */
.xc-settings .setting-card{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:1.4rem 1.5rem;margin:0 0 1.2rem;max-width:720px;
}
.xc-settings .setting-card h2{font-size:1.2rem;margin:0 0 .3rem}
.xc-settings .setting-card > p{color:var(--muted);margin:.3rem 0 1rem;font-size:.95rem}
.xc-setting-row{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:.7rem 0;border-top:1px solid var(--line);flex-wrap:wrap;
}
.xc-setting-row:first-of-type{border-top:none}
.xc-setting-row .xc-setting-label{flex:1;min-width:200px}
.xc-setting-row .xc-setting-label strong{display:block}
.xc-setting-row .xc-setting-label small{color:var(--muted)}
.xc-toggle{
  position:relative;min-width:64px;height:34px;border-radius:999px;cursor:pointer;
  border:2px solid var(--line);background:#1b2030;flex:none;
}
.xc-toggle::after{
  content:"";position:absolute;top:2px;left:3px;width:24px;height:24px;border-radius:50%;
  background:var(--ice);transition:left .18s,background .18s;
}
.xc-toggle[aria-pressed="true"]{background:rgba(110,168,255,.25);border-color:var(--blue)}
.xc-toggle[aria-pressed="true"]::after{left:31px;background:var(--blue)}
.xc-seg{display:flex;gap:.4rem;flex-wrap:wrap}
.xc-seg button{
  border:1px solid var(--line);background:#1b2030;color:var(--ink);
  border-radius:10px;padding:.5rem .95rem;font-size:.9rem;cursor:pointer;
}
.xc-seg button[aria-pressed="true"]{
  background:var(--blue);border-color:var(--blue);color:#0b1428;font-weight:700;
}
.xc-fontscale{display:flex;align-items:center;gap:.5rem}
.xc-fontscale button{
  width:44px;height:44px;border-radius:12px;border:1px solid var(--line);
  background:#1b2030;color:var(--ink);font-size:1.1rem;font-weight:800;cursor:pointer;
}
.xc-fontscale output{min-width:3.2rem;text-align:center;font-weight:700;color:var(--blue2)}
.xc-dismiss-list{list-style:none;margin:0;padding:0;display:grid;gap:.5rem}
.xc-dismiss-list li{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  border:1px solid var(--line);border-radius:10px;padding:.6rem .9rem;flex-wrap:wrap;
}
.xc-data-actions{display:flex;gap:.7rem;flex-wrap:wrap;margin-top:.4rem}
.xc-danger{border-color:#8a3a3a !important}
.xc-reset-confirm{
  border:1px solid #8a3a3a;border-radius:12px;background:rgba(138,58,58,.12);
  padding:1rem 1.2rem;margin-top:1rem;
}
.xc-reset-confirm ul{margin:.5rem 0 1rem;padding-left:1.2rem;color:var(--muted);font-size:.9rem}
.xc-reset-confirm .xc-data-actions{margin-top:.6rem}

/* ---------- #278 forced-colors (Windows high contrast) ------------------ */
/* explicit focus-visible treatment for wave2-c interactive components (#280) —
   builds on the global :focus-visible in styles.css with consistent offset */
[data-checklist] label:focus-within,
.swatches [role="radio"]:focus-visible,
.poll button:focus-visible,
.xc-filter-btn:focus-visible,
.xc-chip:focus-visible,
.xc-kbd-hint kbd:focus-visible,
.xc-motion-toggle button:focus-visible{
  outline:3px solid var(--blue);
  outline-offset:3px;
  border-radius:8px;
}
[data-checklist] label:focus-within{ background:rgba(110,168,255,.08); }

@media (forced-colors: active){
  :focus-visible{outline:3px solid Highlight}
  .progress i{background:Highlight;forced-color-adjust:none}
  .swatches button[aria-pressed="true"],
  .swatch[aria-pressed="true"]{border-color:Highlight;forced-color-adjust:none}
  .timeline .t-dot{background:Canvas !important;border:2px solid CanvasText !important;box-shadow:none !important}
  .timeline .t-dot::after{color:CanvasText}
  .timeline li.done .t-dot::after,
  .timeline li.now .t-dot::after{color:Highlight}
  .xc-toggle[aria-pressed="true"]{background:Highlight;forced-color-adjust:none}
  .xc-toggle[aria-pressed="true"]::after{background:Canvas}
  .xc-seg button[aria-pressed="true"],
  .xc-filter-btn[aria-pressed="true"]{background:Highlight;color:Canvas;forced-color-adjust:none}
  kbd{border:1px solid CanvasText}
  .xc-dialog{border:2px solid CanvasText}
}

/* ---------- touch/keyboard parity: card lift on keyboard focus (#279) --- */
.card:focus-within{transform:translateY(-3px)}
@media (hover:none){
  .card:focus-within{transform:none}
}

/* ---------- print: keep settings readable ------------------------------- */
@media print{
  .xc-settings .xc-toggle,
  .xc-settings .xc-data-actions,
  .xc-settings .xc-dismiss-list button{display:none}
}
