/* 記憶 — Recall Bench. J brand: cyberpunk restraint, màu = lãnh thổ, one accent. */
:root {
  --bg: #0a0e16;
  --bg-soft: #0d1320;
  --card: #11161f;
  --card-hi: #151c28;
  --border: #1f2a3a;
  --border-hi: #2b3a50;
  --fg: #e6edf3;
  --muted: #8b97a7;
  --faint: #5a6677;
  --accent: #2bd4c4; /* teal — the single system voice */
  --cta: #ff5c8a;    /* pink — used exactly once, the footer */

  --t-domain: #2bd4c4;
  --t-commerce: #f2b544;
  --t-product: #7c5cff;
  --t-business: #5bd66a;
  --t-game: #ff5c8a;
  --t-system: #8b97a7;

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --han: "Noto Serif SC", "Songti SC", "SimSun", "Microsoft YaHei", serif;

  --r: 10px;
  --gap: clamp(12px, 1.6vw, 22px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(900px 500px at 50% -10%, #101a2c 0%, transparent 60%),
    var(--bg);
  color: var(--fg);
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: clamp(20px, 4vw, 56px) clamp(16px, 4vw, 64px) 64px;
}

.wrap { max-width: 1180px; margin: 0 auto; }

/* ---- header ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  color: var(--faint); text-transform: uppercase;
}
.topbar .sigil { font-family: var(--han); font-size: 22px; color: var(--accent); letter-spacing: 0; }
.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.28em;
  color: var(--accent); text-transform: uppercase; margin: 30px 0 12px;
}
h1 {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(34px, 6vw, 68px); line-height: 1.02; letter-spacing: -0.02em;
}
.dek { color: var(--muted); max-width: 56ch; margin-top: 14px; font-size: clamp(14px, 1.5vw, 17px); }

/* ---- query chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 8px; }
.chip {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 15px; cursor: pointer; transition: border-color .18s, color .18s, background .18s;
  white-space: nowrap;
}
.chip:hover { color: var(--fg); border-color: var(--border-hi); }
.chip[aria-pressed="true"] {
  color: var(--bg); background: var(--accent); border-color: var(--accent); font-weight: 600;
}
.teach {
  color: var(--faint); font-size: 13px; min-height: 1.4em; margin: 4px 2px 0;
  font-style: italic; transition: opacity .2s;
}

/* ---- bench: 3 lanes, fused is the focal grid-break ---- */
.bench {
  display: grid; gap: var(--gap); margin-top: 22px;
  grid-template-columns: 1fr 1.18fr 1fr;
  align-items: start;
}
.lane {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px 14px 16px; position: relative; overflow: hidden;
}
.lane.fused {
  background: linear-gradient(180deg, #121a2a, var(--card));
  border-color: var(--border-hi);
  box-shadow: 0 0 0 1px rgba(43,212,196,.10), 0 18px 40px -28px rgba(43,212,196,.5);
}
.lane-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.lane-name { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.lane.fused .lane-name { color: var(--accent); }
.lane-han { font-family: var(--han); font-size: 26px; color: var(--faint); opacity: .5; line-height: 1; }
.lane.fused .lane-han { color: var(--accent); opacity: .65; }

.cards { display: flex; flex-direction: column; gap: 8px; position: relative; }

.mcard {
  position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--terr, var(--muted));
  border-radius: 8px; padding: 9px 11px 11px; will-change: transform;
}
.lane.fused .mcard { background: var(--card-hi); }
.mcard .rank { font-family: var(--mono); font-size: 12px; color: var(--faint); padding-top: 1px; }
.lane.fused .mcard:nth-child(-n+3) .rank { color: var(--terr); font-weight: 600; }
.mcard .body { min-width: 0; }
.mcard .han {
  position: absolute; right: 8px; top: 6px; font-family: var(--han);
  font-size: 19px; color: var(--terr); opacity: .22; pointer-events: none;
}
.mcard .txt { font-size: 12.7px; color: var(--fg); line-height: 1.35; padding-right: 18px; }
.lane:not(.fused) .mcard .txt { color: #c4cdd9; }

.bar { margin-top: 7px; height: 4px; background: #0b1019; border-radius: 3px; overflow: hidden; }
.bar > span {
  display: block; height: 100%; width: 0; border-radius: 3px;
  background: var(--terr, var(--accent)); transition: width .5s cubic-bezier(.2,.7,.2,1);
}
.mcard .score { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-top: 5px; }

/* top fused card subtle glow */
.lane.fused .mcard:first-child { box-shadow: 0 0 0 1px var(--terr), 0 0 22px -10px var(--terr); }

/* moved-this-update flash */
.mcard.moved { animation: flash .6s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 1px var(--terr), 0 0 26px -6px var(--terr); } 100% {} }

/* ---- dial ---- */
.dial {
  margin-top: 26px; display: grid; grid-template-columns: 1fr auto; gap: 22px 28px;
  align-items: center; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 20px;
}
.slider-wrap { display: flex; flex-direction: column; gap: 9px; }
.slider-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.slider-row { display: flex; align-items: center; gap: 14px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 4px; border-radius: 3px;
  background: linear-gradient(90deg, var(--t-system), var(--accent)); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--fg); border: 3px solid var(--accent); cursor: pointer; box-shadow: 0 0 10px -2px var(--accent);
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--fg); border: 3px solid var(--accent); cursor: pointer; }
.alpha-val { font-family: var(--mono); font-size: 13px; color: var(--accent); min-width: 64px; }
.dial.rrf-on .slider-wrap { opacity: .4; pointer-events: none; }

.toggle { display: flex; align-items: center; gap: 12px; user-select: none; }
.toggle .lbl { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.switch { position: relative; width: 50px; height: 26px; border-radius: 999px; background: var(--card); border: 1px solid var(--border-hi); cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch[aria-pressed="true"] { background: rgba(43,212,196,.18); border-color: var(--accent); }
.switch[aria-pressed="true"]::after { transform: translateX(24px); background: var(--accent); }
.dial-caption { grid-column: 1 / -1; color: var(--faint); font-size: 12.5px; font-family: var(--mono); border-top: 1px solid var(--border); padding-top: 12px; }

/* ---- footer / CTA ---- */
.note { margin-top: 30px; color: var(--muted); font-size: 13.5px; max-width: 70ch; }
.note b { color: var(--fg); font-weight: 600; }
.cta {
  margin-top: 30px; border-top: 1px solid var(--border); padding-top: 26px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; justify-content: space-between;
}
.cta .pitch { max-width: 52ch; color: var(--muted); font-size: 14px; }
.cta .pitch b { color: var(--fg); }
.cta a {
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em; text-decoration: none;
  color: var(--bg); background: var(--cta); padding: 12px 20px; border-radius: 8px; font-weight: 600;
  white-space: nowrap; transition: transform .15s, box-shadow .15s;
}
.cta a:hover { transform: translateY(-1px); box-shadow: 0 10px 26px -12px var(--cta); }
.sign { margin-top: 22px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--faint); text-transform: uppercase; }

@media (max-width: 880px) {
  .bench { grid-template-columns: 1fr; }
  .lane.fused { order: -1; } /* fused first on mobile */
  .dial { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .bar > span { transition: none; }
  .mcard { transition: none !important; }
  html { scroll-behavior: auto; }
}
