/* Component wall — site chrome only. Pack visuals come from the packs' own classes on each stage. */
[hidden] { display: none !important; }
.top nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Hero ---------- */
.cw-hero { position: relative; padding: 72px 0 44px; text-align: center; isolation: isolate; }
.cw-hero .chip { margin-bottom: 26px; }
.cw-hero h1 { font-size: clamp(42px, 6.4vw, 84px); line-height: 0.98; letter-spacing: -0.05em; font-weight: 600; }
.cw-hero h1 > span:not(.w) { display: block; color: var(--muted); }
.cw-hero__lede { max-width: 60ch; margin: 22px auto 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.cw-hero .aurora { inset: -40px 0 -120px; }

/* ---------- Filter bar (sticky under the header) ---------- */
.cw-bar { position: sticky; top: var(--top-h); z-index: 40; padding: 12px 0; border-block: 1px solid transparent; transition: background-color .3s, border-color .3s; }
.cw-bar.is-stuck { background: rgba(15, 15, 17, 0.78); border-color: var(--line); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
.cw-bar__in { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.cw-bar__end { display: flex; flex: 1 1 auto; align-items: center; gap: 12px; flex-wrap: wrap; }
.cw-bar__end > [data-theme-seg] { margin-left: auto; }
.cw-filter { position: relative; display: inline-flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.03); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.cw-filter::-webkit-scrollbar { display: none; }
.cw-filter__glider { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); transition: transform .42s var(--ease), width .42s var(--ease); pointer-events: none; }
.cw-filter button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 15px; white-space: nowrap; cursor: pointer; transition: color .25s, transform .2s var(--ease); }
.cw-filter button:hover, .cw-filter button[aria-pressed="true"] { color: var(--ink); }
.cw-filter button:active { transform: scale(0.97); }
/* Inside a scroller an outside focus ring would be clipped: draw it inset. */
.cw-filter button:focus-visible, .cw-cats button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.cw-filter button i { width: 8px; height: 8px; border-radius: 50%; }
.cw-filter button b { font-weight: 500; }
.cw-filter button small { font: 500 11px/1 "Geist Mono", ui-monospace, monospace; color: var(--faint); }
/* Search: narrows the wall as you type ("/" or ⌘K focuses it, Esc clears). Fixed width avoids shifting neighbour chips on focus. */
.cw-search { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.03); color: var(--muted); transition: border-color .2s, background-color .2s, box-shadow .3s var(--ease); }
.cw-search:focus-within { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04); color: var(--ink); }
.cw-search svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cw-search input { width: 170px; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; outline: none; }
.cw-search input::placeholder { color: var(--faint); }
.cw-search input::-webkit-search-cancel-button { display: none; }
.cw-search kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border: 1px solid var(--line-strong); border-radius: 6px; font: 500 11px/1 "Geist Mono", ui-monospace, monospace; color: var(--faint); transition: opacity .2s; }
.cw-search:focus-within kbd, .cw-search.has-value kbd { display: none; }
.cw-search__clear { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: var(--muted); cursor: pointer; transition: background-color .2s, color .2s; }
.cw-search__clear:hover { background: rgba(255, 255, 255, 0.16); color: var(--ink); }
.cw-search__clear:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.cw-search__clear svg { width: 12px; height: 12px; }
@media (hover: none) { .cw-search kbd { display: none; } }
.cw-cats { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.cw-cats button { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; white-space: nowrap; cursor: pointer; transition: color .2s, border-color .2s, background-color .2s, transform .2s var(--ease); }
.cw-cats button:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); }
.cw-cats button:active:not(:disabled) { transform: scale(0.96); }
.cw-cats button[aria-pressed="true"] { color: #111; background: var(--ink); border-color: var(--ink); }
.cw-cats button:disabled { opacity: .35; cursor: default; }

/* ---------- Wall ---------- */
/* Padding switches cleanly once before masonry runs (no per-frame padding transition triggering 36+ ResizeObserver relayouts). */
.cw { position: relative; margin-top: 28px; padding-bottom: 40px; }
.cw.is-unified { padding: 40px 40px 72px; }
.cw-backdrops { position: absolute; inset: 0; pointer-events: none; }
/* Each language's canvas: class / style from packs.json → site.backdrop (default: site.page). */
.cw-backdrop { position: absolute; inset: 0; border-radius: 36px; opacity: 0; transform: scale(0.985); transition: opacity .5s var(--ease), transform .65s var(--ease); visibility: hidden; }
.cw-backdrop.is-on { opacity: 1; transform: none; visibility: visible; }
.cw-grid { position: relative; min-height: 400px; overflow: clip; overflow-clip-margin: 64px; } /* filtered-out cards keep their spot without stretching the page */
.cw-grid.is-empty { min-height: 0; }
.cw-empty { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 240px; padding: 48px 20px; text-align: center; color: var(--muted); font-size: 15px; }
.cw.is-unified .cw-empty { color: rgba(0, 0, 0, 0.65); }
.cw.is-unified .cw-empty .pill { color: rgba(0, 0, 0, 0.85); border-color: rgba(0, 0, 0, 0.22); background: rgba(0, 0, 0, 0.04); }
html[data-theme="dark"] .cw.is-unified:not(.is-light-only) .cw-empty,
.cw.is-unified.is-dark-canvas .cw-empty { color: rgba(255, 255, 255, 0.72); }
html[data-theme="dark"] .cw.is-unified:not(.is-light-only) .cw-empty .pill,
.cw.is-unified.is-dark-canvas .cw-empty .pill { color: var(--ink); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.04); }
.cw-note { position: relative; margin-top: 24px; text-align: center; font-size: 13.5px; color: var(--faint); transition: color .4s; }
.cw.is-unified .cw-note { color: rgba(0, 0, 0, 0.55); }
html[data-theme="dark"] .cw.is-unified:not(.is-light-only) .cw-note,
.cw.is-unified.is-dark-canvas .cw-note { color: rgba(255, 255, 255, 0.6); }

