/* Ask Seelan — shared tokens and components (light + dark) */
:root {
  color-scheme: light dark;
  --brand: #3b5bdb;
  --brand-hover: #2f4ac0;
  --brand-tint: #e7ecff;
  --brand-chip: #eef1ff;
  --ink: #16181d;
  --ink-2: #3a3f48;
  --muted: #5c6370;
  --bg: #ffffff;
  --surface: #f4f5f7;
  --surface-2: #e9ebf0;
  --line: #e6e8ec;
  --line-strong: #d2d5db;
  --ok: #2b7a4b;
  --ok-tint: #e6f4ec;
  --tint-indigo: #e7ecff;
  --tint-green: #e6f4ec;
  --tint-peach: #fdf0e7;
  --shadow: 0 8px 28px rgba(22, 24, 29, .07);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, sans-serif;
  --gutter-l: max(24px, env(safe-area-inset-left, 0px));
  --gutter-r: max(24px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #6c8cff;
    --brand-hover: #8aa3ff;
    --brand-tint: #1f2a4d;
    --brand-chip: #1b2442;
    --ink: #f2f3f5;
    --ink-2: #c9cdd4;
    --muted: #9aa1ad;
    --bg: #0f1013;
    --surface: #17191e;
    --surface-2: #22252c;
    --line: #262a31;
    --line-strong: #343944;
    --ok: #5fd08f;
    --ok-tint: #15291e;
    --tint-indigo: #1f2a4d;
    --tint-green: #15291e;
    --tint-peach: #33231a;
    --shadow: 0 8px 28px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
    --brand: #6c8cff;
    --brand-hover: #8aa3ff;
    --brand-tint: #1f2a4d;
    --brand-chip: #1b2442;
    --ink: #f2f3f5;
    --ink-2: #c9cdd4;
    --muted: #9aa1ad;
    --bg: #0f1013;
    --surface: #17191e;
    --surface-2: #22252c;
    --line: #262a31;
    --line-strong: #343944;
    --ok: #5fd08f;
    --ok-tint: #15291e;
    --tint-indigo: #1f2a4d;
    --tint-green: #15291e;
    --tint-peach: #33231a;
    --shadow: 0 8px 28px rgba(0, 0, 0, .4);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Brand mark */
.mark { width: 32px; height: 32px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.mark svg { width: 55%; height: 55%; fill: #fff; }
.mark.lg { width: 56px; height: 56px; border-radius: 18px; box-shadow: 0 10px 30px color-mix(in srgb, var(--brand) 35%, transparent); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-weight: 600; font-size: 14px; display: grid; place-items: center; flex-shrink: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 980px; font-size: 15px; font-weight: 600; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; }
.btn-primary { background: var(--brand); color: #fff !important; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { background: var(--bg); border-color: var(--line-strong); color: var(--ink) !important; }
.btn-ghost:hover { background: var(--surface); }
.btn-outline { border-color: var(--brand); color: var(--brand) !important; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 980px; border: 0; background: var(--brand-chip); color: var(--brand); font-size: 13px; font-weight: 500; cursor: pointer; }
.chip:hover { filter: brightness(.96); }
.tag { font-size: 13px; padding: 6px 12px; border-radius: 980px; background: var(--surface); border: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── Badges (shared) ───────────────────────────── */
.tone-indigo { --tone: #3b5bdb; --tone-2: #8ea2f2; }
.tone-green { --tone: #1f8a5b; --tone-2: #7fd1a8; }
.tone-amber { --tone: #a86b00; --tone-2: #f0c35a; }
.tone-peach { --tone: #c2410c; --tone-2: #f6a77d; }
.tone-slate { --tone: #5c6370; --tone-2: #b8bec8; }
.badge-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.badge-filter { min-height: 36px; padding: 0 14px; border-radius: 980px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 13px; font-weight: 500; cursor: pointer; }
.badge-filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(168px, 100%), 1fr)); gap: 16px; perspective: 900px; }
.badge-grid.compact { grid-template-columns: repeat(auto-fill, minmax(min(132px, 100%), 1fr)); gap: 10px; }
.badge-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 12px 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; text-align: center; transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); transition: transform .15s ease-out, box-shadow .2s, border-color .2s; }
.badge-card:hover { box-shadow: 0 14px 34px rgba(20, 26, 51, .12); border-color: color-mix(in srgb, var(--tone) 35%, var(--line)); }
.badge-card[hidden] { display: none; }
.compact .badge-card { padding: 14px 8px 12px; }
.medal { position: relative; width: 84px; height: 84px; display: grid; place-items: center; flex-shrink: 0; }
.compact .medal { width: 64px; height: 64px; }
.medal.lg { width: 128px; height: 128px; }
.medal img { width: 100%; height: 100%; object-fit: contain; }
.medal-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 210deg, var(--tone), var(--tone-2), var(--tone)); box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--bg) 70%, transparent); }
.medal-hex { position: relative; width: 62%; height: 62%; display: grid; place-items: center; background: var(--bg); color: var(--tone); clip-path: polygon(25% 4%, 75% 4%, 98% 50%, 75% 96%, 25% 96%, 2% 50%); }
.medal-hex .i { width: 42%; height: 42%; }
.medal-level { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 8px; border-radius: 980px; color: #fff; white-space: nowrap; }
.lv-silver { background: #7b8591; } .lv-bronze { background: #a5652d; } .lv-gold { background: #b8860b; }
.badge-name { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.compact .badge-name { font-size: 12px; }
.badge-issuer { font-size: 12px; color: var(--muted); }
.badge-more { display: inline-block; margin-top: 16px; font-size: 14px; font-weight: 600; }
.badge-dialog { border: 0; padding: 0; border-radius: 28px; max-width: min(420px, calc(100vw - 32px)); width: 100%; background: var(--bg); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.badge-dialog::backdrop { background: rgba(10, 12, 20, .45); backdrop-filter: blur(4px); }
.badge-sheet { position: relative; padding: 40px 28px 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.badge-sheet h3 { margin: 8px 0 0; font-size: 22px; letter-spacing: -0.02em; }
.badge-meta { margin: 0; color: var(--muted); font-size: 14px; }
.badge-pending { font-size: 13px; color: var(--muted); padding: 8px 14px; border-radius: 980px; background: var(--surface); }
.badge-x { position: absolute; top: 10px; right: 10px; }
.badge-sheet .btn { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .badge-card { transform: none !important; } }

.lv-foundational { background: #3d7a5a; } .lv-learning { background: #5c6370; }
.badge-desc { margin: 4px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); text-align: left; }
.badge-also { margin: 0; font-size: 13px; color: var(--muted); }
.tags.center { justify-content: center; }
.badge-verified { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--ok); }
.badge-verified .i { width: 12px; height: 12px; }
.badge-dialog { max-height: calc(100svh - 32px); overflow-y: auto; }

/* Theme toggle */
.theme-toggle { width: 44px; height: 44px; border-radius: 50%; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; transition: background .2s; }
.theme-toggle:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
