/* ───────────────────────────────────────────────────────────
   Torax features — v3 layer on top of v3.css
   Hero stat counters, node browser (search + filter + cards),
   capability chapters, board grid, character-sheet strip.
   ─────────────────────────────────────────────────────────── */

/* ── HERO ─────────────────────────────────────────────────────────── */
.fx-hero .hx-h1{max-width:18ch}
.fx-hero .hx-orb.o1{background:radial-gradient(circle,rgba(127,149,248,.5),transparent 66%)}
.fx-hero .hx-orb.o2{background:radial-gradient(circle,rgba(161,235,26,.5),transparent 66%);right:-12%;top:-16%}
.fx-hero .hx-orb.o3{background:radial-gradient(circle,rgba(218,204,250,.42),transparent 66%)}

.fx-stats{display:grid;grid-template-columns:repeat(2,1fr);gap:1px;margin:clamp(30px,4.5vh,44px) auto 0;
  width:100%;max-width:760px;border-radius:16px;overflow:hidden;background:rgba(255,255,255,.09)}
.fx-stat{display:flex;flex-direction:column;align-items:center;gap:6px;padding:20px 12px;
  background:rgba(10,10,12,.72);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.fx-stat b{font-family:'Bricolage Grotesque',sans-serif;font-weight:700;font-size:clamp(1.8rem,3.4vw,2.6rem);
  line-height:1;letter-spacing:-.03em;color:#fff;font-variant-numeric:tabular-nums}
.fx-stat span{font-size:12.5px;color:var(--t400);text-align:center;line-height:1.4}
.fx-stat:nth-child(1) b{color:var(--peri)}
.fx-stat:nth-child(2) b{color:var(--lime)}
.fx-stat:nth-child(3) b{color:var(--sky)}
.fx-stat:nth-child(4) b{color:var(--lilac)}
.fx-hero .hx-hero-links{margin-top:26px}

/* ── NODE BROWSER: search ─────────────────────────────────────────── */
.fx-search{position:relative;width:100%;max-width:560px;margin:28px auto 0;border-radius:14px;isolation:isolate}
.fx-search::before,.fx-search::after{content:"";position:absolute;inset:-1px;border-radius:15px;pointer-events:none;
  background:conic-gradient(from var(--hx-a),transparent 0deg,transparent 210deg,rgba(120,199,239,.8) 255deg,var(--lime) 295deg,rgba(218,204,250,.75) 325deg,transparent 360deg);
  animation:hx-spin 8s linear infinite;opacity:0;transition:opacity .35s}
.fx-search::after{z-index:-2;filter:blur(16px)}
.fx-search::before{z-index:-1}
.fx-search:focus-within::before{opacity:1}
.fx-search:focus-within::after{opacity:.5}
.fx-search:focus-within::before,.fx-search:focus-within::after{animation-duration:4s}

.fx-search-form{position:relative;display:flex;align-items:center;gap:10px;padding:0 8px 0 14px;border-radius:14px;
  background:rgba(12,12,14,.9);border:1px solid rgba(255,255,255,.12);transition:border-color .25s}
.fx-search:focus-within .fx-search-form{border-color:rgba(255,255,255,.05)}
.fx-search-icon{width:16px;height:16px;flex:none;fill:none;stroke:var(--t400);stroke-width:1.9;stroke-linecap:round;transition:stroke .25s}
.fx-search:focus-within .fx-search-icon{stroke:var(--lime)}
.fx-search-input{flex:1;min-width:0;border:0;outline:0;background:none;padding:14px 0;
  font-family:'Inter',sans-serif;font-size:15px;color:#fff;-webkit-appearance:none;appearance:none}
.fx-search-input::-webkit-search-cancel-button{display:none}
.fx-search-ghost{position:absolute;left:40px;right:44px;pointer-events:none;font-size:15px;color:var(--t400);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:opacity .2s}
.fx-search-ghost b{display:inline-block;width:2px;height:1em;margin-left:2px;vertical-align:-.12em;background:var(--lime);
  animation:hx-caret 1s steps(2) infinite;border-radius:1px}
.fx-search-ghost.off{opacity:0}
.fx-search-clear{flex:none;border:0;background:rgba(255,255,255,.08);color:var(--t300);cursor:pointer;
  width:26px;height:26px;border-radius:50%;font-size:11px;line-height:1;transition:background .2s,color .2s}
.fx-search-clear:hover{background:rgba(255,255,255,.16);color:#fff}

/* ── NODE BROWSER: filters + count ────────────────────────────────── */
#fxFilters{margin-top:18px}
.hx-filter-n{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;margin-left:7px;
  border-radius:999px;background:rgba(255,255,255,.1);color:var(--t400);font-size:11px;font-weight:600;transition:background .2s,color .2s}
.hx-filter.on .hx-filter-n{background:rgba(0,0,0,.12);color:rgba(0,0,0,.65)}
.hx-filter[data-group]:not(.on):hover{border-color:var(--tint,rgba(255,255,255,.3));color:#fff}
.hx-filter.on[data-group]:not([data-group="all"]){background:var(--tint,#fff);border-color:var(--tint,#fff);color:#000}

.fx-count{margin:16px auto 0;text-align:center;font-size:12.5px;color:var(--t500);min-height:1.2em;
  font-family:'JetBrains Mono',monospace;letter-spacing:.01em}
.fx-count em{font-style:normal;color:var(--t300)}

/* ── NODE BROWSER: cards ──────────────────────────────────────────── */
.fx-grid{margin-top:22px}
.fx-card{aspect-ratio:auto;min-height:280px;cursor:default;outline-offset:3px}
.fx-card .hx-card-body{position:relative;padding:0 18px 18px;margin-top:auto}
.fx-card{display:flex;flex-direction:column;justify-content:flex-end}
.fx-card h3{font-size:19px;letter-spacing:-.02em;max-width:none}
.fx-acts{margin:10px 0 0;padding:0;list-style:none;display:flex;flex-wrap:wrap;gap:5px}
.fx-acts li{font-size:11.5px;color:var(--t200);background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.1);
  padding:4px 8px;border-radius:6px;line-height:1.3;backdrop-filter:blur(6px)}
.fx-card:hover .fx-acts li{border-color:rgba(255,255,255,.2)}
.fx-models{margin-top:12px;font-size:12px;line-height:1.6;color:var(--tint);font-weight:600}
.fx-ph{margin-top:8px;font-size:12.5px;line-height:1.55;color:var(--t300);font-style:italic;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.fx-card .hx-card-media video,.fx-card .hx-card-media img{opacity:.5}
.fx-card:hover .hx-card-media video,.fx-card:hover .hx-card-media img{opacity:.62;filter:brightness(.7) saturate(1.05)}
.fx-card.hit{animation:fx-hit .5s var(--ease) both}
@keyframes fx-hit{from{opacity:0;transform:translateY(12px) scale(.98)}}
.fx-card.dim{display:none}

.fx-empty{margin:36px auto 0;text-align:center;font-size:14px;color:var(--t300)}
.fx-empty button{border:0;background:none;color:var(--lime);font-weight:600;cursor:pointer;font-size:14px;
  text-decoration:underline;text-underline-offset:3px;padding:0 2px}
.fx-empty button:hover{color:#fff}

/* ── CHAPTERS ─────────────────────────────────────────────────────── */
/* six chapters in a row need a tighter rhythm than the page default gap */
.gv .gv-split + .gv-split{margin-top:calc(var(--gvgap) * -.42)}
.gv .gv-split:first-of-type{margin-top:calc(var(--gvgap) * -.2)}
.gv-split-vis figcaption{z-index:3}
.fx-chip{display:inline-flex;align-items:center;width:max-content;margin-top:24px;padding:7px 12px;border-radius:8px;
  font-size:12.5px;font-weight:600;color:#000;background:var(--tint,#fff);line-height:1.3}
.gv-split-body .gv-list li::before{background:var(--tint,var(--lime))}

/* ── BOARD GRID ───────────────────────────────────────────────────── */
.fx-board{display:grid;grid-template-columns:1fr;gap:0;margin:40px auto 0;max-width:1120px}
.fx-board-item{padding:24px 0;border-top:1px solid rgba(0,0,0,.14)}
.fx-board-item:first-child{border-top:0;padding-top:0}
.fx-board-glyph{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:9px;
  background:rgba(0,0,0,.06);border:1px solid rgba(0,0,0,.12);font-size:15px;color:#000;margin-bottom:12px}
.fx-board-item h3{font-size:17px;color:#000;letter-spacing:-.015em}
.fx-board-item p{margin-top:8px;font-size:13.5px;line-height:1.6;color:#4a4a46;max-width:44ch}
@media(min-width:760px){
  .fx-board{grid-template-columns:repeat(2,1fr);gap:0 40px}
  .fx-board-item:nth-child(2){border-top:0;padding-top:0}
}
@media(min-width:1000px){
  .fx-board{grid-template-columns:repeat(4,1fr);gap:0 34px}
  .fx-board-item{border-top:1px solid rgba(0,0,0,.14);padding:26px 0 0}
  .fx-board-item:nth-child(n){padding-top:26px}
  .fx-board-item:first-child,.fx-board-item:nth-child(2){border-top:1px solid rgba(0,0,0,.14)}
}

/* ── CHARACTER SHEET STRIP ────────────────────────────────────────── */
.fx-sheet{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:36px auto 0;max-width:1120px}
.fx-sheet-item{position:relative;margin:0;border-radius:14px;overflow:hidden;border:1px solid rgba(255,255,255,.08);
  background:var(--s850);transition:border-color .3s,transform .4s var(--ease)}
.fx-sheet-item img{width:100%;aspect-ratio:3/4;object-fit:cover;display:block;transition:transform .9s var(--ease),filter .4s}
.fx-sheet-item:hover{border-color:rgba(255,255,255,.24);transform:translateY(-3px)}
.fx-sheet-item:hover img{transform:scale(1.05)}
.fx-sheet-item figcaption{position:absolute;left:0;right:0;bottom:0;z-index:2;display:flex;align-items:center;
  justify-content:space-between;gap:8px;padding:30px 12px 12px;
  background:linear-gradient(to top,rgba(0,0,0,.88),transparent)}
.fx-sheet-item figcaption span{font-size:13px;font-weight:600;color:#fff}
.fx-sheet-item figcaption b{font-size:11px;font-weight:600;color:#000;background:var(--lime);padding:4px 8px;border-radius:6px;
  opacity:0;transform:translateY(6px);transition:opacity .3s,transform .35s var(--ease)}
.fx-sheet-item:hover figcaption b{opacity:1;transform:none}
@media(min-width:760px){.fx-sheet{grid-template-columns:repeat(4,1fr)}}

/* ── RESPONSIVE ───────────────────────────────────────────────────── */
@media(min-width:680px){.fx-stats{grid-template-columns:repeat(4,1fr)}}
@media(max-width:720px){
  .fx-stat{padding:16px 8px}
  .fx-stat span{font-size:11.5px}
  .fx-search{max-width:none}
  .fx-search-input{font-size:14px;padding:12px 0}
  .fx-search-ghost{font-size:14px;left:38px}
  .fx-card{min-height:240px}
  .fx-card h3{font-size:17px}
  .fx-hero .hx-hero-links{flex-direction:column;align-items:stretch;width:100%}
  /* main.css sizes these buttons to max-content; override so they fill the column */
  .fx-hero .hx-hero-links a{width:100%;justify-content:center}
}
@media(hover:none){
  .fx-sheet-item figcaption b{opacity:1;transform:none}
}
@media(prefers-reduced-motion:reduce){
  .fx-search::before,.fx-search::after{animation:none}
  .fx-card.hit{animation:none}
  .fx-sheet-item:hover{transform:none}
}