/* Cards are absolutely positioned by the masonry script; they glide when the filter changes.
   .is-animating is removed once the glide finishes, so cards never sit permanently on GPU layers. */
.wcard { position: absolute; top: 0; left: 0; contain: layout style; }
.cw-grid.is-animating .wcard:not(.is-gone) { transition: transform .65s var(--ease); will-change: transform; }
.wcard__in { position: relative; contain: layout style; opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity .65s var(--ease), transform .75s var(--ease); }
.wcard.is-in .wcard__in { opacity: 1; transform: none; }
.wcard.is-out .wcard__in { opacity: 0; transform: scale(0.96); transition-duration: .28s; }
.wcard.is-out { pointer-events: none; }
.wcard.is-gone { visibility: hidden; }
.wcard.is-offscreen *, .wcard.is-offscreen *::before, .wcard.is-offscreen *::after,
.wcard.is-out *, .wcard.is-out *::before, .wcard.is-out *::after { animation-play-state: paused !important; }
/* Hover: a soft halo in the language's own color (a gradient, not a blur filter) and a small lift. */
.wcard__in::before { content: ""; position: absolute; inset: 10% 4% -8%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) 55%, transparent), transparent); opacity: 0; transition: opacity .5s var(--ease); pointer-events: none; }
/* Subtle 1px specular hairline in mixed-wall mode so dark stages separate cleanly from #0F0F11. */
body[data-wall-style="all"] .wcard__in::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: 22px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.075); pointer-events: none; transition: opacity .35s var(--ease); }
.wcard:hover .wcard__in::before { opacity: .5; }
.wcard.is-in:hover .wcard__in { transform: translate3d(0, -3px, 0); transition-duration: .45s; }

/* Spotlight: only promoted to a GPU layer while hovered (no 96× 440×440 idle GPU textures). */
.wstage > .wcard__spot { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.wcard__spot i { position: absolute; left: 0; top: 0; width: 440px; height: 440px; margin: -220px 0 0 -220px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.34), transparent); opacity: 0; transition: opacity .45s; }
.wcard:hover .wcard__spot i { opacity: 1; will-change: transform; }
html[data-theme="dark"] .wcard__spot i { background: radial-gradient(closest-side, rgba(255, 255, 255, 0.07), transparent); }

