/* Sophicly Explore (WD-1014). Tokens live on the component root, never :root (root CLAUDE.md, takeover landmine 3).
   Light theme = the reference's own colours; dark theme = darker shades of the same, never a veil (BRAND ruling 2026-09-09). */
.sx-explore {
  --sx-bg: #ffffff; --sx-ink: #3d3d42; --sx-soft: #636366;
  --sx-tile: #f8f8f8; --sx-globe: #ffffff;
  --sx-board-bg: #3d3d42; --sx-board-ink: #ffffff;
  --sx-card: rgba(255,255,255,.92); --sx-line: #e4e4ea; --sx-go-bg: #3d3d42; --sx-go-ink: #ffffff;
  --sx-font: "Proxima Soft Complete", "Proxima Soft", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--sx-ink); font-family: var(--sx-font);
}
html.dark .sx-explore, html[data-theme="dark"] .sx-explore {
  --sx-bg: #17171a; --sx-ink: #ececf0; --sx-soft: #b4b4bc;
  --sx-tile: #2b2c2f; --sx-globe: #1d1d20;
  --sx-board-bg: #ececf0; --sx-board-ink: #17171a;
  --sx-card: rgba(33,33,37,.92); --sx-line: #323238; --sx-go-bg: #ececf0; --sx-go-ink: #17171a;
}
html.sx-lock, html.sx-lock body.sx-page { overflow: hidden; overscroll-behavior: none; }

.sx-explore.sx-js .sx-surface { position: fixed; inset: 0; z-index: 1; background: var(--sx-bg); touch-action: none; user-select: none; -webkit-user-select: none; }
.sx-surface canvas { display: block; }

.sx-title, .sx-loading, .sx-hint { display: none; }
.sx-explore.sx-webgl .sx-title {
  display: block; position: fixed; inset: 0; z-index: 3; margin: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(18px, 2vw, 24px); font-weight: 700; letter-spacing: -.01em; line-height: 1; text-align: center;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  transition: opacity .3s ease;
}
.sx-explore.sx-is-open .sx-title { opacity: 0; }
.sx-explore.sx-webgl:not(.sx-ready) .sx-loading {
  display: block; position: fixed; left: 50%; top: calc(50% + 28px); transform: translateX(-50%); z-index: 3; margin: 0;
  font-size: 13px; color: var(--sx-soft); font-variant-numeric: tabular-nums;
}
.sx-explore.sx-webgl .sx-hint {
  display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; margin: 0; pointer-events: none; text-align: center;
  padding: 72px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(to top, var(--sx-bg), transparent); font-size: 13px; color: var(--sx-soft);
  transition: opacity .3s ease;
}
.sx-explore.sx-is-open .sx-hint { opacity: 0; }

/* the open view: one line + a link to that tile's own page.
   The material is the site's toast glass, copied from sophicly-toasts.css (shadow on the card, frost + blur one
   layer down because clip-path clips a box-shadow; grain at .18/.10). Neil 22 Oct: no stroke; the button not fat.
   It sits ABOVE the site's floating bottom nav: that bar's inner strip (395..1045 × 818..900 at 1440×900) takes
   pointer events even while hidden, and swallowed this button's click (measured, elementFromPoint). */
.sx-explore {
  --st-text: #f4f4f7; --st-muted: rgba(244,244,247,.70);
  --st-frost: rgba(22,24,28,.62); --st-bright: 1.22; --st-blur: 30px; --st-sat: 165%; --st-radius: 12px; --st-grain: .18;
  --st-shadow: rgba(50,50,93,.25) 0px 50px 100px -20px, rgba(0,0,0,.30) 0px 30px 60px -30px, rgba(0,0,0,.28) 0px 2px 10px -3px;
}
html[data-theme="light"] .sx-explore, html.light .sx-explore {
  --st-text: #14161b; --st-muted: rgba(20,22,27,.74);
  --st-frost: rgba(252,252,255,.66); --st-bright: 1.08; --st-grain: .10;
  --st-shadow: rgba(50,50,93,.25) 0px 50px 100px -20px, rgba(44,0,62,.20) 0px 18px 40px -16px, rgba(44,0,62,.22) 0px 2px 10px -3px;
}
.sx-open {
  position: fixed; z-index: 13; left: 50%; transform: translateX(-50%);
  bottom: calc(112px + env(safe-area-inset-bottom, 0px)); width: min(440px, calc(100vw - 32px));
  box-sizing: border-box; display: grid; gap: 4px; padding: 16px 44px 16px 16px;
  border: 0; border-radius: var(--st-radius); box-shadow: var(--st-shadow); color: var(--st-text);
}
.sx-open > :not(.sx-open__glass) { position: relative; z-index: 1; }
.sx-open__glass {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--st-frost); border-radius: var(--st-radius); clip-path: inset(0 round var(--st-radius));
  -webkit-backdrop-filter: blur(var(--st-blur)) saturate(var(--st-sat)) brightness(var(--st-bright));
  backdrop-filter: blur(var(--st-blur)) saturate(var(--st-sat)) brightness(var(--st-bright));
}
.sx-open__glass::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--st-grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sx-explore { --st-frost: rgba(30,32,35,.96); }
  html[data-theme="light"] .sx-explore, html.light .sx-explore { --st-frost: rgba(250,250,252,.97); }
}
.sx-open[hidden] { display: none; }
.sx-open p { margin: 0; }
.sx-open__kind { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--st-muted); }
.sx-open__title { font-weight: 700; font-size: 17px; line-height: 1.25; }
.sx-open__line { font-size: 14px; line-height: 1.45; color: var(--st-muted); }
/* The Incredibles button (Neil, 22 Oct). REUSED, not ported: the site-wide Etch stylesheet
   `.sidebar-card__cta.is-btn-main` (the course CTA's 22-block set, printed on every page) draws it, and the
   colours below are the course archive's own card button (catalog SC-TAXONOMY, WD-889) copied as they are.
   ONE stated change: size. That stylesheet is a full-width 52px / 20px course button; here it is 40px / 14px
   and as wide as its label (Neil, 22 Oct: the old button "looks quite fat"). */
