/* ============================================================================
   /entropy — animated “entropy of identity” diagram + “who sees what” panels.
   Amber lamp on telescreen night; particles travel the whole cascade.
   ============================================================================ */

.ent-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(217, 138, 26, 0.12), transparent 65%),
    radial-gradient(ellipse 40% 50% at 12% 50%, rgba(90, 140, 200, 0.08), transparent 60%),
    radial-gradient(ellipse 40% 50% at 88% 50%, rgba(173, 32, 39, 0.1), transparent 60%),
    linear-gradient(180deg, #0a0c10 0%, #12161c 100%);
  box-shadow: 0 0 0 1px rgba(217, 138, 26, 0.06), 0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 22px 18px 18px;
}

.ent-hero-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  margin: 0 8px 14px;
}

.ent-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #eef2f7;
}

.ent-hero-tag {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lamp, #d98a1a);
}

.ent-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1100 / 520;
  min-height: 280px;
}

.ent-stage svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* --- SVG pieces ---------------------------------------------------------- */
.ent-path {
  fill: none;
  stroke: rgba(180, 200, 220, 0.22);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.ent-path-glow {
  fill: none;
  stroke: rgba(217, 138, 26, 0.55);
  stroke-width: 2.2;
  stroke-linecap: round;
  filter: url(#ent-glow);
  opacity: 0.85;
  stroke-dasharray: 6 14;
  animation: ent-dash 2.4s linear infinite;
}

/* the crowd fan-in is dimmer than the cascade trunk: many faint sources */
.ent-path-in-glow {
  stroke: rgba(217, 138, 26, 0.4);
  stroke-width: 1.8;
  opacity: 0.6;
  filter: none;
}

.ent-path-exit {
  stroke: rgba(200, 70, 70, 0.45);
}

.ent-path-exit-glow {
  stroke: rgba(220, 90, 90, 0.5);
  stroke-width: 1.8;
  opacity: 0.7;
  filter: none;
  animation-direction: reverse;
}

@keyframes ent-dash {
  to { stroke-dashoffset: -80; }
}

.ent-user {
  fill: #9aa3ad;
  opacity: 0.55;
}
.ent-user.is-hot {
  fill: var(--lamp, #d98a1a);
  opacity: 0.95;
  filter: url(#ent-glow);
}

.ent-hub {
  fill: #1a1f28;
  stroke: rgba(217, 138, 26, 0.7);
  stroke-width: 1.6;
  filter: url(#ent-glow);
}
.ent-hub-core {
  fill: var(--lamp, #d98a1a);
  opacity: 0.9;
}
/* Three hubs pulse in sequence; the stagger is a class, not an inline
   animation-delay, because style-src is 'self'. */
.ent-hub-ring.delay-1 { animation-delay: 0.4s; }
.ent-hub-ring.delay-2 { animation-delay: 0.8s; }
.ent-hub-ring {
  fill: none;
  stroke: rgba(217, 138, 26, 0.35);
  stroke-width: 1.2;
  animation: ent-pulse 2.8s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

@keyframes ent-pulse {
  0%, 100% { opacity: 0.35; stroke-width: 1.2; }
  50% { opacity: 0.85; stroke-width: 2.4; }
}

.ent-exit {
  fill: #1c1214;
  stroke: rgba(200, 70, 70, 0.75);
  stroke-width: 1.5;
}
.ent-exit-dot {
  fill: #e85a5a;
  filter: url(#ent-glow);
}

.ent-label {
  fill: #78828f;
  font-family: var(--font-display), sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ent-label-strong {
  fill: #eef2f7;
  font-size: 12px;
  font-weight: 700;
}
.ent-node-label {
  fill: #eef2f7;
  font-family: var(--font-display), sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.11em;
}
.ent-mono {
  fill: #e8c48a;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}
.ent-mono-soft { opacity: 0.75; }
.ent-mono-dim { fill: rgba(232, 196, 138, 0.45); }

.ent-svc-label {
  fill: #eef2f7;
  font-family: var(--font-display), sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ent-particle {
  fill: #ffe0a0;
  filter: url(#ent-glow);
  pointer-events: none;
}
.ent-particle.exit {
  fill: #ff8a8a;
}

/* --- Hero footer: the three claims + the legend --------------------------- */
.ent-claims {
  display: grid;
  gap: 6px;
  margin: 14px 8px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}
.ent-claims p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #eef2f7;
}
.ent-claims .ent-claim-lit { color: var(--lamp, #d98a1a); }

.ent-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 14px 8px 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: #78828f;
}
.ent-legend strong {
  color: var(--lamp, #d98a1a);
  font-weight: 600;
}

/* --- “Who sees what”: tabs ------------------------------------------------ */
.ent-views-lead {
  margin: 0 0 18px;
  color: var(--sub-muted, var(--muted));
  font-size: 0.9rem;
  line-height: 1.6;
}

.ent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.ent-tab {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius, 4px);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--motion-fast, 0.15s) ease,
    background var(--motion-fast, 0.15s) ease, color var(--motion-fast, 0.15s) ease;
}
.ent-tab:hover { border-color: var(--lamp); }
.ent-tab.is-active {
  border-color: var(--lamp);
  background: var(--sub-accent-dim, rgba(230, 165, 44, 0.14));
  color: var(--lamp);
}

/* Progressive: without JS every panel stays open and readable. The tab strip
   only takes over once entropy.js marks the section. */
.ent-panel + .ent-panel { margin-top: 28px; }
.ent-views.js-tabs .ent-panel { display: none; margin-top: 0; }
.ent-views.js-tabs .ent-panel.is-active { display: block; }

.ent-panel-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lamp);
}

/* --- The four-stage chain row -------------------------------------------- */
.ent-chain {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  margin-bottom: 22px;
}

.ent-chain-node {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg, 8px);
  background: var(--surface-inset);
  text-align: center;
}
.ent-chain-node.is-lit { border-color: rgba(230, 165, 44, 0.55); }
.ent-chain-node.is-blind { border-color: var(--border); opacity: 0.5; }
/* the stage this observer cannot reach */
.ent-chain-node.is-blind::after {
  content: "";
  position: absolute;
  left: -10%;
  top: 50%;
  width: 120%;
  height: 1px;
  background: var(--party, #d94141);
  transform: rotate(-18deg);
}

.ent-chain-name {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.ent-chain-node.is-lit .ent-chain-name { color: var(--lamp); }
.ent-chain-node:not(.is-lit):not(.is-blind) .ent-chain-name { color: var(--text-strong); }

.ent-chain-note {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--muted);
}

/* --- Two-column boxes ----------------------------------------------------- */
.ent-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.ent-box {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius, 4px);
  background: var(--surface-inset);
}
.ent-box-red { border-left: 3px solid var(--party, #d94141); }
.ent-box-amber { border-left: 3px solid var(--lamp); }

.ent-box-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lamp);
}
.ent-box-red .ent-box-title { color: var(--party, #d94141); }

.ent-box-list {
  margin: 0;
  padding-left: 1.15em;
  line-height: 1.7;
  color: var(--text);
}
.ent-box-list li { margin: 0 0 4px; }

.ent-analogy {
  margin: 16px 0 0;
  max-width: 80ch;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}

/* --- Masking section ------------------------------------------------------ */
.ent-mask-now {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
}
.ent-mask-name {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--lamp);
  text-shadow: 0 0 12px var(--glow-amber);
}

.ent-fineprint {
  margin: 14px 0 0;
  max-width: 80ch;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
}

/* --- “?” hints ------------------------------------------------------------ */
.ent-hints {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.ent-hint summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  list-style: none;
  cursor: pointer;
}
.ent-hint summary::-webkit-details-marker { display: none; }
.ent-hint summary::before {
  content: "?";
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 1px solid rgba(230, 165, 44, 0.55);
  border-radius: 50%;
  color: var(--lamp);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}
.ent-hint[open] summary::before {
  background: var(--sub-accent-dim, rgba(230, 165, 44, 0.14));
}
.ent-hint summary:hover::before { border-color: var(--lamp); }

.ent-hint-q {
  font-family: var(--font-display);
  font-size: 0.85rem;
  line-height: 1.45;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.ent-hint-a {
  margin: 8px 0 0 32px;
  max-width: 80ch;
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 760px) {
  .ent-stage { aspect-ratio: 1100 / 620; }
  .ent-chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ent-split { grid-template-columns: 1fr; }
  .ent-claims p { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ent-path-glow,
  .ent-hub-ring { animation: none; }
  .ent-particle { display: none; }
}
