/* =========================================================================
   Kentucky Open Science — Explore (PanAtlas client)
   ========================================================================= */

.kx-wrap { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ---- Hero: the document universe ---- */
.kx-hero { position: relative; min-height: 640px; overflow: hidden; background: #05070d; color: #fff; }
.kx-universe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.kx-hero__shade { position: absolute; inset: 0; background:
  radial-gradient(ellipse at 30% 45%, rgba(5,7,13,0.78) 0%, rgba(5,7,13,0.35) 45%, rgba(5,7,13,0) 70%),
  linear-gradient(180deg, rgba(5,7,13,0) 70%, rgba(5,7,13,0.9) 100%); pointer-events: none; }
.kx-hero__inner { position: relative; max-width: 1200px; margin: 0 auto; padding: 5rem 2rem 3rem; }
.kx-eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--kyos-cyan-light); background: rgba(6,182,212,0.12); border: 1px solid rgba(6,182,212,0.3);
  border-radius: 999px; padding: 0.35rem 0.85rem; }
.kx-eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,0.7); animation: kx-pulse 2s infinite; }
@keyframes kx-pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); } 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.kx-title { margin: 1rem 0 0.6rem; font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05;
  background: linear-gradient(90deg, #fff 0%, #a5f3fc 60%, #67e8f9 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kx-sub { max-width: 620px; font-size: 1.05rem; line-height: 1.6; color: #cbd5e1; margin: 0 0 1.75rem; }

.kx-ask { display: flex; max-width: 680px; background: rgba(15,23,42,0.72); border: 1px solid rgba(148,163,184,0.35);
  border-radius: 14px; padding: 6px; backdrop-filter: blur(10px); box-shadow: 0 0 0 0 rgba(34,211,238,0); transition: box-shadow 0.3s; }
.kx-ask:focus-within { box-shadow: 0 0 0 3px rgba(34,211,238,0.35), 0 20px 40px rgba(0,0,0,0.35); }
.kx-ask input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; font: inherit; font-size: 1.02rem; padding: 0.7rem 0.9rem; }
.kx-ask input::placeholder { color: #94a3b8; }
.kx-ask button { border: 0; border-radius: 10px; padding: 0 1.4rem; font: inherit; font-weight: 600; color: #04121a; cursor: pointer;
  background: linear-gradient(90deg, #22d3ee, #34d399); }
.kx-ask button[disabled] { opacity: 0.6; cursor: progress; }
.kx-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.9rem 0 2.5rem; max-width: 760px; }
.kx-chips button { font: inherit; font-size: 0.82rem; color: #e2e8f0; background: rgba(30,41,59,0.6); border: 1px solid rgba(148,163,184,0.3);
  border-radius: 999px; padding: 0.4rem 0.85rem; cursor: pointer; transition: all 0.2s; }
.kx-chips button:hover { border-color: #22d3ee; color: #fff; background: rgba(8,145,178,0.25); }

.kx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem 2rem; max-width: 900px; }
.kx-stat__v { display: block; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.kx-stat__l { display: block; margin-top: 0.15rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #94a3b8; }

/* ---- Result ---- */
.kx-result { background: #05070d; padding: 1.5rem 0 3rem; color: #e2e8f0; scroll-margin-top: 96px; }
.kx-result__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 1.25rem; }
.kx-result .kx-panel { background: rgba(15,23,42,0.85); border-color: rgba(148,163,184,0.2); color: #e2e8f0; }
.kx-panel__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.75rem; }
.kx-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--kyos-cyan-dark); }
.kx-result .kx-label { color: var(--kyos-cyan-light); }
.kx-time { font-size: 0.78rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
.kx-question { font-size: 1.1rem; font-weight: 600; color: #fff; margin-bottom: 0.9rem; }
.kx-trace { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.kx-trace li { display: flex; gap: 0.6rem; align-items: center; font-size: 0.84rem; color: #cbd5e1; opacity: 0; transform: translateY(4px);
  animation: kx-in 0.35s forwards; font-family: "JetBrains Mono", ui-monospace, monospace; }
.kx-trace li .kx-tick { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; background: rgba(52,211,153,0.15); color: #34d399; flex-shrink: 0; }
.kx-trace li.kx-thinking .kx-tick { background: rgba(34,211,238,0.15); color: #22d3ee; animation: kx-spin 1s linear infinite; }
.kx-trace li .kx-n { color: #94a3b8; }
@keyframes kx-in { to { opacity: 1; transform: none; } }
@keyframes kx-spin { to { transform: rotate(360deg); } }
.kx-trace .kx-more { cursor: pointer; color: #67e8f9; font-family: inherit; }
.kx-trace li.kx-hidden { display: none; }
.kx-answer { font-size: 0.98rem; line-height: 1.7; color: #e2e8f0; }
.kx-answer p { margin: 0 0 0.8rem; }
.kx-answer ul { margin: 0 0 0.8rem; padding-left: 1.2rem; }
.kx-answer li { margin-bottom: 0.3rem; }
.kx-answer strong { color: #fff; }
.kx-answer a { color: #67e8f9; }
.kx-answer.kx-reveal { animation: kx-in 0.5s forwards; opacity: 0; }

.kx-panel--graph { display: flex; flex-direction: column; }
.kx-graph { width: 100%; flex: 1; min-height: 420px; display: block; }
.kx-graph text { font-size: 10px; fill: #cbd5e1; pointer-events: none; }
.kx-graph__legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0.5rem; font-size: 0.75rem; color: #94a3b8; }
.kx-graph__legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 0.35rem; background: var(--c); vertical-align: -1px; }

.kx-records { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.9rem; margin-top: 1.25rem; }
.kx-rec { display: block; padding: 1rem 1.1rem; border-radius: 12px; background: rgba(15,23,42,0.85); border: 1px solid rgba(148,163,184,0.2);
  color: #e2e8f0; text-decoration: none; transition: all 0.2s; opacity: 0; animation: kx-in 0.4s forwards; }
.kx-rec:hover { border-color: #22d3ee; transform: translateY(-2px); }
.kx-rec__kind { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #67e8f9; }
.kx-rec__title { display: block; margin: 0.25rem 0 0.35rem; font-weight: 600; color: #fff; }
.kx-rec__sum { display: block; font-size: 0.82rem; line-height: 1.5; color: #94a3b8; }
.kx-rec__open { display: block; margin-top: 0.6rem; font-size: 0.78rem; color: #67e8f9; }

/* ---- What's inside ---- */
.kx-inside { padding: 3rem 0 4rem; background: var(--kyos-bg); }
.kx-inside__head h2 { margin: 0 0 0.3rem; font-size: 1.5rem; }
.kx-inside__head p { margin: 0 0 1.5rem; color: var(--kyos-text-muted); font-size: 0.9rem; }
.kx-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.kx-panel { padding: 1.25rem 1.3rem; border: 1px solid var(--kyos-border); border-radius: var(--kyos-radius-lg); background: var(--kyos-bg); box-shadow: var(--kyos-shadow-card); }
.kx-bars { display: flex; flex-direction: column; gap: 0.45rem; }
.kx-bar { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; font-size: 0.82rem; }
.kx-bar__name { color: var(--kyos-slate-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kx-bar__track { display: block; height: 10px; border-radius: 4px; background: var(--kyos-slate-100); overflow: hidden; }
.kx-bar__fill { display: block; height: 100%; width: 0; border-radius: 0 4px 4px 0; background: var(--kyos-cyan-dark); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.kx-bar:hover .kx-bar__fill { background: var(--kyos-cyan); }
.kx-bar__val { color: var(--kyos-slate-600); font-variant-numeric: tabular-nums; min-width: 3.5rem; text-align: right; }
.kx-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 2rem; }
.kx-btn { display: inline-block; padding: 0.7rem 1.3rem; border-radius: 10px; background: var(--kyos-slate-900); color: #fff; font-weight: 600; text-decoration: none; }
.kx-btn--ghost { background: transparent; color: var(--kyos-slate-900); border: 1px solid var(--kyos-border); }
.kx-cta__note { font-size: 0.82rem; color: var(--kyos-text-muted); }

@media (max-width: 960px) {
  .kx-result__grid, .kx-charts { grid-template-columns: minmax(0, 1fr); }
  .kx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .kx-wrap, .kx-hero__inner { padding-left: 16px; padding-right: 16px; }
  .kx-hero__inner { padding-top: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .kx-trace li, .kx-rec, .kx-answer.kx-reveal { animation: none; opacity: 1; transform: none; }
  .kx-bar__fill { transition: none; }
}
