/* ==========================================================================
   /features/context-manager — record deck, source orbit, synthesis, memory, suggestion, gaps
   (section scaffolding — .pv-head, .pv-rise, .pv-section — from prompt-volumes.css)
   ========================================================================== */
.cx { --expo: cubic-bezier(.19, 1, .22, 1); --cell-line: rgba(255,255,255,.1); --ok: #08ffb6; --vio: #a78bfa; }

/* ---------- Hero ---------- */
.cx-hero { position: relative; padding: 104px 0 0; overflow: hidden; background: radial-gradient(70% 60% at 20% 0%, #15151a 0%, #000 70%); }
.cx-hero h1 { font-size: clamp(36px, 4.8vw, 52px); font-weight: 500; line-height: 1.1; letter-spacing: -0.045em; max-width: 560px; }
.cx-hero p { max-width: 440px; margin-top: 22px; font-size: 16px; color: var(--fg-2); }
.cx-hero .hero-cta { justify-content: flex-start; }

/* Record deck */
.cx-deck { position: relative; height: 380px; margin-top: 70px; user-select: none; -webkit-mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.cx-rec { position: absolute; left: 50%; top: 40px; width: 250px; height: 220px; margin-left: -125px; padding: 20px; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid rgba(255,255,255,.14); background: linear-gradient(180deg, rgba(48,48,52,.75), rgba(22,22,24,.9)); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 30px 60px rgba(0,0,0,.6); color: var(--fg-2); font-size: 14px; line-height: 1.45; cursor: pointer; transition: transform 1.1s var(--expo), opacity 1.1s var(--expo), filter 1.1s var(--expo), border-color .5s; will-change: transform; }
.cx-rec p { flex: 1; overflow: hidden; -webkit-mask: linear-gradient(180deg, #000 55%, transparent); mask: linear-gradient(180deg, #000 55%, transparent); }
.cx-rec footer { display: flex; align-items: center; gap: 9px; color: var(--fg); font-size: 14px; }
.cx-rec footer i { width: 16px; height: 16px; border-radius: 50%; border: 2px dotted var(--c); transition: transform 1.2s var(--expo); }
.cx-rec small { display: block; margin-top: 8px; color: var(--fg-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cx-rec.mid { border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.cx-rec.mid footer i { transform: rotate(180deg) scale(1.15); }

/* ---------- Logos ---------- */
.cx-logos { padding: 80px 0 96px; text-align: center; }
.cx-logos h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 34px; }
.cx-logos-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--cell-line); }
.cx-logos-grid span { display: grid; place-items: center; height: 110px; border-right: 1px solid var(--cell-line); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; transition: background .4s; }
.cx-logos-grid span:last-child { border-right: 0; }
.cx-logos-grid span:hover { background: #0c0c0d; }

/* ---------- Feature rows ---------- */
.cx-rows { border: 1px solid var(--cell-line); }
.cx-row { display: grid; grid-template-columns: 290px 1fr; border-bottom: 1px solid var(--cell-line); }
.cx-row:last-child { border-bottom: 0; }
.cx-copy { padding: 30px 26px; border-right: 1px dashed var(--cell-line); }
.cx-copy h2 { font-size: 18px; font-weight: 500; line-height: 1.3; letter-spacing: -0.02em; max-width: 230px; }
.cx-copy p { margin: 12px 0 18px; color: var(--fg-2); font-size: 14.5px; max-width: 240px; }
.cx-g { position: relative; min-height: 460px; overflow: hidden; display: grid; place-items: center; }
.cx-stage { position: relative; width: 560px; height: 420px; flex: none; }

/* 1 — source orbit */
.cx-orbit svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cx-ring { fill: none; stroke: rgba(255,255,255,.05); }
.cx-beam { stroke: var(--bc, #fff); stroke-width: 1.5; stroke-dasharray: 4 6; opacity: 0; transition: opacity .3s; animation: cxDash .6s linear infinite; }
.cx-beam.on { opacity: 1; }
@keyframes cxDash { to { stroke-dashoffset: -10; } }
.cx-sat { position: absolute; left: 0; top: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #1d1d1f; will-change: transform; }
.cx-sat.app { width: 42px; height: 42px; margin: -21px 0 0 -21px; background: #19191b; border: 1px solid rgba(255,255,255,.1); color: var(--c); display: grid; place-items: center; cursor: pointer; transition: border-color .4s, box-shadow .5s, background .4s; }
.cx-sat.app svg { width: 19px; height: 19px; }
.cx-sat.app.on { border-color: var(--c); background: #222224; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 18%, transparent), 0 0 30px color-mix(in srgb, var(--c) 35%, transparent); }
.cx-hub { position: absolute; left: 50%; top: 50%; width: 66px; height: 66px; margin: -33px 0 0 -33px; border-radius: 16px; background: #2a2a2c; border: 1px solid rgba(255,255,255,.18); display: grid; place-items: center; transition: transform .5s var(--expo), box-shadow .5s; }
.cx-hub svg { width: 30px; height: 30px; }
.cx-hub.beat { transform: scale(1.12); box-shadow: 0 0 40px rgba(255,255,255,.25); }
.cx-tip { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #111112; font-size: 12.5px; color: var(--fg-2); white-space: nowrap; }
.cx-tip b { color: var(--fg); font-weight: 500; }
.cx-tip em { font-style: normal; color: var(--ok); font-variant-numeric: tabular-nums; }

/* 2 — synthesis */
.cx-synth { display: grid; grid-template-columns: 1fr 70px 1fr; align-items: center; gap: 0; width: min(640px, 92%); }
.cx-feed { display: grid; gap: 10px; }
.cx-snip { padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: #101011; font-size: 12.5px; color: var(--fg-3); line-height: 1.4; cursor: pointer; opacity: .45; transition: opacity .6s, border-color .5s, transform .7s var(--expo), color .5s, background .5s; }
.cx-snip small { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; color: var(--c); font-size: 11px; }
.cx-snip small::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.cx-snip.on { opacity: 1; color: var(--fg); border-color: var(--c); background: #17171a; transform: translateX(10px); }
.cx-pipe { position: relative; height: 2px; background: #222224; }
.cx-pipe::before { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 9px; background: #1b1b1d; border: 1px solid rgba(255,255,255,.14); transform: rotate(45deg); }
.cx-pipe i { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #fff); opacity: 0; box-shadow: 0 0 12px var(--c, #fff); }
.cx-pipe.go i { animation: cxTravel .9s var(--expo) forwards; }
@keyframes cxTravel { 0% { left: 0; opacity: 1; } 100% { left: calc(100% - 8px); opacity: 1; } }
.cx-record { padding: 18px; border-radius: 16px; border: 1px solid rgba(255,255,255,.14); background: linear-gradient(180deg, #1c1c1f, #121214); box-shadow: 0 30px 60px rgba(0,0,0,.5); transition: border-color .5s; }
.cx-record header { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; }
.cx-record header i { width: 15px; height: 15px; border-radius: 50%; border: 2px dotted var(--c); }
.cx-record header span { margin-left: auto; color: var(--fg-3); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.cx-facts { margin-top: 14px; display: grid; gap: 7px; min-height: 196px; align-content: start; }
.cx-fact { padding: 9px 11px; border-radius: 9px; background: #0f0f10; border: 1px solid var(--line-soft); font-size: 12.5px; color: var(--fg-2); line-height: 1.35; }
.cx-fact.new { animation: cxFact 1.6s var(--expo); }
@keyframes cxFact { 0% { opacity: 0; transform: translateY(-14px); border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, #0f0f10); color: #fff; } 60% { border-color: var(--c); } }

/* 3 — personal record */
.cx-person { width: min(400px, 92%); border-radius: 18px; border: 1px solid rgba(255,255,255,.12); background: #121213; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.cx-person header { padding: 20px 0 14px; text-align: center; font-size: 13px; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1.3px); background-size: 9px 9px; background-position: center; -webkit-mask: radial-gradient(60% 90% at 50% 40%, #000 30%, transparent 90%); mask: radial-gradient(60% 90% at 50% 40%, #000 30%, transparent 90%); }
.cx-person header i { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 50%; background: linear-gradient(135deg, #7c6cf0, #2f6bff); font-style: normal; font-weight: 600; color: #fff; }
.cx-mem { padding: 12px 18px; border-top: 1px solid var(--line-soft); cursor: pointer; transition: background .4s; }
.cx-mem b { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.cx-mem b em { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 5px; background: rgba(8,255,182,.14); color: var(--ok); opacity: 0; transform: translateX(-6px); transition: opacity .4s, transform .5s var(--expo); }
.cx-mem span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--fg-3); min-height: 18px; transition: color .5s; }
.cx-mem.on { background: #19191b; }
.cx-mem.on b em { opacity: 1; transform: none; }
.cx-mem.on span { color: var(--fg); }
.cx-said { position: absolute; left: 4%; top: 12%; max-width: 210px; padding: 10px 13px; border-radius: 14px 14px 14px 3px; background: #232325; font-size: 12.5px; line-height: 1.4; opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .5s, transform .7s var(--expo); z-index: 2; }
.cx-said.show { opacity: 1; transform: none; }
.cx-said small { display: block; margin-bottom: 3px; color: var(--fg-3); font-size: 11px; }

/* 4 — suggestion */
.cx-sug { width: min(520px, 92%); padding: 22px; border-radius: 18px; border: 1px solid rgba(255,255,255,.14); background: linear-gradient(180deg, #1a1a1c, #101011); box-shadow: 0 30px 70px rgba(0,0,0,.6); }
.cx-sug > small { color: var(--fg-3); font-size: 13px; }
.cx-sug h3 { margin: 12px 0 14px; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; min-height: 26px; }
.cx-srcs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 13px; color: var(--fg-3); }
.cx-srcs span { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-3); cursor: pointer; transition: color .4s, border-color .4s, background .4s, transform .5s var(--expo); }
.cx-srcs span.on { color: var(--fg); border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); transform: translateY(-2px); }
.cx-body { margin-top: 16px; font-size: 14px; line-height: 1.6; min-height: 112px; }
.cx-body .w { opacity: .12; filter: blur(4px); transition: opacity .5s var(--expo), filter .5s var(--expo), color .3s, background .3s; border-radius: 3px; }
.cx-body .w.in { opacity: 1; filter: none; color: var(--fg-2); }
.cx-body .w.in.hl { color: #fff; background: color-mix(in srgb, var(--c) 22%, transparent); }
.cx-acts { display: flex; gap: 8px; margin-top: 16px; }
.cx-acts button { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; color: var(--fg-2); transition: background .3s, color .3s, border-color .3s; }
.cx-acts button:hover { border-color: #555; color: var(--fg); }
.cx-acts button.go { background: var(--fg); color: #000; border-color: var(--fg); font-weight: 500; }
.cx-acts button.done { background: rgba(8,255,182,.12); border-color: rgba(8,255,182,.5); color: var(--ok); }

/* 5 — gap */
.cx-gap { width: min(500px, 92%); padding: 22px; border-radius: 18px; border: 1px solid rgba(255,255,255,.14); background: linear-gradient(180deg, #1a1a1c, #101011); box-shadow: 0 30px 70px rgba(0,0,0,.6); transition: border-color .6s, box-shadow .6s; }
.cx-gap.closed { border-color: rgba(8,255,182,.5); box-shadow: 0 0 60px rgba(8,255,182,.12), 0 30px 70px rgba(0,0,0,.6); }
.cx-gap > small { display: flex; align-items: center; gap: 8px; color: #6ea8ff; font-size: 13px; transition: color .5s; }
.cx-gap > small i { width: 14px; height: 14px; border-radius: 50%; border: 2px dotted currentColor; }
.cx-gap.closed > small { color: var(--ok); }
.cx-gap h3 { margin: 12px 0 8px; font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.cx-gap > p { color: var(--fg-2); font-size: 14px; }
.cx-gap-bar { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 12.5px; color: var(--fg-3); }
.cx-gap-bar button { padding: 7px 13px; border-radius: 8px; background: var(--fg); color: #000; font-weight: 500; font-size: 12.5px; transition: transform .4s var(--expo), background .3s; }
.cx-gap-bar button:hover { transform: scale(1.05); }
.cx-gap-bar .meter { flex: 1; height: 3px; border-radius: 2px; background: #232325; overflow: hidden; }
.cx-gap-bar .meter i { display: block; height: 100%; width: var(--p, 0%); background: var(--ok); transition: width .8s var(--expo); }
.cx-qs { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .8s var(--expo); }
.cx-gap.open .cx-qs { grid-template-rows: 1fr; }
.cx-qs > div { overflow: hidden; }
.cx-q { margin-top: 10px; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line); background: #0e0e0f; font-size: 13px; opacity: .35; transition: opacity .5s, border-color .5s; }
.cx-q.act, .cx-q.ok { opacity: 1; }
.cx-q.act { border-color: #6ea8ff; }
.cx-q.ok { border-color: rgba(8,255,182,.4); }
.cx-q b { display: flex; justify-content: space-between; gap: 10px; font-weight: 500; }
.cx-q b em { font-style: normal; font-size: 11px; color: var(--fg-3); white-space: nowrap; }
.cx-q.ok b em { color: var(--ok); }
.cx-q span { display: block; margin-top: 6px; color: var(--fg-2); min-height: 18px; }
.cx-wave { display: inline-flex; align-items: center; gap: 2px; height: 16px; vertical-align: middle; }
.cx-wave i { width: 2px; height: 100%; border-radius: 1px; background: #6ea8ff; animation: cxWave .7s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms); }
@keyframes cxWave { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ---------- FAQ ---------- */
.cx-faq { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.cx-faq h2 { font-size: 24px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.2; }
.cx-faq .faq { margin: 0; padding: 0; max-width: none; border: 1px solid var(--cell-line); }
.cx-faq .faq details { padding: 0 24px; border-bottom: 1px solid var(--cell-line); transition: background .3s; }
.cx-faq .faq details:last-child { border-bottom: 0; }
.cx-faq .faq details:hover { background: #0b0b0c; }

@media (max-width: 980px) {
  .cx-row { grid-template-columns: 1fr; } .cx-copy { border-right: 0; border-bottom: 1px dashed var(--cell-line); } .cx-copy h2, .cx-copy p { max-width: none; }
  .cx-faq { grid-template-columns: 1fr; } .cx-said { left: 2%; top: 3%; }
}
@media (max-width: 640px) {
  .cx-stage { scale: .62; } .cx-g { min-height: 400px; }
  .cx-synth { grid-template-columns: 1fr; gap: 26px; } .cx-pipe { display: none; } .cx-snip:not(.on) { display: none; } .cx-snip.on { transform: none; }
  .cx-logos-grid { grid-template-columns: 1fr 1fr; } .cx-logos-grid span:nth-child(2) { border-right: 0; } .cx-logos-grid span:nth-child(-n+2) { border-bottom: 1px solid var(--cell-line); }
  .cx-deck { height: 330px; margin-top: 44px; } .cx-rec { width: 210px; margin-left: -105px; height: 200px; font-size: 13px; }
  .cx-said { position: static; margin: 0 auto 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-beam, .cx-wave i, .cx-fact.new, .cx-pipe.go i { animation: none !important; }
  .cx-body .w { opacity: 1; filter: none; }
}