.sx-open .sx-open__go.sidebar-card__cta.is-btn-main {
  justify-self: start; margin-top: 10px; width: auto !important; height: 40px !important; font-size: 14px !important;
}
.sx-open .sx-open__go.is-btn-main .btn-main__inner { box-sizing: border-box; padding: 0 18px; }
.sx-open .sx-open__go.is-btn-main .btn-main__text { color: #fff !important; }
.sx-open .sx-open__go.is-btn-main .btn-main__hover { background: #fff !important; }
.sx-open .sx-open__go.is-btn-main .btn-main__hover .btn-main__text { color: var(--epic-plate, #2a2c2f) !important; }
html[data-theme="dark"] .sx-open .sx-open__go.is-btn-main .btn-main__outer::before, html.dark .sx-open .sx-open__go.is-btn-main .btn-main__outer::before { background: #ECF3FF !important; }
html[data-theme="dark"] .sx-open .sx-open__go.is-btn-main .btn-main__text, html.dark .sx-open .sx-open__go.is-btn-main .btn-main__text { color: #4D76FD !important; }
html[data-theme="dark"] .sx-open .sx-open__go.is-btn-main .btn-main__hover, html.dark .sx-open .sx-open__go.is-btn-main .btn-main__hover { background: #4D76FD !important; }
html[data-theme="dark"] .sx-open .sx-open__go.is-btn-main .btn-main__hover .btn-main__text, html.dark .sx-open .sx-open__go.is-btn-main .btn-main__hover .btn-main__text { color: #ECF3FF !important; }
.sx-open__close {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; color: var(--st-muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.sx-open__close:hover { color: var(--st-text); }
.sx-open__close:focus-visible, .sx-list a:focus-visible { outline: 3px solid #4D76FD; outline-offset: 2px; }

/* the plain list: the whole page when there is no WebGL or no JavaScript; otherwise for keyboards and screen readers */
.sx-list ul { list-style: none; margin: 0; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.sx-list a { display: grid; gap: 8px; color: inherit; text-decoration: none; }
.sx-list img, .sx-list__text { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--sx-tile); }
.sx-list__text { display: grid; place-items: center; font-weight: 700; font-size: 22px; background: var(--sx-board-bg); color: var(--sx-board-ink); }
.sx-list__title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.sx-explore.sx-js:not(.sx-no-webgl) .sx-list {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.sx-explore.sx-js:not(.sx-no-webgl) .sx-list:focus-within {
  position: fixed; z-index: 5; inset: auto 0 0 0; width: auto; height: auto; max-height: 50vh; overflow: auto; clip: auto; clip-path: none;
  background: var(--sx-bg); white-space: normal;
}
.sx-explore.sx-no-webgl .sx-surface { display: none; }
html.sx-lock:has(.sx-no-webgl), html.sx-lock:has(.sx-no-webgl) body.sx-page { overflow: auto; }
.sx-explore:not(.sx-js) .sx-title, .sx-explore.sx-no-webgl .sx-title {
  display: block; margin: 0; padding: 96px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  font-size: clamp(26px, 4vw, 40px); font-weight: 700; line-height: 1.1;
}
@media (prefers-reduced-motion: reduce) { .sx-title, .sx-hint { transition: none; } }
