/* John's World: a globe of cards, one per fact, grouped by business. */
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-grotesque-variable.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Albert"; src: url("fonts/albert-sans-normal-300-700.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Martian"; src: url("fonts/martian-mono-normal-300-600.woff2") format("woff2"); font-weight: 300 600; font-display: swap; }

:root {
  --bg: #101314; --ink: #eef2ef; --ink-2: #a9b3ae; --line: rgba(255, 255, 255, .12);
  --card: #181d1e; --lf: #2fb56a; --th: #f2a516; --fm: #e5483b; --me: #b48cff;
  --f-display: "Bricolage", system-ui, sans-serif; --f-body: "Albert", system-ui, sans-serif; --f-mono: "Martian", ui-monospace, monospace;
  --pad: clamp(16px, 3vw, 36px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--f-body); }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
.w-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- the stage ---------- */
/* the WebGL canvas draws the globe; --glow (set by the script) is the colour of the business facing you */
.w-stage { position: relative; height: 100svh; min-height: 560px; overflow: hidden;
  background: radial-gradient(circle at var(--gx, 55%) 52%, color-mix(in srgb, var(--glow, #2fb56a) 16%, transparent), transparent 46%), var(--bg); }
.w-globe { position: absolute; inset: 0; cursor: grab; touch-action: pan-y; outline: none; }
.w-globe.is-drag { cursor: grabbing !important; }
.w-globe:focus-visible { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .4); }
.w-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .6s; }
.w-stage.is-on .w-gl { opacity: 1; }
.w-keys:focus-within { /* keyboard users: the focused card is lit on the globe itself */ }
.w-nogl .w-globe { display: none; }

/* ---------- words and tools ---------- */
.w-intro { position: absolute; left: var(--pad); bottom: var(--pad); z-index: 3; max-width: 30rem; pointer-events: none; text-shadow: 0 0 16px var(--bg), 0 0 6px var(--bg); }
.w-intro h1 { margin: 0 0 .6rem; font: 700 clamp(1.8rem, 3.4vw, 2.9rem)/1.04 var(--f-display); max-width: 14ch; }
.w-intro p { margin: 0; color: var(--ink-2); max-width: 36ch; }

.w-tools { position: absolute; top: var(--pad); left: var(--pad); right: var(--pad); z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; pointer-events: none; }
.w-tools > * { pointer-events: auto; }
.w-groups { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 22px; background: rgba(16, 19, 20, .78); backdrop-filter: blur(8px); }
.w-groups button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); cursor: pointer; font-size: .9rem; }
.w-groups button i { width: 9px; height: 9px; border-radius: 50%; background: var(--g, #fff); }
.w-groups button[aria-pressed="true"] { background: rgba(255, 255, 255, .12); color: #fff; }
.w-groups button:hover { color: #fff; }
.w-search input { width: 15rem; max-width: 60vw; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(16, 19, 20, .78); backdrop-filter: blur(8px); }
.w-search input:focus { outline: 2px solid var(--lf); outline-offset: 1px; }
.w-listbtn { margin-left: auto; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: rgba(16, 19, 20, .78); cursor: pointer; font-size: .9rem; }
.w-listbtn:hover { border-color: rgba(255, 255, 255, .4); }
button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- the detail panel ---------- */
.w-panel { position: absolute; z-index: 5; top: 50%; right: var(--pad); width: min(400px, 36vw); max-height: calc(100% - 8rem); overflow: auto; transform: translateY(-50%);
  padding: 26px 26px 22px; border-radius: 18px; background: rgba(22, 27, 28, .94); border: 1px solid var(--line); border-top: 5px solid var(--g, var(--lf));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5); backdrop-filter: blur(10px); animation: w-in .35s cubic-bezier(.2, .7, .2, 1); }
@keyframes w-in { from { opacity: 0; transform: translate(20px, -50%); } }
.w-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .07); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.w-pgroup { margin: 0 0 6px; font: 500 .74rem var(--f-mono); color: var(--g); }
.w-ptitle { margin: 0 2rem 8px 0; font: 700 1.75rem/1.1 var(--f-display); }
.w-pstat { margin: 0 0 12px; font: 600 1.05rem var(--f-body); color: #fff; }
.w-pstat:empty { display: none; }
.w-pbody p { margin: 0 0 .8em; color: #cfd6d2; }
.w-plink { display: inline-block; margin: 6px 0 16px; padding: 10px 18px; border-radius: 999px; background: var(--g); color: #101314; font-weight: 600; text-decoration: none; }
.w-plink:hover { filter: brightness(1.1); }
.w-plink:empty { display: none; }
.w-pnav { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.w-pnav button { padding: 7px 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .07); cursor: pointer; font-size: .9rem; }
.w-pnav button:hover { background: rgba(255, 255, 255, .14); }
.w-stage.has-panel .w-intro { opacity: 0; transition: opacity .3s; }

/* ---------- list view ---------- */
.w-list { padding: 40px var(--pad) 20px; max-width: 1100px; margin: 0 auto; }
.w-list h2 { font: 700 1.6rem var(--f-display); margin: 1.6em 0 .6em; display: flex; align-items: center; gap: 10px; }
.w-list h2 i { width: 12px; height: 12px; border-radius: 50%; background: var(--g); }
.w-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.w-list li { padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--g); }
.w-list li b { display: block; font: 650 1.05rem var(--f-display); }
.w-list li span { color: var(--ink-2); font-size: .95rem; }
.w-list li a { display: inline-block; margin-top: 6px; font-size: .9rem; color: var(--g); }

.w-foot { padding: 26px var(--pad) 36px; color: var(--ink-2); font-size: .9rem; border-top: 1px solid var(--line); }
.w-foot p { margin: 0; }
.w-noscript { padding: 40px var(--pad); }

@media (max-width: 800px) {
  .w-stage { height: 100svh; }
  .w-tools { gap: 8px; }
  .w-groups { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .w-groups::-webkit-scrollbar { display: none; }
  .w-groups button { white-space: nowrap; font-size: .85rem; padding: 6px 10px; }
  .w-search { flex: 1; }
  .w-search input { width: 100%; max-width: none; }
  .w-listbtn { margin-left: 0; }
  .w-intro h1 { font-size: 1.6rem; }
  .w-intro p { font-size: .95rem; }
  .w-panel { top: auto; bottom: 10px; left: 10px; right: 10px; width: auto; max-height: 62svh; transform: none; animation-name: w-up; }
  @keyframes w-up { from { opacity: 0; transform: translateY(30px); } }
}
@media (prefers-reduced-motion: reduce) {
  .w-gl, .w-panel { transition: none; animation: none; }
}

/* share image capture */
.shot .w-tools { display: none; }
.shot .w-intro h1 { font-size: 3.1rem; }
