/* PQWERAI 4D ecosystem view, live-data states and section pages. Builds on site.css tokens. */
[hidden] { display: none !important; }
.t4, .demo-banner.wrap { box-sizing: border-box; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono, .tbl .mono, code { font-family: var(--mono); }

/* ---------- live states */
.lv-missing { color: var(--dim); font-family: var(--mono); font-size: .86em; letter-spacing: .04em; }
.lv-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 600 11.5px/1.6 var(--mono); letter-spacing: .06em;
  border: 1px solid var(--border-strong); color: var(--muted); background: rgba(148, 163, 184, .08); white-space: nowrap; }
.lv-pill[data-identity] { white-space: normal; }
.lv-live { color: var(--green); border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .1); }
.lv-stale, .lv-cached { color: var(--amber); border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .1); }
.lv-offline, .lv-unavailable { color: #f87171; border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .08); }
.lv-connecting { color: var(--cyan); border-color: rgba(34, 211, 238, .4); }
.lv-demo { color: #fde047; border-color: rgba(253, 224, 71, .6); background: rgba(253, 224, 71, .1); }
.demo-banner { margin: 12px auto; padding: 10px 14px; border-radius: 12px; border: 1px dashed rgba(253, 224, 71, .7);
  color: #fde047; background: rgba(253, 224, 71, .07); font: 600 13px/1.5 var(--mono); }
.modebar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.btn-sm { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--fg); font: 600 13px/1.2 inherit; cursor: pointer; text-decoration: none; }
.btn-sm:hover { border-color: var(--cyan); }
.btn-sm.primary { background: var(--grad); color: #050816; border: 0; }
.btn-sm:focus-visible, input[type=range]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
a[aria-disabled="true"] { color: inherit; text-decoration: none; pointer-events: none; }

/* ---------- universe (full-bleed, decorative scene; content overlays it) */
.u4 { position: relative; padding: 0 0 30px; }
.u4-stage { position: relative; height: max(640px, min(100svh, 980px)); overflow: hidden; background: #03050d; isolation: isolate; }
#universe-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.u4-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(3, 5, 13, .82) 0%, rgba(3, 5, 13, .35) 38%, rgba(3, 5, 13, 0) 60%),
              linear-gradient(0deg, var(--bg) 0%, rgba(3, 5, 13, 0) 22%), linear-gradient(180deg, rgba(3, 5, 13, .55) 0%, rgba(3, 5, 13, 0) 18%); }
.u-labels { position: absolute; inset: 0; pointer-events: none; }
.u-label { position: absolute; left: 0; top: 0; font: 600 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c);
  white-space: nowrap; text-shadow: 0 0 12px rgba(0, 0, 0, .9), 0 0 2px #000; transition: opacity .6s; will-change: transform; }
.u-label::before { content: ""; display: inline-block; width: 14px; height: 1px; margin-right: 6px; vertical-align: middle; background: var(--c); opacity: .7; }
.u4-over { position: relative; z-index: 1; height: 100%; display: grid; grid-template-rows: 1fr auto; gap: 24px;
  box-sizing: border-box; padding-top: 40px; padding-bottom: 34px; }
.u4-copy { align-self: center; }
.u4-copy { max-width: 600px; }
.u4-copy h1 { font-size: clamp(34px, 5.4vw, 66px); line-height: 1.02; margin: 18px 0 14px; letter-spacing: -.025em; text-shadow: 0 2px 30px rgba(0, 0, 0, .6); }
.u4-copy .lead { color: #c9d4e8; text-shadow: 0 1px 12px rgba(0, 0, 0, .8); }
.u-fallback { display: none; position: absolute; left: 0; right: 0; bottom: 24px; color: var(--muted); font-size: 14px; z-index: 1; }
.u4-stage.no-webgl .u-fallback, html.no-js .u-fallback { display: block; }
.u4-stage.no-webgl { background: radial-gradient(900px 600px at 70% 45%, rgba(139, 92, 246, .25), transparent 60%),
  radial-gradient(500px 400px at 72% 48%, rgba(34, 211, 238, .22), transparent 60%), #03050d; }
.u-hud { display: inline-grid; grid-template-columns: repeat(4, auto); gap: 6px 26px; margin-top: 22px; padding: 12px 18px; border-radius: 14px;
  background: rgba(8, 12, 28, .55); border: 1px solid rgba(148, 163, 184, .18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.u-hud span { display: block; color: #7f8db0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; }
.u-hud b, .u-hud a { font: 700 16px/1.35 var(--mono); color: #eef3fb; }
html[data-time="history"] .u-hud { opacity: .5; }
html[data-time="history"] .u-hud::after { content: "LIVE (timeline shows history)"; grid-column: 1 / -1; color: var(--amber); font: 600 10.5px var(--mono); }

.u4-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.u-traffic { display: none; flex-basis: 100%; max-width: 440px; margin: 2px 0 0; padding: 9px 12px; border-radius: 12px;
  font: 500 11.5px/1.5 var(--mono); color: #9fb0cf; background: rgba(8, 12, 28, .55); border: 1px solid rgba(148, 163, 184, .16); }
.u-traffic b { color: #e6edf9; font-weight: 600; }
.u-traffic span { display: block; margin-top: 4px; color: #a5f3fc; }
.has-webgl .u-traffic { display: block; }

/* ---------- time (4th dimension) */
.t4 { margin-top: 20px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); }
.t4-h { font-size: 18px; margin: 0 0 10px; }
.t4-h3 { font-size: 14px; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.t4-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.t4-row input[type=range] { flex: 1 1 260px; accent-color: var(--violet); min-width: 0; }
.t4-end { font: 600 12px var(--mono); color: var(--dim); }
.t4-label { margin: 8px 0 0; font: 500 13.5px/1.5 var(--mono); color: var(--muted); }
.t4-rec { margin-top: 10px; }
.t4-jumps { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.milestones { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.milestones.big { gap: 10px; font-size: 15px; }
.ms { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(148, 163, 184, .04); }
.ms time { color: var(--dim); font-family: var(--mono); font-size: 12.5px; }
.ms p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.ms-tag { font: 700 10.5px var(--mono); letter-spacing: .08em; padding: 2px 7px; border-radius: 6px; }
.ms-completed .ms-tag { color: var(--green); background: rgba(52, 211, 153, .12); }
.ms-planned { border-style: dashed; }
.ms-in_progress .ms-tag { color: var(--cyan); background: rgba(34, 211, 238, .12); }
.ms-note { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.ms-planned .ms-tag { color: var(--amber); background: rgba(245, 158, 11, .12); }
.ms-jump { margin-left: 6px; padding: 2px 8px; border-radius: 7px; border: 1px solid var(--border-strong); background: transparent; color: var(--cyan); cursor: pointer; font-size: 12.5px; }

/* ---------- section pages */
.phero4 { padding: 64px 0 34px; background: radial-gradient(900px 400px at 20% 0%, rgba(139, 92, 246, .14), transparent 70%); }
.phero4 h1 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.08; margin: 10px 0 14px; letter-spacing: -.02em; }
.phero4 .lead { max-width: 820px; }
.secgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 22px; }
.sec { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); color: var(--fg); text-decoration: none; }
.sec:hover { border-color: var(--cyan); box-shadow: var(--glow); }
.sec span { color: var(--muted); font-size: 13.5px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card4 { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); min-width: 0; margin-bottom: 16px; }
.card4 h3 { margin: 0 0 12px; font-size: 17px; }
.card4 ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 7px 16px; margin: 0 0 16px; font-size: 14.5px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tbl-wrap { overflow-x: auto; margin: 0 0 18px; border-radius: 12px; border: 1px solid var(--border); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl caption { text-align: left; padding: 10px 12px; font-weight: 700; }
.tbl th, .tbl td { text-align: left; padding: 8px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.tbl thead th { color: var(--dim); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.st { display: inline-block; padding: 2px 8px; border-radius: 7px; font: 600 12px/1.45 var(--mono); }
.st-ok { color: var(--green); background: rgba(52, 211, 153, .1); }
.st-warn { color: var(--amber); background: rgba(245, 158, 11, .1); }
.st-dim { color: var(--muted); background: rgba(148, 163, 184, .1); }
.warnbox { padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(245, 158, 11, .5); background: rgba(245, 158, 11, .08); margin-bottom: 18px; }
.note { color: var(--muted); font-size: 14px; }
.band h2[id] { scroll-margin-top: 80px; }
.phero4 ~ .band { padding: 40px 0; }

/* ---------- footer */
.foot4 { border-top: 1px solid var(--border); padding: 40px 0 30px; margin-top: 40px; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1fr 1.3fr 1.1fr; gap: 28px; }
.foot4 h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 0 0 10px; }
.foot-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; color: var(--muted); }
.foot-list a { color: var(--muted); }
.foot-list a:hover { color: var(--fg); }

@media (max-width: 960px) {
  .u4-over { grid-template-rows: auto auto; align-content: start; gap: 18px; padding-top: min(480px, 62vw + 160px); }
  .u4-stage { height: auto; min-height: 100svh; }
  .u4-shade { background: linear-gradient(0deg, var(--bg) 0%, rgba(3,5,13,.85) 45%, rgba(3,5,13,0) 70%); }
  .grid2, .foot-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .u-hud { grid-template-columns: 1fr 1fr; gap: 6px 18px; }
  .u-hud b, .u-hud a { font-size: 14px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .u-label { transition: none; } }
@media (prefers-color-scheme: light) {
  .u4-copy h1 { color: #f5f8fe; }
  .demo-banner { color: #854d0e; border-color: #ca8a04; }
  .lv-demo { color: #854d0e; }
}

/* ---------- relaunch state (operator-set in the telemetry gateway) */
.relaunch { background: linear-gradient(90deg, rgba(245, 158, 11, .18), rgba(139, 92, 246, .14)); border-bottom: 1px solid rgba(245, 158, 11, .45);
  color: #fde68a; font-size: 14px; padding: 10px 0; }
.relaunch b { color: #fbbf24; }
html[data-network-state="relaunching"] .u-hud::before { content: "Network notice · see the banner above"; grid-column: 1 / -1; color: #fbbf24;
  font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
html[data-network-state="relaunching"] .u-hud { border-color: rgba(245, 158, 11, .35); }
@media (prefers-color-scheme: light) { .relaunch { color: #78350f; } .relaunch b { color: #92400e; } }
.u4-copy .u-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; pointer-events: auto; }
