/* Cinematic stagecraft layer. These effects never encode evidence strength, influence,
   political meaning or certainty; they only support navigation, hierarchy and focus. */

:root{
  --fx-transition-duration:320ms;
  --fx-glow-warm:rgba(243,184,121,.22);
  --fx-glow-cool:rgba(134,170,243,.16);
  --fx-glass:rgba(20,20,18,.72);
  --fx-grid:rgba(255,255,255,.035);
}

::view-transition-old(atlas-view),::view-transition-new(atlas-view){animation-duration:var(--fx-transition-duration)}

.hero{position:relative;isolation:isolate}
.hero::before{
  content:"";
  position:absolute;
  z-index:-1;
  inset:-80px -8vw -36px;
  pointer-events:none;
  background:
    radial-gradient(ellipse at 12% 18%,rgba(243,184,121,.07),transparent 34%),
    radial-gradient(ellipse at 78% 6%,rgba(134,170,243,.055),transparent 32%),
    linear-gradient(115deg,transparent 25%,rgba(255,255,255,.018) 48%,transparent 62%);
  mask-image:linear-gradient(to bottom,#000 0 78%,transparent);
}

.state-selector{
  display:grid;
  grid-template-columns:minmax(220px,360px) minmax(0,1fr);
  gap:16px;
  align-items:end;
  margin:0 0 16px;
  padding:14px;
  border:1px solid var(--viz-line);
  border-radius:16px;
  background:linear-gradient(180deg,rgba(255,255,255,.018),transparent),var(--viz-surface);
}
.state-selector label{display:grid;gap:7px;color:var(--muted);font-size:.7rem;text-transform:uppercase;letter-spacing:.08em}
.state-selector select{width:100%;min-height:44px}
.state-selector p{margin:0;color:var(--muted);font-size:.76rem;line-height:1.5;max-width:720px}

.state-stage{
  position:relative;
  min-height:430px;
  display:grid;
  grid-template-columns:minmax(250px,.78fr) minmax(0,1.6fr);
  gap:20px;
  align-items:stretch;
  overflow:hidden;
  border:1px solid #37352f;
  border-radius:26px;
  background:
    linear-gradient(var(--fx-grid) 1px,transparent 1px),
    linear-gradient(90deg,var(--fx-grid) 1px,transparent 1px),
    radial-gradient(circle at 78% 42%,rgba(243,184,121,.07),transparent 34%),
    radial-gradient(circle at 24% 30%,rgba(134,170,243,.055),transparent 30%),
    #0e0e0d;
  background-size:42px 42px,42px 42px,auto,auto,auto;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025),0 24px 80px rgba(0,0,0,.22);
  margin:8px 0 18px;
}
.state-stage::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(100deg,transparent 8%,rgba(255,255,255,.025) 46%,transparent 58%);
  transform:translateX(-42%);
  animation:state-sweep 8s ease-in-out infinite;
}
@keyframes state-sweep{0%,55%{transform:translateX(-42%);opacity:.15}75%{opacity:.48}100%{transform:translateX(48%);opacity:.05}}