.wcard__bar { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.wcard__bar button { pointer-events: auto; }
.wcard__tag { display: inline-flex; align-items: center; gap: 8px; min-width: 0; height: 32px; padding: 0 12px 0 10px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 999px; background: rgba(18, 18, 21, 0.9); color: #F3F3F1; font: 500 13px/1 "Geist", system-ui, sans-serif; letter-spacing: 0; text-transform: none; cursor: pointer; transition: background-color .2s; }
.wcard__tag i { width: 7px; height: 7px; flex: none; border-radius: 50%; }
.wcard__tag b { font-size: 14px; }
.wcard__tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #B8B8BE; }
.wcard__code { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 50%; background: rgba(18, 18, 21, 0.9); color: #F3F3F1; cursor: pointer; opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .35s var(--ease), background-color .2s; }
.wcard__code svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wcard:hover .wcard__code, .wcard:focus-within .wcard__code { opacity: 1; transform: none; }
.wcard__tag:hover, .wcard__code:hover { background: rgba(34, 34, 38, 0.96); }
.wcard__tag:focus-visible, .wcard__code:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: none) { .wcard__code { opacity: 1; transform: none; } }
/* Touch: ≥ 36px hit areas, same look. */
@media (pointer: coarse) {
  .cw-cats button, .cw-search__clear { position: relative; }
  .cw-cats button::after { content: ""; position: absolute; inset: -4px -2px; }
  .cw-search__clear::after { content: ""; position: absolute; inset: -8px; }
}

/* ---------- Drawer ---------- */
html.has-drawer { overflow: hidden; }
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(6, 6, 8, 0.6); opacity: 0; transition: opacity .35s var(--ease); }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 16px; width: min(100%, 720px); padding: 22px 28px 32px; overflow-y: auto; border-left: 1px solid var(--line-strong); background: #111114; box-shadow: -40px 0 80px -30px rgba(0, 0, 0, 0.7); transform: translate3d(104%, 0, 0); transition: transform .42s var(--ease); overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__panel > * { flex-shrink: 0; opacity: 0; transform: translate3d(14px, 0, 0); transition: opacity .3s var(--ease), transform .4s var(--ease); transition-delay: 0s; }
.drawer.is-open .drawer__panel > * { opacity: 1; transform: none; }
.drawer.is-open .drawer__panel > :nth-child(2) { transition-delay: .03s; }
.drawer.is-open .drawer__panel > :nth-child(3) { transition-delay: .06s; }
.drawer.is-open .drawer__panel > :nth-child(4) { transition-delay: .09s; }
.drawer.is-open .drawer__panel > :nth-child(5) { transition-delay: .12s; }
.drawer.is-open .drawer__panel > :nth-child(n+6) { transition-delay: .15s; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; }
.drawer__tag { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; color: var(--ink); }
.drawer__tag i { width: 8px; height: 8px; border-radius: 50%; }
.drawer__close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s, transform .35s var(--ease); }
.drawer__close:hover { color: var(--ink); border-color: var(--line-strong); transform: rotate(90deg); }
.drawer__close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.drawer__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.drawer h2 { margin-top: 2px; font-size: 36px; line-height: 1.04; letter-spacing: -0.035em; font-weight: 600; }
.drawer__sub { max-width: 60ch; margin-top: -6px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.drawer__tabs { align-self: flex-start; flex-wrap: wrap; border-radius: 16px; }
.drawer__view { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(0, 0, 0, 0.25); }
.drawer__frame { display: block; width: 100%; height: 220px; border: 0; opacity: 0; transition: opacity .22s ease; }
.drawer__frame.is-ready { opacity: 1; }

/* Source: HTML / CSS / JS / single file */
.src { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #0B0B0D; }
.src__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 8px; border-bottom: 1px solid var(--line); }
.src__tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.src__tabs::-webkit-scrollbar { display: none; }
.src__tabs button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); font: 500 12.5px/1 "Geist Mono", ui-monospace, monospace; white-space: nowrap; cursor: pointer; transition: color .2s, background-color .2s; }
.src__tabs button:hover:not(:disabled) { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.src__tabs button[aria-selected="true"] { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.src__tabs button:disabled { opacity: .35; cursor: default; }
.src__tabs button:focus-visible, .src__copy:focus-visible, .src__code:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.src__copy { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 30px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font: 500 12.5px/1 "Geist", system-ui, sans-serif; cursor: pointer; transition: color .2s, border-color .2s, background-color .2s; }
.src__copy:hover { color: var(--ink); border-color: var(--line-strong); }
.src__copy:active, .drawer__close:active, .wcard__code:active, .wcard__tag:active { transform: scale(0.95); }
.src__copy.is-copied { color: #A8E6CF; border-color: rgba(168, 230, 207, 0.4); }
.src__copy.is-failed { color: #FF8A80; border-color: rgba(255, 138, 128, 0.4); }
.src__copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.src__code { margin: 0; min-height: 168px; max-height: min(52vh, 460px); overflow: auto; padding: 16px 18px 20px; color: #CFCFD4; font: 12.5px/1.65 "Geist Mono", ui-monospace, monospace; white-space: pre; tab-size: 2; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; overscroll-behavior: contain; }
.src__meta { padding: 9px 16px 10px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px; line-height: 1.45; }
.src__meta:empty { display: none; }
/* Token colors (site chrome, tuned for #0B0B0D) */
.t-c { color: #6B6B74; font-style: italic; }
.t-t { color: #E6B673; }
.t-a { color: #9CC7F5; }
.t-s { color: #A8E6CF; }
.t-n { color: #F0A88E; }
.t-k { color: #C7A5FF; }
.t-v { color: #8FD3D6; }
.t-p { color: #77777F; }

.drawer__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.drawer__link { margin-left: auto; color: var(--muted); font-size: 14px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; transition: color .2s, text-decoration-color .2s; }
.drawer__link:hover { color: var(--ink); text-decoration-color: currentColor; }

@media (max-width: 760px) {
  .cw-hero { padding: 44px 0 28px; text-align: left; }
  .cw-hero__lede { margin-left: 0; }
  .cw-bar { padding: 10px 0; }
  .cw-bar__in { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px; }
  .cw-filter { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 24px; }
  .cw-bar__end { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .cw-search { order: 1; flex: 1 1 0; min-width: 0; }
  .cw-search input { width: 100%; }
  .cw-search kbd { display: none; }
  .cw-bar__end > [data-theme-seg] { order: 2; margin-left: 0; flex: none; }
  .cw-cats { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; padding-right: 24px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
  .cw-cats::-webkit-scrollbar { display: none; }
  .cw.is-unified { padding: 18px 14px 56px; }
  .cw-backdrop { border-radius: 24px; }
  .drawer__panel { padding: 18px 16px 24px; }
  .drawer h2 { font-size: 30px; }
  .src__code { max-height: 60vh; }
  .drawer__link { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wcard__in, .drawer__panel > * { opacity: 1; transform: none; }
  .cw-grid.is-animating .wcard { transition: none; }
}