.state-stage-ambient{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.state-stage-ambient i{position:absolute;border:1px solid rgba(243,184,121,.11);border-radius:50%;aspect-ratio:1}
.state-stage-ambient i:nth-child(1){width:430px;right:-70px;top:-120px}
.state-stage-ambient i:nth-child(2){width:300px;right:120px;bottom:-180px;border-color:rgba(134,170,243,.10)}
.state-stage-ambient i:nth-child(3){width:760px;right:-220px;top:-190px;border-color:rgba(255,255,255,.035)}

.state-stage-copy{
  position:relative;
  z-index:1;
  min-width:0;
  padding:32px 30px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  border-right:1px solid rgba(255,255,255,.06);
  background:linear-gradient(135deg,rgba(255,255,255,.022),transparent 62%);
}
.state-stage-copy h3{margin:.2rem 0 .8rem;font-size:clamp(2.2rem,5vw,4.7rem);letter-spacing:-.055em}
.state-stage-copy p:not(.kicker){max-width:520px;margin:0;color:#aaa49a;font-size:.82rem;line-height:1.65}
.state-monogram{
  position:absolute;
  top:8px;
  left:18px;
  font-size:clamp(7rem,18vw,14rem);
  line-height:1;
  font-weight:800;
  letter-spacing:-.08em;
  color:rgba(255,255,255,.022);
  user-select:none;
}

.state-system-field{
  position:relative;
  z-index:1;
  display:grid;
  align-content:center;
  gap:12px;
  padding:30px;
}
.state-system-orbit{
  position:relative;
  display:grid;
  grid-template-columns:42px minmax(130px,.65fr) minmax(0,1fr);
  gap:12px;
  align-items:center;
  min-height:74px;
  padding:13px 15px;
  border:1px solid rgba(243,184,121,.18);
  border-radius:18px;
  background:linear-gradient(90deg,rgba(243,184,121,.075),rgba(20,20,18,.78) 34%,rgba(20,20,18,.54));
  color:var(--text);
  text-decoration:none;
  backdrop-filter:blur(14px);
  box-shadow:0 0 38px rgba(243,184,121,.035);
}
.state-system-orbit::before{
  content:"";
  position:absolute;
  left:-22px;
  top:50%;
  width:22px;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(243,184,121,.45));
}
.state-system-orbit>span{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;border:1px solid rgba(243,184,121,.28);background:#171512;font-weight:700;font-variant-numeric:tabular-nums}
.state-system-orbit strong{font-size:.9rem}
.state-system-orbit small{color:var(--muted);font-size:.67rem;line-height:1.45}
.state-system-orbit:hover{border-color:rgba(243,184,121,.35);background:linear-gradient(90deg,rgba(243,184,121,.11),rgba(24,22,19,.9) 36%,rgba(20,20,18,.6))}

.state-markets{display:grid;gap:18px;margin:22px 0 0}
.state-market{
  border:1px solid var(--viz-line);
  border-radius:20px;
  overflow:hidden;
  background:var(--viz-surface);
}
.state-market-head{display:flex;justify-content:space-between;align-items:end;gap:16px;padding:17px 19px;border-bottom:1px solid var(--viz-line-soft);background:linear-gradient(180deg,rgba(255,255,255,.018),transparent)}
.state-market-head h3{margin:.18rem 0 0;font-size:1.25rem;letter-spacing:-.025em}
.state-market-head>span{color:var(--muted);font-size:.7rem}
.state-station-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:1px;background:var(--viz-line-soft)}
.state-station-card{min-width:0;padding:18px;background:#111110}
.state-station-card header{display:flex;justify-content:space-between;gap:14px;align-items:start}
.state-station-card h3{margin:.15rem 0 0;font-size:1.35rem}
.state-station-card h3 a{color:var(--text);text-decoration:none}
.state-station-card h3 a:hover{text-decoration:underline;text-decoration-color:var(--viz-warm-2)}
.state-market-chip{display:inline-block;border:1px solid #35342f;border-radius:999px;padding:5px 7px;color:#aca69c;font-size:.62rem;white-space:nowrap}
.state-station-meta{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 14px}
.state-station-meta span{border:1px solid #302f2b;border-radius:999px;padding:5px 7px;color:#918c84;font-size:.61rem}

.state-path{display:flex;align-items:center;gap:7px;overflow-x:auto;padding:10px 0 13px;scrollbar-width:thin}
.state-path-step{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.state-path-node{min-width:118px;max-width:190px;padding:8px 9px;border:1px solid #34332e;border-radius:11px;background:#171715;color:var(--text);text-decoration:none}
.state-path-node strong{display:block;font-size:.72rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.state-path-node small{display:block;margin-top:3px;color:var(--muted);font-size:.57rem}
.state-path-node.selected{border-color:rgba(243,184,121,.45);background:rgba(243,184,121,.07);box-shadow:0 0 28px rgba(243,184,121,.05)}
.state-path-edge{position:relative;width:88px;display:grid;justify-items:center;gap:4px;color:var(--muted)}
.state-path-edge i{display:block;width:100%;height:1px;background:linear-gradient(90deg,rgba(243,184,121,.2),rgba(243,184,121,.9),rgba(243,184,121,.2));transform-origin:left center;box-shadow:0 0 9px rgba(243,184,121,.25)}
.state-path-edge em{font-style:normal;font-size:.54rem;white-space:nowrap;color:#9f998f}

.state-evidence-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:4px}
.state-evidence-grid>div{min-width:0;padding:10px;border:1px solid #2c2b27;border-radius:11px;background:#151513}
.state-evidence-grid>div>p{margin:0 0 7px;color:#918c84;font-size:.58rem;text-transform:uppercase;letter-spacing:.07em}
.state-relationship{display:block;margin-top:7px}
.state-relationship:first-of-type{margin-top:0}
.state-relationship strong{display:block;font-size:.68rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.state-relationship small,.state-unresolved{display:block;color:#77736c;font-size:.58rem;line-height:1.45;margin-top:2px}
.state-unresolved{font-style:italic}
.state-empty{padding:28px;border:1px dashed #393730;border-radius:18px;background:#111110}
.state-empty h3{margin:.2rem 0 .5rem}
.state-empty p:not(.kicker){color:var(--muted)}

/* Lineage: illuminate the already-modeled preferred active ownership/control path. */
.fx-lineage .lineage-panel{position:relative;overflow:hidden}
.fx-lineage .lineage-panel::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:radial-gradient(circle at 50% 42%,rgba(243,184,121,.045),transparent 54%);
  opacity:.8;
}
.fx-lineage .path-stack{position:relative}
.fx-lineage .path-item{position:relative;z-index:1}
.fx-lineage .path-item::after{
  content:"";
  position:absolute;
  left:12px;
  top:calc(100% + 2px);
  width:1px;
  height:12px;
  background:linear-gradient(to bottom,rgba(243,184,121,.65),rgba(243,184,121,.05));
  box-shadow:0 0 8px rgba(243,184,121,.18);
}
.fx-lineage .path-item:last-child::after{display:none}
.fx-lineage .path-item button{border-color:rgba(243,184,121,.22)}
.fx-lineage .primary-panel .focus-entity{
  position:relative;
  background:radial-gradient(circle at 50% 22%,rgba(243,184,121,.07),transparent 55%),var(--panel);
}
.fx-lineage .primary-panel .focus-entity::after{
  content:"";
  position:absolute;
  inset:8px;
  pointer-events:none;
  border:1px solid rgba(243,184,121,.08);
  border-radius:12px;
}

/* Compare: opposite-side entrance and conservative convergence on identical rendered node IDs only. */
.compare-paths.fx-converged{position:relative;overflow:hidden}
.compare-paths.fx-converged::before{
  content:"";
  position:absolute;
  inset:44px 12% 8px;
  pointer-events:none;
  background:radial-gradient(ellipse at center,rgba(243,184,121,.075),transparent 58%);
  filter:blur(8px);
}
.fx-lane-a .compare-path-step{animation:fx-enter-left 520ms cubic-bezier(.2,.75,.2,1) both;animation-delay:calc(var(--fx-order,0) * 70ms)}
.fx-lane-b .compare-path-step{animation:fx-enter-right 520ms cubic-bezier(.2,.75,.2,1) both;animation-delay:calc(var(--fx-order,0) * 70ms)}
@keyframes fx-enter-left{from{opacity:0;transform:translateX(-24px);filter:blur(5px)}to{opacity:1;transform:translateX(0);filter:blur(0)}}
@keyframes fx-enter-right{from{opacity:0;transform:translateX(24px);filter:blur(5px)}to{opacity:1;transform:translateX(0);filter:blur(0)}}
.compare-path-node.fx-shared{
  border-color:rgba(243,184,121,.62);
  background:linear-gradient(180deg,rgba(243,184,121,.09),rgba(23,23,21,.96));
  box-shadow:0 0 0 1px rgba(243,184,121,.08),0 0 28px rgba(243,184,121,.10);
}
.fx-convergence-note{
  position:relative;
  z-index:2;
  width:max-content;
  max-width:100%;
  margin:10px auto 0;
  padding:7px 10px;
  border:1px solid rgba(243,184,121,.18);
  border-radius:999px;
  background:rgba(17,17,15,.86);
  color:#aaa49a;
  font-size:.62rem;
  letter-spacing:.025em;
  text-align:center;
}

/* Timeline: dated records activate as they enter the viewport; pulse is an event cue, not importance. */
.timeline-item.fx-event{
  opacity:.42;
  transform:translateY(10px);
  transition:opacity 420ms ease,transform 520ms cubic-bezier(.2,.75,.2,1),background-color 260ms ease;
}
.timeline-item.fx-event.fx-visible{opacity:1;transform:translateY(0)}
.timeline-item.fx-event.fx-visible .timeline-dot{
  border-color:rgba(243,184,121,.62);
  background:var(--viz-warm);
  box-shadow:0 0 0 4px rgba(243,184,121,.06),0 0 18px rgba(243,184,121,.18);
}
.timeline-item.fx-event.fx-visible .timeline-rail{
  background:linear-gradient(to bottom,rgba(243,184,121,.2),var(--line) 38%,var(--line));
}

@media(max-width:900px){
  .state-stage{grid-template-columns:1fr;min-height:auto}
  .state-stage-copy{min-height:300px;border-right:0;border-bottom:1px solid rgba(255,255,255,.06)}
  .state-system-field{padding:22px}
  .state-evidence-grid{grid-template-columns:1fr}
}

@media(max-width:620px){
  .state-selector{grid-template-columns:1fr}
  .state-stage-copy{padding:26px 20px;min-height:270px}
  .state-system-field{padding:16px}
  .state-system-orbit{grid-template-columns:38px 1fr}
  .state-system-orbit small{grid-column:2}
  .state-station-grid{grid-template-columns:1fr}
  .state-station-card header{display:grid}
  .state-market-chip{justify-self:start}
  .fx-convergence-note{width:auto;border-radius:12px}
}

@media(prefers-reduced-motion:reduce){
  .state-stage::after{animation:none!important;opacity:.08}
  .fx-lane-a .compare-path-step,.fx-lane-b .compare-path-step{animation:none!important}
  .timeline-item.fx-event{opacity:1!important;transform:none!important;transition:none!important}
}
